ScummVM API documentation
character_info.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef MM1_VIEWS_CHARACTER_INFO_H
23 #define MM1_VIEWS_CHARACTER_INFO_H
24 
25 #include "common/array.h"
26 #include "mm/mm1/views/character_base.h"
27 #include "mm/mm1/data/character.h"
28 #include "mm/mm1/data/items.h"
29 #include "mm/mm1/game/equip_remove.h"
30 #include "mm/mm1/game/use_item.h"
31 #include "mm/mm1/views/text_entry.h"
32 
33 namespace MM {
34 namespace MM1 {
35 namespace Views {
36 
41  public MM1::Game::UseItem {
42 private:
43  enum ViewState {
44  DISPLAY, DISCARD, EQUIP, GATHER, REMOVE, SHARE,
45  TRADE_WITH, TRADE_KIND, TRADE_ITEM, USE };
46  ViewState _state = DISPLAY;
47  Common::String _newName;
48 private:
49  int _tradeWith = -1;
50  TransferKind _tradeKind = TK_GEMS;
51  TextEntry _textEntry;
52  static void abortFunc();
53  static void enterFunc(const Common::String &text);
54 private:
58  void discardItem(uint index);
59 
63  void equipItem(uint index);
64 
68  void removeItem(uint index);
69 
73  void drawGemsGoldFood();
74 
78  void tradeHowMuch();
79 
83  void combatUseItem(Inventory &inv, Inventory::Entry &invEntry, bool isEquipped);
84 
88  void nonCombatUseItem(Inventory &inv, Inventory::Entry &invEntry, bool isEquipped);
89 public:
90  CharacterInfo() : CharacterBase("CharacterInfo") {}
91  virtual ~CharacterInfo() {}
92 
93  void draw() override;
94  void timeout() override;
95  bool msgFocus(const FocusMessage &msg) override;
96  bool msgKeypress(const KeypressMessage &msg) override;
97  bool msgAction(const ActionMessage &msg) override;
98  bool msgGame(const GameMessage &msg) override;
99 
103  void howMuchAborted();
104 
108  void howMuchEntered(uint amount);
109 };
110 
111 } // namespace Views
112 } // namespace MM1
113 } // namespace MM
114 
115 #endif
Definition: character_info.h:40
Definition: str.h:59
Definition: character.h:225
Definition: messages.h:56
void howMuchEntered(uint amount)
Definition: messages.h:49
Definition: text_entry.h:34
Definition: detection.h:27
Definition: messages.h:87
Definition: use_item.h:32
Definition: equip_remove.h:31
Definition: character_base.h:39
Definition: messages.h:41
Definition: character.h:223