OSDN Git Service

内部で使う特殊キーコード 255 254 253 252 をマクロで定義。
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 9 Jun 2002 14:18:42 +0000 (14:18 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 9 Jun 2002 14:18:42 +0000 (14:18 +0000)
main-mac.cの終了メニューも特殊キーを使用するようにした。

src/cmd1.c
src/cmd2.c
src/defines.h
src/dungeon.c
src/main-mac.c
src/main-win.c

index f8380fc..2152216 100644 (file)
@@ -4007,7 +4007,7 @@ msg_format("%s
 
                        energy_use = 0;
                        /* Hack -- Enter store */
-                       command_new = 253;
+                       command_new = SPECIAL_KEY_STORE;
                }
 
                /* Handle "building doors" -KMW- */
@@ -4019,7 +4019,7 @@ msg_format("%s
 
                        energy_use = 0;
                        /* Hack -- Enter building */
-                       command_new = 254;
+                       command_new = SPECIAL_KEY_BUILDING;
                }
 
                /* Handle quest areas -KMW- */
@@ -4030,7 +4030,7 @@ msg_format("%s
 
                        energy_use = 0;
                        /* Hack -- Enter quest level */
-                       command_new = 255;
+                       command_new = SPECIAL_KEY_QUEST;
                }
 
                else if (cave[y][x].feat == FEAT_QUEST_EXIT)
index 1aa5e0d..d6d812b 100644 (file)
@@ -3058,7 +3058,7 @@ void do_cmd_stay(int pickup)
 
                energy_use = 0;
                /* Hack -- enter store */
-               command_new = 253;
+               command_new = SPECIAL_KEY_STORE;
        }
 
        /* Hack -- enter a building if we are on one -KMW- */
@@ -3070,7 +3070,7 @@ void do_cmd_stay(int pickup)
 
                energy_use = 0;
                /* Hack -- enter building */
-               command_new = 254;
+               command_new = SPECIAL_KEY_BUILDING;
        }
 
        /* Exit a quest if reach the quest exit */
index 8bd55ab..a3648cd 100644 (file)
 #define MAX_NLEN        160
 
 /*
+ * Special internal key
+ */
+#define SPECIAL_KEY_QUEST    255
+#define SPECIAL_KEY_BUILDING 254
+#define SPECIAL_KEY_STORE    253
+#define SPECIAL_KEY_QUIT     252
+
+/*
  * Store constants
  */
 #define STORE_INVEN_MAX 24              /* Max number of discrete objs in inven */
index 53bcd66..4c14b95 100644 (file)
@@ -4203,21 +4203,21 @@ msg_print("
                /*** Stairs and Doors and Chests and Traps ***/
 
                /* Enter store */
-               case 253:
+               case SPECIAL_KEY_STORE:
                {
                        if (!p_ptr->wild_mode) do_cmd_store();
                        break;
                }
 
                /* Enter building -KMW- */
-               case 254:
+               case SPECIAL_KEY_BUILDING:
                {
                        if (!p_ptr->wild_mode) do_cmd_bldg();
                        break;
                }
 
                /* Enter quest level -KMW- */
-               case 255:
+               case SPECIAL_KEY_QUEST:
                {
                        if (!p_ptr->wild_mode) do_cmd_quest();
                        break;
@@ -4837,7 +4837,7 @@ msg_print("
 
                /* Save and quit */
                case KTRL('X'):
-               case 252:
+               case SPECIAL_KEY_QUIT:
                {
                        do_cmd_save_and_exit();
                        break;
index 708e888..5d52a12 100644 (file)
@@ -3929,8 +3929,10 @@ static void menu(long mc)
                                                msg_flag = FALSE;
 
                                                /* Save the game */
-//                                             do_cmd_save_game(FALSE);
-                                               Term_key_push(KTRL('X'));
+#if 0
+                                               do_cmd_save_game(FALSE);
+#endif
+                                               Term_key_push(SPECIAL_KEY_QUIT);
                                                break;
                                        }
 
index 6fe485b..0408ca4 100644 (file)
@@ -3360,7 +3360,7 @@ static void process_menus(WORD wCmd)
 #else /* ZANGBAND */
                                /* do_cmd_save_game(); */
 #endif /* ZANGBAND */
-                               Term_key_push(252);
+                               Term_key_push(SPECIAL_KEY_QUIT);
                                break;
                        }
                        quit(NULL);