break;
}
- if (isupper(c)) c = tolower(c);
+ if (isupper(c)) c = (char)tolower(c);
buf[i] = c;
}
*/
static cptr pickpref_filename(int filename_mode)
{
-#ifdef JP
- static const char namebase[] = "picktype";
-#else
- static const char namebase[] = "pickpref";
-#endif
+ static const char namebase[] = _("picktype", "pickpref");
switch (filename_mode)
{
if (err == 0 && disp_mes)
{
/* Success */
-#ifdef JP
- msg_format("%sを読み込みました。", buf);
-#else
- msg_format("Loaded '%s'.", buf);
-#endif
+ msg_format(_("%sを読み込みました。", "Loaded '%s'."), buf);
}
/* No file found */
if (err == 0 && disp_mes)
{
/* Success */
-#ifdef JP
- msg_format("%sを読み込みました。", buf);
-#else
- msg_format("Loaded '%s'.", buf);
-#endif
+ msg_format(_("%sを読み込みました。", "Loaded '%s'."), buf);
}
}
if (err && disp_mes)
{
/* Failed */
-#ifdef JP
- msg_print("自動拾い設定ファイルの読み込みに失敗しました。");
-#else
- msg_print("Failed to reload autopick preference.");
-#endif
+ msg_print(_("自動拾い設定ファイルの読み込みに失敗しました。", "Failed to reload autopick preference."));
}
}
/* Now decided to destroy */
- disturb(0,0);
+ disturb(FALSE, FALSE);
/* Artifact? */
if (!can_player_destroy_object(o_ptr))
/* Describe the object (with {terrible/special}) */
object_desc(o_name, o_ptr, 0);
- /* Message */
-#ifdef JP
- msg_format("%sは破壊不能だ。", o_name);
-#else
- msg_format("You cannot auto-destroy %s.", o_name);
-#endif
+ msg_format(_("%sは破壊不能だ。", "You cannot auto-destroy %s."), o_name);
- /* Done */
return;
}
/*
* Auto-destroy marked item
*/
-static void autopick_delayed_alter_aux(int item)
+static void autopick_delayed_alter_aux(INVENTORY_IDX item)
{
object_type *o_ptr;
delete_object_idx(0 - item);
}
- /* Print a message */
-#ifdef JP
- msg_format("%sを自動破壊します。", o_name);
-#else
- msg_format("Auto-destroying %s.", o_name);
-#endif
+ msg_format(_("%sを自動破壊します。", "Auto-destroying %s."), o_name);
}
}
*/
void autopick_delayed_alter(void)
{
- int item;
+ INVENTORY_IDX item;
/*
* Scan inventry in reverse order to prevent
autopick_delayed_alter_aux(item);
/* Scan the pile of objects */
- item = cave[py][px].o_idx;
+ item = cave[p_ptr->y][p_ptr->x].o_idx;
while (item)
{
- int next = o_list[item].next_o_idx;
+ OBJECT_IDX next = o_list[item].next_o_idx;
autopick_delayed_alter_aux(-item);
item = next;
}
* Auto-destroyer works only on inventory or on floor stack only when
* requested.
*/
-void autopick_alter_item(int item, bool destroy)
+void autopick_alter_item(INVENTORY_IDX item, bool destroy)
{
object_type *o_ptr;
int idx;
*/
void autopick_pickup_items(cave_type *c_ptr)
{
- s16b this_o_idx, next_o_idx = 0;
+ 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)
{
int idx;
-
- /* Acquire object */
- object_type *o_ptr = &o_list[this_o_idx];
+ object_type *o_ptr = &o_list[this_o_idx];
/* Acquire next object */
next_o_idx = o_ptr->next_o_idx;
if (idx >= 0 &&
(autopick_list[idx].action & (DO_AUTOPICK | DO_QUERY_AUTOPICK)))
{
- disturb(0,0);
+ disturb(FALSE, FALSE);
if (!inven_carry_okay(o_ptr))
{
char o_name[MAX_NLEN];
- /* Describe the object */
object_desc(o_name, o_ptr, 0);
- /* Message */
-#ifdef JP
- msg_format("ザックには%sを入れる隙間がない。", o_name);
-#else
- msg_format("You have no room for %s.", o_name);
-#endif
+ msg_format(_("ザックには%sを入れる隙間がない。", "You have no room for %s."), o_name);
/* Hack - remember that the item has given a message here. */
o_ptr->marked |= OM_NOMSG;
continue;
}
- /* Describe the object */
object_desc(o_name, o_ptr, 0);
-#ifdef JP
- sprintf(out_val, "%sを拾いますか? ", o_name);
-#else
- sprintf(out_val, "Pick up %s? ", o_name);
-#endif
+ sprintf(out_val, _("%sを拾いますか? ", "Pick up %s? "), o_name);
if (!get_check(out_val))
{
{
/* Close the preference file */
fclose(pref_fff);
-
-#ifdef JP
- msg_format("一時ファイル %s を作成できませんでした。", tmp_file);
-#else
- msg_format("Failed to create temporary file %s.", tmp_file);
-#endif
+ msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), tmp_file);
msg_print(NULL);
return FALSE;
}
if (num)
{
-#ifdef JP
- msg_format("以前のキャラクター用の自動設定(%d行)が残っています。", num);
- strcpy(buf, "古い設定行は削除します。よろしいですか?");
-#else
- msg_format("Auto registered lines (%d lines) for previous character are remaining.", num);
- strcpy(buf, "These lines will be deleted. Are you sure? ");
-#endif
+ msg_format(_("以前のキャラクター用の自動設定(%d行)が残っています。",
+ "Auto registered lines (%d lines) for previous character are remaining."), num);
+ strcpy(buf, _("古い設定行は削除します。よろしいですか?", "These lines will be deleted. Are you sure? "));
/* You can cancel it */
if (!get_check(buf))
okay = FALSE;
autoregister = FALSE;
-#ifdef JP
- msg_print("エディタのカット&ペースト等を使って必要な行を避難してください。");
-#else
- msg_print("Use cut & paste of auto picker editor (_) to keep old prefs.");
-#endif
+ msg_print(_("エディタのカット&ペースト等を使って必要な行を避難してください。",
+ "Use cut & paste of auto picker editor (_) to keep old prefs."));
}
}
cptr what;
byte act = autopick_list[match_autopick].action;
-#ifdef JP
- if (act & DO_AUTOPICK) what = "自動で拾う";
- else if (act & DO_AUTODESTROY) what = "自動破壊する";
- else if (act & DONT_AUTOPICK) what = "放置する";
- else /* if (act & DO_QUERY_AUTOPICK) */ what = "確認して拾う";
-
- msg_format("そのアイテムは既に%sように設定されています。", what);
-#else
- if (act & DO_AUTOPICK) what = "auto-pickup";
- else if (act & DO_AUTODESTROY) what = "auto-destroy";
- else if (act & DONT_AUTOPICK) what = "leave on floor";
- else /* if (act & DO_QUERY_AUTOPICK) */ what = "query auto-pickup";
+ if (act & DO_AUTOPICK) what = _("自動で拾う", "auto-pickup");
+ else if (act & DO_AUTODESTROY) what = _("自動破壊する", "auto-destroy");
+ else if (act & DONT_AUTOPICK) what = _("放置する", "leave on floor");
+ else /* if (act & DO_QUERY_AUTOPICK) */ what = _("確認して拾う", "query auto-pickup");
- msg_format("The object is already registered to %s.", what);
-#endif
-
+ msg_format(_("そのアイテムは既に%sように設定されています。", "The object is already registered to %s."), what);
return FALSE;
}
/* Describe the object (with {terrible/special}) */
object_desc(o_name, o_ptr, 0);
- /* Message */
-#ifdef JP
- msg_format("%sは破壊不能だ。", o_name);
-#else
- msg_format("You cannot auto-destroy %s.", o_name);
-#endif
+ msg_format(_("%sは破壊不能だ。", "You cannot auto-destroy %s."), o_name);
- /* Done */
return FALSE;
}
/* Failure */
if (!pref_fff) {
-#ifdef JP
- msg_format("%s を開くことができませんでした。", pref_file);
-#else
- msg_format("Failed to open %s.", pref_file);
-#endif
+ msg_format(_("%s を開くことができませんでした。", "Failed to open %s."), pref_file);
msg_print(NULL);
/* Failed */
/* Add the header */
fprintf(pref_fff, "%s\n", autoregister_header);
-#ifdef JP
- fprintf(pref_fff, "%s\n", "# *警告!!* 以降の行は自動登録されたものです。");
- fprintf(pref_fff, "%s\n", "# 後で自動的に削除されますので、必要な行は上の方へ移動しておいてください。");
-#else
- fprintf(pref_fff, "%s\n", "# *Waring!* The lines below will be deleated later.");
- fprintf(pref_fff, "%s\n", "# Keep it by cut & paste if you need these lines for future characters.");
-#endif
+ fprintf(pref_fff, "%s\n", _("# *警告!!* 以降の行は自動登録されたものです。",
+ "# *Waring!* The lines below will be deleated later."));
+ fprintf(pref_fff, "%s\n", _("# 後で自動的に削除されますので、必要な行は上の方へ移動しておいてください。",
+ "# Keep it by cut & paste if you need these lines for future characters."));
/* Now auto register is in-use */
p_ptr->autopick_autoregister = TRUE;
static void prepare_default_pickpref(void)
{
const cptr messages[] = {
-#ifdef JP
- "あなたは「自動拾いエディタ」を初めて起動しました。",
- "自動拾いのユーザー設定ファイルがまだ書かれていないので、",
- "基本的な自動拾い設定ファイルをlib/pref/picktype.prfからコピーします。",
- NULL
-#else
- "You have activated the Auto-Picker Editor for the first time.",
- "Since user pref file for autopick is not yet created,",
- "the default setting is loaded from lib/pref/pickpref.prf .",
+ _("あなたは「自動拾いエディタ」を初めて起動しました。", "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 ."),
NULL
-#endif
};
char buf[1024];
/*
* Delete or insert string
*/
-static void toggle_keyword(text_body_type *tb, int flg)
+static void toggle_keyword(text_body_type *tb, BIT_FLAGS flg)
{
int by1, by2, y;
bool add = TRUE;
/*
* Delete or insert string
*/
-static void add_keyword(text_body_type *tb, int flg)
+static void add_keyword(text_body_type *tb, BIT_FLAGS flg)
{
int by1, by2, y;
*/
static object_type *choose_object(cptr q, cptr s)
{
- int item;
+ OBJECT_IDX item;
if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR | USE_EQUIP))) return NULL;
object_type *o_ptr;
cptr q, s;
- /* Get an item */
#ifdef JP
q = "どのアイテムを登録しますか? ";
s = "アイテムを持っていない。";
object_type *o_ptr;
cptr q, s;
- /* Get an item */
#ifdef JP
q = "どのアイテムを検索しますか? ";
s = "アイテムを持っていない。";
char buf[MAX_NLEN+20];
const int len = 80;
-#ifdef JP
- char prompt[] = "検索(^I:持ち物 ^L:破壊された物): ";
-#else
- char prompt[] = "Search key(^I:inven ^L:destroyed): ";
-#endif
+ char prompt[] = _("検索(^I:持ち物 ^L:破壊された物): ", "Search key(^I:inven ^L:destroyed): ");
int col = sizeof(prompt) - 1;
/* Prepare string buffer for edit */
return (back ? -1 : 1);
case KTRL('i'):
- /* Get an item */
return get_object_for_search(o_handle, search_strp);
case KTRL('l'):
/*
* Editor command id's
*/
-#define EC_QUIT 1
-#define EC_SAVEQUIT 2
-#define EC_REVERT 3
-#define EC_HELP 4
-#define EC_RETURN 5
+#define EC_QUIT 1
+#define EC_SAVEQUIT 2
+#define EC_REVERT 3
+#define EC_HELP 4
+#define EC_RETURN 5
#define EC_LEFT 6
#define EC_DOWN 7
#define EC_UP 8
if (menu_data[i].com_id == -1)
{
-#ifdef JP
- strcpy(com_key_str, "▼");
-#else
- strcpy(com_key_str, ">");
-#endif
+ strcpy(com_key_str, _("▼", ">"));
}
else if (menu_data[i].key != -1)
{
/* The menu was shown */
redraw = FALSE;
}
-#ifdef JP
- prt(format("(a-%c) コマンド:", menu_key + 'a' - 1), 0, 0);
-#else
- prt(format("(a-%c) Command:", menu_key + 'a' - 1), 0, 0);
-#endif
+ prt(format(_("(a-%c) コマンド:", "(a-%c) Command:"), menu_key + 'a' - 1), 0, 0);
key = inkey();
if (key == ESCAPE) return 0;
int i;
int by1 = 0, by2 = 0;
- /* Get size */
Term_get_size(&tb->wid, &tb->hgt);
/*
/* Display information */
if (tb->dirty_flags & DIRTY_NOT_FOUND)
{
-#ifdef JP
- str1 = format("パターンが見つかりません: %s", tb->search_str);
-#else
- str1 = format("Pattern not found: %s", tb->search_str);
-#endif
+ str1 = format(_("パターンが見つかりません: %s", "Pattern not found: %s"), tb->search_str);
}
else if (tb->dirty_flags & DIRTY_SKIP_INACTIVE)
{
-#ifdef JP
- str1 = format("無効状態の行をスキップしました。(%sを検索中)", tb->search_str);
-#else
- str1 = format("Some inactive lines are skipped. (Searching %s)", tb->search_str);
-#endif
+ str1 = format(_("無効状態の行をスキップしました。(%sを検索中)",
+ "Some inactive lines are skipped. (Searching %s)"), tb->search_str);
}
else if (tb->dirty_flags & DIRTY_INACTIVE)
{
-#ifdef JP
- str1 = format("無効状態の行だけが見付かりました。(%sを検索中)", tb->search_str);
-#else
- str1 = format("Found only an inactive line. (Searching %s)", tb->search_str);
-#endif
+ str1 = format(_("無効状態の行だけが見付かりました。(%sを検索中)",
+ "Found only an inactive line. (Searching %s)"), tb->search_str);
}
else if (tb->dirty_flags & DIRTY_NO_SEARCH)
{
-#ifdef JP
- str1 = "検索するパターンがありません(^S で検索)。";
-#else
- str1 = "No pattern to search. (Press ^S to search.)";
-#endif
+ str1 = _("検索するパターンがありません(^S で検索)。", "No pattern to search. (Press ^S to search.)");
}
else if (tb->lines_list[tb->cy][0] == '#')
{
-#ifdef JP
- str1 = "この行はコメントです。";
-#else
- str1 = "This line is a comment.";
-#endif
+ str1 = _("この行はコメントです。", "This line is a comment.");
}
else if (tb->lines_list[tb->cy][0] && tb->lines_list[tb->cy][1] == ':')
{
switch(tb->lines_list[tb->cy][0])
{
case '?':
-#ifdef JP
- str1 = "この行は条件分岐式です。";
-#else
- str1 = "This line is a Conditional Expression.";
-#endif
-
+ str1 = _("この行は条件分岐式です。", "This line is a Conditional Expression.");
break;
case 'A':
-#ifdef JP
- str1 = "この行はマクロの実行内容を定義します。";
-#else
- str1 = "This line defines a Macro action.";
-#endif
+ str1 = _("この行はマクロの実行内容を定義します。", "This line defines a Macro action.");
break;
case 'P':
-#ifdef JP
- str1 = "この行はマクロのトリガー・キーを定義します。";
-#else
- str1 = "This line defines a Macro trigger key.";
-#endif
+ str1 = _("この行はマクロのトリガー・キーを定義します。", "This line defines a Macro trigger key.");
break;
case 'C':
-#ifdef JP
- str1 = "この行はキー配置を定義します。";
-#else
- str1 = "This line defines a Keymap.";
-#endif
+ str1 = _("この行はキー配置を定義します。", "This line defines a Keymap.");
break;
}
case '?':
if (tb->states[tb->cy] & LSTAT_BYPASS)
{
-#ifdef JP
- str2 = "現在の式の値は「偽(=0)」です。";
-#else
- str2 = "The expression is 'False'(=0) currently.";
-#endif
+ str2 = _("現在の式の値は「偽(=0)」です。", "The expression is 'False'(=0) currently.");
}
else
{
-#ifdef JP
- str2 = "現在の式の値は「真(=1)」です。";
-#else
- str2 = "The expression is 'True'(=1) currently.";
-#endif
+ str2 = _("現在の式の値は「真(=1)」です。", "The expression is 'True'(=1) currently.");
}
break;
default:
if (tb->states[tb->cy] & LSTAT_AUTOREGISTER)
{
-#ifdef JP
- str2 = "この行は後で削除されます。";
-#else
- str2 = "This line will be delete later.";
-#endif
+ str2 = _("この行は後で削除されます。", "This line will be delete later.");
}
else if (tb->states[tb->cy] & LSTAT_BYPASS)
{
-#ifdef JP
- str2 = "この行は現在は無効な状態です。";
-#else
- str2 = "This line is bypassed currently.";
-#endif
+ str2 = _("この行は現在は無効な状態です。", "This line is bypassed currently.");
}
break;
}
if (tb->states[tb->cy] & LSTAT_AUTOREGISTER)
{
-#ifdef JP
- strcat(buf, "この行は後で削除されます。");
-#else
- strcat(buf, " This line will be delete later.");
-#endif
+ strcat(buf, _("この行は後で削除されます。", " This line will be delete later."));
}
if (tb->states[tb->cy] & LSTAT_BYPASS)
{
-#ifdef JP
- strcat(buf, "この行は現在は無効な状態です。");
-#else
- strcat(buf, " This line is bypassed currently.");
-#endif
+ strcat(buf, _("この行は現在は無効な状態です。", " This line is bypassed currently."));
}
roff_to_buf(buf, 81, temp, sizeof(temp));
while (i)
{
/* Save the key */
- buf[n++] = i;
+ buf[n++] = (char)i;
/* Do not process macros */
inkey_base = TRUE;
/* Terminate */
buf[n] = '\0';
- /* Flush */
flush();
/* Convert the trigger */
{
char tmp[1024];
char buf[2];
- int mode;
+ BIT_FLAGS mode;
cptr act;
/* Roguelike */
mode = KEYMAP_MODE_ORIG;
}
- /* Flush */
flush();
/* Get a key */
buf[0] = inkey();
buf[1] = '\0';
- /* Flush */
flush();
/* Convert the trigger */
case EC_QUIT:
if (tb->changed)
{
-#ifdef JP
- if (!get_check("全ての変更を破棄してから終了します。よろしいですか? ")) break;
-#else
- if (!get_check("Discard all changes and quit. Are you sure? ")) break;
-#endif
+ if (!get_check(_("全ての変更を破棄してから終了します。よろしいですか? ",
+ "Discard all changes and quit. Are you sure? "))) break;
}
return QUIT_WITHOUT_SAVE;
case EC_REVERT:
/* Revert to original */
-#ifdef JP
- if (!get_check("全ての変更を破棄して元の状態に戻します。よろしいですか? ")) break;
-#else
- if (!get_check("Discard all changes and revert to original file. Are you sure? ")) break;
-#endif
+ if (!get_check(_("全ての変更を破棄して元の状態に戻します。よろしいですか? ",
+ "Discard all changes and revert to original file. Are you sure? "))) break;
free_text_lines(tb->lines_list);
tb->lines_list = read_pickpref_text_lines(&tb->filename_mode);
case EC_HELP:
/* Peruse the main help file */
-#ifdef JP
- (void)show_file(TRUE, "jeditor.txt", NULL, 0, 0);
-#else
- (void)show_file(TRUE, "editor.txt", NULL, 0, 0);
-#endif
+ (void)show_file(TRUE, _("jeditor.txt", "editor.txt"), NULL, 0, 0);
/* Redraw all */
tb->dirty_flags |= DIRTY_SCREEN;
Term_erase(0, tb->cy - tb->upper + 1, tb->wid);
/* Prompt */
-#ifdef JP
- Term_putstr(0, tb->cy - tb->upper + 1, tb->wid - 1, TERM_YELLOW, "P:<トリガーキー>: ");
-#else
- Term_putstr(0, tb->cy - tb->upper + 1, tb->wid - 1, TERM_YELLOW, "P:<Trigger key>: ");
-#endif
+ Term_putstr(0, tb->cy - tb->upper + 1, tb->wid - 1, TERM_YELLOW, _("P:<トリガーキー>: ", "P:<Trigger key>: "));
if (insert_macro_line(tb))
{
/* Prepare to input action */
Term_erase(0, tb->cy - tb->upper + 1, tb->wid);
/* Prompt */
-#ifdef JP
- Term_putstr(0, tb->cy - tb->upper + 1, tb->wid - 1, TERM_YELLOW, format("C:%d:<コマンドキー>: ", (rogue_like_commands ? KEYMAP_MODE_ROGUE : KEYMAP_MODE_ORIG)));
-#else
- Term_putstr(0, tb->cy - tb->upper + 1, tb->wid - 1, TERM_YELLOW, format("C:%d:<Keypress>: ", (rogue_like_commands ? KEYMAP_MODE_ROGUE : KEYMAP_MODE_ORIG)));
-#endif
+ Term_putstr(0, tb->cy - tb->upper + 1, tb->wid - 1, TERM_YELLOW,
+ format(_("C:%d:<コマンドキー>: ", "C:%d:<Keypress>: "), (rogue_like_commands ? KEYMAP_MODE_ROGUE : KEYMAP_MODE_ORIG)));
if (insert_keymap_line(tb))
{
next = inkey();
if (j+2 < MAX_LINELEN)
{
- buf[j++] = key;
- buf[j++] = next;
+ buf[j++] = (char)key;
+ buf[j++] = (char)next;
tb->cx += 2;
}
else
#endif
{
if (j+1 < MAX_LINELEN)
- buf[j++] = key;
+ buf[j++] = (char)key;
tb->cx++;
}
draw_text_editor(tb);
/* Display header line */
-#ifdef JP
- prt("(^Q:終了 ^W:セーブして終了, ESC:メニュー, その他:入力)", 0, 0);
-#else
- prt("(^Q:Quit, ^W:Save&Quit, ESC:Menu, Other:Input text)", 0, 0);
-#endif
+ prt(_("(^Q:終了 ^W:セーブして終了, ESC:メニュー, その他:入力)",
+ "(^Q:Quit, ^W:Save&Quit, ESC:Menu, Other:Input text)"), 0, 0);
if (!tb->mark)
{
/* Display current position */
/* Other commands */
else
{
- com_id = get_com_id(key);
+ com_id = get_com_id((char)key);
}
if (com_id) quit = do_editor_command(tb, com_id);
process_autopick_file(buf);
/* HACK -- reset start_time so that playtime is not increase while edit */
- start_time = time(NULL);
+ start_time = (u32b)time(NULL);
/* Save cursor location */
cx_save = tb->cx;