OSDN Git Service

use const
[jnethack/source.git] / src / options.c
index 20a0e88..56d46d3 100644 (file)
@@ -5,7 +5,7 @@
 
 /* JNetHack Copyright */
 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000  */
-/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2016            */
+/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2018            */
 /* JNetHack may be freely redistributed.  See license for details. */
 
 #ifdef OPTION_LISTS_ONLY /* (AMIGA) external program for opt lists */
@@ -581,11 +581,19 @@ static struct Comp_Opt {
     { "soundcard", "\8eg\97p\82µ\82Ä\82¢\82é\83T\83E\83\93\83h\83J\81[\83h\82Ì\8eí\97Þ", 20, SET_IN_FILE },
 #endif
 #ifdef STATUS_HILITES
+#if 0 /*JP*/
     { "statushilites",
       "0=no status highlighting, N=show highlights for N turns",
+#else
+    { "statushilites",
+      "0=\83X\83e\81[\83^\83X\83n\83C\83\89\83C\83g\82È\82µ\81CN\83^\81[\83\93\96\88\82É\83n\83C\83\89\83C\83g\95\\8e¦",
+#endif
       20, SET_IN_GAME },
 #else
+/*JP
     { "statushilites", "highlight control", 20, SET_IN_FILE },
+*/
+    { "statushilites", "\83n\83C\83\89\83C\83g\82Ì\90§\8cä", 20, SET_IN_FILE },
 #endif
 #if 0 /*JP*/
     { "symset", "load a set of display symbols from the symbols file", 70,
@@ -657,11 +665,22 @@ static struct Comp_Opt {
     { "videoshades", "\95\\8e¦\82É\83O\83\8c\83C\83X\83P\81[\83\8b\82ð\97p\82¢\82é", 32,
       DISP_IN_GAME },
 #endif
+#if 0 /*JP*/
     { "whatis_coord", "show coordinates when auto-describing cursor position",
       1, SET_IN_GAME },
+#else
+    { "whatis_coord", "\83J\81[\83\\83\8b\88Ê\92u\82ð\8e©\93®\90à\96¾\82·\82é\82Æ\82«\82É\8dÀ\95W\82ð\95\\8e¦\82·\82é",
+      1, SET_IN_GAME },
+#endif
+#if 0 /*JP*/
     { "whatis_filter",
       "filter coordinate locations when targeting next or previous",
       1, SET_IN_GAME },
+#else
+    { "whatis_filter",
+      "\8e\9f\82â\8eè\91O\82ð\83^\81[\83Q\83b\83g\82·\82é\82Æ\82«\82É\8dÀ\95W\88Ê\92u\82ð\83t\83B\83\8b\83^\82·\82é",
+      1, SET_IN_GAME },
+#endif
 #if 0 /*JP*/
     { "windowcolors", "the foreground/background colors of windows", /*WC*/
       80, DISP_IN_GAME },
@@ -1281,7 +1300,10 @@ boolean val_optional;
 
     if (!colon || !*++colon) {
         if (!val_optional)
+/*JP
             config_error_add("Missing parameter for '%s'", opts);
+*/
+            config_error_add("'%s'\82Ì\88ø\90\94\82ª\82 \82è\82Ü\82¹\82ñ", opts);
         return (char *) 0;
     }
     return colon;
@@ -1305,8 +1327,13 @@ bad_negation(optname, with_parameter)
 const char *optname;
 boolean with_parameter;
 {
+#if 0 /*JP*/
     pline_The("%s option may not %sbe negated.", optname,
               with_parameter ? "both have a value and " : "");
+#else
+    pline_The("%s\83I\83v\83V\83\87\83\93\82Í\94Û\92è%s\82Å\82«\82È\82¢\81D", optname,
+              with_parameter ? "\82Æ\92l\8ew\92è\82Ì\97¼\95û\82Í" : "");
+#endif
 }
 
 /*
@@ -1411,7 +1438,10 @@ const char *optn;
         return 0;
     if (fnv > get_current_feature_ver()) {
         if (!initial) {
+/*JP
             You_cant("disable new feature alerts for future versions.");
+*/
+            You_cant("\8f«\97\88\82Ì\83o\81[\83W\83\87\83\93\82Ì\8b@\94\\8cx\8d\90\82ð\96³\8cø\82É\82·\82é\82±\82Æ\82Í\82Å\82«\82È\82¢\81D");
         } else {
             config_error_add(
                         "%s=%s Invalid reference to a future version ignored",
@@ -1424,9 +1454,15 @@ const char *optn;
     if (!initial) {
         Sprintf(buf, "%lu.%lu.%lu", FEATURE_NOTICE_VER_MAJ,
                 FEATURE_NOTICE_VER_MIN, FEATURE_NOTICE_VER_PATCH);
+#if 0 /*JP*/
         pline(
           "Feature change alerts disabled for NetHack %s features and prior.",
               buf);
+#else
+        pline(
+          "NetHack %s \88È\91O\82Ì\8b@\94\\82É\91Î\82·\82é\8b@\94\\95Ï\8dX\8cx\8d\90\82ð\96³\8cø\82É\82µ\82½\81D",
+              buf);
+#endif
     }
     return 1;
 }
@@ -1508,8 +1544,13 @@ int iscompound; /* 0 == boolean option, 1 == compound */
      * For now just return.
      */
 #else /* !MAC */
+#if 0 /*JP*/
     config_error_add("%s option specified multiple times: %s",
                      iscompound ? "compound" : "boolean", opts);
+#else
+    config_error_add("%s\83I\83v\83V\83\87\83\93\82ª\95¡\90\94\89ñ\8ew\92è\82³\82ê\82Ä\82¢\82Ü\82·\81F%s",
+                     iscompound ? "\95¡\8d\87" : "\90^\8bU\92l", opts);
+#endif
 #endif /* ?MAC */
     return;
 }
@@ -1532,23 +1573,50 @@ STATIC_VAR const struct paranoia_opts {
        both require at least two letters during config processing and use
        case-senstivity for 'O's interactive menu */
     { PARANOID_CONFIRM, "Confirm", 1, "Paranoia", 2,
+/*JP
       "for \"yes\" confirmations, require \"no\" to reject" },
+*/
+      "\"yes\"\82ð\8am\94F\82·\82é\82Æ\82«\82É\81C\8b\91\94Û\82·\82é\82Æ\82«\82É\82Í\"no\"\82ª\95K\97v" },
     { PARANOID_QUIT, "quit", 1, "explore", 1,
+/*JP
       "yes vs y to quit or to enter explore mode" },
+*/
+      "\8fI\97¹\82Ü\82½\82Í\92T\8c\9f\83\82\81[\83h\82É\93ü\82é\82Æ\82«\82Éy\82Å\82Í\82È\82­yes" },
     { PARANOID_DIE, "die", 1, "death", 2,
+/*JP
       "yes vs y to die (explore mode or debug mode)" },
+*/
+      "(\92T\8c\9f\83\82\81[\83h\82©\83f\83o\83b\83O\83\82\81[\83h\82Å)\8e\80\82Ê\82Æ\82«\82Éy\82Å\82Í\82È\82­yes" },
     { PARANOID_BONES, "bones", 1, 0, 0,
+/*JP
       "yes vs y to save bones data when dying in debug mode" },
+*/
+      "\83f\83o\83b\83O\83\82\81[\83h\82Å\8e\80\82ñ\82Å\8d\9c\83f\81[\83^\82ð\95Û\91\82·\82é\82Æ\82«\82Éy\82Å\82Í\82È\82­yes" },
     { PARANOID_HIT, "attack", 1, "hit", 1,
+/*JP
       "yes vs y to attack a peaceful monster" },
+*/
+      "\97F\8dD\93I\89ö\95¨\82ð\8dU\8c\82\82·\82é\82Æ\82«\82Éy\82Å\82Í\82È\82­yes" },
     { PARANOID_BREAKWAND, "wand-break", 2, "break-wand", 2,
+/*JP
       "yes vs y to break a wand via (a)pply" },
+*/
+      "(a)pply\82Å\8fñ\82ð\90Ü\82é\82Æ\82«\82Éy\82Å\82Í\82È\82­yes" },
     { PARANOID_WERECHANGE, "Were-change", 2, (const char *) 0, 0,
+/*JP
       "yes vs y to change form when lycanthropy is controllable" },
+*/
+      "\8fb\89»\95a\82ª\90§\8cä\89Â\94\\82È\8fê\8d\87\82É\95Ï\89»\82·\82é\82Æ\82«\82Éy\82Å\82Í\82È\82­yes" },
     { PARANOID_PRAY, "pray", 1, 0, 0,
+/*JP
       "y to pray (supersedes old \"prayconfirm\" option)" },
+*/
+      "\8bF\82é\82Æ\82«\82Éy\82ª\95K\97v(\8cÃ\82¢\"prayconfirm\"\83I\83v\83V\83\87\83\93\82ð\8fã\8f\91\82«\82·\82é)" },
     { PARANOID_REMOVE, "Remove", 1, "Takeoff", 1,
+/*JP
       "always pick from inventory for Remove and Takeoff" },
+*/
+      "Remove\82ÆTakeoff\82Å\8fí\82É\8e\9d\82¿\95¨\88ê\97\97\82©\82ç\91I\82Ô" },
     /* for config file parsing; interactive menu skips these */
     { 0, "none", 4, 0, 0, 0 }, /* require full word match */
     { ~0, "all", 3, 0, 0, 0 }, /* ditto */
@@ -1737,12 +1805,24 @@ static const struct {
     xchar msgtyp;
     const char *descr;
 } msgtype_names[] = {
+/*JP
     { "show", MSGTYP_NORMAL, "Show message normally" },
+*/
+    { "show", MSGTYP_NORMAL, "\92Ê\8fí\92Ê\82è\83\81\83b\83Z\81[\83W\82ð\95\\8e¦\82·\82é" },
+/*JP
     { "hide", MSGTYP_NOSHOW, "Hide message" },
+*/
+    { "hide", MSGTYP_NOSHOW, "\83\81\83b\83Z\81[\83W\82ð\95\\8e¦\82µ\82È\82¢" },
     { "noshow", MSGTYP_NOSHOW, NULL },
+/*JP
     { "stop", MSGTYP_STOP, "Prompt for more after the message" },
+*/
+    { "stop", MSGTYP_STOP, "more\83v\83\8d\83\93\83v\83g\82Å\91Ò\82Â" },
     { "more", MSGTYP_STOP, NULL },
+/*JP
     { "norep", MSGTYP_NOREP, "Do not repeat the message" }
+*/
+    { "norep", MSGTYP_NOREP, "\82±\82Ì\83\81\83b\83Z\81[\83W\82Í\8cJ\82è\95Ô\82³\82È\82¢" }
 };
 
 STATIC_OVL const char *
@@ -1774,7 +1854,10 @@ query_msgtype()
             add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE,
                  msgtype_names[i].descr, MENU_UNSELECTED);
         }
+/*JP
     end_menu(tmpwin, "How to show the message");
+*/
+    end_menu(tmpwin, "\83\81\83b\83Z\81[\83W\82Ì\95\\8e¦\95û\96@");
     pick_cnt = select_menu(tmpwin, PICK_ONE, &picks);
     destroy_nhwindow(tmpwin);
     if (pick_cnt > 0) {
@@ -4299,7 +4382,10 @@ boolean dolist;
 
 static char fmtstr_doset[] = "%s%-15s [%s]   ";
 static char fmtstr_doset_tab[] = "%s\t[%s]";
+/*JP
 static char n_currently_set[] = "(%d currently set)";
+*/
+static char n_currently_set[] = "(%d\8cÂ\90Ý\92è\92\86)";
 
 /* doset('O' command) menu entries for compound options */
 STATIC_OVL void
@@ -5171,18 +5257,27 @@ boolean setinitial, setfromfile;
 
     msgtypes_again:
         nmt = msgtype_count();
+/*JP
         opt_idx = handle_add_list_remove("message type", nmt);
+*/
+        opt_idx = handle_add_list_remove("\83\81\83b\83Z\81[\83W\8c^", nmt);
         if (opt_idx == 3) { /* done */
             return TRUE;
         } else if (opt_idx == 0) { /* add new */
+/*JP
             getlin("What new message pattern?", mtbuf);
+*/
+            getlin("\90V\82µ\82¢\83\81\83b\83Z\81[\83W\83p\83^\81[\83\93\81F", mtbuf);
             if (*mtbuf == '\033')
                 return TRUE;
             if (*mtbuf
                 && test_regex_pattern(mtbuf, (const char *)0)
                 && (mttyp = query_msgtype()) != -1
                 && !msgtype_add(mttyp, mtbuf)) {
+/*JP
                 pline("Error adding the message type.");
+*/
+                pline("\83\81\83b\83Z\81[\83W\8c^\92Ç\89Á\83G\83\89\81[\81D");
                 wait_synch();
             }
             goto msgtypes_again;
@@ -5211,8 +5306,13 @@ boolean setinitial, setfromfile;
                          MENU_UNSELECTED);
                 tmp = tmp->next;
             }
+#if 0 /*JP*/
             Sprintf(mtbuf, "%s message types",
                     (opt_idx == 1) ? "List of" : "Remove which");
+#else
+            Strcpy(mtbuf, (opt_idx == 1) ?
+                    "\83\81\83b\83Z\81[\83W\8c^\88ê\97\97" : "\8dí\8f\9c\82·\82é\83\81\83b\83Z\81[\83W\8c^");
+#endif
             end_menu(tmpwin, mtbuf);
             pick_cnt = select_menu(tmpwin,
                                    (opt_idx == 1) ? PICK_NONE : PICK_ANY,
@@ -5233,11 +5333,17 @@ boolean setinitial, setfromfile;
 
     menucolors_again:
         nmc = count_menucolors();
+/*JP
         opt_idx = handle_add_list_remove("menucolor", nmc);
+*/
+        opt_idx = handle_add_list_remove("\83\81\83j\83\85\81[\90F", nmc);
         if (opt_idx == 3) { /* done */
             return TRUE;
         } else if (opt_idx == 0) { /* add new */
+/*JP
             getlin("What new menucolor pattern?", mcbuf);
+*/
+            getlin("\90V\82µ\82¢\83\81\83j\83\85\81[\90F\83p\83^\81[\83\93\81F", mcbuf);
             if (*mcbuf == '\033')
                 return TRUE;
             if (*mcbuf
@@ -5245,7 +5351,10 @@ boolean setinitial, setfromfile;
                 && (mcclr = query_color((char *) 0)) != -1
                 && (mcattr = query_attr((char *) 0)) != -1
                 && !add_menu_coloring_parsed(mcbuf, mcclr, mcattr)) {
+/*JP
                 pline("Error adding the menu color.");
+*/
+                pline("\83\81\83j\83\85\81[\90F\92Ç\89Á\83G\83\89\81[\81D");
                 wait_synch();
             }
             goto menucolors_again;
@@ -5282,8 +5391,13 @@ boolean setinitial, setfromfile;
                          MENU_UNSELECTED);
                 tmp = tmp->next;
             }
+#if 0 /*JP*/
             Sprintf(mcbuf, "%s menu colors",
                     (opt_idx == 1) ? "List of" : "Remove which");
+#else
+            Strcpy(mcbuf, (opt_idx == 1) ?
+                    "\83\81\83j\83\85\81[\90F\88ê\97\97" : "\8dí\8f\9c\82·\82é\83\81\83j\83\85\81[\90F");
+#endif
             end_menu(tmpwin, mcbuf);
             pick_cnt = select_menu(tmpwin,
                                    (opt_idx == 1) ? PICK_NONE : PICK_ANY,
@@ -5305,7 +5419,10 @@ boolean setinitial, setfromfile;
 
     ape_again:
         totalapes = count_ape_maps(&numapes[AP_LEAVE], &numapes[AP_GRAB]);
+/*JP
         opt_idx = handle_add_list_remove("autopickup exception", totalapes);
+*/
+        opt_idx = handle_add_list_remove("\8e©\93®\8fE\82¢\97á\8aO", totalapes);
         if (opt_idx == 3) { /* done */
             return TRUE;
         } else if (opt_idx == 0) { /* add new */
@@ -5415,9 +5532,15 @@ boolean setinitial, setfromfile;
                 sl = sl->next;
             }
             if (!setcount) {
+#if 0 /*JP*/
                 pline("There are no appropriate %ssymbol sets available.",
                       (rogueflag) ? "rogue level "
                                   : (primaryflag) ? "primary " : "");
+#else
+                pline("\93K\90Ø\82È%s\83V\83\93\83{\83\8b\90Ý\92è\82ª\82 \82è\82Ü\82¹\82ñ\81D",
+                      (rogueflag) ? "rogue\83\8c\83x\83\8b"
+                                  : (primaryflag) ? "\97D\90æ" : "");
+#endif
                 return TRUE;
             }
 
@@ -5450,8 +5573,13 @@ boolean setinitial, setfromfile;
                 }
                 sl = sl->next;
             }
+#if 0 /*JP*/
             Sprintf(buf, "Select %ssymbol set:",
                     rogueflag ? "rogue level " : "");
+#else
+            Sprintf(buf, "%s\83V\83\93\83{\83\8b\90Ý\92è\82ð\91I\91ð\82µ\82Ä\82­\82¾\82³\82¢\81F",
+                    rogueflag ? "rogue\83\8c\83x\83\8b" : "");
+#endif
             end_menu(tmpwin, buf);
             if (select_menu(tmpwin, PICK_ONE, &symset_pick) > 0) {
                 chosen = symset_pick->item.a_int - 2;
@@ -5490,11 +5618,17 @@ boolean setinitial, setfromfile;
                 nothing_to_do = TRUE;
         } else if (!res) {
             /* The symbols file could not be accessed */
+/*JP
             pline("Unable to access \"%s\" file.", SYMBOLS);
+*/
+            pline("\"%s\"\83t\83@\83C\83\8b\82É\83A\83N\83Z\83X\82Å\82«\82Ü\82¹\82ñ\81D", SYMBOLS);
             return TRUE;
         } else if (!symset_list) {
             /* The symbols file was empty */
+/*JP
             pline("There were no symbol sets found in \"%s\".", SYMBOLS);
+*/
+            pline("\"%s\"\82É\83V\83\93\83{\83\8b\90Ý\92è\82ª\82 \82è\82Ü\82¹\82ñ\81D", SYMBOLS);
             return TRUE;
         }
 
@@ -5624,7 +5758,11 @@ char *buf;
                                       : defopt);
 #endif
     else if (!strcmp(optname, "align"))
+#if 0 /*JP*/
         Sprintf(buf, "%s", rolestring(flags.initalign, aligns, adj));
+#else
+        Sprintf(buf, "%s", rolestring(flags.initalign, aligns, noun));
+#endif
 #ifdef WIN32
     else if (!strcmp(optname, "altkeyhandler"))
         Sprintf(buf, "%s",