ScummVM API documentation
menu.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 HARVESTER_MENU_H
23 #define HARVESTER_MENU_H
24 
25 #include "common/array.h"
26 #include "common/error.h"
27 #include "common/rect.h"
28 #include "common/str.h"
29 #include "harvester/art.h"
30 
31 namespace Graphics {
32 class Font;
33 }
34 
35 namespace Harvester {
36 
37 class HarvesterEngine;
38 class Flow;
39 
40 class MenuSystem {
41 public:
42  MenuSystem(HarvesterEngine &engine, Common::Point &mousePos,
43  const Common::Array<Common::String> &menuItems);
44 
45  Common::Error runMainMenuStub(Flow &flow);
46  Common::Error runRoomMenuStub(const IndexedBitmap &backdrop, const byte *palette,
47  float paletteBrightness, Flow &flow, bool canSaveGame);
48 
49 private:
50  Common::Error runLoadGameMenu(const byte *palette, float paletteBrightness,
51  Flow &flow, bool &loadedGame);
52  Common::Error runOptionsMenu(const IndexedBitmap &backdrop, const byte *palette,
53  float paletteBrightness, Flow &flow);
54  Common::Error runHelpScreen(const byte *palette, float paletteBrightness, Flow &flow);
55  Common::Error runSaveGameMenu(const byte *palette, float paletteBrightness,
56  Flow &flow, bool &savedGame);
57  Common::Error restoreRoomBackdropAfterSave(const IndexedBitmap &backdrop, const byte *palette,
58  float paletteBrightness, Flow &flow) const;
59  Common::Error runConfirmPrompt(const IndexedBitmap &backdrop, const byte *palette,
60  float paletteBrightness, Flow &flow, const Common::String &promptText,
61  bool &confirmed);
62  Common::Error runQuitGameConfirm(const IndexedBitmap &backdrop, const byte *palette,
63  float paletteBrightness, Flow &flow);
64  Common::Error showGameOverBackdrop(Flow &flow);
65  void clearMainMenuBackdrop();
66  void renderMainMenuStub(const Common::Array<Common::String> &menuItems, int selectedItem,
67  const Common::String &statusMessage) const;
68  void renderMainMenuScreen(int selectedItem, const Common::String &statusMessage,
69  bool drawCursor, const Common::Array<Common::String> &menuItems) const;
70  void renderBackdropMenuScreen(const IndexedBitmap &backdrop, const byte *palette,
71  float paletteBrightness, const Common::Array<Common::String> &menuItems,
72  int selectedItem) const;
73  int getMenuItemAt(const Common::Point &mousePos, const Common::Array<Common::String> &menuItems) const;
74  int getBackdropMenuItemAt(const Common::Point &mousePos,
75  const Common::Array<Common::String> &menuItems) const;
76 
77  HarvesterEngine &_engine;
78  Common::Point &_mousePos;
79  const Common::Array<Common::String> &_menuItems;
80  IndexedBitmap _mainMenuBackdrop;
81  byte _mainMenuBackdropPalette[256 * 3] = { 0 };
82  bool _hasMainMenuBackdrop = false;
83 };
84 
85 } // End of namespace Harvester
86 
87 #endif // HARVESTER_MENU_H
Definition: flow.h:46
Definition: str.h:59
Definition: art.h:31
Definition: menu.h:40
Definition: error.h:81
Definition: art.h:35
Definition: formatinfo.h:28
Definition: rect.h:144
Definition: harvester.h:47