1 // Copyright (C) 2008, 2009 Ben Asselstine
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 3 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Library General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 #ifndef GUI_ITEMLIST_DIALOG_H
19 #define GUI_ITEMLIST_DIALOG_H
23 #include <sigc++/signal.h>
24 #include <sigc++/trackable.h>
29 //! Scenario editor. Edits the global list of Item objects in the scenario.
30 class ItemlistDialog: public sigc::trackable
36 void set_parent_window(Gtk::Window &parent);
43 Gtk::Dialog &get_dialog() { return *dialog; }
47 std::string current_save_filename;
48 Itemlist *d_itemlist; //current itemlist
49 ItemProto *d_item; //current item
50 Gtk::Entry *name_entry;
51 Gtk::TreeView *items_treeview;
52 Gtk::Button *add_item_button;
53 Gtk::Button *remove_item_button;
55 Gtk::CheckButton *add1str_checkbutton;
56 Gtk::CheckButton *add2str_checkbutton;
57 Gtk::CheckButton *add3str_checkbutton;
58 Gtk::CheckButton *add1stack_checkbutton;
59 Gtk::CheckButton *add2stack_checkbutton;
60 Gtk::CheckButton *add3stack_checkbutton;
61 Gtk::CheckButton *flystack_checkbutton;
62 Gtk::CheckButton *doublemovestack_checkbutton;
63 Gtk::CheckButton *add2goldpercity_checkbutton;
64 Gtk::CheckButton *add3goldpercity_checkbutton;
65 Gtk::CheckButton *add4goldpercity_checkbutton;
66 Gtk::CheckButton *add5goldpercity_checkbutton;
68 class ItemsColumns: public Gtk::TreeModelColumnRecord {
71 { add(name); add(item);}
73 Gtk::TreeModelColumn<Glib::ustring> name;
74 Gtk::TreeModelColumn<ItemProto *> item;
76 const ItemsColumns items_columns;
77 Glib::RefPtr<Gtk::ListStore> items_list;
79 bool on_delete_event(GdkEventAny *e);
81 void addItemProto(ItemProto *itemproto);
82 void update_item_panel();
83 void update_itemlist_buttons();
85 void fill_item_info(ItemProto *item);
88 void on_name_changed();
89 void on_add_item_clicked();
90 void on_remove_item_clicked();
91 void on_item_selected();
94 void on_checkbutton_toggled(Gtk::CheckButton *checkbutton,
95 ItemProto::Bonus bonus);
96 void on_add1str_toggled();
97 void on_add2str_toggled();
98 void on_add3str_toggled();
99 void on_add1stack_toggled();
100 void on_add2stack_toggled();
101 void on_add3stack_toggled();
102 void on_flystack_toggled();
103 void on_doublemovestack_toggled();
104 void on_add2goldpercity_toggled();
105 void on_add3goldpercity_toggled();
106 void on_add4goldpercity_toggled();
107 void on_add5goldpercity_toggled();