1 // Copyright (C) 2007 Ole Laursen
2 // Copyright (C) 2007, 2008, 2009 Ben Asselstine
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.
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.
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
19 #ifndef NEW_RANDOM_MAP_DIALOG_H
20 #define NEW_RANDOM_MAP_DIALOG_H
24 #include <sigc++/signal.h>
28 #include "game-parameters.h"
29 #include "decorated.h"
31 //! A dialog to let the user create a new random map.
32 class NewRandomMapDialog: public Decorated
36 ~NewRandomMapDialog();
38 void set_parent_window(Gtk::Window &parent);
42 std::string getRandomMapFilename() const {return d_filename;};
44 //std::string create_and_dump_scenario(const std::string &file, const GameParameters &g);
45 static std::string create_and_dump_scenario(const std::string &file,
46 const GameParameters &g, sigc::slot<void> *pulse);
51 GameParameters getParams();
55 int grass, water, swamp, forest, hills, mountains;
56 int cities, ruins, temples;
59 std::string shieldset;
67 Gtk::VBox *dialog_vbox;
68 Gtk::HButtonBox *dialog_action_area;
69 Gtk::ComboBox *map_size_combobox;
70 Gtk::ProgressBar *progressbar;
71 Gtk::Widget *random_map_container;
72 Gtk::ComboBoxText *tile_size_combobox;
73 Gtk::ComboBoxText *tile_theme_combobox;
74 Gtk::ComboBoxText *city_theme_combobox;
75 Gtk::ComboBoxText *army_theme_combobox;
76 Gtk::ComboBoxText *shield_theme_combobox;
77 Gtk::Scale *grass_scale;
78 Gtk::Scale *water_scale;
79 Gtk::Scale *swamp_scale;
80 Gtk::Scale *forest_scale;
81 Gtk::Scale *hills_scale;
82 Gtk::Scale *mountains_scale;
83 Gtk::Scale *cities_scale;
84 Gtk::Scale *ruins_scale;
85 Gtk::Scale *temples_scale;
86 Gtk::Scale *signposts_scale;
87 Gtk::Button *accept_button;
88 Gtk::Button *cancel_button;
89 Gtk::ToggleButton *grass_random_togglebutton;
90 Gtk::ToggleButton *water_random_togglebutton;
91 Gtk::ToggleButton *swamp_random_togglebutton;
92 Gtk::ToggleButton *forest_random_togglebutton;
93 Gtk::ToggleButton *hills_random_togglebutton;
94 Gtk::ToggleButton *mountains_random_togglebutton;
95 Gtk::ToggleButton *cities_random_togglebutton;
97 Gtk::CheckButton *cities_can_produce_allies_checkbutton;
99 enum { MAP_SIZE_NORMAL = 0, MAP_SIZE_SMALL, MAP_SIZE_TINY };
101 void on_map_size_changed();
103 void on_grass_random_toggled();
104 void on_water_random_toggled();
105 void on_swamp_random_toggled();
106 void on_forest_random_toggled();
107 void on_hills_random_toggled();
108 void on_mountains_random_toggled();
109 void on_cities_random_toggled();
110 void on_accept_clicked();
111 void on_cancel_clicked();
113 guint32 get_active_tile_size();
114 void on_tile_size_changed();
115 void on_grass_changed();
117 std::string d_filename;