22 #ifndef ALCACHOFA_MENU_H 23 #define ALCACHOFA_MENU_H 25 #include "common/savefile.h" 35 enum class MainMenuAction : int32 {
52 enum class OptionsMenuAction : int32 {
67 enum class OptionsMenuValue : int32 {
75 static Menu *create();
79 inline bool isOpen()
const {
return _isOpen; }
80 inline uint32 millisBeforeMenu()
const {
return _millisBeforeMenu; }
81 inline Room *previousRoom() {
return _previousRoom; }
82 inline FakeSemaphore &interactionSemaphore() {
return _interactionSemaphore; }
83 inline SlideButton *¤tSlideButton() {
return _currentSlideButton; }
86 void resetAfterLoad();
87 virtual void updateOpeningMenu();
89 virtual void triggerMainMenuAction(MainMenuAction action);
90 void triggerOptionsAction(OptionsMenuAction action);
91 void triggerOptionsValue(OptionsMenuValue valueId,
float value);
99 inline bool isOnNewSlot()
const {
return _selectedSavefileI >= _savefiles.size(); }
100 virtual void updateSelectedSavefile(
bool hasJustSaved);
101 virtual void setOptionsState() = 0;
103 void openOptionsMenu();
105 bool tryReadOldSavefile();
107 void continueMainMenu();
111 _openAtNextFrame =
false;
113 _millisBeforeMenu = 0,
114 _selectedSavefileI = 0;
115 Room *_previousRoom =
nullptr;
128 void triggerMainMenuAction(MainMenuAction action)
override;
131 void updateSelectedSavefile(
bool hasJustSaved)
override;
132 void setOptionsState()
override;
137 void updateOpeningMenu()
override;
138 void triggerMainMenuAction(MainMenuAction action)
override;
141 void updateSelectedSavefile(
bool hasJustSaved)
override;
142 void setOptionsState()
override;
143 void toggleMessageBox(
bool show);
148 void updateOpeningMenu()
override;
149 void triggerMainMenuAction(MainMenuAction action)
override;
152 void updateSelectedSavefile(
bool hasJustSaved)
override;
153 void setOptionsState()
override;
157 void switchToState(MainMenuAction state);
159 MainMenuAction _currentState = MainMenuAction::ConfirmSavestate;
164 #endif // ALCACHOFA_MENU_H Definition: managed_surface.h:51
Definition: alcachofa.h:45
Definition: savefile.h:142
This fake semaphore does not work in multi-threaded scenarios It is used as a safer option for a simp...
Definition: common.h:93