1 /*
2 * This file is part of EasyRPG Player.
3 *
4 * EasyRPG Player 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 * EasyRPG Player 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 General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with EasyRPG Player. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef EP_WINDOW_VARLIST_H
19 #define EP_WINDOW_VARLIST_H
20
21 // Headers
22 #include "window_command.h"
23
24 class Window_VarList : public Window_Command
25 {
26 public:
27 enum Mode {
28 eNone,
29 eSwitch,
30 eVariable,
31 eItem,
32 eTroop,
33 eMap,
34 eHeal,
35 eLevel,
36 eCommonEvent,
37 eMapEvent,
38 };
39
40 /**
41 * Constructor.
42 *
43 * @param commands commands to display.
44 */
45 Window_VarList(std::vector<std::string> commands);
46 ~Window_VarList() override;
47
48 /**
49 * UpdateList.
50 *
51 * @param first_value starting value.
52 */
53 void UpdateList(int first_value);
54
55 /**
56 * Refreshes the window contents.
57 */
58 void Refresh();
59
60 /**
61 * Indicate what to display.
62 *
63 * @param mode the mode to set.
64 */
65 void SetMode(Mode mode);
66
67 /**
68 * Returns the current mode.
69 */
70 Mode GetMode() const;
71
72 private:
73
74 /**
75 * Draws the value of a variable standing on a row.
76 *
77 * @param index row with the var
78 */
79 void DrawItemValue(int index);
80
81 Mode mode = eNone;
82 int first_var = 0;
83
84 bool DataIsValid(int range_index);
85
86 };
87
GetMode()88 inline Window_VarList::Mode Window_VarList::GetMode() const {
89 return mode;
90 }
91
92 #endif
93