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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef NUVIE_VIEWS_PORTRAIT_VIEW_H
24 #define NUVIE_VIEWS_PORTRAIT_VIEW_H
25 
26 #include "ultima/nuvie/views/view.h"
27 
28 namespace Ultima {
29 namespace Nuvie {
30 
31 class Configuration;
32 class TileManager;
33 class Portrait;
34 class Screen;
35 class Font;
36 class ObjManager;
37 class Party;
38 class Player;
39 class Actor;
40 class DollWidget;
41 class U6Shape;
42 
43 class PortraitView : public View {
44 
45 	nuvie_game_t gametype;
46 
47 	uint8 cur_actor_num;
48 	Portrait *portrait;
49 	Std::string *name_string;
50 
51 	unsigned char *portrait_data;
52 	U6Shape *bg_data;
53 	uint8 portrait_width;
54 	uint8 portrait_height;
55 
56 	bool waiting; // waiting for input, then will return to previous view
57 	bool show_cursor; // indicate waiting for input
58 // uint16 cursor_x, cursor_y;
59 
60 	DollWidget *doll_widget;
61 	bool display_doll;
62 
63 public:
64 	PortraitView(Configuration *cfg);
65 	~PortraitView() override;
66 
67 	bool init(uint16 x, uint16 y, Font *f, Party *p, Player *player, TileManager *tm, ObjManager *om, Portrait *port);
68 	void Display(bool full_redraw) override;
69 	GUI_status HandleEvent(const Common::Event *event) override;
70 
71 	bool set_portrait(Actor *actor, const char *name);
set_show_cursor(bool state)72 	void set_show_cursor(bool state) {
73 		show_cursor = state;
74 	}
75 	void set_waiting(bool state);
get_waiting()76 	bool get_waiting()     {
77 		return (waiting);
78 	}
79 
80 protected:
81 
82 	void display_name(uint16 y_offset);
83 
84 private:
85 	void load_background(const char *filename, uint8 lib_offset);
86 
87 };
88 
89 } // End of namespace Nuvie
90 } // End of namespace Ultima
91 
92 #endif
93