From 0bc903bb1c9a7ec5ec259aa1bf876bcc9de8098b Mon Sep 17 00:00:00 2001 From: Eric Branlund Date: Tue, 20 Dec 2022 06:07:05 -0700 Subject: [PATCH] MacOS: disable changing the tile set of wide tile mode when in an in-game menu --- src/main-cocoa.m | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/main-cocoa.m b/src/main-cocoa.m index 703b0cd94..ab4874a3d 100644 --- a/src/main-cocoa.m +++ b/src/main-cocoa.m @@ -5948,7 +5948,14 @@ static void init_windows(void) { NSInteger requestedGraphicsMode = [[NSUserDefaults standardUserDefaults] integerForKey:AngbandGraphicsDefaultsKey]; [menuItem setState: (tag == requestedGraphicsMode)]; - return YES; + /* + * Only allow changes to the graphics mode when at the splash screen + * or in the game proper and at a command prompt. In other situations + * the saved screens for overlayed menus could have tile references + * that become outdated when the graphics mode is changed. + */ + return (!game_in_progress + || (character_generated && inkey_flag)) ? YES : NO; } else if( sel == @selector(toggleSound:) ) { @@ -5963,7 +5970,13 @@ static void init_windows(void) boolForKey:AngbandBigTileDefaultsKey]; [menuItem setState: ((is_on) ? NSOnState : NSOffState)]; - return YES; + /* + * Only allow changes to the tile size if tiles are not being used + * (then there's no effect on appearance) or, like changes to the + * graphics mode, if at the splash screen or command prompt. + */ + return (!graphics_are_enabled() || !game_in_progress + || (character_generated && inkey_flag)) ? YES : NO; } else if( sel == @selector(sendAngbandCommand:) || sel == @selector(saveGame:) ) -- 2.11.0