OSDN Git Service

[Refactor] #39964 Removed the dependency from read-pref-file to autopick-pref-processor
authorHourier <hourier@users.sourceforge.jp>
Sun, 26 Apr 2020 06:27:19 +0000 (15:27 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 26 Apr 2020 06:27:19 +0000 (15:27 +0900)
25 files changed:
src/autopick/autopick-reader-writer.c
src/birth.c
src/birth.h
src/cmd/cmd-autopick.c
src/cmd/cmd-dump.c
src/cmd/cmd-dump.h
src/cmd/cmd-macro.c
src/cmd/cmd-macro.h
src/cmd/cmd-process-screen.c
src/cmd/cmd-process-screen.h
src/cmd/cmd-visuals.c
src/cmd/cmd-visuals.h
src/core.c
src/init.c
src/init.h
src/io/read-pref-file.c
src/io/read-pref-file.h
src/main-win.c
src/market/store.c
src/monster-status.c
src/object.h
src/object1.c
src/player-damage.c
src/report.c
src/report.h

index c18102d..79875a3 100644 (file)
@@ -1,6 +1,7 @@
 #include "angband.h"
 #include "autopick/autopick-reader-writer.h"
 #include "autopick/autopick-initializer.h"
+#include "autopick/autopick-pref-processor.h"
 #include "files.h"
 #include "io/read-pref-file.h"
 
@@ -12,7 +13,7 @@ void autopick_load_pref(player_type *player_ptr, bool disp_mes)
        GAME_TEXT buf[80];
        init_autopick();
        my_strcpy(buf, pickpref_filename(player_ptr, PT_WITH_PNAME), sizeof(buf));
-       errr err = process_autopick_file(player_ptr, buf);
+       errr err = process_autopick_file(player_ptr, buf, process_autopick_file_command);
        if (err == 0 && disp_mes)
        {
                msg_format(_("%s\82ð\93Ç\82Ý\8d\9e\82Ý\82Ü\82µ\82½\81B", "Loaded '%s'."), buf);
@@ -21,7 +22,7 @@ void autopick_load_pref(player_type *player_ptr, bool disp_mes)
        if (err < 0)
        {
                my_strcpy(buf, pickpref_filename(player_ptr, PT_DEFAULT), sizeof(buf));
-               err = process_autopick_file(player_ptr, buf);
+               err = process_autopick_file(player_ptr, buf, process_autopick_file_command);
                if (err == 0 && disp_mes)
                {
                        msg_format(_("%s\82ð\93Ç\82Ý\8d\9e\82Ý\82Ü\82µ\82½\81B", "Loaded '%s'."), buf);
index f7e6bc3..95f47fc 100644 (file)
@@ -3554,7 +3554,7 @@ void add_history_from_pref_line(concptr t)
  * @brief 生い立ちメッセージをファイルからロードする。
  * @return なし
  */
-static bool do_cmd_histpref(player_type *creature_ptr)
+static bool do_cmd_histpref(player_type *creature_ptr, void(*process_autopick_file_command)(char*))
 {
        char buf[80];
        errr err;
@@ -3574,7 +3574,7 @@ static bool do_cmd_histpref(player_type *creature_ptr)
 #else
        sprintf(buf, "histpref-%s.prf", creature_ptr->base_name);
 #endif
-       err = process_histpref_file(creature_ptr, buf);
+       err = process_histpref_file(creature_ptr, buf, process_autopick_file_command);
 
        /* Process 'hist????.prf' if 'hist????-<name>.prf' doesn't exist */
        if (0 > err)
@@ -3584,7 +3584,7 @@ static bool do_cmd_histpref(player_type *creature_ptr)
 #else
                strcpy(buf, "histpref.prf");
 #endif
-               err = process_histpref_file(creature_ptr, buf);
+               err = process_histpref_file(creature_ptr, buf, process_autopick_file_command);
        }
 
        if (err)
@@ -3651,7 +3651,7 @@ static bool do_cmd_histpref(player_type *creature_ptr)
  * @brief 生い立ちメッセージを編集する。/Character background edit-mode
  * @return なし
  */
-static void edit_history(player_type *creature_ptr)
+static void edit_history(player_type *creature_ptr, void(*process_autopick_file_command)(char*))
 {
        char old_history[4][60];
        TERM_LEN y = 0, x = 0;
@@ -3780,7 +3780,7 @@ static void edit_history(player_type *creature_ptr)
                }
                else if (c == KTRL('A'))
                {
-                       if (do_cmd_histpref(creature_ptr))
+                       if (do_cmd_histpref(creature_ptr, process_autopick_file_command))
                        {
 #ifdef JP
                                if ((x > 0) && (iskanji2(creature_ptr->history[y], x - 1))) x--;
@@ -3861,7 +3861,7 @@ static void edit_history(player_type *creature_ptr)
  * expensive CPU wise.  And it cuts down on player stupidity.
  * @return なし
  */
-static bool player_birth_aux(player_type *creature_ptr)
+static bool player_birth_aux(player_type *creature_ptr, void(*process_autopick_file_command)(char*))
 {
        int i, k, n, cs, os;
 
@@ -4439,7 +4439,7 @@ static bool player_birth_aux(player_type *creature_ptr)
        process_player_name(creature_ptr, current_world_ptr->creating_savefile);
 
        /*** Edit character background ***/
-       edit_history(creature_ptr);
+       edit_history(creature_ptr, process_autopick_file_command);
 
        /*** Finish up ***/
 
@@ -4552,7 +4552,7 @@ static bool ask_quick_start(player_type *creature_ptr)
  * fields, so we must be sure to clear them first.
  * @return なし
  */
-void player_birth(player_type *creature_ptr)
+void player_birth(player_type *creature_ptr, void(*process_autopick_file_command)(char*))
 {
        int i, j;
        char buf[80];
@@ -4575,7 +4575,7 @@ void player_birth(player_type *creature_ptr)
                while (TRUE)
                {
                        /* Roll up a new character */
-                       if (player_birth_aux(creature_ptr)) break;
+                       if (player_birth_aux(creature_ptr, process_autopick_file_command)) break;
 
                        /* Wipe the player */
                        player_wipe_without_name(creature_ptr);
index a73fd8b..a68c862 100644 (file)
@@ -38,7 +38,7 @@ extern birther previous_char;
 
 /* birth.c */
 extern void add_history_from_pref_line(concptr t);
-extern void player_birth(player_type *creature_ptr);
+extern void player_birth(player_type *creature_ptr, void(*process_autopick_file_command)(char*));
 extern void get_max_stats(player_type *creature_ptr);
 extern void get_height_weight(player_type *creature_ptr);
 extern void player_outfit(player_type *creature_ptr);
index 0f8e214..ffe1711 100644 (file)
@@ -12,6 +12,7 @@
 #include "autopick/autopick-editor-command.h"
 #include "autopick/autopick-editor-util.h"
 #include "autopick/autopick-inserter-killer.h"
+#include "autopick/autopick-pref-processor.h"
 #include "io/read-pref-file.h"
 #include "world.h"
 #include "view/display-main-window.h" // 暫定。後で消す.
@@ -203,7 +204,7 @@ void do_cmd_edit_autopick(player_type *player_ptr)
        string_free(tb->last_destroyed);
        kill_yank_chain(tb);
 
-       process_autopick_file(player_ptr, buf);
+       process_autopick_file(player_ptr, buf, process_autopick_file_command);
        current_world_ptr->start_time = (u32b)time(NULL);
        cx_save = tb->cx;
        cy_save = tb->cy;
index b11568f..c5fbe42 100644 (file)
@@ -71,7 +71,7 @@ void do_cmd_pref(player_type *creature_ptr)
 /*
  * Interact with "colors"
  */
-void do_cmd_colors(player_type *creature_ptr)
+void do_cmd_colors(player_type *creature_ptr, void(*process_autopick_file_command)(char*))
 {
        int i;
        char tmp[160];
@@ -97,7 +97,7 @@ void do_cmd_colors(player_type *creature_ptr)
                        sprintf(tmp, "%s.prf", creature_ptr->base_name);
                        if (!askfor(tmp, 70)) continue;
 
-                       (void)process_pref_file(creature_ptr, tmp);
+                       (void)process_pref_file(creature_ptr, tmp, process_autopick_file_command);
                        Term_xtra(TERM_XTRA_REACT, 0);
                        Term_redraw();
                }
index 17e2937..0911580 100644 (file)
@@ -1,7 +1,7 @@
 #pragma once
 
 extern void do_cmd_pref(player_type *creature_ptr);
-extern void do_cmd_colors(player_type *creature_ptr);
+extern void do_cmd_colors(player_type *creature_ptr, void(*process_autopick_file_command)(char*));
 extern void do_cmd_note(void);
 extern void do_cmd_version(void);
 extern void do_cmd_feeling(player_type *creature_ptr);
index fc5056b..78b72c2 100644 (file)
@@ -148,7 +148,7 @@ static errr keymap_dump(concptr fname)
  * Could use some helpful instructions on this page.
  * </pre>
  */
-void do_cmd_macros(player_type *creature_ptr)
+void do_cmd_macros(player_type *creature_ptr, void(*process_autopick_file_command)(char*))
 {
        char tmp[1024];
        char buf[1024];
@@ -186,7 +186,7 @@ void do_cmd_macros(player_type *creature_ptr)
                        sprintf(tmp, "%s.prf", creature_ptr->base_name);
                        if (!askfor(tmp, 80)) continue;
 
-                       errr err = process_pref_file(creature_ptr, tmp);
+                       errr err = process_pref_file(creature_ptr, tmp, process_autopick_file_command);
                        if (-2 == err)
                                msg_format(_("標準の設定ファイル'%s'を読み込みました。", "Loaded default '%s'."), tmp);
                        else if (err)
index 4c415c6..4a0bfba 100644 (file)
@@ -1,3 +1,3 @@
 #pragma once
 
-void do_cmd_macros(player_type *creature_ptr);
+void do_cmd_macros(player_type *creature_ptr, void(*process_autopick_file_command)(char*));
index 8818f02..6b1fd98 100644 (file)
@@ -333,12 +333,12 @@ static bool do_cmd_save_screen_text(int wid, int hgt)
  * @param handle_stuff 画面更新用の関数ポインタ
  * @return 記念撮影直前のグラフィックオプション
  */
-static bool update_use_graphics(player_type *creature_ptr, void(*handle_stuff)(player_type*))
+static bool update_use_graphics(player_type *creature_ptr, void(*handle_stuff)(player_type*), void(*process_autopick_file_command)(char*))
 {
        if (!use_graphics) return TRUE;
 
        use_graphics = FALSE;
-       reset_visuals(creature_ptr);
+       reset_visuals(creature_ptr, process_autopick_file_command);
        creature_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
        (*handle_stuff)(creature_ptr);
        return FALSE;
@@ -351,7 +351,7 @@ static bool update_use_graphics(player_type *creature_ptr, void(*handle_stuff)(p
  * @param handle_stuff 画面更新用の関数ポインタ
  * @return なし
  */
-void do_cmd_save_screen(player_type *creature_ptr, void(*handle_stuff)(player_type*))
+void do_cmd_save_screen(player_type *creature_ptr, void(*handle_stuff)(player_type*), void(*process_autopick_file_command)(char*))
 {
        prt(_("記念撮影しますか? [(y)es/(h)tml/(n)o] ", "Save screen dump? [(y)es/(h)tml/(n)o] "), 0, 0);
        bool html_dump;
@@ -360,7 +360,7 @@ void do_cmd_save_screen(player_type *creature_ptr, void(*handle_stuff)(player_ty
        int wid, hgt;
        Term_get_size(&wid, &hgt);
 
-       bool old_use_graphics = update_use_graphics(creature_ptr, handle_stuff);
+       bool old_use_graphics = update_use_graphics(creature_ptr, handle_stuff, process_autopick_file_command);
 
        if (html_dump)
        {
@@ -375,7 +375,7 @@ void do_cmd_save_screen(player_type *creature_ptr, void(*handle_stuff)(player_ty
        if (old_use_graphics) return;
 
        use_graphics = TRUE;
-       reset_visuals(creature_ptr);
+       reset_visuals(creature_ptr, process_autopick_file_command);
        creature_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
        handle_stuff(creature_ptr);
 }
index 0988ddf..c801a36 100644 (file)
@@ -1,5 +1,5 @@
 #pragma once
 
 void do_cmd_save_screen_html_aux(char *filename, int message);
-void do_cmd_save_screen(player_type *creature_ptr, void(*handle_stuff)(player_type*));
+void do_cmd_save_screen(player_type *creature_ptr, void(*handle_stuff)(player_type*), void(*process_autopick_file_command)(char*));
 void do_cmd_load_screen(void);
index 34904ff..9a2158a 100644 (file)
@@ -66,7 +66,7 @@ static void print_visuals_menu(concptr choice_msg)
 /*
  * Interact with "visuals"
  */
-void do_cmd_visuals(player_type *creature_ptr)
+void do_cmd_visuals(player_type *creature_ptr, void(*process_autopick_file_command)(char*))
 {
        FILE *auto_dump_stream;
        char tmp[160];
@@ -93,7 +93,7 @@ void do_cmd_visuals(player_type *creature_ptr)
                        sprintf(tmp, "%s.prf", creature_ptr->base_name);
                        if (!askfor(tmp, 70)) continue;
 
-                       (void)process_pref_file(creature_ptr, tmp);
+                       (void)process_pref_file(creature_ptr, tmp, process_autopick_file_command);
                        need_redraw = TRUE;
                        break;
                }
@@ -436,7 +436,7 @@ void do_cmd_visuals(player_type *creature_ptr)
                }
                case 'R':
                case 'r':
-                       reset_visuals(creature_ptr);
+                       reset_visuals(creature_ptr, process_autopick_file_command);
                        msg_print(_("画面上の[色/文字]を初期値にリセットしました。", "Visual attr/char tables reset."));
                        need_redraw = TRUE;
                        break;
index d95e43f..2b65174 100644 (file)
@@ -1,3 +1,3 @@
 #pragma once
 
-void do_cmd_visuals(player_type *creature_ptr);
+void do_cmd_visuals(player_type *creature_ptr, void(*process_autopick_file_command)(char*));
index f3ca01e..aeff614 100644 (file)
 #include "files.h"
 #include "scores.h"
 #include "autopick/autopick.h"
+#include "autopick/autopick-pref-processor.h"
 #include "autopick/autopick-reader-writer.h"
 #include "save.h"
 #include "realm.h"
@@ -3425,18 +3426,18 @@ static void process_command(player_type *creature_ptr)
        }
        case '@':
        {
-               do_cmd_macros(creature_ptr);
+               do_cmd_macros(creature_ptr, process_autopick_file_command);
                break;
        }
        case '%':
        {
-               do_cmd_visuals(creature_ptr);
+               do_cmd_visuals(creature_ptr, process_autopick_file_command);
                do_cmd_redraw(creature_ptr);
                break;
        }
        case '&':
        {
-               do_cmd_colors(creature_ptr);
+               do_cmd_colors(creature_ptr, process_autopick_file_command);
                do_cmd_redraw(creature_ptr);
                break;
        }
@@ -3521,7 +3522,7 @@ static void process_command(player_type *creature_ptr)
        }
        case ')':
        {
-               do_cmd_save_screen(creature_ptr, handle_stuff);
+               do_cmd_save_screen(creature_ptr, handle_stuff, process_autopick_file_command);
                break;
        }
        case ']':
@@ -4227,25 +4228,25 @@ static void load_all_pref_files(player_type *player_ptr)
 {
        char buf[1024];
        sprintf(buf, "user.prf");
-       process_pref_file(player_ptr, buf);
+       process_pref_file(player_ptr, buf, process_autopick_file_command);
        sprintf(buf, "user-%s.prf", ANGBAND_SYS);
-       process_pref_file(player_ptr, buf);
+       process_pref_file(player_ptr, buf, process_autopick_file_command);
        sprintf(buf, "%s.prf", rp_ptr->title);
-       process_pref_file(player_ptr, buf);
+       process_pref_file(player_ptr, buf, process_autopick_file_command);
        sprintf(buf, "%s.prf", cp_ptr->title);
-       process_pref_file(player_ptr, buf);
+       process_pref_file(player_ptr, buf, process_autopick_file_command);
        sprintf(buf, "%s.prf", player_ptr->base_name);
-       process_pref_file(player_ptr, buf);
+       process_pref_file(player_ptr, buf, process_autopick_file_command);
        if (player_ptr->realm1 != REALM_NONE)
        {
                sprintf(buf, "%s.prf", realm_names[player_ptr->realm1]);
-               process_pref_file(player_ptr, buf);
+               process_pref_file(player_ptr, buf, process_autopick_file_command);
        }
 
        if (player_ptr->realm2 != REALM_NONE)
        {
                sprintf(buf, "%s.prf", realm_names[player_ptr->realm2]);
-               process_pref_file(player_ptr, buf);
+               process_pref_file(player_ptr, buf, process_autopick_file_command);
        }
 
        autopick_load_pref(player_ptr, FALSE);
@@ -4268,7 +4269,7 @@ void play_game(player_type *player_ptr, bool new_game)
 #ifdef CHUUKEI
        if (chuukei_client)
        {
-               reset_visuals();
+               reset_visuals(player_ptr, process_autopick_file_command);
                browse_chuukei();
                return;
        }
@@ -4281,7 +4282,7 @@ void play_game(player_type *player_ptr, bool new_game)
 
        if (browsing_movie)
        {
-               reset_visuals(player_ptr);
+               reset_visuals(player_ptr, process_autopick_file_command);
                browse_movie();
                return;
        }
@@ -4383,7 +4384,7 @@ void play_game(player_type *player_ptr, bool new_game)
                current_world_ptr->seed_flavor = randint0(0x10000000);
                current_world_ptr->seed_town = randint0(0x10000000);
 
-               player_birth(player_ptr);
+               player_birth(player_ptr, process_autopick_file_command);
                counts_write(player_ptr, 2, 0);
                player_ptr->count = 0;
                load = FALSE;
@@ -4495,7 +4496,7 @@ void play_game(player_type *player_ptr, bool new_game)
        }
 
        player_ptr->playing = TRUE;
-       reset_visuals(player_ptr);
+       reset_visuals(player_ptr, process_autopick_file_command);
        load_all_pref_files(player_ptr);
        if (new_game)
        {
index 0a823d1..bc7bc7e 100644 (file)
@@ -1433,7 +1433,7 @@ static void init_angband_aux(concptr why)
  * if needed, in the first (?) pass through "TERM_XTRA_REACT".
  * </pre>
  */
-void init_angband(player_type *player_ptr)
+void init_angband(player_type *player_ptr, void(*process_autopick_file_command)(char*))
 {
        /*** Verify the "news" file ***/
        char buf[1024];
@@ -1606,13 +1606,13 @@ void init_angband(player_type *player_ptr)
        strcpy(buf, "pref.prf");
 
        /* Process that file */
-       process_pref_file(player_ptr, buf);
+       process_pref_file(player_ptr, buf, process_autopick_file_command);
 
        /* Access the "basic" system pref file */
        sprintf(buf, "pref-%s.prf", ANGBAND_SYS);
 
        /* Process that file */
-       process_pref_file(player_ptr, buf);
+       process_pref_file(player_ptr, buf, process_autopick_file_command);
 
        note(_("[初期化終了]", "[Initialization complete]"));
 }
index 2886849..46e0af4 100644 (file)
@@ -128,6 +128,6 @@ extern header g_head;
 
 extern s16b f_tag_to_index(concptr str);
 extern s16b f_tag_to_index_in_init(concptr str);
-extern void init_angband(player_type *player_ptr);
+extern void init_angband(player_type *player_ptr, void(*process_autopick_file_command)(char*));
 extern concptr get_check_sum(void);
 extern void init_file_paths(char *path);
index 42d5cc3..bf62852 100644 (file)
@@ -44,7 +44,7 @@ static int auto_dump_line_num;
  * @param preftype prefファイルのタイプ
  * @return エラーコード
  */
-static errr process_pref_file_aux(player_type *creature_ptr, concptr name, int preftype)
+static errr process_pref_file_aux(player_type *creature_ptr, concptr name, int preftype, void(*process_autopick_file_command)(char*))
 {
        FILE *fp;
        fp = my_fopen(name, "r");
@@ -91,13 +91,13 @@ static errr process_pref_file_aux(player_type *creature_ptr, concptr name, int p
                        switch (preftype)
                        {
                        case PREF_TYPE_AUTOPICK:
-                               (void)process_autopick_file(creature_ptr, buf + 2);
+                               (void)process_autopick_file(creature_ptr, buf + 2, process_autopick_file_command);
                                break;
                        case PREF_TYPE_HISTPREF:
-                               (void)process_histpref_file(creature_ptr, buf + 2);
+                               (void)process_histpref_file(creature_ptr, buf + 2, process_autopick_file_command);
                                break;
                        default:
-                               (void)process_pref_file(creature_ptr, buf + 2);
+                               (void)process_pref_file(creature_ptr, buf + 2, process_autopick_file_command);
                                break;
                        }
 
@@ -111,7 +111,7 @@ static errr process_pref_file_aux(player_type *creature_ptr, concptr name, int p
                        if (preftype != PREF_TYPE_AUTOPICK)
                                break;
                        
-                       process_autopick_file_command(buf);
+                       (*process_autopick_file_command)(buf);
                        err = 0;
                }
        }
@@ -144,16 +144,16 @@ static errr process_pref_file_aux(player_type *creature_ptr, concptr name, int p
  * allow conditional evaluation and filename inclusion.
  * </pre>
  */
-errr process_pref_file(player_type *creature_ptr, concptr name)
+errr process_pref_file(player_type *creature_ptr, concptr name, void(*process_autopick_file_command)(char*))
 {
        char buf[1024];
        path_build(buf, sizeof(buf), ANGBAND_DIR_PREF, name);
 
-       errr err1 = process_pref_file_aux(creature_ptr, buf, PREF_TYPE_NORMAL);
+       errr err1 = process_pref_file_aux(creature_ptr, buf, PREF_TYPE_NORMAL, process_autopick_file_command);
        if (err1 > 0) return err1;
 
        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name);
-       errr err2 = process_pref_file_aux(creature_ptr, buf, PREF_TYPE_NORMAL);
+       errr err2 = process_pref_file_aux(creature_ptr, buf, PREF_TYPE_NORMAL, process_autopick_file_command);
        if (err2 < 0 && !err1)
                return -2;
 
@@ -167,11 +167,11 @@ errr process_pref_file(player_type *creature_ptr, concptr name)
  * @param name ファイル名
  * @details
  */
-errr process_autopick_file(player_type *creature_ptr, concptr name)
+errr process_autopick_file(player_type *creature_ptr, concptr name, void(*process_autopick_file_command)(char*))
 {
        char buf[1024];
        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name);
-       errr err = process_pref_file_aux(creature_ptr, buf, PREF_TYPE_AUTOPICK);
+       errr err = process_pref_file_aux(creature_ptr, buf, PREF_TYPE_AUTOPICK, process_autopick_file_command);
        return err;
 }
 
@@ -184,7 +184,7 @@ errr process_autopick_file(player_type *creature_ptr, concptr name)
  * @return エラーコード
  * @details
  */
-errr process_histpref_file(player_type *creature_ptr, concptr name)
+errr process_histpref_file(player_type *creature_ptr, concptr name, void(*process_autopick_file_command)(char*))
 {
        bool old_character_xtra = current_world_ptr->character_xtra;
        char buf[1024];
@@ -192,7 +192,7 @@ errr process_histpref_file(player_type *creature_ptr, concptr name)
 
        /* Hack -- prevent modification birth options in this file */
        current_world_ptr->character_xtra = TRUE;
-       errr err = process_pref_file_aux(creature_ptr, buf, PREF_TYPE_HISTPREF);
+       errr err = process_pref_file_aux(creature_ptr, buf, PREF_TYPE_HISTPREF, process_autopick_file_command);
        current_world_ptr->character_xtra = old_character_xtra;
        return err;
 }
index da7208b..4c5d92e 100644 (file)
@@ -3,9 +3,9 @@
 extern char auto_dump_header[];
 extern char auto_dump_footer[];
 
-extern errr process_pref_file(player_type *creature_ptr, concptr name);
-extern errr process_autopick_file(player_type *creature_ptr, concptr name);
-extern errr process_histpref_file(player_type *creature_ptr, concptr name);
+extern errr process_pref_file(player_type *creature_ptr, concptr name, void(*process_autopick_file_command)(char*));
+extern errr process_autopick_file(player_type *creature_ptr, concptr name, void(*process_autopick_file_command)(char*));
+extern errr process_histpref_file(player_type *creature_ptr, concptr name, void(*process_autopick_file_command)(char*));
 
 void auto_dump_printf(FILE *auto_dump_stream, concptr fmt, ...);
 bool open_auto_dump(FILE **fpp, concptr buf, concptr mark);
index 80f3c03..0cbaa0d 100644 (file)
@@ -98,6 +98,7 @@
 #include "chuukei.h"
 
 #include "io/write-diary.h"
+#include "autopick/autopick-pref-processor.h"
 #include "cmd/cmd-process-screen.h"
 #include "cmd/cmd-save.h"
 #include "view/display-main-window.h"
@@ -1440,7 +1441,7 @@ static errr term_xtra_win_react(player_type *player_ptr)
                }
 
                use_graphics = arg_graphics;
-               reset_visuals(player_ptr);
+               reset_visuals(player_ptr, process_autopick_file_command);
        }
 
        for (int i = 0; i < MAX_TERM_DATA; i++)
@@ -3853,7 +3854,7 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC
 
        signals_init();
        Term_activate(term_screen);
-       init_angband(p_ptr);
+       init_angband(p_ptr, process_autopick_file_command);
        initialized = TRUE;
 #ifdef CHUUKEI
        if (lpCmdLine[0] == '-') {
index de75616..733af48 100644 (file)
@@ -57,6 +57,7 @@
 #include "world.h"
 #include "object/object-kind.h"
 #include "autopick/autopick.h"
+#include "autopick/autopick-pref-processor.h"
 #include "floor-town.h"
 #include "japanese.h"
 #include "view/display-main-window.h"
@@ -1950,21 +1951,21 @@ static void store_process_command(player_type *client_ptr)
        case '@':
        {
                client_ptr->town_num = old_town_num;
-               do_cmd_macros(client_ptr);
+               do_cmd_macros(client_ptr, process_autopick_file_command);
                client_ptr->town_num = inner_town_num;
                break;
        }
        case '%':
        {
                client_ptr->town_num = old_town_num;
-               do_cmd_visuals(client_ptr);
+               do_cmd_visuals(client_ptr, process_autopick_file_command);
                client_ptr->town_num = inner_town_num;
                break;
        }
        case '&':
        {
                client_ptr->town_num = old_town_num;
-               do_cmd_colors(client_ptr);
+               do_cmd_colors(client_ptr, process_autopick_file_command);
                client_ptr->town_num = inner_town_num;
                break;
        }
@@ -2018,7 +2019,7 @@ static void store_process_command(player_type *client_ptr)
        }
        case ')':
        {
-               do_cmd_save_screen(client_ptr, handle_stuff);
+               do_cmd_save_screen(client_ptr, handle_stuff, process_autopick_file_command);
                break;
        }
        default:
index 2a12f7e..9114109 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "creature.h"
 #include "io/write-diary.h"
+#include "autopick/autopick-pref-processor.h"
 #include "cmd/cmd-draw.h"
 #include "cmd/cmd-dump.h"
 #include "dungeon.h"
@@ -1192,7 +1193,7 @@ bool mon_take_hit(player_type *target_ptr, MONSTER_IDX m_idx, HIT_POINT dam, boo
 #ifdef WORLD_SCORE
                        if (m_ptr->r_idx == MON_SERPENT)
                        {
-                               screen_dump = make_screen_dump(target_ptr);
+                               screen_dump = make_screen_dump(target_ptr, process_autopick_file_command);
                        }
 #endif
                }
index a7b1297..a81a0f7 100644 (file)
@@ -392,7 +392,7 @@ extern OBJECT_TYPE_VALUE item_tester_tval;
 extern bool(*get_obj_num_hook)(KIND_OBJECT_IDX k_idx);
 
 /* object1.c */
-extern void reset_visuals(player_type *owner_ptr);
+extern void reset_visuals(player_type *owner_ptr, void(*process_autopick_file_command)(char*));
 extern void object_flags(object_type *o_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE]);
 extern void object_flags_known(object_type *o_ptr, BIT_FLAGS flgs[TR_FLAG_SIZE]);
 extern concptr item_activation(object_type *o_ptr);
index 36a8829..d8b53dd 100644 (file)
@@ -53,7 +53,7 @@
  *\n
  * The "prefs" parameter is no longer meaningful.  \n
  */
-void reset_visuals(player_type *owner_ptr)
+void reset_visuals(player_type *owner_ptr, void(*process_autopick_file_command)(char*))
 {
        for (int i = 0; i < max_f_idx; i++)
        {
@@ -82,9 +82,9 @@ void reset_visuals(player_type *owner_ptr)
        char *pref_file = use_graphics ? "graf.prf" : "font.prf";
        char *base_name = use_graphics ? "graf-%s.prf" : "font-%s.prf";
        char buf[1024];
-       process_pref_file(owner_ptr, pref_file);
+       process_pref_file(owner_ptr, pref_file, process_autopick_file_command);
        sprintf(buf, base_name, owner_ptr->base_name);
-       process_pref_file(owner_ptr, buf);
+       process_pref_file(owner_ptr, buf, process_autopick_file_command);
 }
 
 
index 0b1a0d0..ad98771 100644 (file)
@@ -8,6 +8,7 @@
 #include "avatar.h"
 #include "market/building.h"
 #include "io/write-diary.h"
+#include "autopick/autopick-pref-processor.h"
 #include "cmd/cmd-process-screen.h"
 #include "market/arena-info-table.h"
 #include "realm-song.h"
@@ -513,7 +514,7 @@ int take_hit(player_type *creature_ptr, int damage_type, HIT_POINT damage, concp
 
 #ifdef WORLD_SCORE
                        /* Make screen dump */
-                       screen_dump = make_screen_dump(creature_ptr);
+                       screen_dump = make_screen_dump(creature_ptr, process_autopick_file_command);
 #endif
 
                        /* Note cause of death */
@@ -567,7 +568,7 @@ int take_hit(player_type *creature_ptr, int damage_type, HIT_POINT damage, concp
 
                        if (get_check_strict(_("画面を保存しますか?", "Dump the screen? "), CHECK_NO_HISTORY))
                        {
-                               do_cmd_save_screen(creature_ptr, handle_stuff);
+                               do_cmd_save_screen(creature_ptr, handle_stuff, process_autopick_file_command);
                        }
 
                        flush();
@@ -664,7 +665,7 @@ int take_hit(player_type *creature_ptr, int damage_type, HIT_POINT damage, concp
                                        flush();
 #ifdef WORLD_SCORE
                                        /* Make screen dump */
-                                       screen_dump = make_screen_dump(creature_ptr);
+                                       screen_dump = make_screen_dump(creature_ptr, process_autopick_file_command);
 #endif
 
                                        /* Wait a key press */
index 758e0ea..76f0c5a 100644 (file)
@@ -262,7 +262,7 @@ static errr make_dump(player_type *creature_ptr, BUF* dumpbuf, void(*update_play
  * @brief スクリーンダンプを作成する/ Make screen dump to buffer
  * @return 作成したスクリーンダンプの参照ポインタ
  */
-concptr make_screen_dump(player_type *creature_ptr)
+concptr make_screen_dump(player_type *creature_ptr, void(*process_autopick_file_command)(char*))
 {
        static concptr html_head[] = {
                "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
@@ -290,7 +290,7 @@ concptr make_screen_dump(player_type *creature_ptr)
                msg_print(NULL);
 
                use_graphics = FALSE;
-               reset_visuals(creature_ptr);
+               reset_visuals(creature_ptr, process_autopick_file_command);
 
                creature_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
                handle_stuff(creature_ptr);
@@ -371,7 +371,7 @@ concptr make_screen_dump(player_type *creature_ptr)
        if (!old_use_graphics) return ret;
 
        use_graphics = TRUE;
-       reset_visuals(creature_ptr);
+       reset_visuals(creature_ptr, process_autopick_file_command);
 
        creature_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
        handle_stuff(creature_ptr);
index 4ab7e15..e83cce8 100644 (file)
@@ -6,5 +6,5 @@ extern concptr screen_dump;
 #include "files.h"
 
 extern errr report_score(player_type *creature_ptr, void(*update_playtime)(void), display_player_pf display_player, map_name_pf map_name);
-extern concptr make_screen_dump(player_type *creature_ptr);
+extern concptr make_screen_dump(player_type *creature_ptr, void(*process_autopick_file_command)(char*));
 #endif