2 * @brief 自動拾いの登録状況を表示する
7 #include "knowledge/knowledge-autopick.h"
8 #include "autopick/autopick-entry.h"
9 #include "autopick/autopick-methods-table.h"
10 #include "autopick/autopick-reader-writer.h"
11 #include "autopick/autopick-util.h"
12 #include "core/asking-player.h"
13 #include "core/show-file.h"
14 #include "io-dump/dump-util.h"
15 #include "system/player-type-definition.h"
16 #include "util/angband-files.h"
19 * @brief 自動拾い設定ファイルをロードするコマンドのメインルーチン /
20 * @param player_ptr プレイヤーへの参照ポインタ
22 void do_cmd_reload_autopick(PlayerType *player_ptr)
24 if (!get_check(_("自動拾い設定ファイルをロードしますか? ", "Reload auto-pick preference file? ")))
27 autopick_load_pref(player_ptr, true);
31 * Check the status of "autopick"
33 void do_cmd_knowledge_autopick(PlayerType *player_ptr)
36 GAME_TEXT file_name[FILE_NAME_SIZE];
37 if (!open_temporary_file(&fff, file_name))
40 if (autopick_list.empty()) {
41 fprintf(fff, _("自動破壊/拾いには何も登録されていません。", "No preference for auto picker/destroyer."));
43 fprintf(fff, _(" 自動拾い/破壊には現在 %d行登録されています。\n\n", " There are %d registered lines for auto picker/destroyer.\n\n"),
44 static_cast<int>(autopick_list.size()));
47 for (auto &item : autopick_list) {
49 byte act = item.action;
50 if (act & DONT_AUTOPICK) {
51 tmp = _("放置", "Leave");
52 } else if (act & DO_AUTODESTROY) {
53 tmp = _("破壊", "Destroy");
54 } else if (act & DO_AUTOPICK) {
55 tmp = _("拾う", "Pickup");
57 tmp = _("確認", "Query");
61 fprintf(fff, "%11s", format("[%s]", tmp));
63 fprintf(fff, "%11s", format("(%s)", tmp));
65 tmp = autopick_line_from_entry(&item);
66 fprintf(fff, " %s", tmp);
73 (void)show_file(player_ptr, true, file_name, _("自動拾い/破壊 設定リスト", "Auto-picker/Destroyer"), 0, 0);