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_CORE_CONVERSE_GUMP_WOU_H
24 #define NUVIE_CORE_CONVERSE_GUMP_WOU_H
25 
26 #include "ultima/nuvie/misc/call_back.h"
27 #include "ultima/nuvie/gui/widgets/gui_widget.h"
28 #include "ultima/nuvie/fonts/font.h"
29 #include "ultima/shared/std/containers.h"
30 #include "ultima/shared/std/string.h"
31 
32 namespace Ultima {
33 namespace Nuvie {
34 
35 using Std::list;
36 
37 class Configuration;
38 class Font;
39 class MsgScroll;
40 class Actor;
41 
42 class ConverseGumpWOU: public MsgScroll {
43 
44 	uint8 converse_bg_color;
45 
46 	uint8 frame_w;
47 	uint8 frame_h;
48 	uint16 min_w;
49 
50 	nuvie_game_t game_type;
51 	bool found_break_char;
52 public:
53 
54 	ConverseGumpWOU(Configuration *cfg, Font *f, Screen *s);
55 	~ConverseGumpWOU() override;
56 
57 	void set_talking(bool state, Actor *actor = NULL) override;
set_font(uint8 font_type)58 	void set_font(uint8 font_type) override {}
59 	void display_converse_prompt() override;
60 
61 	void Display(bool full_redraw) override;
62 
MouseUp(int x,int y,Shared::MouseButton button)63 	GUI_status MouseUp(int x, int y, Shared::MouseButton button) override {
64 		return GUI_YUM;
65 	}
66 
MouseDown(int x,int y,Shared::MouseButton button)67 	GUI_status MouseDown(int x, int y, Shared::MouseButton button) override {
68 		return GUI_YUM;
69 	}
MouseMotion(int x,int y,uint8 state)70 	GUI_status MouseMotion(int x, int y, uint8 state) override {
71 		return GUI_YUM;
72 	}
MouseEnter(uint8 state)73 	GUI_status MouseEnter(uint8 state) override {
74 		return GUI_YUM;
75 	}
MouseLeave(uint8 state)76 	GUI_status MouseLeave(uint8 state) override {
77 		return GUI_YUM;
78 	}
MouseClick(int x,int y,Shared::MouseButton button)79 	GUI_status MouseClick(int x, int y, Shared::MouseButton button) override {
80 		return GUI_YUM;
81 	}
MouseDouble(int x,int y,Shared::MouseButton button)82 	GUI_status MouseDouble(int x, int y, Shared::MouseButton button) override {
83 		return GUI_YUM;
84 	}
MouseDelayed(int x,int y,Shared::MouseButton button)85 	GUI_status MouseDelayed(int x, int y, Shared::MouseButton button) override {
86 		return GUI_YUM;
87 	}
MouseHeld(int x,int y,Shared::MouseButton button)88 	GUI_status MouseHeld(int x, int y, Shared::MouseButton button) override {
89 		return GUI_YUM;
90 	}
91 
is_converse_finished()92 	bool is_converse_finished() override {
93 		return (is_holding_buffer_empty() && !page_break);
94 	}
95 
96 protected:
97 
98 	void input_add_string(Std::string token_str);
99 	void process_page_break() override;
get_input_font_color()100 	uint8 get_input_font_color() override {
101 		return FONT_COLOR_WOU_CONVERSE_INPUT;
102 	}
103 	void display_bg();
104 
105 private:
106 
107 	Graphics::ManagedSurface *bg_image;
108 };
109 
110 } // End of namespace Nuvie
111 } // End of namespace Ultima
112 
113 #endif
114