ScummVM API documentation
view_manager.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_VIEW_MANAGER_H
23#define NUVIE_VIEWS_VIEW_MANAGER_H
24
25namespace Ultima {
26namespace Nuvie {
27
28class Configuration;
29class GUI;
30class TileManager;
31class ObjManager;
32class Portrait;
33class Party;
34class Player;
35class Font;
36class Actor;
37class Obj;
38
39class View;
40class PartyView;
41class PortraitView;
42class InventoryView;
43class ActorView;
44class SpellView;
45class ContainerViewGump;
46class DollViewGump;
47class DraggableView;
48class SunMoonRibbon;
49class MDSkyStripWidget;
50
51typedef enum { CURSOR_HEAD, CURSOR_NECK, CURSOR_CHEST, CURSOR_RIGHT_HAND, CURSOR_LEFT_HAND, CURSOR_RIGHT_RING, CURSOR_LEFT_RING, CURSOR_FEET,
52 CURSOR_LEFT, CURSOR_RIGHT, CURSOR_COMBAT, CURSOR_CHECK, CURSOR_HEART, CURSOR_PARTY, CURSOR_INVENTORY
53 } gumpCursorPos;
54
56protected:
57
58 const Configuration *config;
59 int game_type;
60 GUI *gui;
61 Font *font;
62 TileManager *tile_manager;
63 ObjManager *obj_manager;
64 Party *party;
65 Portrait *portrait;
66
67 ActorView *actor_view;
68 InventoryView *inventory_view;
69 PortraitView *portrait_view;
70 PartyView *party_view;
71 SpellView *spell_view;
72
73 View *current_view;
74
75 Common::List<DraggableView *> container_gumps;
78
79 uint8 doll_next_party_member;
80
81 SunMoonRibbon *ribbon;
82 MDSkyStripWidget *mdSkyWidget;
83
84 Common::Path DollDataDirString;
85
86public:
87
88 ViewManager(const Configuration *cfg);
89 virtual ~ViewManager();
90
91 bool init(GUI *g, Font *f, Party *p, Player *player, TileManager *tm, ObjManager *om, Portrait *por);
92 void reload();
93
94 void update();
95
96 void set_portrait_mode(Actor *actor, const char *name);
97 void set_inventory_mode();
98 void set_party_mode();
99 void set_actor_mode();
100 void set_spell_mode(Actor *caster, Obj *spell_container, bool eventMode = false);
101
102 void close_spell_mode();
103
104 View *get_current_view() {
105 return current_view;
106 }
107 ActorView *get_actor_view() {
108 return actor_view;
109 }
110 InventoryView *get_inventory_view() {
111 return inventory_view;
112 }
113 PortraitView *get_portrait_view() {
114 return portrait_view;
115 }
116 PartyView *get_party_view() {
117 return party_view;
118 }
119 SpellView *get_spell_view() {
120 return spell_view;
121 }
122 MDSkyStripWidget *get_mdSkyWidget() {
123 return mdSkyWidget;
124 }
125
126 void close_current_view();
127
128 void open_doll_view(Actor *actor);
129
130 void open_container_view(Obj *obj) {
131 open_container_view(nullptr, obj);
132 }
133 void open_container_view(Actor *actor) {
134 open_container_view(actor, nullptr);
135 }
136
137 void close_container_view(Actor *actor);
138
139 void open_mapeditor_view();
140 void open_portrait_gump(Actor *a);
141 void open_sign_gump(const char *sign_text, uint16 length);
142 void open_scroll_gump(const char *text, uint16 length);
143 void close_gump(DraggableView *gump);
144 void close_all_gumps();
145 bool gumps_are_active() {
146 return !gumps.empty();
147 }
148
149 bool set_current_view(View *view);
150 void double_click_obj(Obj *obj);
151 unsigned int get_display_weight(float weight);
152
153// custom doll functions shared between DollWidget and DollViewGump
154 Common::Path getDollDataDirString();
155 Graphics::ManagedSurface *loadAvatarDollImage(Graphics::ManagedSurface *avatar_doll, bool orig = false);
156 Graphics::ManagedSurface *loadCustomActorDollImage(Graphics::ManagedSurface *actor_doll, uint8 actor_num, bool orig = false);
157 Graphics::ManagedSurface *loadGenericDollImage(bool orig);
158
159protected:
160
161 Actor *doll_view_get_next_party_member();
162 DollViewGump *get_doll_view(Actor *actor);
163 ContainerViewGump *get_container_view(Actor *actor, Obj *obj);
164 void open_container_view(Actor *actor, Obj *obj);
165 void add_gump(DraggableView *gump);
166 void add_view(View *view);
167 void move_gump_to_top(DraggableView *gump);
168};
169
170} // End of namespace Nuvie
171} // End of namespace Ultima
172
173#endif
Definition: list.h:44
bool empty() const
Definition: list.h:258
Definition: path.h:52
Definition: managed_surface.h:51
Definition: actor.h:174
Definition: actor_view.h:38
Definition: configuration.h:60
Definition: container_view_gump.h:40
Definition: doll_view_gump.h:41
Definition: draggable_view.h:34
Definition: font.h:42
Definition: gui.h:42
Definition: inventory_view.h:40
Definition: md_sky_strip_widget.h:35
Definition: obj.h:84
Definition: obj_manager.h:74
Definition: party.h:92
Definition: party_view.h:40
Definition: player.h:41
Definition: portrait.h:40
Definition: portrait_view.h:42
Definition: spell_view.h:40
Definition: sun_moon_ribbon.h:30
Definition: tile_manager.h:145
Definition: view.h:42
Definition: view_manager.h:55