ILLUSIONS: Fixed crash in Duckman demo on attempt to launch the menu

Fixes #11190
This commit is contained in:
Eugene Sandulenko 2020-09-02 18:40:19 +02:00
parent 476aa60c9a
commit 33a47d23b8
2 changed files with 15 additions and 3 deletions

View File

@ -77,6 +77,8 @@ BaseMenu *DuckmanMenuSystem::createMenuById(int menuId) {
switch (menuId) {
case kDuckmanMainMenu:
return createMainMenu();
case kDuckmanMainMenuDemo:
return createMainMenuDemo();
case kDuckmanPauseMenu:
return createPauseMenu();
case kDuckmanQueryRestartMenu:
@ -107,6 +109,15 @@ BaseMenu *DuckmanMenuSystem::createMainMenu() {
return menu;
}
BaseMenu *DuckmanMenuSystem::createMainMenuDemo() {
BaseMenu *menu = new BaseMenu(this, 0x00120003, 12, 17, 11, 27, 0);
menu->addMenuItem(new MenuItem("Start New Game", new MenuActionReturnChoice(this, 2)));
menu->addMenuItem(new MenuItem("Load Saved Game", new MenuActionLoadGame(this, 1)));
menu->addMenuItem(new MenuItem("Options", new MenuActionEnterMenu(this, kDuckmanOptionsMenu)));
menu->addMenuItem(new MenuItem("Quit Game", new MenuActionEnterQueryMenu(this, kDuckmanQueryQuitMenu, 3)));
return menu;
}
BaseMenu *DuckmanMenuSystem::createLoadGameMenu() {
return 0; // TODO
}
@ -277,10 +288,9 @@ int DuckmanMenuSystem::convertRootMenuId(uint32 menuId) {
case 0x180007: // load game failed menu
return kDuckmanLoadGameFailedMenu;
/* TODO CHECKME Another pause menu?
case 0x180008:
menuData = &g_menuDataPause;
*/
return kDuckmanMainMenuDemo;
default:
error("DuckmanMenuSystem() Menu ID %08X not found", menuId);
}

View File

@ -36,6 +36,7 @@ enum SliderActionType {
enum {
kDuckmanMainMenu,
kDuckmanMainMenuDemo,
kDuckmanLoadGameMenu,
kDuckmanLoadGameFailedMenu,
kDuckmanOptionsMenu,
@ -66,6 +67,7 @@ public://protected:
BaseMenu *getMenuById(int menuId) override;
BaseMenu *createMenuById(int menuId);
BaseMenu *createMainMenu();
BaseMenu *createMainMenuDemo();
BaseMenu *createLoadGameMenu();
BaseMenu *createLoadGameFailedMenu();
BaseMenu *createOptionsMenu();