From 0793272dfa574d48c28e94181993c3c7ab5afb60 Mon Sep 17 00:00:00 2001 From: Eric Fry Date: Fri, 8 Jun 2018 23:03:21 +1000 Subject: ILLUSIONS: Wire up sfx to menus --- engines/illusions/duckman/menusystem_duckman.cpp | 10 ++++++++-- engines/illusions/duckman/menusystem_duckman.h | 1 + engines/illusions/menusystem.cpp | 4 ++-- engines/illusions/menusystem.h | 1 + 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/engines/illusions/duckman/menusystem_duckman.cpp b/engines/illusions/duckman/menusystem_duckman.cpp index e7565189cc..8a9e1cce47 100644 --- a/engines/illusions/duckman/menusystem_duckman.cpp +++ b/engines/illusions/duckman/menusystem_duckman.cpp @@ -97,7 +97,7 @@ BaseMenu *DuckmanMenuSystem::createMainMenu() { BaseMenu *menu = new BaseMenu(this, 0x00120003, 12, 17, 11, 27, 0); menu->addMenuItem(new MenuItem("Start New Game", new MenuActionReturnChoice(this, 11))); menu->addMenuItem(new MenuItem("Load Saved Game", new MenuActionLoadGame(this, 1))); - // TODO menu->addMenuItem(new MenuItem("Options", new MenuActionEnterMenu(this, kDuckmanOptionsMenu))); + menu->addMenuItem(new MenuItem("Options", new MenuActionEnterMenu(this, kDuckmanOptionsMenu))); menu->addMenuItem(new MenuItem("Quit Game", new MenuActionEnterQueryMenu(this, kDuckmanQueryQuitMenu, 12))); return menu; } @@ -156,7 +156,7 @@ BaseMenu *DuckmanMenuSystem::createSaveCompleteMenu() { BaseMenu *DuckmanMenuSystem::createDebugMenu() { // TODO BaseMenu *menu = new BaseMenu(this, 0x00120002, 0, 0, 0, 17, 1); - menu->addText("Debug Pause Menu"); + menu->addText("Debug Menu"); menu->addText("-----------------"); return menu; } @@ -167,6 +167,7 @@ BaseMenu *DuckmanMenuSystem::createDebugPauseMenu() { menu->addText("-----------------"); menu->addMenuItem(new MenuItem("Return to Game", new MenuActionReturnChoice(this, 1))); menu->addMenuItem(new MenuItem("Add/Remove Inventory", new MenuActionEnterMenu(this, kDuckmanAddRemoveInventoryMenu))); + // TODO quit to debug menu. return menu; } @@ -209,6 +210,7 @@ BaseMenu *DuckmanMenuSystem::createAddRemoveInventoryMenu() { for(int i=0;i < 21;i++) { menu->addMenuItem(new MenuItem(kDebugInventoryItems[i].name, new MenuActionInventoryAddRemove(this, _vm, i))); } + menu->addMenuItem(new MenuItem("Back", new MenuActionLeaveMenu(this))); return menu; } @@ -266,6 +268,10 @@ void DuckmanMenuSystem::setGameState(int gameState) { _vm->_cursor._gameState = gameState; } +void DuckmanMenuSystem::playSoundEffect(int sfxId) { + _vm->playSoundEffect(sfxId); +} + MenuActionInventoryAddRemove::MenuActionInventoryAddRemove(BaseMenuSystem *menuSystem, IllusionsEngine_Duckman *vm, uint choiceIndex) : BaseMenuAction(menuSystem), _choiceIndex(choiceIndex), _vm(vm) { } diff --git a/engines/illusions/duckman/menusystem_duckman.h b/engines/illusions/duckman/menusystem_duckman.h index 787ced350b..2921277630 100644 --- a/engines/illusions/duckman/menusystem_duckman.h +++ b/engines/illusions/duckman/menusystem_duckman.h @@ -71,6 +71,7 @@ public://protected: virtual int getGameState(); virtual void setGameState(int gameState); virtual void setMenuCursorNum(int cursorNum); + virtual void playSoundEffect(int sfxId); }; class MenuActionInventoryAddRemove : public BaseMenuAction { diff --git a/engines/illusions/menusystem.cpp b/engines/illusions/menusystem.cpp index 3330cb727a..e1aacf78ee 100644 --- a/engines/illusions/menusystem.cpp +++ b/engines/illusions/menusystem.cpp @@ -100,11 +100,11 @@ BaseMenuSystem::~BaseMenuSystem() { } void BaseMenuSystem::playSoundEffect13() { - // TODO + playSoundEffect(13); } void BaseMenuSystem::playSoundEffect14() { - // TODO + playSoundEffect(14); } void BaseMenuSystem::selectMenuChoiceIndex(uint choiceIndex) { diff --git a/engines/illusions/menusystem.h b/engines/illusions/menusystem.h index d9961f82d5..0a7f432e99 100644 --- a/engines/illusions/menusystem.h +++ b/engines/illusions/menusystem.h @@ -163,6 +163,7 @@ protected: void hideActorTextColorRect(); virtual BaseMenu *getMenuById(int menuId) = 0; + virtual void playSoundEffect(int sfxId) = 0; }; /* -- cgit v1.2.3