ScummVM API documentation
doll_view_gump.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 NUVIE_VIEWS_DOLL_VIEW_GUMP_H
23 #define NUVIE_VIEWS_DOLL_VIEW_GUMP_H
24 
25 #include "ultima/nuvie/core/nuvie_defs.h"
26 #include "ultima/nuvie/views/draggable_view.h"
27 
28 namespace Ultima {
29 namespace Nuvie {
30 
31 class Configuration;
32 class TileManager;
33 class ObjManager;
34 class Screen;
35 class Actor;
36 class Font;
37 class DollWidget;
38 
39 static const int DOLLVIEWGUMP_HEIGHT = 136;
40 
41 class DollViewGump : public DraggableView {
42 
43  GUI_Button *gump_button;
44  GUI_Button *combat_button;
45  GUI_Button *heart_button;
46  GUI_Button *party_button;
47  GUI_Button *inventory_button;
48  DollWidget *doll_widget;
49 
50  GUI_Font *font;
51 
52  Actor *actor;
53  bool is_avatar;
54  bool show_cursor;
55  const Tile *cursor_tile;
56  gumpCursorPos cursor_pos;
57  uint8 cursor_xoff, cursor_yoff;
58 
59  Graphics::ManagedSurface *actor_doll;
60 
61 public:
62  DollViewGump(const Configuration *cfg);
63  ~DollViewGump() override;
64 
65  bool init(Screen *tmp_screen, void *view_manager, uint16 x, uint16 y, Actor *a, Font *f, Party *p, TileManager *tm, ObjManager *om);
66 
67  void set_actor(Actor *a);
68  Actor *get_actor() {
69  return actor;
70  }
71 
72  void Display(bool full_redraw) override;
73 
74  GUI_status MouseDown(int x, int y, Shared::MouseButton button) override;
75  GUI_status MouseUp(int x, int y, Shared::MouseButton button) override;
76  GUI_status MouseMotion(int x, int y, uint8 state) override {
77  return DraggableView::MouseMotion(x, y, state);
78  }
79  GUI_status MouseWheel(sint32 xpos, sint32 ypos) override;
80  void MoveRelative(int dx, int dy) override {
81  return DraggableView::MoveRelative(dx, dy);
82  }
83 
84 
85  GUI_status callback(uint16 msg, GUI_CallBack *caller, void *data) override;
86 protected:
87 
88  void displayEquipWeight();
89  void displayCombatMode();
90 
91  void left_arrow();
92  void right_arrow();
93 
94 private:
95 
96  void activate_combat_button();
97  void setColorKey(Graphics::ManagedSurface *image);
98  GUI_status set_cursor_pos(gumpCursorPos pos);
99  GUI_status moveCursorRelative(NuvieDir direction);
100  GUI_status KeyDown(const Common::KeyState &key) override;
101 
102 };
103 
104 } // End of namespace Nuvie
105 } // End of namespace Ultima
106 
107 #endif
Definition: managed_surface.h:51
Definition: actor.h:178
Definition: configuration.h:61
Definition: gui_font.h:36
Definition: gui_button.h:70
Definition: atari-screen.h:60
Definition: tile_manager.h:145
Definition: party.h:92
Definition: screen.h:41
Definition: detection.h:27
Definition: doll_view_gump.h:41
Definition: draggable_view.h:34
Definition: obj_manager.h:75
Definition: doll_widget.h:37
Definition: keyboard.h:294
Definition: tile_manager.h:113
Definition: font.h:42
Definition: gui_callback.h:31