ScummVM API documentation
gamescreen.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 MUTATIONOFJB_GUI_H
23#define MUTATIONOFJB_GUI_H
24
25#include "mutationofjb/inventory.h"
26#include "mutationofjb/script.h"
27#include "mutationofjb/guiscreen.h"
28#include "mutationofjb/widgets/buttonwidget.h"
29#include "mutationofjb/widgets/inventorywidget.h"
30#include "mutationofjb/widgets/gamewidget.h"
31
32#include "common/array.h"
33#include "common/hashmap.h"
34#include "common/hash-str.h"
35
36#include "graphics/surface.h"
37
38namespace Common {
39struct Event;
40}
41
42namespace Graphics {
43class Screen;
44}
45
46namespace MutationOfJB {
47
48class Game;
49class Widget;
50class InventoryWidget;
51class ConversationWidget;
52class LabelWidget;
53class GameWidget;
54
56public:
57 friend class InventoryAnimationDecoderCallback;
58 friend class HudAnimationDecoderCallback;
59
60 GameScreen(Game &game, Graphics::Screen *screen);
61 ~GameScreen() override;
62
63 bool init();
64
65 void handleEvent(const Common::Event &event) override;
66
67 void onInventoryChanged() override;
68 void onButtonClicked(ButtonWidget *) override;
69 void onInventoryItemHovered(InventoryWidget *widget, int posInWidget) override;
70 void onInventoryItemClicked(InventoryWidget *widget, int posInWidget) override;
71 void onGameDoorClicked(GameWidget *, Door *door) override;
72 void onGameStaticClicked(GameWidget *, Static *stat) override;
73 void onGameEntityHovered(GameWidget *, const Common::String &entity) override;
74
75 ConversationWidget &getConversationWidget();
76
77 void showConversationWidget(bool show);
78 void refreshAfterSceneChanged();
79
80private:
81 bool loadInventoryGfx();
82 bool loadHudGfx();
83 void drawInventoryItem(const Common::String &item, int pos);
84 void drawInventory();
85
86 void updateStatusBarText(const Common::String &entity, bool inventory);
87
88 Common::Array<Graphics::Surface> _inventorySurfaces;
90
92 InventoryWidget *_inventoryWidget;
93 ConversationWidget *_conversationWidget;
94 LabelWidget *_statusBarWidget;
95 GameWidget *_gameWidget;
96
97 ActionInfo::Action _currentAction;
98 Common::String _currentPickedItem;
99};
100
101}
102
103#endif
Definition: str.h:59
Definition: screen.h:47
Definition: buttonwidget.h:32
Definition: buttonwidget.h:38
Definition: conversationwidget.h:38
Definition: game.h:50
Definition: gamescreen.h:55
void onInventoryItemClicked(InventoryWidget *widget, int posInWidget) override
void handleEvent(const Common::Event &event) override
void onInventoryItemHovered(InventoryWidget *widget, int posInWidget) override
Definition: gamewidget.h:33
Definition: gamewidget.h:41
Definition: guiscreen.h:45
Definition: inventory.h:34
Definition: inventorywidget.h:38
Definition: inventorywidget.h:59
Definition: labelwidget.h:31
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: events.h:218
Definition: gamedata.h:51
Definition: gamedata.h:213
Definition: atari-screen.h:58