OSDN Git Service

Revert "Added menu item and backing value stored in the preferences to control whethe...
authorEric Branlund <ebranlund@fastmail.com>
Wed, 26 Aug 2020 16:53:44 +0000 (09:53 -0700)
committerEric Branlund <ebranlund@fastmail.com>
Wed, 26 Aug 2020 16:53:44 +0000 (09:53 -0700)
This reverts commit d97d359231982cc5ef4915c0ba0b301fa92716f1.

src/cocoa/AppDelegate.h
src/cocoa/AppDelegate.m
src/cocoa/Base.lproj/MainMenu.nib
src/cocoa/Base.lproj/MainMenu.xib
src/cocoa/ja.lproj/MainMenu.strings
src/main-cocoa.m

index e7a6ffe..e0217c4 100644 (file)
@@ -30,7 +30,6 @@
 - (IBAction)saveGame:(id)sender;
 - (IBAction)setRefreshRate:(NSMenuItem *)sender;
 - (IBAction)toggleSound:(NSMenuItem *)menuItem;
-- (IBAction)toggleWideTiles:(NSMenuItem *)sender;
 - (void)setGraphicsMode:(NSMenuItem *)sender;
 - (void)selectWindow:(id)sender;
 
index 3a7450f..570cb60 100644 (file)
 - (IBAction)toggleSound:(NSMenuItem*)menuItem {
 }
 
-- (IBAction)toggleWideTiles:(NSMenuItem *)sender {
-}
-
 - (IBAction)setGraphicsMode:(NSMenuItem *)sender {
 }
 
index c5e9e7d..e23cd01 100644 (file)
Binary files a/src/cocoa/Base.lproj/MainMenu.nib and b/src/cocoa/Base.lproj/MainMenu.nib differ
index 715b874..010c5d4 100644 (file)
                                     <action selector="toggleSound:" target="Voe-Tx-rLC" id="y1f-OG-ExO"/>
                                 </connections>
                             </menuItem>
-                            <menuItem title="Toggle Wide Tiles" state="on" id="tR9-z3-4SZ" userLabel="Toggle Wide Tiles">
-                                <modifierMask key="keyEquivalentModifierMask"/>
-                                <connections>
-                                    <action selector="toggleWideTiles:" target="Voe-Tx-rLC" id="fLa-ij-GCQ"/>
-                                </connections>
-                            </menuItem>
                         </items>
                     </menu>
                 </menuItem>
index 556ce7f..4737351 100644 (file)
@@ -88,9 +88,6 @@
 /* Class = "NSMenu"; title = "Window"; ObjectID = "Td7-aD-5lo"; */
 "Td7-aD-5lo.title" = "ウインドウ";
 
-/* Class = "NSMenuItem"; title = "Toggle Wide Tiles"; ObjectID = "tR9-z3-4SZ"; */
-"tR9-z3-4SZ.title" = "広いタイルを切り替え";
-
 /* Class = "NSMenu"; title = "Hengband"; ObjectID = "uQy-DD-JDr"; */
 "uQy-DD-JDr.title" = "変愚蛮怒";
 
index 444e96a..be161bb 100644 (file)
@@ -41,7 +41,6 @@ static NSString * const AngbandTerminalRowsDefaultsKey = @"Rows";
 static NSString * const AngbandTerminalColumnsDefaultsKey = @"Columns";
 static NSString * const AngbandTerminalVisibleDefaultsKey = @"Visible";
 static NSString * const AngbandGraphicsDefaultsKey = @"GraphicsID";
-static NSString * const AngbandBigTileDefaultsKey = @"UseBigTiles";
 static NSString * const AngbandFrameRateDefaultsKey = @"FramesPerSecond";
 static NSString * const AngbandSoundDefaultsKey = @"AllowSound";
 static NSInteger const AngbandWindowMenuItemTagBase = 1000;
@@ -2237,9 +2236,6 @@ static errr Term_xtra_cocoa_react(void)
             /* If we failed to create the image, revert to ASCII. */
             if (! pict_image) {
                 new_mode = NULL;
-               if (use_bigtile) {
-                   arg_bigtile = FALSE;
-               }
                [[NSUserDefaults angbandDefaults]
                    setInteger:GRAPHICS_NONE
                    forKey:AngbandGraphicsDefaultsKey];
@@ -2289,20 +2285,12 @@ static errr Term_xtra_cocoa_react(void)
         }
         
         /* Reset visuals */
