ScummVM API documentation
global-ui.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 ALCACHOFA_GLOBAL_UI_H
23#define ALCACHOFA_GLOBAL_UI_H
24
25#include "alcachofa/objects.h"
26
27namespace Alcachofa {
28
29class GlobalUI {
30public:
31 GlobalUI();
32 virtual ~GlobalUI() {}
33
34 inline Font &generalFont() const { assert(_generalFont != nullptr); return *_generalFont; }
35 inline Font &dialogFont() const { assert(_dialogFont != nullptr); return *_dialogFont; }
36 inline bool &isPermanentFaded() { return _isPermanentFaded; }
37
38 bool updateChangingCharacter();
39 virtual void drawChangingButton() = 0;
40 virtual void drawInventoryButton() = 0;
41 virtual bool updateOpeningInventory() = 0;
42 virtual void startClosingInventory() = 0;
43 virtual bool isHoveringInventoryExit() const = 0;
44 void updateClosingInventory();
45 void drawScreenStates(); // black borders and/or permanent fade
46 void syncGame(Common::Serializer &s);
47
48protected:
49 Animation *activeAnimation() const;
50 virtual bool isHoveringChangeButton() const = 0;
51
52 Graphic _changeButton, _inventoryButton;
54 _generalFont,
55 _dialogFont;
57 _iconMortadelo,
58 _iconFilemon,
59 _iconInventory;
60
61 bool
62 _isOpeningInventory = false,
63 _isClosingInventory = false,
64 _isPermanentFaded = false;
65 uint32 _timeForInventory = 0;
66};
67
68class GlobalUIV1 final : public GlobalUI {
69public:
70 void drawChangingButton() override;
71 void drawInventoryButton() override;
72 bool updateOpeningInventory() override;
73 void startClosingInventory() override;
74 bool isHoveringInventoryExit() const override;
75
76protected:
77 bool isHoveringChangeButton() const override;
78};
79
80class GlobalUIV3 final : public GlobalUI {
81public:
82 void drawChangingButton() override;
83 void drawInventoryButton() override;
84 bool updateOpeningInventory() override;
85 void startClosingInventory() override;
86 bool isHoveringInventoryExit() const override;
87
88protected:
89 bool isHoveringChangeButton() const override;
90};
91
92Task *showCenterBottomText(Process &process, int32 dialogId, uint32 durationMs);
93
94}
95
96
97#endif // ALCACHOFA_GLOBAL_UI_H
Definition: graphics.h:220
Definition: graphics.h:276
Definition: global-ui.h:29
virtual bool updateOpeningInventory()=0
returns true iff interaction is handled
Definition: global-ui.h:68
bool updateOpeningInventory() override
returns true iff interaction is handled
Definition: global-ui.h:80
bool updateOpeningInventory() override
returns true iff interaction is handled
Definition: graphics.h:297
Definition: scheduler.h:164
Definition: ptr.h:572
Definition: serializer.h:80
Definition: scheduler.h:84