*/
#include "angband.h"
+#include "util.h"
+#include "term.h"
+#include "autopick.h"
+#include "core.h"
+
+#include "mind.h"
+
#include "store.h"
+#include "player-status.h"
+#include "player-move.h"
+#include "player-class.h"
+#include "player-race.h"
+#include "player-inventory.h"
+#include "objectkind.h"
+#include "object-ego.h"
+#include "object-flavor.h"
+#include "object-hook.h"
+
+#include "files.h"
+#include "floor.h"
+#include "world.h"
+#include "monster.h"
+#include "monsterrace.h"
+#include "view-mainwindow.h"
#define MAX_LINELEN 1024
static GAME_TEXT KEY_ARTIFACT[] = "artifact";
static GAME_TEXT KEY_EGO[] = "ego";
static GAME_TEXT KEY_GOOD[] = "good";
-static GAME_TEXT KEY_nameLESS[] = "nameless";
+static GAME_TEXT KEY_NAMELESS[] = "nameless";
static GAME_TEXT KEY_AVERAGE[] = "average";
static GAME_TEXT KEY_WORTHLESS[] = "worthless";
static GAME_TEXT KEY_RARE[] = "rare";
/*
+ * 自動拾い/破壊設定のリストに関する変数 / List for auto-picker/destroyer entries
+ */
+int max_autopick = 0; /*!< 現在登録している自動拾い/破壊設定の数 */
+int max_max_autopick = 0; /*!< 自動拾い/破壊設定の限界数 */
+autopick_type *autopick_list = NULL; /*!< 自動拾い/破壊設定構造体のポインタ配列 */
+
+/*
* A function to create new entry
*/
-static bool autopick_new_entry(autopick_type *entry, cptr str, bool allow_default)
+static bool autopick_new_entry(autopick_type *entry, concptr str, bool allow_default)
{
- cptr insc;
+ concptr insc;
int i;
byte act = 0;
char buf[MAX_LINELEN];
- cptr prev_ptr, ptr, old_ptr;
+ concptr prev_ptr, ptr, old_ptr;
int prev_flg;
if (str[0] && str[1] == ':') switch (str[0])
bool bol_mark = TRUE;
#endif
- char name_str[MAX_NLEN];
+ GAME_TEXT name_str[MAX_NLEN];
/* Initialize name string */
name_str[0] = '\0';
}
/* Wanted monster's corpse */
- if (object_is_shoukinkubi(o_ptr))
+ if (object_is_bounty(o_ptr))
{
REM_FLG(FLG_WORTHLESS);
ADD_FLG(FLG_WANTED);
/*
* Get file name for autopick preference
*/
-static cptr pickpref_filename(int filename_mode)
+static concptr pickpref_filename(int filename_mode)
{
static const char namebase[] = _("picktype", "pickpref");
return format("%s.prf", namebase);
case PT_WITH_PNAME:
- return format("%s-%s.prf", namebase, player_base);
+ return format("%s-%s.prf", namebase, p_ptr->base_name);
default:
return NULL;
*/
void autopick_load_pref(bool disp_mes)
{
- char buf[80];
+ GAME_TEXT buf[80];
errr err;
/* Free old entries */
/*
* Reconstruct preference line from entry
*/
-cptr autopick_line_from_entry(autopick_type *entry)
+concptr autopick_line_from_entry(autopick_type *entry)
{
char buf[MAX_LINELEN];
char *ptr;
/*
* Reconstruct preference line from entry and kill entry
*/
-static cptr autopick_line_from_entry_kill(autopick_type *entry)
+static concptr autopick_line_from_entry_kill(autopick_type *entry)
{
- cptr ptr = autopick_line_from_entry(entry);
+ concptr ptr = autopick_line_from_entry(entry);
/* Free memory for original entry */
autopick_free_entry(entry);
* A function for Auto-picker/destroyer
* Examine whether the object matches to the entry
*/
-static bool is_autopick_aux(object_type *o_ptr, autopick_type *entry, cptr o_name)
+static bool is_autopick_aux(object_type *o_ptr, autopick_type *entry, concptr o_name)
{
int j;
- cptr ptr = entry->name;
+ concptr ptr = entry->name;
/*** Unaware items ***/
if (IS_FLG(FLG_UNAWARE) && object_is_aware(o_ptr))
return FALSE;
/*** Wanted monster's corpse/skeletons ***/
- if (IS_FLG(FLG_WANTED) && !object_is_shoukinkubi(o_ptr))
+ if (IS_FLG(FLG_WANTED) && !object_is_bounty(o_ptr))
return FALSE;
/*** Unique monster's corpse/skeletons/statues ***/
* into an inventory slot.
* But an item can not be absorbed into itself!
*/
- if ((&inventory[j] != o_ptr) &&
- object_similar(&inventory[j], o_ptr))
+ if ((&p_ptr->inventory_list[j] != o_ptr) &&
+ object_similar(&p_ptr->inventory_list[j], o_ptr))
return TRUE;
}
if (leave_wanted)
{
- if (object_is_shoukinkubi(o_ptr)) return FALSE;
+ if (object_is_bounty(o_ptr)) return FALSE;
}
if (leave_corpse)
/* Now decided to destroy */
- disturb(FALSE, FALSE);
+ disturb(p_ptr, FALSE, FALSE);
/* Artifact? */
if (!can_player_destroy_object(o_ptr))
/* Destroy Later */
o_ptr->marked |= OM_AUTODESTROY;
- p_ptr->notice |= PN_AUTODESTROY;
+ p_ptr->update |= PU_AUTODESTROY;
return;
}
{
object_type *o_ptr;
- /* Get the item (in the pack) */
- if (item >= 0) o_ptr = &inventory[item];
-
- /* Get the item (on the floor) */
- else o_ptr = &o_list[0 - item];
+ o_ptr = REF_ITEM(p_ptr, p_ptr->current_floor_ptr, item);
if (o_ptr->k_idx && (o_ptr->marked & OM_AUTODESTROY))
{
autopick_delayed_alter_aux(item);
/* Scan the pile of objects */
- item = cave[p_ptr->y][p_ptr->x].o_idx;
+ item = p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx;
while (item)
{
- OBJECT_IDX next = o_list[item].next_o_idx;
+ OBJECT_IDX next = p_ptr->current_floor_ptr->o_list[item].next_o_idx;
autopick_delayed_alter_aux(-item);
item = next;
}
object_type *o_ptr;
int idx;
- /* Get the item (in the pack) */
- if (item >= 0) o_ptr = &inventory[item];
-
- /* Get the item (on the floor) */
- else o_ptr = &o_list[0 - item];
+ o_ptr = REF_ITEM(p_ptr, p_ptr->current_floor_ptr, item);
/* Get the index in the auto-pick/destroy list */
idx = is_autopick(o_ptr);
/*
* Automatically pickup/destroy items in this grid.
*/
-void autopick_pickup_items(cave_type *c_ptr)
+void autopick_pickup_items(grid_type *g_ptr)
{
OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Scan the pile of objects */
- for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
+ for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
int idx;
- object_type *o_ptr = &o_list[this_o_idx];
-
- /* Acquire next object */
- next_o_idx = o_ptr->next_o_idx;
+ object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[this_o_idx];
+ next_o_idx = o_ptr->next_o_idx;
idx = is_autopick(o_ptr);
if (idx >= 0 &&
(autopick_list[idx].action & (DO_AUTOPICK | DO_QUERY_AUTOPICK)))
{
- disturb(FALSE, FALSE);
+ disturb(p_ptr, FALSE, FALSE);
if (!inven_carry_okay(o_ptr))
{
/* Already registered */
if (match_autopick != -1)
{
- cptr what;
+ concptr what;
byte act = autopick_list[match_autopick].action;
if (act & DO_AUTOPICK) what = _("自動で拾う", "auto-pickup");
byte mark;
object_type *search_o_ptr;
- cptr search_str;
- cptr last_destroyed;
+ concptr search_str;
+ concptr last_destroyed;
chain_str_type *yank;
bool yank_eol;
- cptr *lines_list;
+ concptr *lines_list;
byte states[MAX_LINES];
u16b dirty_flags;
*/
static void describe_autopick(char *buff, autopick_type *entry)
{
- cptr str = entry->name;
+ concptr str = entry->name;
byte act = entry->action;
- cptr insc = entry->insc;
+ concptr insc = entry->insc;
int i;
bool top = FALSE;
#ifdef JP
- cptr before_str[100], body_str;
+ concptr before_str[100], body_str;
int before_n = 0;
body_str = "アイテム";
#else /* JP */
- cptr before_str[20], after_str[20], which_str[20], whose_str[20], body_str;
+ concptr before_str[20], after_str[20], which_str[20], whose_str[20], body_str;
int before_n = 0, after_n = 0, which_n = 0, whose_n = 0;
body_str = "items";
/*** Collecting items ***/
/*** Which can be absorbed into a slot as a bundle ***/
if (IS_FLG(FLG_COLLECTING))
- which_str[which_n++] = "can be absorbed into an existing inventory slot";
+ which_str[which_n++] = "can be absorbed into an existing p_ptr->inventory_list slot";
/*** Unaware items ***/
if (IS_FLG(FLG_UNAWARE))
/*
* Read whole lines of a file to memory
*/
-static cptr *read_text_lines(cptr filename)
+static concptr *read_text_lines(concptr filename)
{
- cptr *lines_list = NULL;
+ concptr *lines_list = NULL;
FILE *fff;
int lines = 0;
char buf[1024];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, filename);
-
- /* Open the file */
- fff = my_fopen(buf, "r");
+ fff = my_fopen(buf, "r");
if (fff)
{
/* Allocate list of pointers */
- C_MAKE(lines_list, MAX_LINES, cptr);
+ C_MAKE(lines_list, MAX_LINES, concptr);
/* Parse it */
while (0 == my_fgets(fff, buf, sizeof(buf)))
*/
static void prepare_default_pickpref(void)
{
- const cptr messages[] = {
+ const concptr messages[] = {
_("あなたは「自動拾いエディタ」を初めて起動しました。", "You have activated the Auto-Picker Editor for the first time."),
_("自動拾いのユーザー設定ファイルがまだ書かれていないので、", "Since user pref file for autopick is not yet created,"),
_("基本的な自動拾い設定ファイルをlib/pref/picktype.prfからコピーします。", "the default setting is loaded from lib/pref/pickpref.prf ."),
FILE *pref_fp;
FILE *user_fp;
int i;
- cptr filename = pickpref_filename(PT_DEFAULT);
+ concptr filename = pickpref_filename(PT_DEFAULT);
/* Display messages */
for (i = 0; messages[i]; i++) msg_print(messages[i]);
* Read an autopick prefence file to memory
* Prepare default if no user file is found
*/
-static cptr *read_pickpref_text_lines(int *filename_mode_p)
+static concptr *read_pickpref_text_lines(int *filename_mode_p)
{
char buf[1024];
- cptr *lines_list;
+ concptr *lines_list;
/* Try a filename with player name */
*filename_mode_p = PT_WITH_PNAME;
if (!lines_list)
{
/* Allocate list of pointers */
- C_MAKE(lines_list, MAX_LINES, cptr);
+ C_MAKE(lines_list, MAX_LINES, concptr);
lines_list[0] = string_make("");
}
return lines_list;
/*
* Write whole lines of memory to a file.
*/
-static bool write_text_lines(cptr filename, cptr *lines_list)
+static bool write_text_lines(concptr filename, concptr *lines_list)
{
FILE *fff;
int lines = 0;
char buf[1024];
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, filename);
-
- /* Open the file */
- fff = my_fopen(buf, "w");
+ fff = my_fopen(buf, "w");
if (fff)
{
for (lines = 0; lines_list[lines]; lines++)
/*
* Free memory of lines_list.
*/
-static void free_text_lines(cptr *lines_list)
+static void free_text_lines(concptr *lines_list)
{
int lines;
string_free(lines_list[lines]);
/* free list of pointers */
- C_KILL(lines_list, MAX_LINES, cptr);
+ C_KILL(lines_list, MAX_LINES, concptr);
}
*/
static void check_expression_line(text_body_type *tb, int y)
{
- cptr s = tb->lines_list[y];
+ concptr s = tb->lines_list[y];
if ((s[0] == '?' && s[1] == ':') ||
(tb->states[y] & LSTAT_BYPASS))
static bool entry_from_choosed_object(autopick_type *entry)
{
object_type *o_ptr;
- cptr q, s;
+ concptr 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);
+ o_ptr = choose_object(p_ptr, NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
if (!o_ptr) return FALSE;
autopick_entry_from_object(entry, o_ptr);
/*
* Choose an item for search
*/
-static byte get_object_for_search(object_type **o_handle, cptr *search_strp)
+static byte get_object_for_search(object_type **o_handle, concptr *search_strp)
{
char buf[MAX_NLEN+20];
object_type *o_ptr;
- cptr q, s;
+ concptr 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);
+ o_ptr = choose_object(p_ptr, NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
if (!o_ptr) return 0;
*o_handle = o_ptr;
/*
* Prepare for search by destroyed object
*/
-static byte get_destroyed_object_for_search(object_type **o_handle, cptr *search_strp)
+static byte get_destroyed_object_for_search(object_type **o_handle, concptr *search_strp)
{
char buf[MAX_NLEN+20];
/*
* Choose an item or string for search
*/
-static byte get_string_for_search(object_type **o_handle, cptr *search_strp)
+static byte get_string_for_search(object_type **o_handle, concptr *search_strp)
{
int pos = 0;
/*
* Search next line matches to the string
*/
-static void search_for_string(text_body_type *tb, cptr search_str, bool forward)
+static void search_for_string(text_body_type *tb, concptr search_str, bool forward)
{
int bypassed_cy = -1;
int bypassed_cx = 0;
while (TRUE)
{
- cptr pos;
+ concptr pos;
/* End of list? */
if (forward)
/* Manu names */
#ifdef JP
-static char MN_QUIT[] = "セーブ無しで終了";
-static char MN_SAVEQUIT[] = "セーブして終了";
-static char MN_REVERT[] = "全ての変更を破棄";
-static char MN_HELP[] = "ヘルプ";
-
-static char MN_MOVE[] = "カーソル移動";
-static char MN_LEFT[] = "左 (←矢印キー)";
-static char MN_DOWN[] = "下 (↓矢印キー)";
-static char MN_UP[] = "上 (↑矢印キー)";
-static char MN_RIGHT[] = "右 (→矢印キー)";
-static char MN_BOL[] = "行の先頭";
-static char MN_EOL[] = "行の終端";
-static char MN_PGUP[] = "上のページ (PageUpキー)";
-static char MN_PGDOWN[] = "下のページ (PageDownキー)";
-static char MN_TOP[] = "1行目へ移動 (Homeキー)";
-static char MN_BOTTOM[] = "最下行へ移動(Endキー)";
-
-static char MN_EDIT[] = "編集";
-static char MN_CUT[] = "カット";
-static char MN_COPY[] = "コピー";
-static char MN_PASTE[] = "ペースト";
-static char MN_BLOCK[] = "選択範囲の指定";
-static char MN_KILL_LINE[] = "行の残りを削除";
-static char MN_DELETE_CHAR[] = "1文字削除";
-static char MN_BACKSPACE[] = "バックスペース";
-static char MN_RETURN[] = "改行";
-
-static char MN_SEARCH[] = "検索";
-static char MN_SEARCH_STR[] = "文字列で検索";
-static char MN_SEARCH_FORW[] = "前方へ再検索";
-static char MN_SEARCH_BACK[] = "後方へ再検索";
-static char MN_SEARCH_OBJ[] = "アイテムを選択して検索";
-static char MN_SEARCH_DESTROYED[] = "自動破壊されたアイテムで検索";
-
-static char MN_INSERT[] = "色々挿入";
-static char MN_INSERT_OBJECT[] = "選択したアイテムの名前を挿入";
-static char MN_INSERT_DESTROYED[] = "自動破壊されたアイテムの名前を挿入";
-static char MN_INSERT_BLOCK[] = "条件分岐ブロックの例を挿入";
-static char MN_INSERT_MACRO[] = "マクロ定義を挿入";
-static char MN_INSERT_KEYMAP[] = "キーマップ定義を挿入";
-
-static char MN_COMMAND_LETTER[] = "拾い/破壊/放置の選択";
-static char MN_CL_AUTOPICK[] = "「 」 (自動拾い)";
-static char MN_CL_DESTROY[] = "「!」 (自動破壊)";
-static char MN_CL_LEAVE[] = "「~」 (放置)";
-static char MN_CL_QUERY[] = "「;」 (確認して拾う)";
-static char MN_CL_NO_DISP[] = "「(」 (マップコマンドで表示しない)";
-
-static char MN_ADJECTIVE_GEN[] = "形容詞(一般)の選択";
-static char MN_RARE[] = "レアな (装備)";
-static char MN_COMMON[] = "ありふれた (装備)";
-
-static char MN_ADJECTIVE_SPECIAL[] = "形容詞(特殊)の選択";
-static char MN_BOOSTED[] = "ダイス目の違う (武器)";
-static char MN_MORE_DICE[] = "ダイス目 # 以上の (武器)";
-static char MN_MORE_BONUS[] = "修正値 # 以上の (指輪等)";
-static char MN_WANTED[] = "賞金首の (死体)";
-static char MN_UNIQUE[] = "ユニーク・モンスターの (死体)";
-static char MN_HUMAN[] = "人間の (死体)";
-static char MN_UNREADABLE[] = "読めない (魔法書)";
-static char MN_REALM1[] = "第一領域の (魔法書)";
-static char MN_REALM2[] = "第二領域の (魔法書)";
-static char MN_FIRST[] = "1冊目の (魔法書)";
-static char MN_SECOND[] = "2冊目の (魔法書)";
-static char MN_THIRD[] = "3冊目の (魔法書)";
-static char MN_FOURTH[] = "4冊目の (魔法書)";
-
-static char MN_NOUN[] = "名詞の選択";
+static GAME_TEXT MN_QUIT[] = "セーブ無しで終了";
+static GAME_TEXT MN_SAVEQUIT[] = "セーブして終了";
+static GAME_TEXT MN_REVERT[] = "全ての変更を破棄";
+static GAME_TEXT MN_HELP[] = "ヘルプ";
+
+static GAME_TEXT MN_MOVE[] = "カーソル移動";
+static GAME_TEXT MN_LEFT[] = "左 (←矢印キー)";
+static GAME_TEXT MN_DOWN[] = "下 (↓矢印キー)";
+static GAME_TEXT MN_UP[] = "上 (↑矢印キー)";
+static GAME_TEXT MN_RIGHT[] = "右 (→矢印キー)";
+static GAME_TEXT MN_BOL[] = "行の先頭";
+static GAME_TEXT MN_EOL[] = "行の終端";
+static GAME_TEXT MN_PGUP[] = "上のページ (PageUpキー)";
+static GAME_TEXT MN_PGDOWN[] = "下のページ (PageDownキー)";
+static GAME_TEXT MN_TOP[] = "1行目へ移動 (Homeキー)";
+static GAME_TEXT MN_BOTTOM[] = "最下行へ移動(Endキー)";
+
+static GAME_TEXT MN_EDIT[] = "編集";
+static GAME_TEXT MN_CUT[] = "カット";
+static GAME_TEXT MN_COPY[] = "コピー";
+static GAME_TEXT MN_PASTE[] = "ペースト";
+static GAME_TEXT MN_BLOCK[] = "選択範囲の指定";
+static GAME_TEXT MN_KILL_LINE[] = "行の残りを削除";
+static GAME_TEXT MN_DELETE_CHAR[] = "1文字削除";
+static GAME_TEXT MN_BACKSPACE[] = "バックスペース";
+static GAME_TEXT MN_RETURN[] = "改行";
+
+static GAME_TEXT MN_SEARCH[] = "検索";
+static GAME_TEXT MN_SEARCH_STR[] = "文字列で検索";
+static GAME_TEXT MN_SEARCH_FORW[] = "前方へ再検索";
+static GAME_TEXT MN_SEARCH_BACK[] = "後方へ再検索";
+static GAME_TEXT MN_SEARCH_OBJ[] = "アイテムを選択して検索";
+static GAME_TEXT MN_SEARCH_DESTROYED[] = "自動破壊されたアイテムで検索";
+
+static GAME_TEXT MN_INSERT[] = "色々挿入";
+static GAME_TEXT MN_INSERT_OBJECT[] = "選択したアイテムの名前を挿入";
+static GAME_TEXT MN_INSERT_DESTROYED[] = "自動破壊されたアイテムの名前を挿入";
+static GAME_TEXT MN_INSERT_BLOCK[] = "条件分岐ブロックの例を挿入";
+static GAME_TEXT MN_INSERT_MACRO[] = "マクロ定義を挿入";
+static GAME_TEXT MN_INSERT_KEYMAP[] = "キーマップ定義を挿入";
+
+static GAME_TEXT MN_COMMAND_LETTER[] = "拾い/破壊/放置の選択";
+static GAME_TEXT MN_CL_AUTOPICK[] = "「 」 (自動拾い)";
+static GAME_TEXT MN_CL_DESTROY[] = "「!」 (自動破壊)";
+static GAME_TEXT MN_CL_LEAVE[] = "「~」 (放置)";
+static GAME_TEXT MN_CL_QUERY[] = "「;」 (確認して拾う)";
+static GAME_TEXT MN_CL_NO_DISP[] = "「(」 (マップコマンドで表示しない)";
+
+static GAME_TEXT MN_ADJECTIVE_GEN[] = "形容詞(一般)の選択";
+static GAME_TEXT MN_RARE[] = "レアな (装備)";
+static GAME_TEXT MN_COMMON[] = "ありふれた (装備)";
+
+static GAME_TEXT MN_ADJECTIVE_SPECIAL[] = "形容詞(特殊)の選択";
+static GAME_TEXT MN_BOOSTED[] = "ダイス目の違う (武器)";
+static GAME_TEXT MN_MORE_DICE[] = "ダイス目 # 以上の (武器)";
+static GAME_TEXT MN_MORE_BONUS[] = "修正値 # 以上の (指輪等)";
+static GAME_TEXT MN_WANTED[] = "賞金首の (死体)";
+static GAME_TEXT MN_UNIQUE[] = "ユニーク・モンスターの (死体)";
+static GAME_TEXT MN_HUMAN[] = "人間の (死体)";
+static GAME_TEXT MN_UNREADABLE[] = "読めない (魔法書)";
+static GAME_TEXT MN_REALM1[] = "第一領域の (魔法書)";
+static GAME_TEXT MN_REALM2[] = "第二領域の (魔法書)";
+static GAME_TEXT MN_FIRST[] = "1冊目の (魔法書)";
+static GAME_TEXT MN_SECOND[] = "2冊目の (魔法書)";
+static GAME_TEXT MN_THIRD[] = "3冊目の (魔法書)";
+static GAME_TEXT MN_FOURTH[] = "4冊目の (魔法書)";
+
+static GAME_TEXT MN_NOUN[] = "名詞の選択";
#else
-static char MN_QUIT[] = "Quit without save";
-static char MN_SAVEQUIT[] = "Save & Quit";
-static char MN_REVERT[] = "Revert all changes";
-static char MN_HELP[] = "Help";
-
-static char MN_MOVE[] = "Move cursor";
-static char MN_LEFT[] = "Left (Left Arrow key)";
-static char MN_DOWN[] = "Down (Down Arrow key)";
-static char MN_UP[] = "Up (Up Arrow key)";
-static char MN_RIGHT[] = "Right (Right Arrow key)";
-static char MN_BOL[] = "Beggining of line";
-static char MN_EOL[] = "End of line";
-static char MN_PGUP[] = "Page up (PageUp key)";
-static char MN_PGDOWN[] = "Page down(PageDown key)";
-static char MN_TOP[] = "Top (Home key)";
-static char MN_BOTTOM[] = "Bottom (End key)";
-
-static char MN_EDIT[] = "Edit";
-static char MN_CUT[] = "Cut";
-static char MN_COPY[] = "Copy";
-static char MN_PASTE[] = "Paste";
-static char MN_BLOCK[] = "Select block";
-static char MN_KILL_LINE[] = "Kill rest of line";
-static char MN_DELETE_CHAR[] = "Delete character";
-static char MN_BACKSPACE[] = "Backspace";
-static char MN_RETURN[] = "Return";
-
-static char MN_SEARCH[] = "Search";
-static char MN_SEARCH_STR[] = "Search by string";
-static char MN_SEARCH_FORW[] = "Search forward";
-static char MN_SEARCH_BACK[] = "Search backward";
-static char MN_SEARCH_OBJ[] = "Search by inventory object";
-static char MN_SEARCH_DESTROYED[] = "Search by destroyed object";
-
-static char MN_INSERT[] = "Insert...";
-static char MN_INSERT_OBJECT[] = "Insert name of choosen object";
-static char MN_INSERT_DESTROYED[] = "Insert name of destroyed object";
-static char MN_INSERT_BLOCK[] = "Insert conditional block";
-static char MN_INSERT_MACRO[] = "Insert a macro definition";
-static char MN_INSERT_KEYMAP[] = "Insert a keymap definition";
-
-static char MN_COMMAND_LETTER[] = "Command letter";
-static char MN_CL_AUTOPICK[] = "' ' (Auto pick)";
-static char MN_CL_DESTROY[] = "'!' (Auto destroy)";
-static char MN_CL_LEAVE[] = "'~' (Leave it on the floor)";
-static char MN_CL_QUERY[] = "';' (Query to pick up)";
-static char MN_CL_NO_DISP[] = "'(' (No display on the large map)";
-
-static char MN_ADJECTIVE_GEN[] = "Adjective (general)";
-static char MN_RARE[] = "rare (equipments)";
-static char MN_COMMON[] = "common (equipments)";
-
-static char MN_ADJECTIVE_SPECIAL[] = "Adjective (special)";
-static char MN_BOOSTED[] = "dice boosted (weapons)";
-static char MN_MORE_DICE[] = "more than # dice (weapons)";
-static char MN_MORE_BONUS[] = "more bonus than # (rings etc.)";
-static char MN_WANTED[] = "wanted (corpse)";
-static char MN_UNIQUE[] = "unique (corpse)";
-static char MN_HUMAN[] = "human (corpse)";
-static char MN_UNREADABLE[] = "unreadable (spellbooks)";
-static char MN_REALM1[] = "realm1 (spellbooks)";
-static char MN_REALM2[] = "realm2 (spellbooks)";
-static char MN_FIRST[] = "first (spellbooks)";
-static char MN_SECOND[] = "second (spellbooks)";
-static char MN_THIRD[] = "third (spellbooks)";
-static char MN_FOURTH[] = "fourth (spellbooks)";
-
-static char MN_NOUN[] = "Keywords (noun)";
+static GAME_TEXT MN_QUIT[] = "Quit without save";
+static GAME_TEXT MN_SAVEQUIT[] = "Save & Quit";
+static GAME_TEXT MN_REVERT[] = "Revert all changes";
+static GAME_TEXT MN_HELP[] = "Help";
+
+static GAME_TEXT MN_MOVE[] = "Move cursor";
+static GAME_TEXT MN_LEFT[] = "Left (Left Arrow key)";
+static GAME_TEXT MN_DOWN[] = "Down (Down Arrow key)";
+static GAME_TEXT MN_UP[] = "Up (Up Arrow key)";
+static GAME_TEXT MN_RIGHT[] = "Right (Right Arrow key)";
+static GAME_TEXT MN_BOL[] = "Beggining of line";
+static GAME_TEXT MN_EOL[] = "End of line";
+static GAME_TEXT MN_PGUP[] = "Page up (PageUp key)";
+static GAME_TEXT MN_PGDOWN[] = "Page down(PageDown key)";
+static GAME_TEXT MN_TOP[] = "Top (Home key)";
+static GAME_TEXT MN_BOTTOM[] = "Bottom (End key)";
+
+static GAME_TEXT MN_EDIT[] = "Edit";
+static GAME_TEXT MN_CUT[] = "Cut";
+static GAME_TEXT MN_COPY[] = "Copy";
+static GAME_TEXT MN_PASTE[] = "Paste";
+static GAME_TEXT MN_BLOCK[] = "Select block";
+static GAME_TEXT MN_KILL_LINE[] = "Kill rest of line";
+static GAME_TEXT MN_DELETE_CHAR[] = "Delete character";
+static GAME_TEXT MN_BACKSPACE[] = "Backspace";
+static GAME_TEXT MN_RETURN[] = "Return";
+
+static GAME_TEXT MN_SEARCH[] = "Search";
+static GAME_TEXT MN_SEARCH_STR[] = "Search by string";
+static GAME_TEXT MN_SEARCH_FORW[] = "Search forward";
+static GAME_TEXT MN_SEARCH_BACK[] = "Search backward";
+static GAME_TEXT MN_SEARCH_OBJ[] = "Search by p_ptr->inventory_list object";
+static GAME_TEXT MN_SEARCH_DESTROYED[] = "Search by destroyed object";
+
+static GAME_TEXT MN_INSERT[] = "Insert...";
+static GAME_TEXT MN_INSERT_OBJECT[] = "Insert name of choosen object";
+static GAME_TEXT MN_INSERT_DESTROYED[] = "Insert name of destroyed object";
+static GAME_TEXT MN_INSERT_BLOCK[] = "Insert conditional block";
+static GAME_TEXT MN_INSERT_MACRO[] = "Insert a macro definition";
+static GAME_TEXT MN_INSERT_KEYMAP[] = "Insert a keymap definition";
+
+static GAME_TEXT MN_COMMAND_LETTER[] = "Command letter";
+static GAME_TEXT MN_CL_AUTOPICK[] = "' ' (Auto pick)";
+static GAME_TEXT MN_CL_DESTROY[] = "'!' (Auto destroy)";
+static GAME_TEXT MN_CL_LEAVE[] = "'~' (Leave it on the floor)";
+static GAME_TEXT MN_CL_QUERY[] = "';' (Query to pick up)";
+static GAME_TEXT MN_CL_NO_DISP[] = "'(' (No display on the large map)";
+
+static GAME_TEXT MN_ADJECTIVE_GEN[] = "Adjective (general)";
+static GAME_TEXT MN_RARE[] = "rare (equipments)";
+static GAME_TEXT MN_COMMON[] = "common (equipments)";
+
+static GAME_TEXT MN_ADJECTIVE_SPECIAL[] = "Adjective (special)";
+static GAME_TEXT MN_BOOSTED[] = "dice boosted (weapons)";
+static GAME_TEXT MN_MORE_DICE[] = "more than # dice (weapons)";
+static GAME_TEXT MN_MORE_BONUS[] = "more bonus than # (rings etc.)";
+static GAME_TEXT MN_WANTED[] = "wanted (corpse)";
+static GAME_TEXT MN_UNIQUE[] = "unique (corpse)";
+static GAME_TEXT MN_HUMAN[] = "human (corpse)";
+static GAME_TEXT MN_UNREADABLE[] = "unreadable (spellbooks)";
+static GAME_TEXT MN_REALM1[] = "realm1 (spellbooks)";
+static GAME_TEXT MN_REALM2[] = "realm2 (spellbooks)";
+static GAME_TEXT MN_FIRST[] = "first (spellbooks)";
+static GAME_TEXT MN_SECOND[] = "second (spellbooks)";
+static GAME_TEXT MN_THIRD[] = "third (spellbooks)";
+static GAME_TEXT MN_FOURTH[] = "fourth (spellbooks)";
+
+static GAME_TEXT MN_NOUN[] = "Keywords (noun)";
#endif
typedef struct {
- cptr name;
+ concptr name;
int level;
int key;
int com_id;
for (i = start; menu_data[i].level >= level; i++)
{
char com_key_str[3];
- cptr str;
+ concptr str;
/* Ignore lower level sub menus */
if (menu_data[i].level > level) continue;
}
-static chain_str_type *new_chain_str(cptr str)
+static chain_str_type *new_chain_str(concptr str)
{
chain_str_type *chain;
}
-static void add_str_to_yank(text_body_type *tb, cptr str)
+static void add_str_to_yank(text_body_type *tb, concptr str)
{
chain_str_type *chain;
for (y = 0; tb->lines_list[y]; y++)
{
char f;
- cptr v;
- cptr s = tb->lines_list[y];
+ concptr v;
+ concptr s = tb->lines_list[y];
char *ss, *s_keep;
int s_len;
{
int j;
int leftcol = 0;
- cptr msg;
+ concptr msg;
byte color;
int y = tb->upper+i;
if (tb->old_cy != tb->cy || (tb->dirty_flags & (DIRTY_ALL | DIRTY_NOT_FOUND | DIRTY_NO_SEARCH)) || tb->dirty_line == tb->cy)
{
autopick_type an_entry, *entry = &an_entry;
- cptr str1 = NULL, str2 = NULL;
+ concptr str1 = NULL, str2 = NULL;
/* Clear information line */
{
char buf[MAX_LINELEN];
char temp[MAX_LINELEN];
- cptr t;
+ concptr t;
describe_autopick(buf, entry);
static void kill_line_segment(text_body_type *tb, int y, int x0, int x1, bool whole)
{
char buf[MAX_LINELEN];
- cptr s = tb->lines_list[y];
+ concptr s = tb->lines_list[y];
char *d = buf;
int x;
char tmp[1024];
char buf[2];
BIT_FLAGS mode;
- cptr act;
+ concptr act;
/* Roguelike */
if (rogue_like_commands)
/* Paste text */
while (chain)
{
- cptr yank_str = chain->s;
+ concptr yank_str = chain->s;
char buf[MAX_LINELEN];
int i;
/*
* In-game editor of Object Auto-picker/Destoryer
+ * @param player_ptr プレーヤーへの参照ポインタ
*/
-void do_cmd_edit_autopick(void)
+void do_cmd_edit_autopick(player_type *player_ptr)
{
static int cx_save = 0;
static int cy_save = 0;
tb->dirty_line = -1;
tb->filename_mode = PT_DEFAULT;
- if (turn < old_autosave_turn)
+ if (current_world_ptr->game_turn < old_autosave_turn)
{
- while (old_autosave_turn > turn) old_autosave_turn -= TURNS_PER_TICK * TOWN_DAWN;
+ while (old_autosave_turn > current_world_ptr->game_turn) old_autosave_turn -= TURNS_PER_TICK * TOWN_DAWN;
}
/* Autosave */
- if (turn > old_autosave_turn + 100L)
+ if (current_world_ptr->game_turn > old_autosave_turn + 100L)
{
- do_cmd_save_game(TRUE);
- old_autosave_turn = turn;
+ do_cmd_save_game(player_ptr, TRUE);
+ old_autosave_turn = current_world_ptr->game_turn;
}
- /* HACK -- Reset start_time to stop counting playtime while edit */
+ /* HACK -- Reset current_world_ptr->start_time to stop counting current_world_ptr->play_time while edit */
update_playtime();
/* Free old entries */
/* Reload autopick pref */
process_autopick_file(buf);
- /* HACK -- reset start_time so that playtime is not increase while edit */
- start_time = (u32b)time(NULL);
+ /* HACK -- reset current_world_ptr->start_time so that current_world_ptr->play_time is not increase while edit */
+ current_world_ptr->start_time = (u32b)time(NULL);
/* Save cursor location */
cx_save = tb->cx;