-        if (arg_bigtile == use_bigtile)
+        if (initialized && game_in_progress)
         {
             reset_visuals();
         }
     }
 
-    if (arg_bigtile != use_bigtile) {
-       /* Reset visuals */
-       reset_visuals();
-
-       Term_activate(angband_term[0]);
-       Term_resize(angband_term[0]->wid, angband_term[0]->hgt);
-    }
-
     [pool drain];
     
     /* Success */
@@ -3325,7 +3313,6 @@ static void load_prefs()
                               [NSNumber numberWithInt:60], AngbandFrameRateDefaultsKey,
                               [NSNumber numberWithBool:YES], AngbandSoundDefaultsKey,
                               [NSNumber numberWithInt:GRAPHICS_NONE], AngbandGraphicsDefaultsKey,
-                              [NSNumber numberWithBool:YES], AngbandBigTileDefaultsKey,
                               defaultTerms, AngbandTerminalsDefaultsKey,
                               nil];
     [defs registerDefaults:defaults];
@@ -3334,16 +3321,7 @@ static void load_prefs()
     
     /* Preferred graphics mode */
     graf_mode_req = [defs integerForKey:AngbandGraphicsDefaultsKey];
-    if (graf_mode_req != GRAPHICS_NONE &&
-       get_graphics_mode(graf_mode_req)->grafID != GRAPHICS_NONE &&
-       [defs boolForKey:AngbandBigTileDefaultsKey] == YES) {
-       use_bigtile = TRUE;
-       arg_bigtile = TRUE;
-    } else {
-       use_bigtile = FALSE;
-       arg_bigtile = FALSE;
-    }
-
+    
     /* Use sounds; set the Angband global */
     use_sound = ([defs boolForKey:AngbandSoundDefaultsKey] == YES) ? TRUE : FALSE;
     
@@ -4214,23 +4192,8 @@ static void hook_quit(const char * str)
     [[NSUserDefaults angbandDefaults] setInteger:graf_mode_req forKey:AngbandGraphicsDefaultsKey];
     [[NSUserDefaults angbandDefaults] synchronize];
     
-    if (graf_mode_req == GRAPHICS_NONE ||
-       get_graphics_mode(graf_mode_req) == GRAPHICS_NONE) {
-       if (use_bigtile) {
-           arg_bigtile = FALSE;
-       }
-    } else if ([[NSUserDefaults angbandDefaults] boolForKey:AngbandBigTileDefaultsKey] == YES &&
-              ! use_bigtile) {
-       arg_bigtile = TRUE;
-    }
-
     if (game_in_progress)
     {
-       if (arg_bigtile != use_bigtile) {
-           Term_activate(angband_term[0]);
-           Term_resize(angband_term[0]->wid, angband_term[0]->hgt);
-       }
-
         /* Hack -- Force redraw */
         do_cmd_redraw();
         
@@ -4250,27 +4213,6 @@ static void hook_quit(const char * str)
                                      forKey:AngbandSoundDefaultsKey];
 }
 
-- (IBAction)toggleWideTiles:(NSMenuItem *) sender
-{
-    BOOL is_on = (sender.state == NSOnState);
-
-    /* Toggle the state and update the Angband globals and preferences. */
-    sender.state = (is_on) ? NSOffState : NSOnState;
-    [[NSUserDefaults angbandDefaults] setBool:(! is_on)
-                                     forKey:AngbandBigTileDefaultsKey];
-    [[NSUserDefaults angbandDefaults] synchronize];
-    if (graphics_are_enabled()) {
-       arg_bigtile = (is_on) ? FALSE : TRUE;
-       /* Mimics the logic in setGraphicsMode(). */
-       if (game_in_progress && arg_bigtile != use_bigtile) {
-           Term_activate(angband_term[0]);
-           Term_resize(angband_term[0]->wid, angband_term[0]->hgt);
-           do_cmd_redraw();
-           wakeup_event_loop();
-       }
-    }
-}
-
 /**
  *  Send a command to Angband via a menu item. This places the appropriate key
  * down events into the queue so that it seems like the user pressed them