+#define OPT_NUM 15
+
+static struct opts
+{
+ char key;
+ cptr name;
+ int row;
+}
+option_fields[OPT_NUM] =
+{
+#ifdef JP
+ { '1', " ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 3 },
+ { '2', " ¥Þ¥Ã¥×²èÌÌ ¥ª¥×¥·¥ç¥ó", 4 },
+ { '3', " ¥Æ¥¥¹¥Èɽ¼¨ ¥ª¥×¥·¥ç¥ó", 5 },
+ { '4', " ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 6 },
+ { '5', " ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 7 },
+ { '6', " ´Ê°×¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 8 },
+ { 'r', " ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 9 },
+
+ { 'p', "¼«Æ°½¦¤¤¥¨¥Ç¥£¥¿", 11 },
+ { 'd', " ´ðËÜ¥¦¥§¥¤¥ÈÎÌ ", 12 },
+ { 'h', "Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È", 13 },
+ { 'm', " ÄãËâÎÏ¿§ïçÃÍ ", 14 },
+ { 'a', " ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 15 },
+ { 'w', "¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 16 },
+
+ { 'b', " ½é´ü ¥ª¥×¥·¥ç¥ó (»²¾È¤Î¤ß)", 18 },
+ { 'c', " º¾µ½ ¥ª¥×¥·¥ç¥ó", 19 },
+#else
+ { '1', "Input Options", 3 },
+ { '2', "Map Screen Options", 4 },
+ { '3', "Text Display Options", 5 },
+ { '4', "Game-Play Options", 6 },
+ { '5', "Disturbance Options", 7 },
+ { '6', "Easy Auto-Destroyer Options", 8 },
+ { 'r', "Play record Options", 9 },
+
+ { 'p', "Auto-picker/destroyer editor", 11 },
+ { 'd', "Base Delay Factor", 12 },
+ { 'h', "Hitpoint Warning", 13 },
+ { 'm', "Mana Color Threshold", 14 },
+ { 'a', "Autosave Options", 15 },
+ { 'w', "Window Flags", 16 },
+
+ { 'b', "Birth Options (Browse Only)", 18 },
+ { 'c', "Cheat Options", 19 },
+#endif
+};
+
/*
* Set or unset various options.
*/
void do_cmd_options(void)
{
- int k;
-
+ char k;
+ int i, d, skey;
+ int y = 0;
/* Save the screen */
screen_save();
/* Interact */
while (1)
{
+ int n = OPT_NUM;
+
+ /* Does not list cheat option when cheat option is off */
+ if (!p_ptr->noscore && !allow_debug_opts) n--;
+
/* Clear screen */
Term_clear();
#ifdef JP
prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 1, 0);
#else
- prt("Options", 1, 0);
+ prt("TinyAngband options", 1, 0);
#endif
-
- /* Give some choices */
-#ifdef JP
- prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 2, 5);
- prt("(2) ¥Þ¥Ã¥×²èÌÌ ¥ª¥×¥·¥ç¥ó", 3, 5);
- prt("(3) ¥Æ¥¥¹¥Èɽ¼¨ ¥ª¥×¥·¥ç¥ó", 4, 5);
- prt("(4) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 5, 5);
- prt("(5) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 6, 5);
- prt("(6) ´Ê°×¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 7, 5);
- prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 8, 5);
-
- /* Special choices */
- prt("(P) ¼«Æ°½¦¤¤¥¨¥Ç¥£¥¿", 10, 5);
- prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 11, 5);
- prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 12, 5);
- prt("(M) ÄãËâÎÏ¿§ïçÃÍ", 13, 5);
- prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5);
- /* Window flags */
- prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
-#else
- prt("(1) Input Options", 2, 5);
- prt("(2) Map Screen Options", 3, 5);
- prt("(3) Text Display Options", 4, 5);
- prt("(4) Game-Play Options", 5, 5);
- prt("(5) Disturbance Options", 6, 5);
- prt("(6) Easy Auto-Destroyer Options", 7, 5);
- prt("(R) Play-record Options", 8, 5);
- /* Special choices */
- prt("(P) Auto-picker/destroyer editor", 10, 5);
- prt("(D) Base Delay Factor", 11, 5);
- prt("(H) Hitpoint Warning", 12, 5);
- prt("(M) Mana Color Threshold", 13, 5);
- prt("(A) Autosave Options", 14, 5);
- /* Window flags */
- prt("(W) Window Flags", 15, 5);
-#endif
-
- if (!p_ptr->wizard || !allow_debug_opts)
- {
- /* Birth */
-#ifdef JP
- prt("(B) ½é´ü ¥ª¥×¥·¥ç¥ó (»²¾È¤Î¤ß)", 16, 5);
-#else
- prt("(B) Birth Options (Browse Only)", 16, 5);
-#endif
- }
- else
+ while(1)
{
- /* Birth */
+ /* Give some choices */
+ for (i = 0; i < n; i++)
+ {
+ byte a = TERM_WHITE;
+ if (i == y) a = TERM_L_BLUE;
+ Term_putstr(5, option_fields[i].row, -1, a,
+ format("(%c) %s", toupper(option_fields[i].key), option_fields[i].name));
+ }
+
#ifdef JP
- prt("(B) ½é´ü ¥ª¥×¥·¥ç¥ó", 16, 5);
+ prt("<Êý¸þ>¤Ç°ÜÆ°, Enter¤Ç·èÄê, ESC¤Ç¥¥ã¥ó¥»¥ë, ?¤Ç¥Ø¥ë¥×: ", 21, 0);
#else
- prt("(B) Birth Options", 16, 5);
+ prt("Move to <dir>, Select to Enter, Cancel to ESC, ? to help: ", 21, 0);
#endif
- }
+ /* Get command */
+ skey = inkey_special(TRUE);
+ if (!(skey & SKEY_MASK)) k = (char)skey;
+ else k = 0;
- if (p_ptr->noscore || allow_debug_opts)
- {
- /* Cheating */
-#ifdef JP
- prt("(C) º¾µ½ ¥ª¥×¥·¥ç¥ó", 17, 5);
-#else
- prt("(C) Cheating Options", 17, 5);
-#endif
- }
+ /* Exit */
+ if (k == ESCAPE) break;
+ if (my_strchr("\n\r ", k))
+ {
+ k = option_fields[y].key;
+ break;
+ }
- /* Prompt */
-#ifdef JP
- prt("¥³¥Þ¥ó¥É:", 19, 0);
-#else
- prt("Command: ", 19, 0);
-#endif
+ for (i = 0; i < n; i++)
+ {
+ if (tolower(k) == option_fields[i].key) break;
+ }
+ /* Command is found */
+ if (i < n) break;
- /* Get command */
- k = inkey();
+ /* Hack -- browse help */
+ if (k == '?') break;
+
+ /* Move cursor */
+ d = 0;
+ if (skey == SKEY_UP) d = 8;
+ if (skey == SKEY_DOWN) d = 2;
+ y = (y + ddy[d] + n) % n;
+ if (!d) bell();
+ }
/* Exit */
if (k == ESCAPE) break;
#else
do_cmd_options_aux(OPT_PAGE_INPUT, "Input Options");
#endif
-
break;
}
#else
do_cmd_options_aux(OPT_PAGE_MAPSCREEN, "Map Screen Options");
#endif
-
break;
}
#else
do_cmd_options_aux(OPT_PAGE_TEXT, "Text Display Options");
#endif
-
break;
}
#else
do_cmd_options_aux(OPT_PAGE_GAMEPLAY, "Game-Play Options");
#endif
-
break;
}
#else
do_cmd_options_aux(OPT_PAGE_DISTURBANCE, "Disturbance Options");
#endif
-
break;
}
#else
do_cmd_options_aux(OPT_PAGE_BIRTH, (!p_ptr->wizard || !allow_debug_opts) ? "Birth Options(browse only)" : "Birth Options((*)s effect score)");
#endif
-
break;
}
#else
do_cmd_options_cheat("Cheaters never win");
#endif
-
break;
}
#else
do_cmd_options_autosave("Autosave");
#endif
-
break;
}
case 'd':
{
/* Prompt */
+ clear_from(18);
#ifdef JP
prt("¥³¥Þ¥ó¥É: ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 19, 0);
#else
prt("Command: Base Delay Factor", 19, 0);
#endif
-
/* Get a new value */
while (1)
{
case 'h':
{
/* Prompt */
+ clear_from(18);
#ifdef JP
prt("¥³¥Þ¥ó¥É: Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 19, 0);
#else
prt("Command: Hitpoint Warning", 19, 0);
#endif
-
/* Get a new value */
while (1)
{
case 'm':
{
/* Prompt */
+ clear_from(18);
#ifdef JP
prt("¥³¥Þ¥ó¥É: ÄãËâÎÏ¿§ïçÃÍ", 19, 0);
#else
prt("Command: Mana Color Threshold", 19, 0);
#endif
-
/* Get a new value */
while (1)
{