initial commit, lordsawar source, slightly modified
[lordsawar] / src / editor / new-map-dialog.h
1 //  Copyright (C) 2007 Ole Laursen
2 //  Copyright (C) 2007, 2008, 2009 Ben Asselstine
3 //
4 //  This program is free software; you can redistribute it and/or modify
5 //  it under the terms of the GNU General Public License as published by
6 //  the Free Software Foundation; either version 3 of the License, or
7 //  (at your option) any later version.
8 //
9 //  This program is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //  GNU Library General Public License for more details.
13 //
14 //  You should have received a copy of the GNU General Public License
15 //  along with this program; if not, write to the Free Software
16 //  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
17 //  02110-1301, USA.
18
19 #ifndef NEW_MAP_DIALOG_H
20 #define NEW_MAP_DIALOG_H
21
22 #include <memory>
23 #include <vector>
24 #include <sigc++/signal.h>
25 #include <gtkmm.h>
26
27 #include "Tile.h"
28 #include "game-parameters.h"
29
30 //! Scenario editor.  Edit parameters to make a new map.
31 class NewMapDialog
32 {
33  public:
34     NewMapDialog();
35     ~NewMapDialog();
36
37     void set_parent_window(Gtk::Window &parent);
38
39     void run();
40
41     struct Map
42     {
43         int fill_style;
44         int width, height;
45         int grass, water, swamp, forest, hills, mountains;
46         int cities, ruins, temples;
47         int signposts;
48         std::string tileset;
49         std::string shieldset;
50         std::string cityset;
51         std::string armyset;
52     };
53
54     Map map;
55     
56     bool map_set;
57     
58  private:
59     Gtk::Dialog* dialog;
60
61     Gtk::ComboBox *map_size_combobox;
62     Gtk::Table *custom_size_table;
63     Gtk::SpinButton *width_spinbutton;
64     Gtk::SpinButton *height_spinbutton;
65     Gtk::ComboBoxText *fill_style_combobox;
66     Gtk::Widget *random_map_container;
67     Gtk::ComboBoxText *tile_size_combobox;
68     Gtk::ComboBoxText *tile_theme_combobox;
69     Gtk::ComboBoxText *city_theme_combobox;
70     Gtk::ComboBoxText *army_theme_combobox;
71     Gtk::ComboBoxText *shield_theme_combobox;
72     Gtk::Scale *grass_scale;
73     Gtk::Scale *water_scale;
74     Gtk::Scale *swamp_scale;
75     Gtk::Scale *forest_scale;
76     Gtk::Scale *hills_scale;
77     Gtk::Scale *mountains_scale;
78     Gtk::Scale *cities_scale;
79     Gtk::Scale *ruins_scale;
80     Gtk::Scale *temples_scale;
81     Gtk::Scale *signposts_scale;
82     Gtk::Button *accept_button;
83
84     enum { MAP_SIZE_NORMAL = 0, MAP_SIZE_SMALL, MAP_SIZE_TINY, 
85       MAP_SIZE_CUSTOM };
86
87     void on_fill_style_changed();
88     void on_map_size_changed();
89
90     void add_fill_style(Tile::Type tile_type);
91
92     guint32 get_active_tile_size();
93     void on_tile_size_changed();
94     std::vector<int> fill_style;
95 };
96
97 #endif