22 #ifndef ILLUSIONS_MENUSYSTEM_H 23 #define ILLUSIONS_MENUSYSTEM_H 25 #include "illusions/actor.h" 26 #include "illusions/graphics.h" 27 #include "illusions/resources/fontresource.h" 28 #include "common/array.h" 29 #include "common/rect.h" 30 #include "common/stack.h" 31 #include "common/str.h" 32 #include "graphics/surface.h" 36 class IllusionsEngine;
41 const uint kMenuTextSize = 4096;
50 const Common::Point& getMouseClickPoint() {
return _mouseClickPoint; };
59 BaseMenu(
BaseMenuSystem *menuSystem, uint32 fontId, byte backgroundColor, byte borderColor, byte textColor, byte fieldE,
60 uint defaultMenuItemIndex);
63 void addMenuItem(
MenuItem *menuItem);
64 uint getHeaderLinesCount();
66 uint getMenuItemsCount();
68 virtual void enterMenu();
73 byte _backgroundColor, _borderColor, _textColor, _fieldE;
75 uint _defaultMenuItemIndex;
89 void playSoundEffect13();
90 void playSoundEffect14();
91 void selectMenuChoiceIndex(uint choiceIndex);
95 void enterSubMenuById(
int menuId);
96 uint getQueryConfirmationChoiceIndex()
const;
97 void setQueryConfirmationChoiceIndex(uint queryConfirmationChoiceIndex);
98 bool isActive()
const {
return _isActive; }
101 void handleClick(uint menuItemIndex,
const Common::Point &mousePos);
103 void redrawMenuText(
BaseMenu *menu);
104 void update(
Control *cursorControl);
105 void setTimeOutDuration(uint32 duration, uint timeOutMenuChoiceIndex);
106 void setMenuCallerThreadId(uint32 menuCallerThreadId);
107 void setMenuChoiceOffsets(MenuChoiceOffsets menuChoiceOffsets, int16 *menuChoiceOffset);
108 void setSavegameSlotNum(
int slotNum);
110 bool calcMenuItemTextPositionAtPoint(
Common::Point pt,
int &offset);
111 virtual bool initMenuCursor() = 0;
112 virtual int getGameState() = 0;
113 virtual void setGameState(
int gameState) = 0;
114 virtual void setMenuCursorNum(
int cursorNum) = 0;
119 uint32 _menuCallerThreadId;
120 bool _isTimeOutEnabled;
121 bool _isTimeOutReached;
122 uint32 _timeOutDuration;
123 uint _timeOutMenuChoiceIndex;
124 uint32 _timeOutStartTime;
125 uint32 _timeOutEndTime;
128 bool _cursorInitialVisibleFlag;
130 int _savedCursorActorIndex;
131 int _savedCursorSequenceId;
135 MenuChoiceOffsets _menuChoiceOffsets;
136 int16 *_menuChoiceOffset;
138 uint _queryConfirmationChoiceIndex;
141 uint _menuLinesCount;
144 uint _hoveredMenuItemIndex;
145 uint _hoveredMenuItemIndex2;
146 uint _hoveredMenuItemIndex3;
149 void setMouseCursorToMenuItem(
int menuItemIndex);
151 void calcMenuItemRect(uint menuItemIndex,
WRect &rect);
152 bool calcMenuItemMousePos(uint menuItemIndex,
Common::Point &pt);
153 bool calcMenuItemIndexAtPoint(
Common::Point pt, uint &menuItemIndex);
158 void updateTimeOut(
bool resetTimeOut);
160 void initActorHoverBackground();
161 void placeActorHoverBackground();
162 void updateActorHoverBackground();
163 void hideActorHoverBackground();
165 void initActorTextColorRect();
166 void placeActorTextColorRect();
167 void hideActorTextColorRect();
169 virtual BaseMenu *getMenuById(
int menuId) = 0;
170 virtual void playSoundEffect(
int sfxId) = 0;
177 void appendNewLine();
179 uint16 *getText() {
return _text; }
181 uint16 _text[kMenuTextSize];
191 virtual void execute() = 0;
201 void execute()
override;
211 void execute()
override;
219 void execute()
override;
229 void execute()
override;
232 uint _confirmationChoiceIndex;
238 void execute()
override;
246 void execute()
override;
253 #endif // ILLUSIONS_MENUSYSTEM_H
Definition: graphics.h:44
Definition: illusions.h:92