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 PETKA_MAIN_H
24 #define PETKA_MAIN_H
25 
26 #include "audio/mixer.h"
27 
28 #include "petka/interfaces/interface.h"
29 #include "petka/interfaces/dialog_interface.h"
30 
31 namespace Petka {
32 
33 struct BGInfo {
34 	uint16 objId;
35 	Common::Array<uint16> attachedObjIds;
36 };
37 
38 class Sound;
39 
40 class InterfaceMain : public Interface {
41 public:
42 	InterfaceMain();
43 
44 	void start(int id) override;
45 
46 	virtual void update(uint time) override;
47 
48 	void loadRoom(int id, bool fromSave);
49 
50 	const BGInfo *findBGInfo(int id) const;
51 
52 	void unloadRoom(bool fromSave);
53 
54 	void onLeftButtonDown(Common::Point p) override;
55 	void onRightButtonDown(Common::Point p) override;
56 	void onMouseMove(Common::Point p) override;
57 
58 	void setTextChoice(const Common::Array<Common::U32String> &choices, uint16 color, uint16 selectedColor);
59 	void setTextDescription(const Common::U32String &text, int frame);
60 
61 	void removeTextDescription();
62 
63 private:
64 	void playSound(int id, Audio::Mixer::SoundType type);
65 
66 public:
67 	DialogInterface _dialog;
68 	Common::Array<BGInfo> _bgs;
69 	int _roomId;
70 	bool _hasTextDesc;
71 };
72 
73 } // End of namespace Petka
74 
75 #endif
76