OSDN Git Service

Use the Angband global, angband_term_name, as the source for the terminal names so...
authorEric Branlund <ebranlund@fastmail.com>
Tue, 27 Aug 2019 17:12:38 +0000 (10:12 -0700)
committerEric Branlund <ebranlund@fastmail.com>
Tue, 27 Aug 2019 17:12:38 +0000 (10:12 -0700)
src/main-cocoa.m

index dd5e48e..d396ee5 100644 (file)
@@ -1660,11 +1660,19 @@ static void Term_init_cocoa(term *t)
 
     /* Get the window */
     NSWindow *window = [context makePrimaryWindow];
-    
+    NSString *title;
+
     /* Set its title and, for auxiliary terms, tentative size */
     if (termIdx == 0)
     {
-        [window setTitle:@"Hengband"];
+       title = [NSString stringWithCString:angband_term_name[0]
+#ifdef JP
+                             encoding:NSJapaneseEUCStringEncoding
+#else
+                             encoding:NSMacOSRomanString
+#endif
+       ];
+        [window setTitle:title];
 
         /* Set minimum size (80x24) */
         NSSize minsize;
@@ -1674,7 +1682,14 @@ static void Term_init_cocoa(term *t)
     }
     else
     {
-        [window setTitle:[NSString stringWithFormat:@"Term %d", termIdx]];
+       title = [NSString stringWithCString:angband_term_name[termIdx]
+#ifdef JP
+                             encoding:NSJapaneseEUCStringEncoding
+#else
+                             encoding:NSMacOSRomanString
+#endif
+       ];
+        [window setTitle:title];
         /* Set minimum size (1x1) */
         NSSize minsize;
         minsize.width = context->tileSize.width + context->borderSize.width * 2.0;