1 //  Copyright (C) 2008, 2009, 2014, 2020 Ben Asselstine
2 //
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.
7 //
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.
12 //
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
16 //  02110-1301, USA.
17 
18 #pragma once
19 #ifndef REWARD_EDITOR_DIALOG_H
20 #define REWARD_EDITOR_DIALOG_H
21 
22 #include <gtkmm.h>
23 #include "lw-editor-dialog.h"
24 
25 class Reward;
26 class Item;
27 class ArmyProto;
28 class Ruin;
29 class Player;
30 class ArmyChooserButton;
31 
32 //! Scenario editor.  Edits rewards.
33 class RewardEditorDialog: public LwEditorDialog
34 {
35  public:
36     RewardEditorDialog(Gtk::Window &parent, Player *player, bool hidden_ruins,
37                        Reward *r);
38     ~RewardEditorDialog();
39 
40     int run();
41 
get_reward()42     Reward *get_reward() {return reward;}
43 
44  private:
45     Player *d_player;
46     Reward *reward;
47     Item *item;
48     ArmyProto *ally;
49     Ruin *hidden_ruin;
50     bool d_hidden_ruins;
51     Gtk::ComboBox *reward_type_combobox;
52     Gtk::Notebook *notebook;
53     Gtk::SpinButton *gold_spinbutton;
54     Gtk::Button *randomize_gold_button;
55     Gtk::Button *item_button;
56     Gtk::Button *randomize_item_button;
57     ArmyChooserButton *ally_button;
58     Gtk::Button *randomize_allies_button;
59     Gtk::SpinButton *num_allies_spinbutton;
60     Gtk::SpinButton *map_x_spinbutton;
61     Gtk::SpinButton *map_y_spinbutton;
62     Gtk::SpinButton *map_width_spinbutton;
63     Gtk::SpinButton *map_height_spinbutton;
64     Gtk::Button *randomize_map_button;
65     Gtk::Button *randomize_hidden_ruin_button;
66     Gtk::Button *hidden_ruin_button;
67 
68     void on_randomize_gold_clicked();
69     void on_item_clicked();
70     void on_clear_item_clicked();
71     void on_randomize_item_clicked();
72     void set_item_name();
73     void on_ally_selected(const ArmyProto *a);
74     void on_randomize_allies_clicked();
75     void on_randomize_map_clicked();
76     void on_hidden_ruin_clicked();
77     void on_randomize_hidden_ruin_clicked();
78     void on_clear_hidden_ruin_clicked();
79     void set_hidden_ruin_name();
80 
81     void fill_in_reward_info();
82     void on_reward_type_changed();
83 
84 };
85 
86 #endif
87