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_ENH_CHARACTER_INFO_H
23 #define MM1_VIEWS_ENH_CHARACTER_INFO_H
24 
25 #include "mm/mm1/views_enh/party_view.h"
26 #include "mm/mm1/views_enh/scroll_popup.h"
27 #include "mm/shared/xeen/sprites.h"
28 
29 namespace MM {
30 namespace MM1 {
31 namespace ViewsEnh {
32 
33 #define CHAR_ICONS_COUNT 22
34 
35 class CharacterInfo : public PartyView {
36  struct IconPos {
37  int _frame; int _x; int _y;
38  };
39  class AttributeView : public ScrollPopup {
40  public:
41  AttributeView() : ScrollPopup("ScrollText") {}
42  virtual ~AttributeView() {}
43  bool msgFocus(const FocusMessage &msg) override;
44  };
45 private:
47  static const IconPos ICONS[CHAR_ICONS_COUNT];
48  Common::String ICONS_TEXT[CHAR_ICONS_COUNT];
49  int _cursorCell = 0;
50  bool _cursorVisible = false;
51  AttributeView _statInfo;
52 private:
56  void drawTitle();
57 
61  void drawIcons();
62 
66  void drawStats();
67 
71  void showCursor(bool flag);
72 
76  void showAttribute(int attrib);
77 
78 protected:
79  void timeout() override;
80 
84  void charSwitched(Character *priorChar) override;
85 
86 public:
87  CharacterInfo();
88  virtual ~CharacterInfo() {}
89 
90  bool msgFocus(const FocusMessage &msg) override;
91  bool msgUnfocus(const UnfocusMessage &msg) override;
92  bool msgGame(const GameMessage &msg) override;
93  bool msgKeypress(const KeypressMessage &msg) override;
94  bool msgAction(const ActionMessage &msg) override;
95  bool msgMouseUp(const MouseUpMessage &msg) override;
96  void draw() override;
97 };
98 
100 public:
102  _name = "CharacterViewCombat";
103  }
104  virtual ~CharacterInfoCombat() {
105  }
106 };
107 
108 } // namespace ViewsEnh
109 } // namespace MM1
110 } // namespace MM
111 
112 #endif
Definition: str.h:59
Definition: scroll_popup.h:31
Definition: messages.h:79
Definition: sprites.h:52
Definition: party_view.h:32
Definition: messages.h:56
Definition: character_info.h:99
Definition: character_info.h:35
Definition: messages.h:49
Definition: detection.h:27
Definition: messages.h:48
Definition: character.h:432
void charSwitched(Character *priorChar) override
Definition: messages.h:87
Definition: messages.h:41