aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2017-08-21 19:40:05 +0200
committerEugene Sandulenko2017-08-21 19:40:05 +0200
commit97ed6a2af73608dad953e740f58432921a6ac700 (patch)
treed56ac0a12eeb3091b7570f106d92a14ba100e784
parent203b5138fa9bd32b2b218566639b9dfd7c53bd2c (diff)
downloadscummvm-rg350-97ed6a2af73608dad953e740f58432921a6ac700.tar.gz
scummvm-rg350-97ed6a2af73608dad953e740f58432921a6ac700.tar.bz2
scummvm-rg350-97ed6a2af73608dad953e740f58432921a6ac700.zip
GRAPHICS: MACGUI: Pass command id when creating menu to avoid namespace clashes
This fixes Command menu in WAGE.
-rw-r--r--engines/wage/gui.cpp2
-rw-r--r--graphics/macgui/macmenu.cpp9
-rw-r--r--graphics/macgui/macmenu.h2
3 files changed, 4 insertions, 9 deletions
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index 53f83bb97c..ffc4e41e66 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -199,7 +199,7 @@ bool Gui::processSceneEvents(WindowClick click, Common::Event &event) {
// Menu stuff
////////////////
void Gui::regenCommandsMenu() {
- _menu->createSubMenuFromString(_commandsMenuId, _engine->_world->_commandsMenu.c_str());
+ _menu->createSubMenuFromString(_commandsMenuId, _engine->_world->_commandsMenu.c_str(), kMenuActionCommand);
}
void Gui::regenWeaponsMenu() {
diff --git a/graphics/macgui/macmenu.cpp b/graphics/macgui/macmenu.cpp
index dcf2e20470..cecdcabcea 100644
--- a/graphics/macgui/macmenu.cpp
+++ b/graphics/macgui/macmenu.cpp
@@ -56,11 +56,6 @@ enum {
kFontStyleExtended = 64
};
-enum {
- kMenuActionCommand
-};
-
-
struct MacMenuSubItem {
Common::String text;
int action;
@@ -216,7 +211,7 @@ void MacMenu::clearSubMenu(int id) {
menu->subitems.clear();
}
-void MacMenu::createSubMenuFromString(int id, const char *str) {
+void MacMenu::createSubMenuFromString(int id, const char *str, int commandId) {
clearSubMenu(id);
MacMenuItem *menu = _items[id];
@@ -278,7 +273,7 @@ void MacMenu::createSubMenuFromString(int id, const char *str) {
}
}
- menu->subitems.push_back(new MacMenuSubItem(item.c_str(), kMenuActionCommand, style, shortcut, enabled));
+ menu->subitems.push_back(new MacMenuSubItem(item.c_str(), commandId, style, shortcut, enabled));
}
item.clear();
diff --git a/graphics/macgui/macmenu.h b/graphics/macgui/macmenu.h
index a25b65afbc..8b3e8ff258 100644
--- a/graphics/macgui/macmenu.h
+++ b/graphics/macgui/macmenu.h
@@ -52,7 +52,7 @@ public:
int addMenuItem(const char *name);
void addMenuSubItem(int id, const char *text, int action, int style = 0, char shortcut = 0, bool enabled = true);
- void createSubMenuFromString(int id, const char *string);
+ void createSubMenuFromString(int id, const char *string, int commandId);
void clearSubMenu(int id);
bool draw(ManagedSurface *g, bool forceRedraw = false);