ScummVM API documentation
menusystem_duckman.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 ILLUSIONS_DUCKMAN_MENUSYSTEM_DUCKMAN_H
23 #define ILLUSIONS_DUCKMAN_MENUSYSTEM_DUCKMAN_H
24 
25 #include "illusions/menusystem.h"
26 
27 namespace Illusions {
28 
29 enum SliderActionType {
30  SFX,
31  MUSIC,
32  VOICE,
33  TEXT_DURATION
34 };
35 
36 enum {
37  kDuckmanMainMenu,
38  kDuckmanMainMenuDemo,
39  kDuckmanLoadGameMenu,
40  kDuckmanLoadGameFailedMenu,
41  kDuckmanOptionsMenu,
42  kDuckmanPauseMenu,
43  kDuckmanDebugMenu,
44  kDuckmanDebugPauseMenu,
45  kDuckmanAddRemoveInventoryMenu,
46  kDuckmanQueryQuitMenu,
47  kDuckmanQueryRestartMenu,
48  kDuckmanSaveCompleteMenu,
49  kDuckmanLastMenuIndex
50 };
51 
52 class IllusionsEngine_Duckman;
53 class MenuActionUpdateSlider;
54 
56 public:
58  ~DuckmanMenuSystem() override;
59  void runMenu(MenuChoiceOffsets menuChoiceOffsets, int16 *menuChoiceOffset,
60  uint32 menuId, uint32 duration, uint timeOutMenuChoiceIndex, uint32 menuCallerThreadId);
61 public://protected:
63  BaseMenu *_menus[kDuckmanLastMenuIndex];
64  void clearMenus();
65  void freeMenus();
66  BaseMenu *getMenuById(int menuId) override;
67  BaseMenu *createMenuById(int menuId);
68  BaseMenu *createMainMenu();
69  BaseMenu *createMainMenuDemo();
70  BaseMenu *createLoadGameMenu();
71  BaseMenu *createLoadGameFailedMenu();
72  BaseMenu *createOptionsMenu();
73  BaseMenu *createPauseMenu();
74  BaseMenu *createQueryRestartMenu();
75  BaseMenu *createQueryQuitMenu();
76  BaseMenu *createSaveCompleteMenu();
77  BaseMenu *createDebugMenu();
78  BaseMenu *createDebugPauseMenu();
79  BaseMenu *createAddRemoveInventoryMenu();
80  int convertRootMenuId(uint32 menuId);
81  bool initMenuCursor() override;
82  int getGameState() override;
83  void setGameState(int gameState) override;
84  void setMenuCursorNum(int cursorNum) override;
85  void playSoundEffect(int sfxId) override;
86 private:
87  MenuItem *createOptionsSliderMenuItem(MenuActionUpdateSlider **action, const Common::String &text,
88  SliderActionType type, BaseMenu *baseMenu);
89  };
90 
92 public:
93  MenuActionInventoryAddRemove(BaseMenuSystem *menuSystem, IllusionsEngine_Duckman *vm, uint choiceIndex);
94  void execute() override;
95 protected:
97  int _choiceIndex;
98 };
99 
101 public:
102  MenuActionUpdateSlider(BaseMenuSystem *menuSystem, BaseMenu *baseMenu, SliderActionType type, IllusionsEngine_Duckman *vm);
103  void setMenuItem(MenuItem *menuItem) {
104  _menuItem = menuItem;
105  }
106 
107  void execute() override;
108  void setSliderValue(uint8 newValue);
109 protected:
111  SliderActionType _type;
112  MenuItem *_menuItem;
113  BaseMenu *menu;
114  int calcNewSliderValue(int newOffset);
115 };
116 
118 public:
120  MenuActionUpdateSlider *sfxSlider,
121  MenuActionUpdateSlider *musicSlider,
122  MenuActionUpdateSlider *speechSlider,
123  MenuActionUpdateSlider *textDurationSlider
124  );
125  void execute() override;
126 protected:
127  MenuActionUpdateSlider *_sfxSlider;
128  MenuActionUpdateSlider *_musicSlider;
129  MenuActionUpdateSlider *_speechSlider;
130  MenuActionUpdateSlider *_textDurationSlider;
131 };
132 
133 } // End of namespace Illusions
134 
135 #endif // ILLUSIONS_DUCKMAN_MENUSYSTEM_DUCKMAN_H
Definition: menusystem.h:57
Definition: menusystem_duckman.h:91
Definition: str.h:59
Definition: menusystem.h:85
Definition: menusystem.h:187
Definition: actor.h:34
Definition: menusystem_duckman.h:55
Definition: menusystem_duckman.h:100
Definition: menusystem.h:43
Definition: illusions_duckman.h:78
Definition: menusystem_duckman.h:117