ScummVM API documentation
systemui.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 AGI_SYSTEMUI_H
23 #define AGI_SYSTEMUI_H
24 
25 namespace Agi {
26 
27 #define SYSTEMUI_SAVEDGAME_MAXIMUM_SLOTS 100
28 #define SYSTEMUI_SAVEDGAME_SLOTS_ON_SCREEN 12
29 #define SYSTEMUI_SAVEDGAME_DESCRIPTION_LEN 30
30 #define SYSTEMUI_SAVEDGAME_DISPLAYTEXT_LEN 31
31 #define SYSTEMUI_SAVEDGAME_DISPLAYTEXT_PREFIX_LEN 3
32 
34  int16 slotId;
35  bool exists;
36  bool isValid;
37  char description[SYSTEMUI_SAVEDGAME_DESCRIPTION_LEN + 1]; // actual description
38  char displayText[SYSTEMUI_SAVEDGAME_DISPLAYTEXT_LEN + 1]; // modified description, meant for display purposes only
39 };
41 
43  Common::Rect rect;
44  const char *text;
45  int16 textWidth;
46  bool active;
47  bool isDefault;
48 };
50 
51 class SystemUI {
52 public:
53  SystemUI(AgiEngine *vm, GfxMgr *gfx, TextMgr *text);
54  ~SystemUI();
55 
56 private:
57  AgiEngine *_vm;
58  GfxMgr *_gfx;
59  TextMgr *_text;
60 
61 public:
62  const char *getStatusTextScore();
63  const char *getStatusTextSoundOn();
64  const char *getStatusTextSoundOff();
65 
66  void pauseDialog();
67  bool restartDialog();
68  bool quitDialog();
69 
70 private:
71 
72 
73 public:
74  const char *getInventoryTextNothing();
75  const char *getInventoryTextYouAreCarrying();
76  const char *getInventoryTextSelectItems();
77  const char *getInventoryTextReturnToGame();
78 
79  bool askForCommand(Common::String &commandText);
80 
81  int16 figureOutAutomaticSaveGameSlot(const char *automaticSaveDescription);
82  int16 figureOutAutomaticRestoreGameSlot(const char *automaticSaveDescription);
83 
84  int16 askForSaveGameSlot();
85  int16 askForRestoreGameSlot();
86  bool askForSaveGameDescription(int16 slotId, Common::String &newDescription);
87 
88  void savedGameSlot_KeyPress(uint16 newKey);
89 
90 private:
91  int16 askForSavedGameSlot(const char *slotListText);
92  bool askForSavedGameVerification(const char *verifyText, const char *verifyButton1, const char *verifyButton2, const char *actualDescription, int16 slotId);
93 
94  bool askForVerification(const char *verifyText, const char *button1Text, const char *button2Text, bool continueOnMessageBoxClick);
95 
96  void createSavedGameDisplayText(char *destDisplayText, const char *actualDescription, int16 slotId, bool fillUpWithSpaces);
97  void clearSavedGameSlots();
98  void readSavedGameSlots(bool filterNonexistant, bool withAutoSaveSlot);
99  void figureOutAutomaticSavedGameSlot(const char *automaticSaveDescription, int16 &matchedGameSlotId, int16 &freshGameSlotId);
100 
101  void drawSavedGameSlots();
102  void drawSavedGameSlotSelector(bool active);
103 
104  SystemUISavedGameArray _savedGameArray;
105  int16 _savedGameUpmostSlotNr;
106  int16 _savedGameSelectedSlotNr;
107 
108 private:
109  SystemUIButtonArray _buttonArray;
110 
111  Common::Rect createRect(int16 x, int16 adjX, int16 y, int16 adjY, int16 width, int16 adjWidth, int16 height, int16 adjHeight);
112 
113  void drawButton(SystemUIButtonEntry *button);
114  void drawButtonAppleIIgs(SystemUIButtonEntry *buttonEntry);
115  void drawButtonAppleIIgsEdgePixels(int16 x, int16 adjX, int16 y, int16 adjY, byte *edgeBitmap, bool mirrored, bool upsideDown);
116  void drawButtonAmiga(SystemUIButtonEntry *buttonEntry);
117  void drawButtonAtariST(SystemUIButtonEntry *buttonEntry);
118 
119 public:
120  void askForVerificationKeyPress(uint16 newKey);
121 
122 private:
123  bool _askForVerificationContinueOnMessageBoxClick;
124  bool _askForVerificationCancelled;
125  int16 _askForVerificationMouseLockedButtonNr;
126  int16 _askForVerificationMouseActiveButtonNr;
127 
128 private:
129  const char *_textStatusScore;
130  const char *_textStatusSoundOn;
131  const char *_textStatusSoundOff;
132 
133  const char *_textEnterCommand;
134 
135  const char *_textPause;
136  const char *_textPauseButton;
137  const char *_textRestart;
138  const char *_textRestartButton1;
139  const char *_textRestartButton2;
140  const char *_textQuit;
141  const char *_textQuitButton1;
142  const char *_textQuitButton2;
143 
144  const char *_textInventoryNothing;
145  const char *_textInventoryYouAreCarrying;
146  const char *_textInventorySelectItems;
147  const char *_textInventoryReturnToGame;
148 
149  const char *_textSaveGameSelectSlot;
150  const char *_textSaveGameEnterDescription;
151  const char *_textSaveGameVerify;
152  const char *_textSaveGameVerifyButton1;
153  const char *_textSaveGameVerifyButton2;
154 
155  const char *_textRestoreGameNoSlots;
156  const char *_textRestoreGameSelectSlot;
157  const char *_textRestoreGameError;
158  const char *_textRestoreGameVerify;
159  const char *_textRestoreGameVerifyButton1;
160  const char *_textRestoreGameVerifyButton2;
161 };
162 
163 } // End of namespace Agi
164 
165 #endif /* AGI_SYSTEMUI_H */
Definition: str.h:59
Definition: rect.h:144
Definition: systemui.h:51
Definition: graphics.h:58
Definition: agi.h:839
Definition: systemui.h:33
Definition: systemui.h:42
Definition: agi.h:63
Definition: text.h:76