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 
27 namespace Alcachofa {
28 
29 Common::Rect openInventoryTriggerBounds();
30 Common::Rect closeInventoryTriggerBounds();
31 
32 class GlobalUI {
33 public:
34  GlobalUI();
35 
36  inline Font &generalFont() const { assert(_generalFont != nullptr); return *_generalFont; }
37  inline Font &dialogFont() const { assert(_dialogFont != nullptr); return *_dialogFont; }
38  inline bool &isPermanentFaded() { return _isPermanentFaded; }
39 
40  bool updateChangingCharacter();
41  void drawChangingButton();
42  bool updateOpeningInventory();
43  void updateClosingInventory();
44  void startClosingInventory();
45  void drawScreenStates(); // black borders and/or permanent fade
46  void syncGame(Common::Serializer &s);
47 
48 private:
49  Animation *activeAnimation() const;
50  bool isHoveringChangeButton() const;
51 
52  Graphic _changeButton;
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 
68 Task *showCenterBottomText(Process &process, int32 dialogId, uint32 durationMs);
69 
70 }
71 
72 
73 #endif // ALCACHOFA_GLOBAL_UI_H
Definition: alcachofa.h:45
Definition: scheduler.h:84
Definition: scheduler.h:164
Definition: graphics.h:257
Definition: rect.h:524
Definition: graphics.h:184
Definition: ptr.h:572
Definition: serializer.h:79
Definition: global-ui.h:32
Definition: graphics.h:240