OSDN Git Service

[Refactor] #37353 コメント整理。 / Refactor comments.
[hengband/hengband.git] / src / autopick.c
index 0b2360a..685c7c3 100644 (file)
 /*
  * Macros for Keywords
  */
-#define FLG_ALL              
-#define FLG_UNAWARE         
-#define FLG_UNIDENTIFIED     
-#define FLG_IDENTIFIED      
-#define FLG_STAR_IDENTIFIED  
-#define FLG_COLLECTING      
-#define FLG_ARTIFACT        
+#define FLG_ALL                                0
+#define FLG_UNAWARE                    1
+#define FLG_UNIDENTIFIED       2
+#define FLG_IDENTIFIED         3
+#define FLG_STAR_IDENTIFIED    4
+#define FLG_COLLECTING         5
+#define FLG_ARTIFACT           6
 #define FLG_EGO                     7 
 #define FLG_GOOD            10
-#define FLG_NAMELESS        11
+#define FLG_NAMELESS    11
 #define FLG_AVERAGE         12
-#define FLG_WORTHLESS       13
+#define FLG_WORTHLESS   13
 #define FLG_RARE            14
 #define FLG_COMMON          15
 #define FLG_BOOSTED         16
-#define FLG_MORE_DICE       17
-#define FLG_MORE_BONUS      18 
+#define FLG_MORE_DICE   17
+#define FLG_MORE_BONUS  18
 #define FLG_WANTED          19
 #define FLG_UNIQUE          20
 #define FLG_HUMAN           21
-#define FLG_UNREADABLE      22
+#define FLG_UNREADABLE  22
 #define FLG_REALM1          23
 #define FLG_REALM2          24
 #define FLG_FIRST           25
@@ -2013,8 +2013,6 @@ bool autopick_autoregister(object_type *o_ptr)
        /* Add a line to the file */
        /* Don't kill "entry" */
        fprintf(pref_fff, "%s\n", autopick_line_from_entry(entry));
-
-       /* Close the file */
        fclose(pref_fff);
 
        return TRUE;
@@ -3239,36 +3237,14 @@ static bool insert_return_code(text_body_type *tb)
 /*
  * Choose an item and get auto-picker entry from it.
  */
-static object_type *choose_object(cptr q, cptr s)
-{
-       OBJECT_IDX item;
-
-       if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR | USE_EQUIP))) return NULL;
-
-       /* Get the item (in the pack) */
-       if (item >= 0) return &inventory[item];
-
-       /* Get the item (on the floor) */
-       else return &o_list[0 - item];
-}
-
-
-/*
- * Choose an item and get auto-picker entry from it.
- */
 static bool entry_from_choosed_object(autopick_type *entry)
 {
        object_type *o_ptr;
        cptr q, s;
 
-#ifdef JP
-       q = "どのアイテムを登録しますか? ";
-       s = "アイテムを持っていない。";
-#else
-       q = "Enter which item? ";
-       s = "You have nothing to enter.";
-#endif
-       o_ptr = choose_object(q, s);
+       q = _("どのアイテムを登録しますか? ", "Enter which item? ");
+       s = _("アイテムを持っていない。", "You have nothing to enter.");
+       o_ptr = choose_object(NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP);
        if (!o_ptr) return FALSE;
 
        autopick_entry_from_object(entry, o_ptr);
@@ -3285,14 +3261,9 @@ static byte get_object_for_search(object_type **o_handle, cptr *search_strp)
        object_type *o_ptr;
        cptr q, s;
 
-#ifdef JP
-       q = "どのアイテムを検索しますか? ";
-       s = "アイテムを持っていない。";
-#else
-       q = "Enter which item? ";
-       s = "You have nothing to enter.";
-#endif
-       o_ptr = choose_object(q, s);
+       q = _("どのアイテムを検索しますか? ", "Enter which item? ");
+       s = _("アイテムを持っていない。", "You have nothing to enter.");
+       o_ptr = choose_object(NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP);
        if (!o_ptr) return 0;
 
        *o_handle = o_ptr;
@@ -4488,8 +4459,6 @@ static void draw_text_editor(text_body_type *tb)
        if (tb->dirty_flags & DIRTY_SCREEN)
        {
                tb->dirty_flags |= (DIRTY_ALL | DIRTY_MODE);
-
-               /* Clear screen */
                Term_clear();
        }
 
@@ -6060,8 +6029,6 @@ void do_cmd_edit_autopick(void)
                        break;
                }
        }
-
-       /* Save the screen */
        screen_save();
 
        /* Process requests until done */
@@ -6145,8 +6112,6 @@ void do_cmd_edit_autopick(void)
 
                if (com_id) quit = do_editor_command(tb, com_id);
        } /* while (TRUE) */
-
-       /* Restore the screen */
        screen_load();
 
        /* Get the filename of preference */