22#ifndef HARVESTER_MENU_H
23#define HARVESTER_MENU_H
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"
72 bool hasDialogueKeywordLabel()
const {
return !dialogueKeywordLabel.empty(); }
73 bool hasQuickTipsHeader()
const {
return !quickTipsHeader.empty(); }
96 Common::Error runHelpScreen(
const byte *palette,
float paletteBrightness,
Flow &flow);
98 float paletteBrightness,
Flow &flow,
bool canSaveGame);
101 Flow &flow,
bool &promptCompleted);
105 struct MenuSelection;
108 struct RoomMenuActivationResult;
109 enum MenuNavigationCommand { kNoMenuCommand, kActivateMenuItem, kCloseMenu };
110 MenuNavigationCommand handleMenuNavigationEvent(MenuSelection &selection,
112 bool captureMainMenuBackdrop(MainMenu &menu,
IndexedBitmap &backdrop);
114 Common::Error startNewGameFromMainMenu(MainMenu &menu,
const byte *menuPalette);
115 Common::Error loadGameFromMainMenu(MainMenu &menu,
const byte *menuPalette);
117 RoomMenuActivationResult startNewGameFromRoomMenu(RoomMenu &menu);
118 RoomMenuActivationResult saveGameFromRoomMenu(RoomMenu &menu);
119 RoomMenuActivationResult activateRoomMenuItem(RoomMenu &menu);
122 static int getNativeRoomMenuSelectionFromMouse(
const Graphics::Font &selectedFont, uint itemCount,
126 void updateOptionsSlider(OptionsMenu &menu,
int sliderIndex);
127 void cycleOptionsTextMode(OptionsMenu &menu);
128 void toggleOptionsGore(OptionsMenu &menu);
129 void toggleOptionsPassword(OptionsMenu &menu);
132 void handleOptionsMouseMove(OptionsMenu &menu,
const Graphics::Font &selectedFont);
139 struct SaveSlotEventResult;
140 enum SaveLoadMode { kSaveMode, kLoadMode };
141 enum SaveSlotCommand { kNoSlotCommand, kConfirmSlot, kCancelSlot };
143 SaveSlotEventResult handleSaveSlotEvent(SaveSlotMenu &menu, SaveLoadMode mode,
146 void reloadSaveSlotTitles(SaveSlotMenu &menu)
const;
148 SaveSlotCommand getSaveSlotCommand(
const Common::Event &event)
const;
149 void renderSaveSlotMenu(
const SaveSlotMenu &menu,
const Common::String *editingText =
nullptr)
const;
153 void loadSelectedSlot(SaveSlotMenu &menu,
bool &loaded);
155 Common::Error runLoadGameMenu(
const byte *palette,
float paletteBrightness,
156 Flow &flow,
bool &loadedGame);
158 float paletteBrightness,
Flow &flow);
159 Common::Error runSaveGameMenu(
const byte *palette,
float paletteBrightness,
160 Flow &flow,
bool &savedGame);
162 float paletteBrightness,
Flow &flow)
const;
167 float paletteBrightness,
Flow &flow);
168 struct PasswordPromptResult {
170 bool accepted =
false;
173 float paletteBrightness,
Flow &flow,
bool drawLogo, PasswordPromptResult &prompt)
const;
175 void clearMainMenuBackdrop();
176 void renderMainMenuScreen(
int selectedItem,
const Common::String &statusMessage,
178 void renderBackdropMenuScreen(
const IndexedBitmap &backdrop,
const byte *palette,
180 int selectedItem)
const;
189 byte _mainMenuBackdropPalette[256 * 3] = { 0 };
190 bool _hasMainMenuBackdrop =
false;
Definition: harvester.h:47
Definition: resources.h:32
Definition: algorithm.h:29
Definition: formatinfo.h:28