#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"
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);
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);
* @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;
#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)
#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)
* @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;
}
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--;
* 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;
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 ***/
* 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];
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);
/* 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);
#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" // 暫定。後で消す.
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;
/*
* 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];
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();
}
#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);
* 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];
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)
#pragma once
-void do_cmd_macros(player_type *creature_ptr);
+void do_cmd_macros(player_type *creature_ptr, void(*process_autopick_file_command)(char*));
* @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;
* @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;
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)
{
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);
}
#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);
/*
* 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];
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;
}
}
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;
#pragma once
-void do_cmd_visuals(player_type *creature_ptr);
+void do_cmd_visuals(player_type *creature_ptr, void(*process_autopick_file_command)(char*));
#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"
}
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;
}
}
case ')':
{
- do_cmd_save_screen(creature_ptr, handle_stuff);
+ do_cmd_save_screen(creature_ptr, handle_stuff, process_autopick_file_command);
break;
}
case ']':
{
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);
#ifdef CHUUKEI
if (chuukei_client)
{
- reset_visuals();
+ reset_visuals(player_ptr, process_autopick_file_command);
browse_chuukei();
return;
}
if (browsing_movie)
{
- reset_visuals(player_ptr);
+ reset_visuals(player_ptr, process_autopick_file_command);
browse_movie();
return;
}
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;
}
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)
{
* 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];
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]"));
}
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);
* @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");
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;
}
if (preftype != PREF_TYPE_AUTOPICK)
break;
- process_autopick_file_command(buf);
+ (*process_autopick_file_command)(buf);
err = 0;
}
}
* 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;
* @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;
}
* @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];
/* 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;
}
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);
#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"
}
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++)
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] == '-') {
#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"
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;
}
}
case ')':
{
- do_cmd_save_screen(client_ptr, handle_stuff);
+ do_cmd_save_screen(client_ptr, handle_stuff, process_autopick_file_command);
break;
}
default:
#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"
#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
}
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);
*\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++)
{
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);
}
#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"
#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 */
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();
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 */
* @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",
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);
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);
#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