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 SELECT_ARMY_DIALOG_H
20 #define SELECT_ARMY_DIALOG_H
24 #include <sigc++/trackable.h>
27 #include "gui/army-info-tip.h"
33 //! Scenario editor. Select an Army prototype.
34 class SelectArmyDialog: public sigc::trackable
37 SelectArmyDialog(Player *p, bool hero_too = false,
38 bool defends_ruins = false,
39 bool rewardable = false);
42 void set_parent_window(Gtk::Window &parent);
46 const ArmyProto *get_selected_army() { return selected_army; }
50 ArmyInfoTip* army_info_tip;
51 Gtk::Label *army_info_label1;
52 Gtk::Label *army_info_label2;
53 Gtk::Table *toggles_table;
54 Gtk::Button *select_button;
55 std::vector<guint32> armysets;
57 const ArmyProto *selected_army;
63 std::vector<Gtk::ToggleButton *> army_toggles;
65 std::vector<const ArmyProto*> selectable;
67 void on_army_toggled(Gtk::ToggleButton *toggle);
68 bool on_army_button_event(GdkEventButton *e, Gtk::ToggleButton *toggle);
70 void fill_in_army_toggles();
71 void fill_in_army_info();
72 void set_select_button_state();