Fix the longstanding xib bug keeping me from editor preferences on mac

fix #496
This commit is contained in:
2025-05-17 09:53:44 -05:00
parent 99b0c9a227
commit 3bbb6b7d9d
3 changed files with 15 additions and 3 deletions

View File

@@ -137,8 +137,12 @@ void init_menubar() {
MenuHandler* handler = [[[MenuHandler alloc] init] retain];
setMenuCallback([apple_menu itemWithTitle: @"About Blades of Exile"], handler, @selector(menuChoice:), int(eMenu::ABOUT));
setMenuCallback([apple_menu itemWithTitle: @"Preferences…"], handler, @selector(menuChoice:), int(eMenu::PREFS));
setMenuCallback([apple_menu itemWithTitle: @"Quit Blades of Exile"], handler, @selector(menuChoice:), int(eMenu::QUIT));
// An inscrutable bug is making the apple menu not localize this element for some of the apps on some computers.
// Attaching the event to a nonexistent item should be harmless.
setMenuCallback([apple_menu itemWithTitle: @"Preferences…"], handler, @selector(menuChoice:), int(eMenu::PREFS));
setMenuCallback([apple_menu itemWithTitle: @"Settings…"], handler, @selector(menuChoice:), int(eMenu::PREFS));
int i = 0;
for(eMenu opt : file_choices)

View File

@@ -64,9 +64,13 @@ void init_menubar() {
MenuHandler* handler = [[[MenuHandler alloc] init] retain];
setMenuCallback([apple_menu itemWithTitle: @"About BoE Character Editor"], handler, @selector(menuChoice:), int(eMenu::ABOUT));
setMenuCallback([apple_menu itemWithTitle: @"Preferences…"], handler, @selector(menuChoice:), int(eMenu::PREFS));
setMenuCallback([apple_menu itemWithTitle: @"Quit BoE Character Editor"], handler, @selector(menuChoice:), int(eMenu::QUIT));
setMenuCallback([[[menu_bar_handle itemWithTitle: @"Help"] submenu] itemAtIndex: 0], handler, @selector(menuChoice:), int(eMenu::HELP_TOC));
// An inscrutable bug is making the apple menu not localize this element for some of the apps on some computers.
// Attaching the event to a nonexistent item should be harmless.
setMenuCallback([apple_menu itemWithTitle: @"Preferences…"], handler, @selector(menuChoice:), int(eMenu::PREFS));
setMenuCallback([apple_menu itemWithTitle: @"Settings…"], handler, @selector(menuChoice:), int(eMenu::PREFS));
int i = 0;
for(eMenu opt : file_choices)

View File

@@ -80,9 +80,13 @@ void init_menubar() {
MenuHandler* handler = [[[MenuHandler alloc] init] retain];
setMenuCallback([app_menu itemWithTitle: @"About BoE Scenario Editor"], handler, @selector(menuChoice:), int(eMenu::ABOUT));
setMenuCallback([app_menu itemWithTitle: @"Preferences…"], handler, @selector(menuChoice:), int(eMenu::PREFS));
setMenuCallback([app_menu itemWithTitle: @"Quit BoE Scenario Editor"], handler, @selector(menuChoice:), int(eMenu::QUIT));
// An inscrutable bug is making the apple menu not localize this element for some of the apps on some computers.
// Attaching the event to a nonexistent item should be harmless.
setMenuCallback([app_menu itemWithTitle: @"Preferences…"], handler, @selector(menuChoice:), int(eMenu::PREFS));
setMenuCallback([app_menu itemWithTitle: @"Settings…"], handler, @selector(menuChoice:), int(eMenu::PREFS));
int i = 0;
for(eMenu opt : file_choices)
setMenuCallback([file_menu itemAtIndex: i++], handler, @selector(menuChoice:), int(opt));