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_BATTLECOMMAND_H 19 #define EP_WINDOW_BATTLECOMMAND_H 20 21 // Headers 22 #include <string> 23 #include <vector> 24 #include "window_base.h" 25 #include <lcf/rpg/battlecommand.h> 26 #include "font.h" 27 28 /** 29 * Window_BattleCommand class. 30 */ 31 class Window_BattleCommand: public Window_Base { 32 public: 33 /** 34 * Constructor. 35 */ 36 Window_BattleCommand(int x, int y, int width, int height); 37 38 /** 39 * Refreshes the window contents. 40 */ 41 void Refresh(); 42 43 /** 44 * Updates the window state. 45 */ 46 void Update() override; 47 48 /** 49 * Enables or disables a command. 50 * 51 * @param index command index. 52 * @param enabled whether the command is enabled. 53 */ 54 void SetEnabled(int index, bool enabled); 55 56 void SetActor(int actor_id); 57 58 int GetIndex(); 59 void SetIndex(int index); 60 void SetActive(bool active); 61 void UpdateCursorRect(); 62 int GetSkillSubset(); 63 64 protected: 65 int actor_id; 66 std::vector<std::string> commands; 67 int index; 68 int num_rows; 69 int top_row; 70 std::vector<bool> disabled; 71 int cycle; 72 73 void DrawItem(int index, Font::SystemColor color); 74 }; 75 76 #endif 77