aboutsummaryrefslogtreecommitdiff
path: root/engines/wage
diff options
context:
space:
mode:
authorEugene Sandulenko2016-01-14 18:18:04 +0100
committerEugene Sandulenko2016-02-14 17:12:45 +0100
commit61c4f2091b0e3d70c51223f50240ee9e822b3f78 (patch)
treee4c03a09b28adcfe48b35b7fe46e1f3f3415a88b /engines/wage
parent72b95e639ee9fc270df05e8d1738774fd35ac4ca (diff)
downloadscummvm-rg350-61c4f2091b0e3d70c51223f50240ee9e822b3f78.tar.gz
scummvm-rg350-61c4f2091b0e3d70c51223f50240ee9e822b3f78.tar.bz2
scummvm-rg350-61c4f2091b0e3d70c51223f50240ee9e822b3f78.zip
WAGE: Make menu commands working
Diffstat (limited to 'engines/wage')
-rw-r--r--engines/wage/menu.cpp33
-rw-r--r--engines/wage/menu.h1
-rw-r--r--engines/wage/wage.h2
3 files changed, 35 insertions, 1 deletions
diff --git a/engines/wage/menu.cpp b/engines/wage/menu.cpp
index 2dde420fa4..5bf6fc766f 100644
--- a/engines/wage/menu.cpp
+++ b/engines/wage/menu.cpp
@@ -484,7 +484,12 @@ bool Menu::mouseMove(int x, int y) {
bool Menu::mouseRelease(int x, int y) {
if (_menuActivated) {
_menuActivated = false;
+
+ if (_activeItem != -1 && _activeSubItem != -1 && _items[_activeItem]->subitems[_activeSubItem]->enabled)
+ executeCommand(_items[_activeItem]->subitems[_activeSubItem]);
+
_activeItem = -1;
+ _activeSubItem = -1;
return true;
}
@@ -492,4 +497,32 @@ bool Menu::mouseRelease(int x, int y) {
return false;
}
+void Menu::executeCommand(MenuSubItem *subitem) {
+ switch(subitem->action) {
+ case kMenuActionAbout:
+ case kMenuActionNew:
+ case kMenuActionOpen:
+ case kMenuActionClose:
+ case kMenuActionSave:
+ case kMenuActionSaveAs:
+ case kMenuActionRevert:
+ case kMenuActionQuit:
+
+ case kMenuActionUndo:
+ case kMenuActionCut:
+ case kMenuActionCopy:
+ case kMenuActionPaste:
+ case kMenuActionClear:
+ break;
+
+ case kMenuActionCommand:
+ _gui->_engine->processTurn(&subitem->text, NULL);
+ break;
+
+ default:
+ warning("Unknown action: %d", subitem->action);
+
+ }
+}
+
} // End of namespace Wage
diff --git a/engines/wage/menu.h b/engines/wage/menu.h
index 62ad835b8e..41696978ff 100644
--- a/engines/wage/menu.h
+++ b/engines/wage/menu.h
@@ -89,6 +89,7 @@ private:
void renderSubmenu(MenuItem *menu);
MenuItem *createCommandsMenu();
MenuItem *createWeaponsMenu();
+ void executeCommand(MenuSubItem *subitem);
Common::Array<MenuItem *> _items;
diff --git a/engines/wage/wage.h b/engines/wage/wage.h
index 375425b69b..2eb9803695 100644
--- a/engines/wage/wage.h
+++ b/engines/wage/wage.h
@@ -119,12 +119,12 @@ public:
bool canSaveGameStateCurrently();
const char *getGameFile() const;
+ void processTurn(Common::String *textInput, Designed *clickInput);
private:
bool loadWorld(Common::MacResManager *resMan);
void performInitialSetup();
void wearObjs(Chr *chr);
- void processTurn(Common::String *textInput, Designed *clickInput);
void processTurnInternal(Common::String *textInput, Designed *clickInput);
void regen();
void performCombatAction(Chr *npc, Chr *player);