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_ITEM_H
19 #define EP_WINDOW_ITEM_H
20 
21 // Headers
22 #include <vector>
23 #include "window_help.h"
24 #include "window_selectable.h"
25 
26 /**
27  * Window_Item class.
28  */
29 class Window_Item : public Window_Selectable {
30 
31 public:
32 	/**
33 	 * Constructor.
34 	 */
35 	Window_Item(int ix, int iy, int iwidth, int iheight);
36 
37 	/**
38 	 * Gets item.
39 	 *
40 	 * @return current selected item.
41 	 */
42 	const lcf::rpg::Item* GetItem() const;
43 
44 	/**
45 	 * Checks if the item should be in the list.
46 	 *
47 	 * @param item_id item to check.
48 	 */
49 	virtual bool CheckInclude(int item_id);
50 
51 	/**
52 	 * Checks if item should be enabled.
53 	 *
54 	 * @param item_id item to check.
55 	 */
56 	virtual bool CheckEnable(int item_id);
57 
58 	/**
59 	 * Refreshes the item list.
60 	 */
61 	void Refresh();
62 
63 	/**
64 	 * Draws an item together with the quantity.
65 	 *
66 	 * @param index index of item to draw.
67 	 */
68 	void DrawItem(int index);
69 
70 	/**
71 	 * Updates the help window.
72 	 */
73 	void UpdateHelp() override;
74 
75 	/**
76 	 * Assigns an actor to the item list.
77 	 * All equipped skill items will be added.
78 	 */
79 	void SetActor(Game_Actor* actor);
80 
81 private:
82 	std::vector<int> data;
83 
84 	Game_Actor* actor = nullptr;
85 };
86 
87 #endif
88