Skip to content

Commit

Permalink
macOS: only allow changing the graphics mode while waiting for a game…
Browse files Browse the repository at this point in the history
… command or while on the splash screen (#103)
  • Loading branch information
backwardsEric authored Dec 26, 2022
1 parent 2710b11 commit f6e2d33
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/main-cocoa.m
Original file line number Diff line number Diff line change
Expand Up @@ -4970,7 +4970,14 @@ - (BOOL)validateMenuItem:(NSMenuItem *)menuItem
{
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(sendAngbandCommand:) ||
sel == @selector(saveGame:) )
Expand Down

0 comments on commit f6e2d33

Please sign in to comment.