[Scummvm-git-logs] scummvm master -> 381c508e30378ca83c76d4164ef6fd0df660a07c
sev-
noreply at scummvm.org
Wed Mar 4 23:31:40 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
381c508e30 WAGE: Support custom File menu
Commit: 381c508e30378ca83c76d4164ef6fd0df660a07c
https://github.com/scummvm/scummvm/commit/381c508e30378ca83c76d4164ef6fd0df660a07c
Author: SHANKHARAJ DATTA (shankharajdatta2004 at gmail.com)
Date: 2026-03-05T00:31:35+01:00
Commit Message:
WAGE: Support custom File menu
Fixed an issue where games with custom File menus (like The Village) were incorrectly forced to use the default ScummVM hardcoded File menu. The engine now parses the MENU 2002 resource from the game data and dynamically builds a custom menu with the correct layout, keyboard shortcuts, and disabled items, accurately bringing back the developer's original intended UI.
Changed paths:
engines/wage/gui.cpp
engines/wage/world.cpp
engines/wage/world.h
diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp
index ff1492436ad..2c46d01df44 100644
--- a/engines/wage/gui.cpp
+++ b/engines/wage/gui.cpp
@@ -109,6 +109,24 @@ Gui::Gui(WageEngine *engine) {
_menu->addSubMenu(nullptr, kMenuAbout);
_menu->addMenuItem(_menu->getSubmenu(nullptr, kMenuAbout), _engine->_world->getAboutMenuItemName(), kMenuActionAbout);
+ if (!_engine->_world->_fileMenu.empty()) {
+ _menu->setName(_menu->getMenuItem(kMenuFile), _engine->_world->_fileMenuName);
+ _menu->createSubMenuFromString(kMenuFile, _engine->_world->_fileMenu.c_str(), 0);
+
+ Graphics::MacMenuSubMenu *submenu = _menu->getSubmenu(nullptr, kMenuFile);
+ if (submenu) {
+ int fileActions[] = {
+ kMenuActionNew, kMenuActionOpen, kMenuActionClose,
+ kMenuActionSave, kMenuActionSaveAs, kMenuActionRevert,
+ kMenuActionQuit};
+ int actionIdx = 0;
+ for (uint i = 0; i < submenu->items.size() && actionIdx < 7; i++) {
+ if (submenu->items[i]->text.empty())
+ continue;
+ _menu->setAction(submenu->items[i], fileActions[actionIdx++]);
+ }
+ }
+ }
_commandsMenuId = _menu->addMenuItem(nullptr, _engine->_world->_commandsMenuName);
regenCommandsMenu();
diff --git a/engines/wage/world.cpp b/engines/wage/world.cpp
index 291ce84ba8e..5ce289bec65 100644
--- a/engines/wage/world.cpp
+++ b/engines/wage/world.cpp
@@ -362,6 +362,18 @@ bool World::loadWorld(Common::MacResManager *resMan) {
delete menu;
delete res;
}
+ res = resMan->getResource(MKTAG('M', 'E', 'N', 'U'), 2002);
+ if (res != NULL) {
+ Common::StringArray *menu = Graphics::MacMenu::readMenuFromResource(res);
+ if (menu->size() >= 2) {
+ _fileMenuName = menu->operator[](0);
+ _fileMenu = menu->operator[](1);
+ debugC(1, kDebugLoading, "MENU: File name: %s", toPrintable(_fileMenuName).c_str());
+ debugC(1, kDebugLoading, "MENU: File menu: %s", toPrintable(_fileMenu).c_str());
+ }
+ delete menu;
+ delete res;
+ }
res = resMan->getResource(MKTAG('M','E','N','U'), 2004);
if (res != NULL) {
Common::StringArray *menu = Graphics::MacMenu::readMenuFromResource(res);
diff --git a/engines/wage/world.h b/engines/wage/world.h
index 6da4ee324f3..5797b522c16 100644
--- a/engines/wage/world.h
+++ b/engines/wage/world.h
@@ -107,6 +107,8 @@ public:
Common::String _commandsMenu;
Common::String _commandsMenuDefault;
Common::String _weaponsMenuName;
+ Common::String _fileMenuName;
+ Common::String _fileMenu;
void addScene(Scene *room) {
if (!room->_name.empty()) {
More information about the Scummvm-git-logs
mailing list