X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fcmd4.c;h=16e0464f5e22d663bf9bea5276abe1166643d89b;hb=68fbe51bccdceba8a1713b1824a00cfc37726111;hp=361036c77c924b4af891a6df2d628af44bd52a29;hpb=7fcb3df3f64f2ac3eb493e6f0ba5ae36c84fdf32;p=hengband%2Fhengband.git diff --git a/src/cmd4.c b/src/cmd4.c index 361036c77..16e0464f5 100644 --- a/src/cmd4.c +++ b/src/cmd4.c @@ -1,23 +1,18 @@ -/* File: cmd4.c */ - -/* +/*! + * @file cmd4.c + * @brief ãã¬ã¤ã¤ã¼ã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ã«é¢ããã³ãã³ãã®å®è£ / Interface commands + * @date 2014/01/02 + * @author + *
* Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke - * * This software may be copied and distributed for educational, research, * and not for profit purposes provided that this copyright and statement * are included in all such copies. Other copyrights may also apply. - */ - -/* Purpose: Interface commands */ - -#include "angband.h" - - - -/* + *+ * @details + *
* A set of functions to maintain automatic dumps of various kinds. * -Mogami- - * * remove_auto_dump(orig_file, mark) * Remove the old automatic dump of type "mark". * auto_dump_printf(fmt, ...) @@ -26,24 +21,29 @@ * Open a file, remove old dump, and add new header. * close_auto_dump(void) * Add a footer, and close the file. - * * The dump commands of original Angband simply add new lines to * existing files; these files will become bigger and bigger unless * an user deletes some or all of these files by hand at some * point. - * * These three functions automatically delete old dumped lines * before adding new ones. Since there are various kinds of automatic * dumps in a single file, we add a header and a footer with a type * name for every automatic dump, and kill old lines only when the * lines have the correct type of header and footer. - * * We need to be quite paranoid about correctness; the user might * (mistakenly) edit the file by hand, and see all their work come * to nothing on the next auto dump otherwise. The current code only * detects changes by noting inconsistencies between the actual number * of lines and the number written in the footer. Note that this will * not catch single-line edits. + *+ */ + +#include "angband.h" + + + +/* */ /* @@ -59,8 +59,11 @@ static FILE *auto_dump_stream; static cptr auto_dump_mark; static int auto_dump_line_num; -/* + +/*! + * @brief prfåºåå 容ãæ¶å»ãã / * Remove old lines automatically generated before. + * @param orig_file æ¶å»ãè¡ããã¡ã¤ã«å */ static void remove_auto_dump(cptr orig_file) { @@ -93,11 +96,7 @@ static void remove_auto_dump(cptr orig_file) if (!tmp_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; } @@ -223,8 +222,10 @@ static void remove_auto_dump(cptr orig_file) } -/* +/*! + * @brief prfãã¡ã¤ã«ã®ãã©ã¼ãããã«å¾ã£ãå 容ãåºåãã / * Dump a formatted line, using "vstrnfmt()". + * @param fmt åºåå 容 */ static void auto_dump_printf(cptr fmt, ...) { @@ -253,8 +254,12 @@ static void auto_dump_printf(cptr fmt, ...) } -/* - * Open file to append auto dump. +/*! + * @brief prfãã¡ã¤ã«ããã¡ã¤ã«ãªã¼ãã³ãã / + * Open file to append auto dump. + * @param buf ãã¡ã¤ã«å + * @param mark åºåããããããã¼ã¯ + * @return ãã¡ã¤ã«ãã¤ã³ã¿ãåå¾ã§ãããTRUEãè¿ã */ static bool open_auto_dump(cptr buf, cptr mark) { @@ -275,11 +280,7 @@ static bool open_auto_dump(cptr buf, cptr mark) /* Failure */ if (!auto_dump_stream) { -#ifdef JP - msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf); -#else - msg_format("Failed to open %s.", buf); -#endif + msg_format(_("%s ãéããã¨ãã§ãã¾ããã§ããã", "Failed to open %s."), buf); msg_print(NULL); /* Failed */ @@ -292,20 +293,18 @@ static bool open_auto_dump(cptr buf, cptr mark) /* Initialize counter */ auto_dump_line_num = 0; -#ifdef JP - auto_dump_printf("# *·Ù¹ð!!* °Ê¹ß¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n"); - auto_dump_printf("# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n"); -#else - auto_dump_printf("# *Warning!* The lines below are an automatic dump.\n"); - auto_dump_printf("# Don't edit them; changes will be deleted and replaced automatically.\n"); -#endif - + auto_dump_printf(_("# *è¦å!!* 以éã®è¡ã¯èªåçæããããã®ã§ãã\n", + "# *Warning!* The lines below are an automatic dump.\n")); + auto_dump_printf(_("# *è¦å!!* å¾ã§èªåçã«åé¤ãããã®ã§ç·¨éããªãã§ãã ããã\n", + "# Don't edit them; changes will be deleted and replaced automatically.\n")); /* Success */ return TRUE; } -/* - * Append foot part and close auto dump. +/*! + * @brief prfãã¡ã¤ã«ããã¡ã¤ã«ã¯ãã¼ãºãã / + * Append foot part and close auto dump. + * @return ãªã */ static void close_auto_dump(void) { @@ -314,14 +313,10 @@ static void close_auto_dump(void) /* Prepare a footer mark string */ sprintf(footer_mark_str, auto_dump_footer, auto_dump_mark); -#ifdef JP - auto_dump_printf("# *·Ù¹ð!!* °Ê¾å¤Î¹Ô¤Ï¼«Æ°À¸À®¤µ¤ì¤¿¤â¤Î¤Ç¤¹¡£\n"); - auto_dump_printf("# *·Ù¹ð!!* ¸å¤Ç¼«Æ°Åª¤Ëºï½ü¤µ¤ì¤ë¤Î¤ÇÊÔ½¸¤·¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£\n"); -#else - auto_dump_printf("# *Warning!* The lines above are an automatic dump.\n"); - auto_dump_printf("# Don't edit them; changes will be deleted and replaced automatically.\n"); -#endif - + auto_dump_printf(_("# *è¦å!!* 以éã®è¡ã¯èªåçæããããã®ã§ãã\n", + "# *Warning!* The lines below are an automatic dump.\n")); + auto_dump_printf(_("# *è¦å!!* å¾ã§èªåçã«åé¤ãããã®ã§ç·¨éããªãã§ãã ããã\n", + "# Don't edit them; changes will be deleted and replaced automatically.\n")); /* End of dump */ fprintf(auto_dump_stream, "%s (%d)\n", footer_mark_str, auto_dump_line_num); @@ -333,8 +328,11 @@ static void close_auto_dump(void) #ifndef JP -/* - * Return suffix of ordinal number + +/*! + * @brief Return suffix of ordinal number + * @param num number + * @return pointer of suffix string. */ cptr get_ordinal_number_suffix(int num) { @@ -354,8 +352,13 @@ cptr get_ordinal_number_suffix(int num) #endif -/* - * Take note to the diary. +/*! + * @brief æ¥è¨ã«ã¡ãã»ã¼ã¸ã追å ãã / + * Take note to the diary. + * @param type æ¥è¨å 容ã®ID + * @param num æ¥è¨å 容ã®IDã«å¿ããæ°å¤ + * @param note æ¥è¨å 容ã®IDã«å¿ããæåååç §ãã¤ã³ã¿ + * @return ã¨ã©ã¼ID */ errr do_cmd_write_nikki(int type, int num, cptr note) { @@ -386,7 +389,7 @@ errr do_cmd_write_nikki(int type, int num, cptr note) p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num; /* Get the quest text */ - init_flags = INIT_ASSIGN; + init_flags = INIT_NAME_ONLY; process_dungeon_file("q_info.txt", 0, 0, 0, 0); @@ -394,12 +397,8 @@ errr do_cmd_write_nikki(int type, int num, cptr note) p_ptr->inside_quest = old_quest; } -#ifdef JP - sprintf(file_name,"playrecord-%s.txt",savefile_base); -#else /* different filne name to avoid mixing */ - sprintf(file_name,"playrec-%s.txt",savefile_base); -#endif + sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base); /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name); @@ -412,11 +411,7 @@ errr do_cmd_write_nikki(int type, int num, cptr note) /* Failure */ if (!fff) { -#ifdef JP - msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¥×¥ì¥¤µÏ¿¤ò°ì»þÄä»ß¤·¤Þ¤¹¡£", buf); -#else - msg_format("Failed to open %s. Play-Record is disabled temporally.", buf); -#endif + msg_format(_("%s ãéããã¨ãã§ãã¾ããã§ããããã¬ã¤è¨é²ãä¸æåæ¢ãã¾ãã", "Failed to open %s. Play-Record is disabled temporally."), buf); msg_format(NULL); disable_nikki=TRUE; return (-1); @@ -427,28 +422,16 @@ errr do_cmd_write_nikki(int type, int num, cptr note) if (write_level) { if (p_ptr->inside_arena) -#ifdef JP - note_level = "¥¢¥ê¡¼¥Ê:"; -#else - note_level = "Arane:"; -#endif + note_level = _("ã¢ãªã¼ã:", "Arane:"); else if (!dun_level) -#ifdef JP - note_level = "ÃϾå:"; -#else - note_level = "Surface:"; -#endif + note_level = _("å°ä¸:", "Surface:"); else if (q_idx && (is_fixed_quest_idx(q_idx) && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT)))) -#ifdef JP - note_level = "¥¯¥¨¥¹¥È:"; -#else - note_level = "Quest:"; -#endif + note_level = _("ã¯ã¨ã¹ã:", "Quest:"); else { #ifdef JP - sprintf(note_level_buf, "%d³¬(%s):", dun_level, d_name+d_info[dungeon_type].name); + sprintf(note_level_buf, "%dé(%s):", dun_level, d_name+d_info[dungeon_type].name); #else sprintf(note_level_buf, "%s L%d:", d_name+d_info[dungeon_type].name, dun_level); #endif @@ -460,11 +443,8 @@ errr do_cmd_write_nikki(int type, int num, cptr note) { case NIKKI_HIGAWARI: { -#ifdef JP - fprintf(fff, "%dÆüÌÜ\n",day); -#else - fprintf(fff, "Day %d\n",day); -#endif + if (day < MAX_DAYS) fprintf(fff, _("%dæ¥ç®\n", "Day %d\n"), day); + else fputs(_("*****æ¥ç®\n", "Day *****\n"), fff); do_level = FALSE; break; } @@ -481,80 +461,58 @@ errr do_cmd_write_nikki(int type, int num, cptr note) } case NIKKI_ART: { -#ifdef JP - fprintf(fff, " %2d:%02d %20s %s¤òȯ¸«¤·¤¿¡£\n", hour, min, note_level, note); -#else - fprintf(fff, " %2d:%02d %20s discovered %s.\n", hour, min, note_level, note); -#endif + fprintf(fff, _(" %2d:%02d %20s %sãçºè¦ããã\n", " %2d:%02d %20s discovered %s.\n"), hour, min, note_level, note); break; } case NIKKI_UNIQUE: { -#ifdef JP - fprintf(fff, " %2d:%02d %20s %s¤òÅݤ·¤¿¡£\n", hour, min, note_level, note); -#else - fprintf(fff, " %2d:%02d %20s defeated %s.\n", hour, min, note_level, note); -#endif + fprintf(fff, _(" %2d:%02d %20s %sãåããã\n", " %2d:%02d %20s defeated %s.\n"), hour, min, note_level, note); break; } case NIKKI_FIX_QUEST_C: { if (quest[num].flags & QUEST_FLAG_SILENT) break; -#ifdef JP - fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, quest[num].name); -#else - fprintf(fff, " %2d:%02d %20s completed quest '%s'.\n", hour, min, note_level, quest[num].name); -#endif + fprintf(fff, _(" %2d:%02d %20s ã¯ã¨ã¹ãã%sããéæããã\n", + " %2d:%02d %20s completed quest '%s'.\n"), hour, min, note_level, quest[num].name); break; } case NIKKI_FIX_QUEST_F: { if (quest[num].flags & QUEST_FLAG_SILENT) break; -#ifdef JP - fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤«¤éÌ¿¤«¤é¤¬¤éƨ¤²µ¢¤Ã¤¿¡£\n", hour, min, note_level, quest[num].name); -#else - fprintf(fff, " %2d:%02d %20s run away from quest '%s'.\n", hour, min, note_level, quest[num].name); -#endif + fprintf(fff, _(" %2d:%02d %20s ã¯ã¨ã¹ãã%sãããå½ããããéã帰ã£ãã\n", + " %2d:%02d %20s run away from quest '%s'.\n"), hour, min, note_level, quest[num].name); break; } case NIKKI_RAND_QUEST_C: { char name[80]; strcpy(name, r_name+r_info[quest[num].r_idx].name); -#ifdef JP - fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤òãÀ®¤·¤¿¡£\n", hour, min, note_level, name); -#else - fprintf(fff, " %2d:%02d %20s completed randome quest '%s'\n", hour, min, note_level, name); -#endif + fprintf(fff, _(" %2d:%02d %20s ã©ã³ãã ã¯ã¨ã¹ã(%s)ãéæããã\n", + " %2d:%02d %20s completed random quest '%s'\n"), hour, min, note_level, name); break; } case NIKKI_RAND_QUEST_F: { char name[80]; strcpy(name, r_name+r_info[quest[num].r_idx].name); -#ifdef JP - fprintf(fff, " %2d:%02d %20s ¥é¥ó¥À¥à¥¯¥¨¥¹¥È(%s)¤«¤éƨ¤²½Ð¤·¤¿¡£\n", hour, min, note_level, name); -#else - fprintf(fff, " %2d:%02d %20s ran away from quest '%s'.\n", hour, min, note_level, name); -#endif + fprintf(fff, _(" %2d:%02d %20s ã©ã³ãã ã¯ã¨ã¹ã(%s)ããéãåºããã\n", + " %2d:%02d %20s ran away from quest '%s'.\n"), hour, min, note_level, name); break; } case NIKKI_MAXDEAPTH: { -#ifdef JP - fprintf(fff, " %2d:%02d %20s %s¤ÎºÇ¿¼³¬%d³¬¤ËÅþ㤷¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, num); -#else - fprintf(fff, " %2d:%02d %20s reached level %d of %s for the first time.\n", hour, min, note_level, num, d_name+d_info[dungeon_type].name); -#endif + fprintf(fff, _(" %2d:%02d %20s %sã®ææ·±é%déã«å°éããã\n", + " %2d:%02d %20s reached level %d of %s for the first time.\n"), hour, min, note_level, + _(d_name+d_info[dungeon_type].name, num), + _(num, d_name+d_info[dungeon_type].name)); break; } case NIKKI_TRUMP: { -#ifdef JP - fprintf(fff, " %2d:%02d %20s %s%s¤ÎºÇ¿¼³¬¤ò%d³¬¤Ë¥»¥Ã¥È¤·¤¿¡£\n", hour, min, note_level, note, d_name + d_info[num].name, max_dlv[num]); -#else - fprintf(fff, " %2d:%02d %20s reset recall level of %s to %d %s.\n", hour, min, note_level, d_name + d_info[num].name, max_dlv[num], note); -#endif + fprintf(fff, _(" %2d:%02d %20s %s%sã®ææ·±éã%déã«ã»ããããã\n", + " %2d:%02d %20s reset recall level of %s to %d %s.\n"), hour, min, note_level, note, + _(d_name + d_info[num].name, max_dlv[num]), + _(max_dlv[num], d_name + d_info[num].name)); break; } case NIKKI_STAIR: @@ -563,173 +521,101 @@ errr do_cmd_write_nikki(int type, int num, cptr note) if (q_idx && (is_fixed_quest_idx(q_idx) && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT)))) { -#ifdef JP - to = "ÃϾå"; -#else - to = "the surface"; -#endif + to = _("å°ä¸", "the surface"); } else { -#ifdef JP - if (!(dun_level+num)) to = "ÃϾå"; - else to = format("%d³¬", dun_level+num); -#else - if (!(dun_level+num)) to = "the surface"; - else to = format("level %d", dun_level+num); -#endif + if (!(dun_level+num)) to = _("å°ä¸", "the surface"); + else to = format(_("%dé", "level %d"), dun_level+num); } - -#ifdef JP - fprintf(fff, " %2d:%02d %20s %s¤Ø%s¡£\n", hour, min, note_level, to, note); -#else - fprintf(fff, " %2d:%02d %20s %s %s.\n", hour, min, note_level, note, to); -#endif + fprintf(fff, _(" %2d:%02d %20s %sã¸%sã\n", " %2d:%02d %20s %s %s.\n"), hour, min, note_level, _(to, note), _(note, to)); break; } case NIKKI_RECALL: { if (!num) -#ifdef JP - fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤Æ%s¤Î%d³¬¤Ø²¼¤ê¤¿¡£\n", hour, min, note_level, d_name+d_info[dungeon_type].name, max_dlv[dungeon_type]); -#else - fprintf(fff, " %2d:%02d %20s recalled to dungeon level %d of %s.\n", hour, min, note_level, max_dlv[dungeon_type], d_name+d_info[dungeon_type].name); -#endif + fprintf(fff, _(" %2d:%02d %20s 帰éã使ã£ã¦%sã®%déã¸ä¸ããã\n", " %2d:%02d %20s recalled to dungeon level %d of %s.\n"), + hour, min, note_level, _(d_name+d_info[dungeon_type].name, max_dlv[dungeon_type]), + _(max_dlv[dungeon_type], d_name+d_info[dungeon_type].name)); else -#ifdef JP - fprintf(fff, " %2d:%02d %20s µ¢´Ô¤ò»È¤Ã¤ÆÃϾå¤Ø¤ÈÌá¤Ã¤¿¡£\n", hour, min, note_level); -#else - fprintf(fff, " %2d:%02d %20s recalled from dungeon to surface.\n", hour, min, note_level); -#endif + fprintf(fff, _(" %2d:%02d %20s 帰éã使ã£ã¦å°ä¸ã¸ã¨æ»ã£ãã\n", " %2d:%02d %20s recalled from dungeon to surface.\n"), hour, min, note_level); break; } case NIKKI_TO_QUEST: { if (quest[num].flags & QUEST_FLAG_SILENT) break; -#ifdef JP - fprintf(fff, " %2d:%02d %20s ¥¯¥¨¥¹¥È¡Ö%s¡×¤Ø¤ÈÆÍÆþ¤·¤¿¡£\n", hour, min, note_level, quest[num].name); -#else - fprintf(fff, " %2d:%02d %20s entered the quest '%s'.\n", hour, min, note_level, quest[num].name); -#endif + fprintf(fff, _(" %2d:%02d %20s ã¯ã¨ã¹ãã%sãã¸ã¨çªå ¥ããã\n", " %2d:%02d %20s entered the quest '%s'.\n"), + hour, min, note_level, quest[num].name); break; } case NIKKI_TELE_LEV: { -#ifdef JP - fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¡¦¥Æ¥ì¥Ý¡¼¥È¤Çæ½Ð¤·¤¿¡£\n", hour, min, note_level); -#else - fprintf(fff, " %2d:%02d %20s Got out using teleport level.\n", hour, min, note_level); -#endif + fprintf(fff, _(" %2d:%02d %20s ã¬ãã«ã»ãã¬ãã¼ãã§è±åºããã\n", " %2d:%02d %20s Got out using teleport level.\n"), + hour, min, note_level); break; } case NIKKI_BUY: { -#ifdef JP - fprintf(fff, " %2d:%02d %20s %s¤ò¹ØÆþ¤·¤¿¡£\n", hour, min, note_level, note); -#else - fprintf(fff, " %2d:%02d %20s bought %s.\n", hour, min, note_level, note); -#endif + fprintf(fff, _(" %2d:%02d %20s %sãè³¼å ¥ããã\n", " %2d:%02d %20s bought %s.\n"), hour, min, note_level, note); break; } case NIKKI_SELL: { -#ifdef JP - fprintf(fff, " %2d:%02d %20s %s¤òÇäµÑ¤·¤¿¡£\n", hour, min, note_level, note); -#else - fprintf(fff, " %2d:%02d %20s sold %s.\n", hour, min, note_level, note); -#endif + fprintf(fff, _(" %2d:%02d %20s %sã売å´ããã\n", " %2d:%02d %20s sold %s.\n"), hour, min, note_level, note); break; } case NIKKI_ARENA: { if (num < 0) { -#ifdef JP - fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï¤Ç¡¢%s¤ÎÁ°¤ËÇÔ¤ìµî¤Ã¤¿¡£\n", hour, min, note_level, -num, note); -#else int n = -num; - fprintf(fff, " %2d:%02d %20s beaten by %s in the %d%s fight.\n", hour, min, note_level, note, n, get_ordinal_number_suffix(n)); -#endif + fprintf(fff, _(" %2d:%02d %20s éæå ´ã®%d%såæ¦ã§ã%sã®åã«æãå»ã£ãã\n", " %2d:%02d %20s beaten by %s in the %d%s fight.\n"), + hour, min, note_level, _(n, note), _("", n), _(note, get_ordinal_number_suffix(n))); break; } -#ifdef JP - fprintf(fff, " %2d:%02d %20s Æ®µ»¾ì¤Î%d²óÀï(%s)¤Ë¾¡Íø¤·¤¿¡£\n", hour, min, note_level, num, note); -#else - fprintf(fff, " %2d:%02d %20s won the %d%s fight (%s).\n", hour, min, note_level, num, get_ordinal_number_suffix(num), note); -#endif + fprintf(fff, _(" %2d:%02d %20s éæå ´ã®%d%såæ¦(%s)ã«åå©ããã\n", " %2d:%02d %20s won the %d%s fight (%s).\n"), + hour, min, note_level, num, _("", get_ordinal_number_suffix(num)), note); + if (num == MAX_ARENA_MONS) { -#ifdef JP - fprintf(fff, " Æ®µ»¾ì¤Î¤¹¤Ù¤Æ¤ÎŨ¤Ë¾¡Íø¤·¡¢¥Á¥ã¥ó¥Ô¥ª¥ó¤È¤Ê¤Ã¤¿¡£\n"); -#else - fprintf(fff, " won all fight to become a Chanpion.\n"); -#endif + fprintf(fff, _(" éæå ´ã®ãã¹ã¦ã®æµã«åå©ãããã£ã³ããªã³ã¨ãªã£ãã\n", + " won all fight to become a Chanpion.\n")); do_level = FALSE; } break; } case NIKKI_HANMEI: { -#ifdef JP - fprintf(fff, " %2d:%02d %20s %s¤ò¼±Ê̤·¤¿¡£\n", hour, min, note_level, note); -#else - fprintf(fff, " %2d:%02d %20s identified %s.\n", hour, min, note_level, note); -#endif + fprintf(fff, _(" %2d:%02d %20s %sãèå¥ããã\n", " %2d:%02d %20s identified %s.\n"), hour, min, note_level, note); break; } case NIKKI_WIZ_TELE: { cptr to; if (!dun_level) -#ifdef JP - to = "ÃϾå"; -#else - to = "the surface"; -#endif + to = _("å°ä¸", "the surface"); else -#ifdef JP - to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name); -#else - to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name); -#endif + to = format(_("%dé(%s)", "level %d of %s"), dun_level, d_name+d_info[dungeon_type].name); -#ifdef JP - fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥¦¥£¥¶¡¼¥É¡¦¥Æ¥ì¥Ý¡¼¥È¤Ç°ÜÆ°¤·¤¿¡£\n", hour, min, note_level, to); -#else - fprintf(fff, " %2d:%02d %20s wizard-teleport to %s.\n", hour, min, note_level, to); -#endif + fprintf(fff, _(" %2d:%02d %20s %sã¸ã¨ã¦ã£ã¶ã¼ãã»ãã¬ãã¼ãã§ç§»åããã\n", + " %2d:%02d %20s wizard-teleport to %s.\n"), hour, min, note_level, to); break; } case NIKKI_PAT_TELE: { cptr to; if (!dun_level) -#ifdef JP - to = "ÃϾå"; -#else - to = "the surface"; -#endif + to = _("å°ä¸", "the surface"); else -#ifdef JP - to = format("%d³¬(%s)", dun_level, d_name+d_info[dungeon_type].name); -#else - to = format("level %d of %s", dun_level, d_name+d_info[dungeon_type].name); -#endif + to = format(_("%dé(%s)", "level %d of %s"), dun_level, d_name+d_info[dungeon_type].name); -#ifdef JP - fprintf(fff, " %2d:%02d %20s %s¤Ø¤È¥Ñ¥¿¡¼¥ó¤ÎÎϤǰÜÆ°¤·¤¿¡£\n", hour, min, note_level, to); -#else - fprintf(fff, " %2d:%02d %20s used Pattern to teleport to %s.\n", hour, min, note_level, to); -#endif + fprintf(fff, _(" %2d:%02d %20s %sã¸ã¨ãã¿ã¼ã³ã®åã§ç§»åããã\n", + " %2d:%02d %20s used Pattern to teleport to %s.\n"), hour, min, note_level, to); break; } case NIKKI_LEVELUP: { -#ifdef JP - fprintf(fff, " %2d:%02d %20s ¥ì¥Ù¥ë¤¬%d¤Ë¾å¤¬¤Ã¤¿¡£\n", hour, min, note_level, num); -#else - fprintf(fff, " %2d:%02d %20s reached player level %d.\n", hour, min, note_level, num); -#endif + fprintf(fff, _(" %2d:%02d %20s ã¬ãã«ã%dã«ä¸ãã£ãã\n", " %2d:%02d %20s reached player level %d.\n"), hour, min, note_level, num); break; } case NIKKI_GAMESTART: @@ -749,61 +635,50 @@ errr do_cmd_write_nikki(int type, int num, cptr note) fprintf(fff, " %2d:%02d %20s ", hour, min, note_level); switch (num) { - case 0: -#ifdef JP - fprintf(fff, "%s¤òι¤Îͧ¤Ë¤¹¤ë¤³¤È¤Ë·è¤á¤¿¡£\n", note); -#else - fprintf(fff, "decided to travel together with %s.\n", note); -#endif + case RECORD_NAMED_PET_NAME: + fprintf(fff, _("%sãæ ã®åã«ãããã¨ã«æ±ºããã\n", "decided to travel together with %s.\n"), note); break; - case 1: -#ifdef JP - fprintf(fff, "%s¤Î̾Á°¤ò¾Ã¤·¤¿¡£\n", note); -#else - fprintf(fff, "unnamed %s.\n", note); -#endif + case RECORD_NAMED_PET_UNNAME: + fprintf(fff, _("%sã®ååãæ¶ããã\n", "unnamed %s.\n"), note); break; - case 2: -#ifdef JP - fprintf(fff, "%s¤ò²òÊü¤·¤¿¡£\n", note); -#else - fprintf(fff, "dismissed %s.\n", note); -#endif + case RECORD_NAMED_PET_DISMISS: + fprintf(fff, _("%sã解æ¾ããã\n", "dismissed %s.\n"), note); break; - case 3: -#ifdef JP - fprintf(fff, "%s¤¬»à¤ó¤Ç¤·¤Þ¤Ã¤¿¡£\n", note); -#else - fprintf(fff, "%s died.\n", note); -#endif + case RECORD_NAMED_PET_DEATH: + fprintf(fff, _("%sãæ»ãã§ãã¾ã£ãã\n", "%s died.\n"), note); break; - case 4: -#ifdef JP - fprintf(fff, "%s¤ò¤ª¤¤¤ÆÊ̤ΥޥåפذÜÆ°¤·¤¿¡£\n", note); -#else - fprintf(fff, "moved to another map leaving %s behind.\n", note); -#endif + case RECORD_NAMED_PET_MOVED: + fprintf(fff, _("%sãããã¦å¥ã®ãããã¸ç§»åããã\n", "moved to another map leaving %s behind.\n"), note); break; - case 5: -#ifdef JP - fprintf(fff, "%s¤È¤Ï¤°¤ì¤Æ¤·¤Þ¤Ã¤¿¡£\n", note); -#else - fprintf(fff, "lost sight of %s.\n", note); -#endif + case RECORD_NAMED_PET_LOST_SIGHT: + fprintf(fff, _("%sã¨ã¯ããã¦ãã¾ã£ãã\n", "lost sight of %s.\n"), note); break; - case 6: -#ifdef JP - fprintf(fff, "%s¤¬*Ç˲õ*¤Ë¤è¤Ã¤Æ¾Ã¤¨µî¤Ã¤¿¡£\n", note); -#else - fprintf(fff, "%s was made disappeared by *destruction*.\n", note); -#endif + case RECORD_NAMED_PET_DESTROY: + fprintf(fff, _("%sã*ç ´å£*ã«ãã£ã¦æ¶ãå»ã£ãã\n", "%s was made disappeared by *destruction*.\n"), note); break; - case 7: -#ifdef JP - fprintf(fff, "%s¤¬´äÀФ˲¡¤·ÄÙ¤µ¤ì¤¿¡£\n", note); -#else - fprintf(fff, "%s was crushed by falling rocks.\n", note); -#endif + case RECORD_NAMED_PET_EARTHQUAKE: + fprintf(fff, _("%sã岩ç³ã«æ¼ãæ½°ãããã\n", "%s was crushed by falling rocks.\n"), note); + break; + case RECORD_NAMED_PET_GENOCIDE: + fprintf(fff, _("%sãæ¹æ®ºã«ãã£ã¦æ¶ãå»ã£ãã\n", "%s was made disappeared by genocide.\n"), note); + break; + case RECORD_NAMED_PET_WIZ_ZAP: + fprintf(fff, _("%sããããã°ã³ãã³ãã«ãã£ã¦æ¶ãå»ã£ãã\n", "%s was removed by debug command.\n"), note); + break; + case RECORD_NAMED_PET_TELE_LEVEL: + fprintf(fff, _("%sããã¬ãã¼ãã»ã¬ãã«ã«ãã£ã¦æ¶ãå»ã£ãã\n", "%s was made disappeared by teleport level.\n"), note); + break; + case RECORD_NAMED_PET_BLAST: + fprintf(fff, _("%sãçç ´ããã\n", "blasted %s.\n"), note); + break; + case RECORD_NAMED_PET_HEAL_LEPER: + fprintf(fff, _("%sã®ç æ°ãæ²»ãæ ããå¤ããã\n", "%s was healed and left.\n"), note); + break; + case RECORD_NAMED_PET_COMPACT: + fprintf(fff, _("%sãã¢ã³ã¹ã¿ã¼æ å ±å§ç¸®ã«ãã£ã¦æ¶ãå»ã£ãã\n", "%s was made disappeared by compacting monsters.\n"), note); + break; + case RECORD_NAMED_PET_LOSE_PARENT: + fprintf(fff, _("%sã®å¬åè ãæ¢ã«ããªãããæ¶ãå»ã£ãã\n", "%s disappeared because there does not exist summoner.\n"), note); break; default: fprintf(fff, "\n"); @@ -825,6 +700,12 @@ errr do_cmd_write_nikki(int type, int num, cptr note) #define MAX_SUBTITLE (sizeof(subtitle)/sizeof(subtitle[0])) +/*! + * @brief æ¥è¨ã®ã¿ã¤ãã«è¡¨è¨ã¨å 容åºå / + * @return ãªã + * @details + * æ¥è¨ã®ã¿ã¤ãã«ã¯æ¬é¢æ°ã® subtitle ãã¼ã«ã«å¤æ°ã§å®ç¾©ããã¦ããã + */ static void do_cmd_disp_nikki(void) { char nikki_title[256]; @@ -832,36 +713,37 @@ static void do_cmd_disp_nikki(void) char buf[1024]; char tmp[80]; #ifdef JP - static const char subtitle[][30] = {"ºÇ¶¯¤ÎÆùÂΤòµá¤á¤Æ", - "¿ÍÀ¸¤½¤ì¤Ï¤Ï¤«¤Ê¤¤", - "ÌÀÆü¤Ë¸þ¤«¤Ã¤Æ", - "꤫¤é¤Ü¤¿¤â¤Á", - "¤¢¤È¤Îº×¤ê", - "¤½¤ì¤Ï¤¤¤¤¹Í¤¨¤À", - "²¿¤È¤Ç¤â¸À¤¨", - "ÅƤˤâ³Ñ¤Ë¤â", - "¥¦¥½¤À¤±¤É", - "¤â¤Ï¤ä¤³¤ì¤Þ¤Ç", - "¤Ê¤ó¤Ç¤³¤¦¤Ê¤ë¤Î", - "¤½¤ì¤Ï̵Íý¤À", - "Åݤ¹¤Ù¤Å¨¤Ï¥²¡û¥Ä", - "¤ó¡Á¡©Ê¹¤³¤¨¤ó¤Ê¤¡", - "¥ª¥ì¤Î̾¤ò¸À¤Ã¤Æ¤ß¤í", - "Ƭ¤¬ÊѤˤʤäÁ¤ã¤Ã¤¿", - "¸ß´¹¤·¤Þ¤»¤ó", - "¤»¤Ã¤«¤¯¤À¤«¤é", - "¤Þ¤À¤Þ¤À´Å¤¤¤Í", - "¤à¤´¤¤¤à¤´¤¹¤®¤ë", - "¤³¤ó¤Ê¤â¤ó¤¸¤ã¤Ê¤¤", - "¤À¤á¤À¤³¤ê¤ã", - "¼¡¤¤¤Ã¤Æ¤ß¤è¤¦", - "¤Á¤ç¤Ã¤È¤À¤±¤è", - "°¥¤·¤ËÁ¸±¼Ô", - "Ìî˾¤Î²Ì¤Æ", - "̵¸ÂÃϹö", - "¿À¤Ë·ö²Þ¤òÇä¤ë¼Ô", - "̤ÃΤÎÀ¤³¦¤Ø", - "ºÇ¹â¤ÎƬǾ¤òµá¤á¤Æ"}; + /*! */ + static const char subtitle[][30] = {"æå¼·ã®èä½ãæ±ãã¦", + "人çããã¯ã¯ããªã", + "ææ¥ã«åãã£ã¦", + "æ£ããã¼ããã¡", + "ãã¨ã®ç¥ã", + "ããã¯ããèãã ", + "ä½ã¨ã§ãè¨ã", + "å ã«ãè§ã«ã", + "ã¦ã½ã ãã©", + "ãã¯ãããã¾ã§", + "ãªãã§ãããªãã®", + "ããã¯ç¡çã ", + "åãã¹ãæµã¯ã²âã", + "ãï½ï¼èããããªã", + "ãªã¬ã®åãè¨ã£ã¦ã¿ã", + "é ãå¤ã«ãªã£ã¡ãã£ã", + "äºæãã¾ãã", + "ãã£ããã ãã", + "ã¾ã ã¾ã çãã", + "ãããããããã", + "ãããªãããããªã", + "ã ãã ããã", + "次ãã£ã¦ã¿ãã", + "ã¡ãã£ã¨ã ãã", + "åããåéºè ", + "éæã®æã¦", + "ç¡éå°ç", + "ç¥ã«å§å©ã売ãè ", + "æªç¥ã®ä¸çã¸", + "æé«ã®é è³ãæ±ãã¦"}; #else static const char subtitle[][51] ={"Quest of The World's Toughest Body", "Attack is the best form of defence.", @@ -897,11 +779,7 @@ static void do_cmd_disp_nikki(void) "Time is money.", "Quest of The World's Greatest Brain"}; #endif -#ifdef JP - sprintf(file_name,"playrecord-%s.txt",savefile_base); -#else - sprintf(file_name,"playrec-%s.txt",savefile_base); -#endif + sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base); /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name); @@ -913,27 +791,27 @@ static void do_cmd_disp_nikki(void) else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]); #ifdef JP - sprintf(nikki_title, "¡Ö%s%s%s¤ÎÅÁÀâ -%s-¡×", - ap_ptr->title, ap_ptr->no ? "¤Î" : "", player_name, tmp); + sprintf(nikki_title, "ã%s%s%sã®ä¼èª¬ -%s-ã", + ap_ptr->title, ap_ptr->no ? "ã®" : "", p_ptr->name, tmp); #else sprintf(nikki_title, "Legend of %s %s '%s'", - ap_ptr->title, player_name, tmp); + ap_ptr->title, p_ptr->name, tmp); #endif /* Display the file contents */ show_file(FALSE, buf, nikki_title, -1, 0); } +/*! + * @brief æ¥è¨ã«ä»»æã®å 容ã表è¨ããã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ / + * @return ãªã + */ static void do_cmd_bunshou(void) { char tmp[80] = "\0"; char bunshou[80] = "\0"; -#ifdef JP - if (get_string("ÆâÍÆ: ", tmp, 79)) -#else - if (get_string("diary note: ", tmp, 79)) -#endif + if (get_string(_("å 容: ", "diary note: "), tmp, 79)) { strcpy(bunshou, tmp); @@ -941,6 +819,10 @@ static void do_cmd_bunshou(void) } } +/*! + * @brief æå¾ã«åå¾ããã¢ã¤ãã ã®æ å ±ãæ¥è¨ã«è¿½å ããã¡ã¤ã³ã«ã¼ãã³ / + * @return ãªã + */ static void do_cmd_last_get(void) { char buf[256]; @@ -948,41 +830,28 @@ static void do_cmd_last_get(void) if (record_o_name[0] == '\0') return; -#ifdef JP - sprintf(buf,"%s¤ÎÆþ¼ê¤òµÏ¿¤·¤Þ¤¹¡£",record_o_name); -#else - sprintf(buf,"Do you really want to record getting %s? ",record_o_name); -#endif + sprintf(buf,_("%sã®å ¥æãè¨é²ãã¾ãã", "Do you really want to record getting %s? "),record_o_name); if (!get_check(buf)) return; turn_tmp = turn; turn = record_turn; -#ifdef JP - sprintf(buf,"%s¤ò¼ê¤ËÆþ¤ì¤¿¡£", record_o_name); -#else - sprintf(buf,"descover %s.", record_o_name); -#endif + sprintf(buf,_("%sãæã«å ¥ããã", "descover %s."), record_o_name); do_cmd_write_nikki(NIKKI_BUNSHOU, 0, buf); turn = turn_tmp; } +/*! + * @brief ãã¡ã¤ã«ä¸ã®å ¨æ¥è¨è¨é²ãæ¶å»ãã / + * @return ãªã + */ static void do_cmd_erase_nikki(void) { char file_name[80]; char buf[256]; FILE *fff = NULL; -#ifdef JP - if (!get_check("ËÜÅö¤ËµÏ¿¤ò¾Ãµî¤·¤Þ¤¹¤«¡©")) return; -#else - if (!get_check("Do you really want to delete all your record? ")) return; -#endif - -#ifdef JP - sprintf(file_name,"playrecord-%s.txt",savefile_base); -#else - sprintf(file_name,"playrec-%s.txt",savefile_base); -#endif + if (!get_check(_("æ¬å½ã«è¨é²ãæ¶å»ãã¾ããï¼", "Do you really want to delete all your record? "))) return; + sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base); /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name); @@ -993,22 +862,17 @@ static void do_cmd_erase_nikki(void) fff = my_fopen(buf, "w"); if(fff){ my_fclose(fff); -#ifdef JP - msg_format("µÏ¿¤ò¾Ãµî¤·¤Þ¤·¤¿¡£"); -#else - msg_format("deleted record."); -#endif + msg_format(_("è¨é²ãæ¶å»ãã¾ããã", "deleted record.")); }else{ -#ifdef JP - msg_format("%s ¤Î¾Ãµî¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£", buf); -#else - msg_format("failed to delete %s.", buf); -#endif + msg_format(_("%s ã®æ¶å»ã«å¤±æãã¾ããã", "failed to delete %s."), buf); } msg_print(NULL); } - +/*! + * @brief æ¥è¨ã³ãã³ã + * @return ãªã + */ void do_cmd_nikki(void) { int i; @@ -1026,34 +890,18 @@ void do_cmd_nikki(void) Term_clear(); /* Ask for a choice */ -#ifdef JP - prt("[ µÏ¿¤ÎÀßÄê ]", 2, 0); -#else - prt("[ Play Record ]", 2, 0); -#endif - + prt(_("[ è¨é²ã®è¨å® ]", "[ Play Record ]"), 2, 0); /* Give some choices */ -#ifdef JP - prt("(1) µÏ¿¤ò¸«¤ë", 4, 5); - prt("(2) ʸ¾Ï¤òµÏ¿¤¹¤ë", 5, 5); - prt("(3) ľÁ°¤ËÆþ¼êËô¤Ï´ÕÄꤷ¤¿¤â¤Î¤òµÏ¿¤¹¤ë", 6, 5); - prt("(4) µÏ¿¤ò¾Ãµî¤¹¤ë", 7, 5); -#else - prt("(1) Display your record", 4, 5); - prt("(2) Add record", 5, 5); - prt("(3) Record item you last get/identify", 6, 5); - prt("(4) Delete your record", 7, 5); -#endif + prt(_("(1) è¨é²ãè¦ã", "(1) Display your record"), 4, 5); + prt(_("(2) æç« ãè¨é²ãã", "(2) Add record"), 5, 5); + prt(_("(3) ç´åã«å ¥æåã¯éå®ãããã®ãè¨é²ãã", "(3) Record item you last get/identify"), 6, 5); + prt(_("(4) è¨é²ãæ¶å»ãã", "(4) Delete your record"), 7, 5); + prt(_("(R) ãã¬ã¤åç»ãè¨é²ãã/ä¸æ¢ãã", "(R) Record playing movie / or stop it"), 9, 5); /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É:", 18, 0); -#else - prt("Command: ", 18, 0); -#endif - + prt(_("ã³ãã³ã:", "Command: "), 18, 0); /* Prompt */ i = inkey(); @@ -1075,6 +923,10 @@ void do_cmd_nikki(void) case '4': do_cmd_erase_nikki(); break; + case 'r': case 'R': + screen_load(); + prepare_movie_hooks(); + return; default: /* Unknown option */ bell(); } @@ -1087,9 +939,12 @@ void do_cmd_nikki(void) screen_load(); } -/* +/*! + * @brief ç»é¢ãåæç»ããã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ * Hack -- redraw the screen - * + * @return ãªã + * @details + *
* This command performs various low level updates, clears all the "extra" * windows, does a total redraw of the main window, and requests all of the * interesting updates and redraws that I can think of. @@ -1097,6 +952,7 @@ void do_cmd_nikki(void) * This command is also used to "instantiate" the results of the user * selecting various things, such as graphics mode, so it must call * the "TERM_XTRA_REACT" hook before redrawing the windows. + **/ void do_cmd_redraw(void) { @@ -1166,8 +1022,10 @@ void do_cmd_redraw(void) } -/* +/*! + * @brief ååãå¤æ´ããã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ * Hack -- change name + * @return ãªã */ void do_cmd_change_name(void) { @@ -1198,7 +1056,7 @@ void do_cmd_change_name(void) /* Prompt */ #ifdef JP Term_putstr(2, 23, -1, TERM_WHITE, - "['c'¤Ç̾Á°Êѹ¹, 'f'¤Ç¥Õ¥¡¥¤¥ë¤Ø½ñ½Ð, 'h'¤Ç¥â¡¼¥ÉÊѹ¹, ESC¤Ç½ªÎ»]"); + "['c'ã§ååå¤æ´, 'f'ã§ãã¡ã¤ã«ã¸æ¸åº, 'h'ã§ã¢ã¼ãå¤æ´, ESCã§çµäº]"); #else Term_putstr(2, 23, -1, TERM_WHITE, "['c' to change name, 'f' to file, 'h' to change mode, or ESC]"); @@ -1224,12 +1082,7 @@ void do_cmd_change_name(void) else if (c == 'f') { sprintf(tmp, "%s.txt", player_base); -#ifdef JP - if (get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80)) -#else - if (get_string("File name: ", tmp, 80)) -#endif - + if (get_string(_("ãã¡ã¤ã«å: ", "File name: "), tmp, 80)) { if (tmp[0] && (tmp[0] != ' ')) { @@ -1264,8 +1117,10 @@ void do_cmd_change_name(void) } -/* +/*! + * @brief æè¿è¡¨ç¤ºãããã¡ãã»ã¼ã¸ãå表示ããã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ * Recall the most recent message + * @return ãªã */ void do_cmd_message_one(void) { @@ -1274,7 +1129,12 @@ void do_cmd_message_one(void) } -/* +/*! + * @brief ã¡ãã»ã¼ã¸ã®ãã°ã表示ããã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ + * Recall the most recent message + * @return ãªã + * @details + *
* Show previous messages to the user -BEN- * * The screen format uses line 0 and 23 for headers and prompts, @@ -1288,26 +1148,30 @@ void do_cmd_message_one(void) * "slide" the virtual display to the left or right. * * Attempt to only hilite the matching portions of the string. + **/ void do_cmd_messages(int num_now) { - int i, j, k, n; - uint q; + int i, n; - char shower[80]; - char finder[80]; + char shower_str[81]; + char finder_str[81]; + char back_str[81]; + cptr shower = NULL; int wid, hgt; - + int num_lines; /* Get size */ Term_get_size(&wid, &hgt); + /* Number of message lines in a screen */ + num_lines = hgt - 4; + /* Wipe finder */ - strcpy(finder, ""); + strcpy(finder_str, ""); /* Wipe shower */ - strcpy(shower, ""); - + strcpy(shower_str, ""); /* Total messages */ n = message_num(); @@ -1315,41 +1179,38 @@ void do_cmd_messages(int num_now) /* Start on first message */ i = 0; - /* Start at leftmost edge */ - q = 0; - /* Save the screen */ screen_save(); + /* Clear screen */ + Term_clear(); + /* Process requests until done */ while (1) { - /* Clear screen */ - Term_clear(); + int j; + int skey; /* Dump up to 20 lines of messages */ - for (j = 0; (j < hgt - 4) && (i + j < n); j++) + for (j = 0; (j < num_lines) && (i + j < n); j++) { cptr msg = message_str(i+j); - /* Apply horizontal scroll */ - msg = (strlen(msg) >= q) ? (msg + q) : ""; - /* Dump the messages, bottom to top */ - Term_putstr(0, hgt-j-3, -1, (bool)(i+j < num_now ? TERM_WHITE : TERM_SLATE), msg); + c_prt((i + j < num_now ? TERM_WHITE : TERM_SLATE), msg, num_lines + 1 - j, 0); /* Hilite "shower" */ - if (shower[0]) + if (shower && shower[0]) { cptr str = msg; /* Display matches */ - while ((str = strstr(str, shower)) != NULL) + while ((str = my_strstr(str, shower)) != NULL) { int len = strlen(shower); /* Display the match */ - Term_putstr(str-msg, hgt-j-3, len, TERM_YELLOW, shower); + Term_putstr(str-msg, num_lines + 1 - j, len, TERM_YELLOW, shower); /* Advance */ str += len; @@ -1357,148 +1218,153 @@ void do_cmd_messages(int num_now) } } + /* Erase remaining lines */ + for (; j < num_lines; j++) + { + Term_erase(0, num_lines + 1 - j, 255); + } + /* Display header XXX XXX XXX */ #ifdef JP /* translation */ - prt(format("°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸ %d-%d Á´Éô¤Ç(%d) ¥ª¥Õ¥»¥Ã¥È(%d)", - i, i+j-1, n, q), 0, 0); + prt(format("以åã®ã¡ãã»ã¼ã¸ %d-%d å ¨é¨ã§(%d)", + i, i + j - 1, n), 0, 0); #else - prt(format("Message Recall (%d-%d of %d), Offset %d", - i, i+j-1, n, q), 0, 0); + prt(format("Message Recall (%d-%d of %d)", + i, i + j - 1, n), 0, 0); #endif - /* Display prompt (not very informative) */ -#ifdef JP - prt("[ 'p' ¤Ç¹¹¤Ë¸Å¤¤¤â¤Î, 'n' ¤Ç¹¹¤Ë¿·¤·¤¤¤â¤Î, '/' ¤Ç¸¡º÷, ESC ¤ÇÃæÃÇ ]", hgt - 1, 0); -#else - prt("[Press 'p' for older, 'n' for newer, ..., or ESCAPE]", hgt - 1, 0); -#endif - + prt(_("[ 'p' ã§æ´ã«å¤ããã®, 'n' ã§æ´ã«æ°ãããã®, '/' ã§æ¤ç´¢, ESC ã§ä¸æ ]", + "[Press 'p' for older, 'n' for newer, ..., or ESCAPE]"), hgt - 1, 0); /* Get a command */ - k = inkey(); + skey = inkey_special(TRUE); /* Exit on Escape */ - if (k == ESCAPE) break; + if (skey == ESCAPE) break; /* Hack -- Save the old index */ j = i; - /* Horizontal scroll */ - if (k == '4') + switch (skey) { - /* Scroll left */ - q = (q >= 40) ? (q - 40) : 0; - - /* Success */ - continue; - } - - /* Horizontal scroll */ - if (k == '6') - { - /* Scroll right */ - q = q + 40; - - /* Success */ - continue; - } - - /* Hack -- handle show */ - if (k == '=') - { - /* Prompt */ -#ifdef JP - prt("¶¯Ä´: ", hgt - 1, 0); -#else - prt("Show: ", hgt - 1, 0); -#endif - + /* Hack -- handle show */ + case '=': + /* Prompt */ + prt(_("強調: ", "Show: "), hgt - 1, 0); /* Get a "shower" string, or continue */ - if (!askfor_aux(shower, 80)) continue; + strcpy(back_str, shower_str); + if (askfor(shower_str, 80)) + { + /* Show it */ + shower = shower_str[0] ? shower_str : NULL; + } + else strcpy(shower_str, back_str); /* Okay */ continue; - } /* Hack -- handle find */ - if (k == '/') - { - int z; - - /* Prompt */ -#ifdef JP - prt("¸¡º÷: ", hgt - 1, 0); -#else - prt("Find: ", hgt - 1, 0); -#endif - + case '/': + case KTRL('s'): + { + int z; - /* Get a "finder" string, or continue */ - if (!askfor_aux(finder, 80)) continue; + /* Prompt */ + prt(_("æ¤ç´¢: ", "Find: "), hgt - 1, 0); - /* Show it */ - strcpy(shower, finder); + /* Get a "finder" string, or continue */ + strcpy(back_str, finder_str); + if (!askfor(finder_str, 80)) + { + strcpy(finder_str, back_str); + continue; + } + else if (!finder_str[0]) + { + shower = NULL; /* Stop showing */ + continue; + } - /* Scan messages */ - for (z = i + 1; z < n; z++) - { - cptr msg = message_str(z); + /* Show it */ + shower = finder_str; - /* Search for it */ - if (strstr(msg, finder)) + /* Scan messages */ + for (z = i + 1; z < n; z++) { - /* New location */ - i = z; + cptr msg = message_str(z); - /* Done */ - break; + /* Search for it */ + if (my_strstr(msg, finder_str)) + { + /* New location */ + i = z; + + /* Done */ + break; + } } } - } + break; /* Recall 1 older message */ - if ((k == '8') || (k == '\n') || (k == '\r')) - { - /* Go newer if legal */ - if (i + 1 < n) i += 1; - } + case SKEY_TOP: + /* Go to the oldest line */ + i = n - num_lines; + break; + + /* Recall 1 newer message */ + case SKEY_BOTTOM: + /* Go to the newest line */ + i = 0; + break; + + /* Recall 1 older message */ + case '8': + case SKEY_UP: + case '\n': + case '\r': + /* Go older if legal */ + i = MIN(i + 1, n - num_lines); + break; /* Recall 10 older messages */ - if (k == '+') - { + case '+': /* Go older if legal */ - if (i + 10 < n) i += 10; - } + i = MIN(i + 10, n - num_lines); + break; /* Recall 20 older messages */ - if ((k == 'p') || (k == KTRL('P')) || (k == ' ')) - { + case 'p': + case KTRL('P'): + case ' ': + case SKEY_PGUP: /* Go older if legal */ - if (i + 20 < n) i += 20; - } + i = MIN(i + num_lines, n - num_lines); + break; /* Recall 20 newer messages */ - if ((k == 'n') || (k == KTRL('N'))) - { + case 'n': + case KTRL('N'): + case SKEY_PGDOWN: /* Go newer (if able) */ - i = (i >= 20) ? (i - 20) : 0; - } + i = MAX(0, i - num_lines); + break; /* Recall 10 newer messages */ - if (k == '-') - { + case '-': /* Go newer (if able) */ - i = (i >= 20) ? (i - 20) : 0; - } + i = MAX(0, i - 10); + break; /* Recall 1 newer messages */ - if (k == '2') - { + case '2': + case SKEY_DOWN: /* Go newer (if able) */ - i = (i >= 1) ? (i - 1) : 0; + i = MAX(0, i - 1); + break; } /* Hack -- Error of some kind */ @@ -1511,75 +1377,50 @@ void do_cmd_messages(int num_now) -/* - * Number of cheating options +/*! + * ãã¼ããªãã·ã§ã³ã®æå¤§æ° / Number of cheating options */ #define CHEAT_MAX 7 -/* - * Cheating options +/*! + * ãã¼ã¨ãªãã·ã§ã³ã®å®ç¾©ãã¼ãã« / Cheating options */ static option_type cheat_info[CHEAT_MAX] = { { &cheat_peek, FALSE, 255, 0x01, 0x00, -#ifdef JP - "cheat_peek", "¥¢¥¤¥Æ¥à¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" -#else - "cheat_peek", "Peek into object creation" -#endif + "cheat_peek", _("ã¢ã¤ãã ã®çæãã®ããè¦ã", "Peek into object creation") }, { &cheat_hear, FALSE, 255, 0x02, 0x00, -#ifdef JP - "cheat_hear", "¥â¥ó¥¹¥¿¡¼¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" -#else - "cheat_hear", "Peek into monster creation" -#endif + "cheat_hear", _("ã¢ã³ã¹ã¿ã¼ã®çæãã®ããè¦ã", "Peek into monster creation") }, { &cheat_room, FALSE, 255, 0x04, 0x00, -#ifdef JP - "cheat_room", "¥À¥ó¥¸¥ç¥ó¤ÎÀ¸À®¤ò¤Î¤¾¤¸«¤ë" -#else - "cheat_room", "Peek into dungeon creation" -#endif + "cheat_room", _("ãã³ã¸ã§ã³ã®çæãã®ããè¦ã", "Peek into dungeon creation") }, { &cheat_xtra, FALSE, 255, 0x08, 0x00, -#ifdef JP - "cheat_xtra", "¤½¤Î¾¤Î»ö¤ò¤Î¤¾¤¸«¤ë" -#else - "cheat_xtra", "Peek into something else" -#endif + "cheat_xtra", _("ãã®ä»ã®äºãã®ããè¦ã", "Peek into something else") }, { &cheat_know, FALSE, 255, 0x10, 0x00, -#ifdef JP - "cheat_know", "´°Á´¤Ê¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤òÃΤë" -#else - "cheat_know", "Know complete monster info" -#endif + "cheat_know", _("å®å ¨ãªã¢ã³ã¹ã¿ã¼ã®æãåºãç¥ã", "Know complete monster info") }, { &cheat_live, FALSE, 255, 0x20, 0x00, -#ifdef JP - "cheat_live", "»à¤ò²óÈò¤¹¤ë¤³¤È¤ò²Äǽ¤Ë¤¹¤ë" -#else - "cheat_live", "Allow player to avoid death" -#endif + "cheat_live", _("æ»ãåé¿ãããã¨ãå¯è½ã«ãã", "Allow player to avoid death") }, { &cheat_save, FALSE, 255, 0x40, 0x00, -#ifdef JP - "cheat_save", "»à¤ó¤À»þ¥»¡¼¥Ö¤¹¤ë¤«³Îǧ¤¹¤ë" -#else - "cheat_save", "Ask for saving death" -#endif + "cheat_save", _("æ»ãã æã»ã¼ãããã確èªãã", "Ask for saving death") } }; -/* +/*! + * @brief ãã¼ããªãã·ã§ã³ãå¤æ´ããã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ * Interact with some options for cheating + * @param info 表示ã¡ãã»ã¼ã¸ + * @return ãªã */ static void do_cmd_options_cheat(cptr info) { @@ -1599,20 +1440,16 @@ static void do_cmd_options_cheat(cptr info) int dir; /* Prompt XXX XXX XXX */ -#ifdef JP - sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, ESC ¤Ç·èÄê )", info); -#else - sprintf(buf, "%s (RET to advance, y/n to set, ESC to accept) ", info); -#endif + sprintf(buf, _("%s ( ãªã¿ã¼ã³ã§æ¬¡ã¸, y/n ã§ã»ãã, ESC ã§æ±ºå® )", "%s (RET to advance, y/n to set, ESC to accept) "), info); prt(buf, 0, 0); #ifdef JP - /* º¾µ½¥ª¥×¥·¥ç¥ó¤ò¤¦¤Ã¤«¤ê¤¤¤¸¤Ã¤Æ¤·¤Þ¤¦¿Í¤¬¤¤¤ë¤è¤¦¤Ê¤Î¤ÇÃí°Õ */ - prt(" << Ãí°Õ >>", 11, 0); - prt(" º¾µ½¥ª¥×¥·¥ç¥ó¤ò°ìÅ٤ǤâÀßÄꤹ¤ë¤È¡¢¥¹¥³¥¢µÏ¿¤¬»Ä¤é¤Ê¤¯¤Ê¤ê¤Þ¤¹¡ª", 12, 0); - prt(" ¸å¤Ë²ò½ü¤·¤Æ¤â¥À¥á¤Ç¤¹¤Î¤Ç¡¢¾¡Íø¼Ô¤òÌܻؤ¹Êý¤Ï¤³¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¤¤", 13, 0); - prt(" ¤¸¤é¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£", 14, 0); + /* è©æ¬ºãªãã·ã§ã³ããã£ããããã£ã¦ãã¾ã人ããããããªã®ã§æ³¨æ */ + prt(" << 注æ >>", 11, 0); + prt(" è©æ¬ºãªãã·ã§ã³ãä¸åº¦ã§ãè¨å®ããã¨ãã¹ã³ã¢è¨é²ãæ®ããªããªãã¾ãï¼", 12, 0); + prt(" å¾ã«è§£é¤ãã¦ããã¡ã§ãã®ã§ãåå©è ãç®æãæ¹ã¯ããã®ãªãã·ã§ã³ã¯ã", 13, 0); + prt(" ãããªãããã«ãã¦ä¸ããã", 14, 0); #endif /* Display the options */ for (i = 0; i < n; i++) @@ -1625,12 +1462,7 @@ static void do_cmd_options_cheat(cptr info) /* Display the option text */ sprintf(buf, "%-48s: %s (%s)", cheat_info[i].o_desc, -#ifdef JP - (*cheat_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"), -#else - (*cheat_info[i].o_var ? "yes" : "no "), -#endif - + (*cheat_info[i].o_var ? _("ã¯ã ", "yes") : _("ããã", "no ")), cheat_info[i].o_text); c_prt(a, buf, i + 2, 0); } @@ -1678,11 +1510,8 @@ static void do_cmd_options_cheat(cptr info) case '6': { if(!p_ptr->noscore) -#ifdef JP - do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "º¾µ½¥ª¥×¥·¥ç¥ó¤òON¤Ë¤·¤Æ¡¢¥¹¥³¥¢¤ò»Ä¤»¤Ê¤¯¤Ê¤Ã¤¿¡£"); -#else - do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up sending score to use cheating options."); -#endif + do_cmd_write_nikki(NIKKI_BUNSHOU, 0, + _("è©æ¬ºãªãã·ã§ã³ãONã«ãã¦ãã¹ã³ã¢ãæ®ããªããªã£ãã", "give up sending score to use cheating options.")); p_ptr->noscore |= (cheat_info[k].o_set * 256 + cheat_info[k].o_bit); (*cheat_info[k].o_var) = TRUE; k = (k + 1) % n; @@ -1700,11 +1529,7 @@ static void do_cmd_options_cheat(cptr info) case '?': { -#ifdef JP - strnfmt(buf, sizeof(buf), "joption.txt#%s", cheat_info[k].o_text); -#else - strnfmt(buf, sizeof(buf), "option.txt#%s", cheat_info[k].o_text); -#endif + strnfmt(buf, sizeof(buf), _("joption.txt#%s", "option.txt#%s"), cheat_info[k].o_text); /* Peruse the help file */ (void)show_file(TRUE, buf, NULL, 0, 0); @@ -1722,26 +1547,23 @@ static void do_cmd_options_cheat(cptr info) } +/*! + * èªåã»ã¼ããªãã·ã§ã³ãã¼ãã« + */ static option_type autosave_info[2] = { { &autosave_l, FALSE, 255, 0x01, 0x00, -#ifdef JP - "autosave_l", "¿·¤·¤¤³¬¤ËÆþ¤ëÅ٤˼«Æ°¥»¡¼¥Ö¤¹¤ë" }, -#else - "autosave_l", "Autosave when entering new levels" }, -#endif - + "autosave_l", _("æ°ããéã«å ¥ã度ã«èªåã»ã¼ããã", "Autosave when entering new levels") }, { &autosave_t, FALSE, 255, 0x02, 0x00, -#ifdef JP - "autosave_t", "°ìÄ꥿¡¼¥óËè¤Ë¼«Æ°¥»¡¼¥Ö¤¹¤ë" }, -#else - "autosave_t", "Timed autosave" }, -#endif - + "autosave_t", _("ä¸å®ã¿ã¼ã³æ¯ã«èªåã»ã¼ããã", "Timed autosave") }, }; - +/*! + * @brief ã»ã¼ãé »åº¦ã¿ã¼ã³ã®æ¬¡ã®å¤ãè¿ã + * @param current ç¾å¨ã®ã»ã¼ãé »åº¦ã¿ã¼ã³å¤ + * @return 次ã®ã»ã¼ãé »åº¦ã¿ã¼ã³å¤ + */ static s16b toggle_frequency(s16b current) { switch (current) @@ -1760,8 +1582,10 @@ static s16b toggle_frequency(s16b current) } -/* - * Interact with some options for cheating +/*! + * @brief èªåã»ã¼ããªãã·ã§ã³ãå¤æ´ããã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ + * @param info 表示ã¡ãã»ã¼ã¸ + * @return ãªã */ static void do_cmd_options_autosave(cptr info) { @@ -1779,11 +1603,8 @@ static void do_cmd_options_autosave(cptr info) while (TRUE) { /* Prompt XXX XXX XXX */ -#ifdef JP - sprintf(buf, "%s ( ¥ê¥¿¡¼¥ó¤Ç¼¡¤Ø, y/n ¤Ç¥»¥Ã¥È, F ¤ÇÉÑÅÙ¤òÆþÎÏ, ESC ¤Ç·èÄê ) ", info); -#else - sprintf(buf, "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) ", info); -#endif + sprintf(buf, _("%s ( ãªã¿ã¼ã³ã§æ¬¡ã¸, y/n ã§ã»ãã, F ã§é »åº¦ãå ¥å, ESC ã§æ±ºå® ) ", + "%s (RET to advance, y/n to set, 'F' for frequency, ESC to accept) "), info); prt(buf, 0, 0); @@ -1798,23 +1619,11 @@ static void do_cmd_options_autosave(cptr info) /* Display the option text */ sprintf(buf, "%-48s: %s (%s)", autosave_info[i].o_desc, -#ifdef JP - (*autosave_info[i].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"), -#else - (*autosave_info[i].o_var ? "yes" : "no "), -#endif - + (*autosave_info[i].o_var ? _("ã¯ã ", "yes") : _("ããã", "no ")), autosave_info[i].o_text); c_prt(a, buf, i + 2, 0); } - -#ifdef JP - prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", autosave_freq), 5, 0); -#else - prt(format("Timed autosave frequency: every %d turns", autosave_freq), 5, 0); -#endif - - + prt(format(_("èªåã»ã¼ãã®é »åº¦ï¼ %d ã¿ã¼ã³æ¯", "Timed autosave frequency: every %d turns"), autosave_freq), 5, 0); /* Hilite current option */ move_cursor(k + 2, 50); @@ -1869,25 +1678,13 @@ static void do_cmd_options_autosave(cptr info) case 'F': { autosave_freq = toggle_frequency(autosave_freq); -#ifdef JP - prt(format("¼«Æ°¥»¡¼¥Ö¤ÎÉÑÅÙ¡§ %d ¥¿¡¼¥óËè", - autosave_freq), 5, 0); -#else - prt(format("Timed autosave frequency: every %d turns", - autosave_freq), 5, 0); -#endif + prt(format(_("èªåã»ã¼ãã®é »åº¦ï¼ %d ã¿ã¼ã³æ¯", "Timed autosave frequency: every %d turns"), autosave_freq), 5, 0); break; } case '?': { -#ifdef JP - (void)show_file(TRUE, "joption.txt#Autosave", NULL, 0, 0); -#else - (void)show_file(TRUE, "option.txt#Autosave", NULL, 0, 0); -#endif - - + (void)show_file(TRUE, _("joption.txt#Autosave", "option.txt#Autosave"), NULL, 0, 0); Term_clear(); break; } @@ -1902,11 +1699,12 @@ static void do_cmd_options_autosave(cptr info) } -#define PAGE_BIRTH 6 -#define PAGE_AUTODESTROY 7 - -/* +/*! + * @brief æ¨æºãªãã·ã§ã³ãå¤æ´ããã³ãã³ãã®ãµãã«ã¼ãã³ / * Interact with some options + * @param page ãªãã·ã§ã³ãã¼ã¸çªå· + * @param info 表示ã¡ãã»ã¼ã¸ + * @return ãªã */ void do_cmd_options_aux(int page, cptr info) { @@ -1914,7 +1712,7 @@ void do_cmd_options_aux(int page, cptr info) int i, k = 0, n = 0, l; int opt[24]; char buf[80]; - bool browse_only = (page == PAGE_BIRTH) && character_generated && + bool browse_only = (page == OPT_PAGE_BIRTH) && character_generated && (!p_ptr->wizard || !allow_debug_opts); @@ -1938,21 +1736,14 @@ void do_cmd_options_aux(int page, cptr info) int dir; /* Prompt XXX XXX XXX */ -#ifdef JP - sprintf(buf, "%s (¥ê¥¿¡¼¥ó:¼¡, %sESC:½ªÎ», ?:¥Ø¥ë¥×) ", info, browse_only ? "" : "y/n:Êѹ¹, "); -#else - sprintf(buf, "%s (RET:next, %s, ?:help) ", info, browse_only ? "ESC:exit" : "y/n:change, ESC:accept"); -#endif - + sprintf(buf, _("%s (ãªã¿ã¼ã³:次, %sESC:çµäº, ?:ãã«ã) ", "%s (RET:next, %s, ?:help) "), + info, browse_only ? _("", "ESC:exit") : _("y/n:å¤æ´, ", "y/n:change, ESC:accept")); prt(buf, 0, 0); - /* HACK -- description for easy-auto-destroy options */ -#ifdef JP - if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "°Ê²¼¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢´Ê°×¼«Æ°Ç˲õ¤ò»ÈÍѤ¹¤ë¤È¤¤Î¤ß͸ú", 6, 6); -#else - if (page == PAGE_AUTODESTROY) c_prt(TERM_YELLOW, "Following options will protect items from easy auto-destroyer.", 6, 3); -#endif + if (page == OPT_PAGE_AUTODESTROY) + c_prt(TERM_YELLOW, _("以ä¸ã®ãªãã·ã§ã³ã¯ãç°¡æèªåç ´å£ã使ç¨ããã¨ãã®ã¿æå¹", + "Following options will protect items from easy auto-destroyer."), 6, _(6, 3)); /* Display the options */ for (i = 0; i < n; i++) @@ -1965,18 +1756,13 @@ void do_cmd_options_aux(int page, cptr info) /* Display the option text */ sprintf(buf, "%-48s: %s (%.19s)", option_info[opt[i]].o_desc, -#ifdef JP - (*option_info[opt[i]].o_var ? "¤Ï¤¤ " : "¤¤¤¤¤¨"), -#else - (*option_info[opt[i]].o_var ? "yes" : "no "), -#endif - + (*option_info[opt[i]].o_var ? _("ã¯ã ", "yes") : _("ããã", "no ")), option_info[opt[i]].o_text); - if ((page == PAGE_AUTODESTROY) && i > 2) c_prt(a, buf, i + 5, 0); + if ((page == OPT_PAGE_AUTODESTROY) && i > 2) c_prt(a, buf, i + 5, 0); else c_prt(a, buf, i + 2, 0); } - if ((page == PAGE_AUTODESTROY) && (k > 2)) l = 3; + if ((page == OPT_PAGE_AUTODESTROY) && (k > 2)) l = 3; else l = 0; /* Hilite current option */ @@ -2046,11 +1832,7 @@ void do_cmd_options_aux(int page, cptr info) case '?': { -#ifdef JP - strnfmt(buf, sizeof(buf), "joption.txt#%s", option_info[opt[k]].o_text); -#else - strnfmt(buf, sizeof(buf), "option.txt#%s", option_info[opt[k]].o_text); -#endif + strnfmt(buf, sizeof(buf), _("joption.txt#%s", "option.txt#%s"), option_info[opt[k]].o_text); /* Peruse the help file */ (void)show_file(TRUE, buf, NULL, 0, 0); @@ -2068,20 +1850,18 @@ void do_cmd_options_aux(int page, cptr info) } -/* +/*! + * @brief ã¦ã£ã³ãã¦ãªãã·ã§ã³ãå¤æ´ããã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ / * Modify the "window" options + * @return ãªã */ static void do_cmd_options_win(void) { int i, j, d; - int y = 0; int x = 0; - char ch; - bool go = TRUE; - u32b old_flag[8]; @@ -2100,12 +1880,7 @@ static void do_cmd_options_win(void) while (go) { /* Prompt XXX XXX XXX */ -#ifdef JP - prt("¥¦¥£¥ó¥É¥¦¡¦¥Õ¥é¥° (<Êý¸þ>¤Ç°ÜÆ°, t¤Ç¥Á¥§¥ó¥¸, y/n ¤Ç¥»¥Ã¥È, ESC)", 0, 0); -#else - prt("Window Flags (
* The user must use the "Ctrl-R" command to "adapt" to changes * in any options which control "visual" aspects of the game. + **/ void do_cmd_options(void) { - int k; - + char k; + int i, d, skey; + int y = 0; /* Save the screen */ screen_save(); @@ -2282,94 +2100,62 @@ void do_cmd_options(void) /* Interact */ while (1) { + int n = OPT_NUM; + + /* Does not list cheat option when cheat option is off */ + if (!p_ptr->noscore && !allow_debug_opts) n--; + /* Clear screen */ Term_clear(); /* Why are we here */ -#ifdef JP - prt("[ ¥ª¥×¥·¥ç¥ó¤ÎÀßÄê ]", 1, 0); -#else - prt("Options", 1, 0); -#endif + prt(_("[ ãªãã·ã§ã³ã®è¨å® ]", "TinyAngband options"), 1, 0); + while(1) + { + /* Give some choices */ + for (i = 0; i < n; i++) + { + byte a = TERM_WHITE; + if (i == y) a = TERM_L_BLUE; + Term_putstr(5, option_fields[i].row, -1, a, + format("(%c) %s", toupper(option_fields[i].key), option_fields[i].name)); + } - /* Give some choices */ -#ifdef JP - prt("(1) ¥¡¼ÆþÎÏ ¥ª¥×¥·¥ç¥ó", 2, 5); - prt("(2) ²èÌ̽ÐÎÏ ¥ª¥×¥·¥ç¥ó", 3, 5); - prt("(3) ¥²¡¼¥à¥×¥ì¥¤ ¥ª¥×¥·¥ç¥ó", 4, 5); - prt("(4) ¹ÔÆ°Ãæ»ß´Ø·¸ ¥ª¥×¥·¥ç¥ó", 5, 5); - prt("(5) ¸úΨ²½ ¥ª¥×¥·¥ç¥ó", 6, 5); - prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ ¥ª¥×¥·¥ç¥ó", 7, 5); - prt("(R) ¥×¥ì¥¤µÏ¿ ¥ª¥×¥·¥ç¥ó", 8, 5); - - /* Special choices */ - prt("(P) ¼«Æ°½¦¤¤¥¨¥Ç¥£¥¿", 10, 5); - prt("(D) ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 11, 5); - prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 12, 5); - prt("(M) ÄãËâÎÏ¿§ïçÃÍ", 13, 5); - prt("(A) ¼«Æ°¥»¡¼¥Ö ¥ª¥×¥·¥ç¥ó", 14, 5); - /* Window flags */ - prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5); -#else - prt("(1) Input Options", 2, 5); - prt("(2) Output Options", 3, 5); - prt("(3) Game-Play Options", 4, 5); - prt("(4) Disturbance Options", 5, 5); - prt("(5) Efficiency Options", 6, 5); - prt("(6) Easy Auto-Destroyer Options", 7, 5); - prt("(R) Play-record Options", 8, 5); - /* Special choices */ - prt("(P) Auto-picker/destroyer editor", 10, 5); - prt("(D) Base Delay Factor", 11, 5); - prt("(H) Hitpoint Warning", 12, 5); - prt("(M) Mana Color Threshold", 13, 5); - prt("(A) Autosave Options", 14, 5); - /* Window flags */ - prt("(W) Window Flags", 15, 5); -#endif + prt(_("<æ¹å>ã§ç§»å, Enterã§æ±ºå®, ESCã§ãã£ã³ã»ã«, ?ã§ãã«ã: ", "Move to
* Note the complex use of the "inkey()" function from "util.c". * * Note that both "flush()" calls are extremely important. + **/ static void do_cmd_macro_aux(char *buf) { @@ -2903,12 +2525,16 @@ static void do_cmd_macro_aux(char *buf) #endif - -/* +/*! + * @brief ãã¯ãã®ãã¼è¡¨è¨ããã¢ã¹ãã¼ã³ã¼ããå¾ã¦ã¿ã¼ããã«ã«è¡¨ç¤ºãã / * Hack -- ask for a keymap "trigger" (see below) - * + * @param buf ãã¼è¡¨è¨ãåå¾ãããããã¡ + * @return ãªã + * @details + *
* Note that both "flush()" calls are extremely important. This may * no longer be true, since "util.c" is much simpler now. XXX XXX XXX + **/ static void do_cmd_macro_aux_keymap(char *buf) { @@ -2936,8 +2562,12 @@ static void do_cmd_macro_aux_keymap(char *buf) } -/* +/*! + * @brief ãã¼ããããprefãã¡ã¤ã«ã«ãã³ããã / * Hack -- append all keymaps to the given file + * @param fname ãã¡ã¤ã«ãã¼ã + * @return ã¨ã©ã¼ã³ã¼ã + * @details */ static errr keymap_dump(cptr fname) { @@ -2972,12 +2602,8 @@ static errr keymap_dump(cptr fname) if (!open_auto_dump(buf, mark)) return -1; /* Start dumping */ -#ifdef JP - auto_dump_printf("\n# ¼«Æ°¥¡¼ÇÛÃÖ¥»¡¼¥Ö\n\n"); -#else - auto_dump_printf("\n# Automatic keymap dump\n\n"); -#endif - + auto_dump_printf(_("\n# èªåãã¼é ç½®ã»ã¼ã\n\n", "\n# Automatic keymap dump\n\n")); + /* Dump them */ for (i = 0; i < 256; i++) { @@ -3010,13 +2636,16 @@ static errr keymap_dump(cptr fname) } - -/* +/*! + * @brief ãã¯ããè¨å®ããã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ / * Interact with "macros" - * + * @return ãªã + * @details + *
* Note that the macro "action" must be defined before the trigger. * * Could use some helpful instructions on this page. XXX XXX XXX + **/ void do_cmd_macros(void) { @@ -3056,21 +2685,10 @@ void do_cmd_macros(void) Term_clear(); /* Describe */ -#ifdef JP - prt("[ ¥Þ¥¯¥í¤ÎÀßÄê ]", 2, 0); -#else - prt("Interact with Macros", 2, 0); -#endif - - + prt(_("[ ãã¯ãã®è¨å® ]", "Interact with Macros"), 2, 0); /* Describe that action */ -#ifdef JP - prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5); -#else - prt("Current action (if any) shown below:", 20, 0); -#endif - + prt(_("ãã¯ãè¡åã(ããããã°)ä¸ã«è¡¨ç¤ºããã¾ã:", "Current action (if any) shown below:"), 20, 0); /* Analyze the current action */ ascii_to_text(buf, macro__buf); @@ -3080,44 +2698,21 @@ void do_cmd_macros(void) /* Selections */ -#ifdef JP - prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5); -#else - prt("(1) Load a user pref file", 4, 5); -#endif - + prt(_("(1) ã¦ã¼ã¶ã¼è¨å®ãã¡ã¤ã«ã®ãã¼ã", "(1) Load a user pref file"), 4, 5); #ifdef ALLOW_MACROS -#ifdef JP - prt("(2) ¥Õ¥¡¥¤¥ë¤Ë¥Þ¥¯¥í¤òÄɲÃ", 5, 5); - prt("(3) ¥Þ¥¯¥í¤Î³Îǧ", 6, 5); - prt("(4) ¥Þ¥¯¥í¤ÎºîÀ®", 7, 5); - prt("(5) ¥Þ¥¯¥í¤Îºï½ü", 8, 5); - prt("(6) ¥Õ¥¡¥¤¥ë¤Ë¥¡¼ÇÛÃÖ¤òÄɲÃ", 9, 5); - prt("(7) ¥¡¼ÇÛÃ֤γÎǧ", 10, 5); - prt("(8) ¥¡¼ÇÛÃ֤κîÀ®", 11, 5); - prt("(9) ¥¡¼ÇÛÃ֤κï½ü", 12, 5); - prt("(0) ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 13, 5); -#else - prt("(2) Append macros to a file", 5, 5); - prt("(3) Query a macro", 6, 5); - prt("(4) Create a macro", 7, 5); - prt("(5) Remove a macro", 8, 5); - prt("(6) Append keymaps to a file", 9, 5); - prt("(7) Query a keymap", 10, 5); - prt("(8) Create a keymap", 11, 5); - prt("(9) Remove a keymap", 12, 5); - prt("(0) Enter a new action", 13, 5); -#endif - + prt(_("(2) ãã¡ã¤ã«ã«ãã¯ãã追å ", "(2) Append macros to a file"), 5, 5); + prt(_("(3) ãã¯ãã®ç¢ºèª", "(3) Query a macro"), 6, 5); + prt(_("(4) ãã¯ãã®ä½æ", "(4) Create a macro"), 7, 5); + prt(_("(5) ãã¯ãã®åé¤", "(5) Remove a macro"), 8, 5); + prt(_("(6) ãã¡ã¤ã«ã«ãã¼é ç½®ã追å ", "(6) Append keymaps to a file"), 9, 5); + prt(_("(7) ãã¼é ç½®ã®ç¢ºèª", "(7) Query a keymap"), 10, 5); + prt(_("(8) ãã¼é ç½®ã®ä½æ", "(8) Create a keymap"), 11, 5); + prt(_("(9) ãã¼é ç½®ã®åé¤", "(9) Remove a keymap"), 12, 5); + prt(_("(0) ãã¯ãè¡åã®å ¥å", "(0) Enter a new action"), 13, 5); #endif /* ALLOW_MACROS */ /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ", 16, 0); -#else - prt("Command: ", 16, 0); -#endif - + prt(_("ã³ãã³ã: ", "Command: "), 16, 0); /* Get a command */ i = inkey(); @@ -3131,53 +2726,31 @@ void do_cmd_macros(void) errr err; /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0); -#else - prt("Command: Load a user pref file", 16, 0); -#endif - + prt(_("ã³ãã³ã: ã¦ã¼ã¶ã¼è¨å®ãã¡ã¤ã«ã®ãã¼ã", "Command: Load a user pref file"), 16, 0); /* Prompt */ -#ifdef JP - prt("¥Õ¥¡¥¤¥ë: ", 18, 0); -#else - prt("File: ", 18, 0); -#endif - + prt(_("ãã¡ã¤ã«: ", "File: "), 18, 0); /* Default filename */ - sprintf(tmp, "%s.prf", player_name); + sprintf(tmp, "%s.prf", player_base); /* Ask for a file */ - if (!askfor_aux(tmp, 80)) continue; + if (!askfor(tmp, 80)) continue; /* Process the given filename */ err = process_pref_file(tmp); if (-2 == err) { -#ifdef JP - msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp); -#else - msg_format("Loaded default '%s'.", tmp); -#endif + msg_format(_("æ¨æºã®è¨å®ãã¡ã¤ã«'%s'ãèªã¿è¾¼ã¿ã¾ããã", "Loaded default '%s'."), tmp); } else if (err) { /* Prompt */ -#ifdef JP - msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp); -#else - msg_format("Failed to load '%s'!"); -#endif + msg_format(_("'%s'ã®èªã¿è¾¼ã¿ã«å¤±æãã¾ããï¼", "Failed to load '%s'!"), tmp); } else { -#ifdef JP - msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp); -#else - msg_format("Loaded '%s'.", tmp); -#endif + msg_format(_("'%s'ãèªã¿è¾¼ã¿ã¾ããã", "Loaded '%s'."), tmp); } } @@ -3187,37 +2760,22 @@ void do_cmd_macros(void) else if (i == '2') { /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0); -#else - prt("Command: Append macros to a file", 16, 0); -#endif - + prt(_("ã³ãã³ã: ãã¯ãããã¡ã¤ã«ã«è¿½å ãã", "Command: Append macros to a file"), 16, 0); /* Prompt */ -#ifdef JP - prt("¥Õ¥¡¥¤¥ë: ", 18, 0); -#else - prt("File: ", 18, 0); -#endif - + prt(_("ãã¡ã¤ã«: ", "File: "), 18, 0); /* Default filename */ - sprintf(tmp, "%s.prf", player_name); + sprintf(tmp, "%s.prf", player_base); /* Ask for a file */ - if (!askfor_aux(tmp, 80)) continue; + if (!askfor(tmp, 80)) continue; /* Dump the macros */ (void)macro_dump(tmp); /* Prompt */ -#ifdef JP - msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£"); -#else - msg_print("Appended macros."); -#endif - + msg_print(_("ãã¯ãã追å ãã¾ããã", "Appended macros.")); } /* Query a macro */ @@ -3226,20 +2784,11 @@ void do_cmd_macros(void) int k; /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Î³Îǧ", 16, 0); -#else - prt("Command: Query a macro", 16, 0); -#endif + prt(_("ã³ãã³ã: ãã¯ãã®ç¢ºèª", "Command: Query a macro"), 16, 0); /* Prompt */ -#ifdef JP - prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0); -#else - prt("Trigger: ", 18, 0); -#endif - + prt(_("ããªã¬ã¼ãã¼: ", "Trigger: "), 18, 0); /* Get a macro trigger */ do_cmd_macro_aux(buf); @@ -3251,12 +2800,7 @@ void do_cmd_macros(void) if (k < 0) { /* Prompt */ -#ifdef JP - msg_print("¤½¤Î¥¡¼¤Ë¤Ï¥Þ¥¯¥í¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£"); -#else - msg_print("Found no macro."); -#endif - + msg_print(_("ãã®ãã¼ã«ã¯ãã¯ãã¯å®ç¾©ããã¦ãã¾ããã", "Found no macro.")); } /* Found one */ @@ -3272,12 +2816,7 @@ void do_cmd_macros(void) prt(buf, 22, 0); /* Prompt */ -#ifdef JP - msg_print("¥Þ¥¯¥í¤ò³Îǧ¤·¤Þ¤·¤¿¡£"); -#else - msg_print("Found a macro."); -#endif - + msg_print(_("ãã¯ãã確èªãã¾ããã", "Found a macro.")); } } @@ -3285,20 +2824,10 @@ void do_cmd_macros(void) else if (i == '4') { /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤ÎºîÀ®", 16, 0); -#else - prt("Command: Create a macro", 16, 0); -#endif - + prt(_("ã³ãã³ã: ãã¯ãã®ä½æ", "Command: Create a macro"), 16, 0); /* Prompt */ -#ifdef JP - prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0); -#else - prt("Trigger: ", 18, 0); -#endif - + prt(_("ããªã¬ã¼ãã¼: ", "Trigger: "), 18, 0); /* Get a macro trigger */ do_cmd_macro_aux(buf); @@ -3306,19 +2835,18 @@ void do_cmd_macros(void) /* Clear */ clear_from(20); - /* Prompt */ -#ifdef JP - prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0); -#else - prt("Action: ", 20, 0); -#endif + /* Help message */ + c_prt(TERM_L_RED, _("ã«ã¼ã½ã«ãã¼ã®å·¦å³ã§ã«ã¼ã½ã«ä½ç½®ã移åãBackspaceãDeleteã§ä¸æååé¤ã", + "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0); + /* Prompt */ + prt(_("ãã¯ãè¡å: ", "Action: "), 20, 0); /* Convert to text */ ascii_to_text(tmp, macro__buf); /* Get an encoded action */ - if (askfor_aux(tmp, 80)) + if (askfor(tmp, 80)) { /* Convert to ascii */ text_to_ascii(macro__buf, tmp); @@ -3327,12 +2855,7 @@ void do_cmd_macros(void) macro_add(buf, macro__buf); /* Prompt */ -#ifdef JP - msg_print("¥Þ¥¯¥í¤òÄɲä·¤Þ¤·¤¿¡£"); -#else - msg_print("Added a macro."); -#endif - + msg_print(_("ãã¯ãã追å ãã¾ããã", "Added a macro.")); } } @@ -3340,20 +2863,10 @@ void do_cmd_macros(void) else if (i == '5') { /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¤Îºï½ü", 16, 0); -#else - prt("Command: Remove a macro", 16, 0); -#endif - + prt(_("ã³ãã³ã: ãã¯ãã®åé¤", "Command: Remove a macro"), 16, 0); /* Prompt */ -#ifdef JP - prt("¥È¥ê¥¬¡¼¥¡¼: ", 18, 0); -#else - prt("Trigger: ", 18, 0); -#endif - + prt(_("ããªã¬ã¼ãã¼: ", "Trigger: "), 18, 0); /* Get a macro trigger */ do_cmd_macro_aux(buf); @@ -3362,49 +2875,29 @@ void do_cmd_macros(void) macro_add(buf, buf); /* Prompt */ -#ifdef JP - msg_print("¥Þ¥¯¥í¤òºï½ü¤·¤Þ¤·¤¿¡£"); -#else - msg_print("Removed a macro."); -#endif - + msg_print(_("ãã¯ããåé¤ãã¾ããã", "Removed a macro.")); } /* Save keymaps */ else if (i == '6') { /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃÖ¤ò¥Õ¥¡¥¤¥ë¤ËÄɲ乤ë", 16, 0); -#else - prt("Command: Append keymaps to a file", 16, 0); -#endif - + prt(_("ã³ãã³ã: ãã¼é ç½®ããã¡ã¤ã«ã«è¿½å ãã", "Command: Append keymaps to a file"), 16, 0); /* Prompt */ -#ifdef JP - prt("¥Õ¥¡¥¤¥ë: ", 18, 0); -#else - prt("File: ", 18, 0); -#endif - + prt(_("ãã¡ã¤ã«: ", "File: "), 18, 0); /* Default filename */ - sprintf(tmp, "%s.prf", player_name); + sprintf(tmp, "%s.prf", player_base); /* Ask for a file */ - if (!askfor_aux(tmp, 80)) continue; + if (!askfor(tmp, 80)) continue; /* Dump the macros */ (void)keymap_dump(tmp); /* Prompt */ -#ifdef JP - msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£"); -#else - msg_print("Appended keymaps."); -#endif - + msg_print(_("ãã¼é ç½®ã追å ãã¾ããã", "Appended keymaps.")); } /* Query a keymap */ @@ -3413,20 +2906,10 @@ void do_cmd_macros(void) cptr act; /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤γÎǧ", 16, 0); -#else - prt("Command: Query a keymap", 16, 0); -#endif - + prt(_("ã³ãã³ã: ãã¼é ç½®ã®ç¢ºèª", "Command: Query a keymap"), 16, 0); /* Prompt */ -#ifdef JP - prt("²¡¤¹¥¡¼: ", 18, 0); -#else - prt("Keypress: ", 18, 0); -#endif - + prt(_("æ¼ããã¼: ", "Keypress: "), 18, 0); /* Get a keymap trigger */ do_cmd_macro_aux_keymap(buf); @@ -3438,12 +2921,7 @@ void do_cmd_macros(void) if (!act) { /* Prompt */ -#ifdef JP - msg_print("¥¡¼ÇÛÃÖ¤ÏÄêµÁ¤µ¤ì¤Æ¤¤¤Þ¤»¤ó¡£"); -#else - msg_print("Found no keymap."); -#endif - + msg_print(_("ãã¼é ç½®ã¯å®ç¾©ããã¦ãã¾ããã", "Found no keymap.")); } /* Found one */ @@ -3459,12 +2937,7 @@ void do_cmd_macros(void) prt(buf, 22, 0); /* Prompt */ -#ifdef JP - msg_print("¥¡¼ÇÛÃÖ¤ò³Îǧ¤·¤Þ¤·¤¿¡£"); -#else - msg_print("Found a keymap."); -#endif - + msg_print(_("ãã¼é ç½®ã確èªãã¾ããã", "Found a keymap.")); } } @@ -3472,20 +2945,10 @@ void do_cmd_macros(void) else if (i == '8') { /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κîÀ®", 16, 0); -#else - prt("Command: Create a keymap", 16, 0); -#endif - + prt(_("ã³ãã³ã: ãã¼é ç½®ã®ä½æ", "Command: Create a keymap"), 16, 0); /* Prompt */ -#ifdef JP - prt("²¡¤¹¥¡¼: ", 18, 0); -#else - prt("Keypress: ", 18, 0); -#endif - + prt(_("æ¼ããã¼: ", "Keypress: "), 18, 0); /* Get a keymap trigger */ do_cmd_macro_aux_keymap(buf); @@ -3493,19 +2956,18 @@ void do_cmd_macros(void) /* Clear */ clear_from(20); - /* Prompt */ -#ifdef JP - prt("¹ÔÆ°: ", 20, 0); -#else - prt("Action: ", 20, 0); -#endif + /* Help message */ + c_prt(TERM_L_RED, _("ã«ã¼ã½ã«ãã¼ã®å·¦å³ã§ã«ã¼ã½ã«ä½ç½®ã移åãBackspaceãDeleteã§ä¸æååé¤ã", + "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0); + /* Prompt */ + prt(_("è¡å: ", "Action: "), 20, 0); /* Convert to text */ ascii_to_text(tmp, macro__buf); /* Get an encoded action */ - if (askfor_aux(tmp, 80)) + if (askfor(tmp, 80)) { /* Convert to ascii */ text_to_ascii(macro__buf, tmp); @@ -3517,12 +2979,7 @@ void do_cmd_macros(void) keymap_act[mode][(byte)(buf[0])] = string_make(macro__buf); /* Prompt */ -#ifdef JP - msg_print("¥¡¼ÇÛÃÖ¤òÄɲä·¤Þ¤·¤¿¡£"); -#else - msg_print("Added a keymap."); -#endif - + msg_print(_("ãã¼é ç½®ã追å ãã¾ããã", "Added a keymap.")); } } @@ -3530,20 +2987,10 @@ void do_cmd_macros(void) else if (i == '9') { /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥¡¼ÇÛÃ֤κï½ü", 16, 0); -#else - prt("Command: Remove a keymap", 16, 0); -#endif - + prt(_("ã³ãã³ã: ãã¼é ç½®ã®åé¤", "Command: Remove a keymap"), 16, 0); /* Prompt */ -#ifdef JP - prt("²¡¤¹¥¡¼: ", 18, 0); -#else - prt("Keypress: ", 18, 0); -#endif - + prt(_("æ¼ããã¼: ", "Keypress: "), 18, 0); /* Get a keymap trigger */ do_cmd_macro_aux_keymap(buf); @@ -3555,33 +3002,30 @@ void do_cmd_macros(void) keymap_act[mode][(byte)(buf[0])] = NULL; /* Prompt */ -#ifdef JP - msg_print("¥¡¼ÇÛÃÖ¤òºï½ü¤·¤Þ¤·¤¿¡£"); -#else - msg_print("Removed a keymap."); -#endif - + msg_print(_("ãã¼é ç½®ãåé¤ãã¾ããã", "Removed a keymap.")); } /* Enter a new action */ else if (i == '0') { /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥Þ¥¯¥í¹ÔÆ°¤ÎÆþÎÏ", 16, 0); -#else - prt("Command: Enter a new action", 16, 0); -#endif + prt(_("ã³ãã³ã: ãã¯ãè¡åã®å ¥å", "Command: Enter a new action"), 16, 0); + /* Clear */ + clear_from(20); + + /* Help message */ + c_prt(TERM_L_RED, _("ã«ã¼ã½ã«ãã¼ã®å·¦å³ã§ã«ã¼ã½ã«ä½ç½®ã移åãBackspaceãDeleteã§ä¸æååé¤ã", + "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0); - /* Go to the correct location */ - Term_gotoxy(0, 22); + /* Prompt */ + prt(_("ãã¯ãè¡å: ", "Action: "), 20, 0); /* Hack -- limit the value */ tmp[80] = '\0'; /* Get an encoded action */ - if (!askfor_aux(buf, 80)) continue; + if (!askfor(buf, 80)) continue; /* Extract an action */ text_to_ascii(macro__buf, buf); @@ -3604,8 +3048,31 @@ void do_cmd_macros(void) screen_load(); } +/*! + * @brief ãã£ã©ã¯ã¿è²ã®ææè¡¨ç¾ + */ +static cptr lighting_level_str[F_LIT_MAX] = +{ +#ifdef JP + "æ¨æºè²", + "æè²", + "æè²", +#else + "standard", + "brightly lit", + "darkened", +#endif +}; + -static void cmd_visuals_aux(int i, int *num, int max) +/*! + * @brief ãã£ã©ã¯ã¿ã®ãã¸ã¥ã¢ã«IDãå¤æ´ããéã®å¯¾è±¡æå®é¢æ° + * @param i æå®å¯¾è±¡ã¨ãªããã£ã©ã¯ã¿ã³ã¼ã + * @param num æå®ããããã¸ã¥ã¢ã«IDãè¿ãåç §ãã¤ã³ã¿ + * @param max ãã¸ã¥ã¢ã«IDã®æå¤§æ° + * @return æå®ãå®éã«è¡ãããå ´åTRUEããã£ã³ã»ã«ãããå ´åFALSE + */ +static bool cmd_visuals_aux(int i, int *num, int max) { if (iscntrl(i)) { @@ -3615,32 +3082,63 @@ static void cmd_visuals_aux(int i, int *num, int max) sprintf(str, "%d", *num); if (!get_string(format("Input new number(0-%d): ", max-1), str, 4)) - return; + return FALSE; tmp = strtol(str, NULL, 0); if (tmp >= 0 && tmp < max) *num = tmp; - return; } else if (isupper(i)) *num = (*num + max - 1) % max; else *num = (*num + 1) % max; - return; + return TRUE; +} + +/*! + * @brief ãã£ã©ã¯ã¿ã®å¤æ´ã¡ãã¥ã¼è¡¨ç¤º + * @param choice_msg é¸æã¡ãã»ã¼ã¸ + * @return ãªã + */ +static void print_visuals_menu(cptr choice_msg) +{ + prt(_("[ ç»é¢è¡¨ç¤ºã®è¨å® ]", "Interact with Visuals"), 1, 0); + + /* Give some choices */ + prt(_("(0) ã¦ã¼ã¶ã¼è¨å®ãã¡ã¤ã«ã®ãã¼ã", "(0) Load a user pref file"), 3, 5); + +#ifdef ALLOW_VISUALS + prt(_("(1) ã¢ã³ã¹ã¿ã¼ã® è²/æå ããã¡ã¤ã«ã«æ¸ãåºã", "(1) Dump monster attr/chars"), 4, 5); + prt(_("(2) ã¢ã¤ãã ã® è²/æå ããã¡ã¤ã«ã«æ¸ãåºã", "(2) Dump object attr/chars"), 5, 5); + prt(_("(3) å°å½¢ã® è²/æå ããã¡ã¤ã«ã«æ¸ãåºã", "(3) Dump feature attr/chars"), 6, 5); + prt(_("(4) ã¢ã³ã¹ã¿ã¼ã® è²/æå ãå¤æ´ãã (æ°å¤æä½)", "(4) Change monster attr/chars (numeric operation)"), 7, 5); + prt(_("(5) ã¢ã¤ãã ã® è²/æå ãå¤æ´ãã (æ°å¤æä½)", "(5) Change object attr/chars (numeric operation)"), 8, 5); + prt(_("(6) å°å½¢ã® è²/æå ãå¤æ´ãã (æ°å¤æä½)", "(6) Change feature attr/chars (numeric operation)"), 9, 5); + prt(_("(7) ã¢ã³ã¹ã¿ã¼ã® è²/æå ãå¤æ´ãã (ã·ã³ãã«ã¨ãã£ã¿)", "(7) Change monster attr/chars (visual mode)"), 10, 5); + prt(_("(8) ã¢ã¤ãã ã® è²/æå ãå¤æ´ãã (ã·ã³ãã«ã¨ãã£ã¿)", "(8) Change object attr/chars (visual mode)"), 11, 5); + prt(_("(9) å°å½¢ã® è²/æå ãå¤æ´ãã (ã·ã³ãã«ã¨ãã£ã¿)", "(9) Change feature attr/chars (visual mode)"), 12, 5); +#endif /* ALLOW_VISUALS */ + + prt(_("(R) ç»é¢è¡¨ç¤ºæ¹æ³ã®åæå", "(R) Reset visuals"), 13, 5); + + /* Prompt */ + prt(format("ã³ãã³ã: %s", choice_msg ? choice_msg : _("", "")), 15, 0); } +static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, int direct_r_idx); +static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, int direct_k_idx); +static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, int direct_f_idx, int *lighting_level); + /* * Interact with "visuals" */ void do_cmd_visuals(void) { int i; - char tmp[160]; - char buf[1024]; - + bool need_redraw = FALSE; const char *empty_symbol = "<< ? >>"; if (use_bigtile) empty_symbol = "<< ?? >>"; @@ -3648,11 +3146,9 @@ void do_cmd_visuals(void) /* File type is "TEXT" */ FILE_TYPE(FILE_TYPE_TEXT); - /* Save the screen */ screen_save(); - /* Interact until done */ while (1) { @@ -3660,56 +3156,7 @@ void do_cmd_visuals(void) Term_clear(); /* Ask for a choice */ -#ifdef JP - prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0); -#else - prt("Interact with Visuals", 2, 0); -#endif - - - /* Give some choices */ -#ifdef JP - prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5); -#else - prt("(1) Load a user pref file", 4, 5); -#endif - -#ifdef ALLOW_VISUALS -#ifdef JP - prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5); - prt("(3) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 6, 5); - prt("(4) ÃÏ·Á¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 7, 5); - prt("(5) (̤»ÈÍÑ)", 8, 5); - prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5); - prt("(7) ¥¢¥¤¥Æ¥à¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5); - prt("(8) ÃÏ·Á¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5); - prt("(9) (̤»ÈÍÑ)", 12, 5); -#else - prt("(2) Dump monster attr/chars", 5, 5); - prt("(3) Dump object attr/chars", 6, 5); - prt("(4) Dump feature attr/chars", 7, 5); - prt("(5) (unused)", 8, 5); - prt("(6) Change monster attr/chars", 9, 5); - prt("(7) Change object attr/chars", 10, 5); - prt("(8) Change feature attr/chars", 11, 5); - prt("(9) (unused)", 12, 5); -#endif - -#endif -#ifdef JP - prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5); -#else - prt("(0) Reset visuals", 13, 5); -#endif - - - /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É:", 18, 0); -#else - prt("Command: ", 15, 0); -#endif - + print_visuals_menu(NULL); /* Prompt */ i = inkey(); @@ -3717,63 +3164,46 @@ void do_cmd_visuals(void) /* Done */ if (i == ESCAPE) break; - /* Load a 'pref' file */ - else if (i == '1') + switch (i) { + /* Load a 'pref' file */ + case '0': /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0); -#else - prt("Command: Load a user pref file", 15, 0); -#endif - + prt(_("ã³ãã³ã: ã¦ã¼ã¶ã¼è¨å®ãã¡ã¤ã«ã®ãã¼ã", "Command: Load a user pref file"), 15, 0); /* Prompt */ -#ifdef JP - prt("¥Õ¥¡¥¤¥ë: ", 18, 0); -#else - prt("File: ", 17, 0); -#endif - + prt(_("ãã¡ã¤ã«: ", "File: "), 17, 0); /* Default filename */ - sprintf(tmp, "%s.prf", player_name); + sprintf(tmp, "%s.prf", player_base); /* Query */ - if (!askfor_aux(tmp, 70)) continue; + if (!askfor(tmp, 70)) continue; /* Process the given filename */ (void)process_pref_file(tmp); - } + + need_redraw = TRUE; + break; #ifdef ALLOW_VISUALS /* Dump monster attr/chars */ - else if (i == '2') + case '1': { static cptr mark = "Monster attr/chars"; /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0); -#else - prt("Command: Dump monster attr/chars", 15, 0); -#endif - + prt(_("ã³ãã³ã: ã¢ã³ã¹ã¿ã¼ã®[è²/æå]ããã¡ã¤ã«ã«æ¸ãåºãã¾ã", "Command: Dump monster attr/chars"), 15, 0); /* Prompt */ -#ifdef JP - prt("¥Õ¥¡¥¤¥ë: ", 17, 0); -#else - prt("File: ", 17, 0); -#endif - + prt(_("ãã¡ã¤ã«: ", "File: "), 17, 0); /* Default filename */ - sprintf(tmp, "%s.prf", player_name); - + sprintf(tmp, "%s.prf", player_base); + /* Get a filename */ - if (!askfor_aux(tmp, 70)) continue; + if (!askfor(tmp, 70)) continue; /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp); @@ -3782,14 +3212,10 @@ void do_cmd_visuals(void) if (!open_auto_dump(buf, mark)) continue; /* Start dumping */ -#ifdef JP - auto_dump_printf("\n# ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n"); -#else - auto_dump_printf("\n# Monster attr/char definitions\n\n"); -#endif + auto_dump_printf(_("\n# ã¢ã³ã¹ã¿ã¼ã®[è²/æå]ã®è¨å®\n\n", "\n# Monster attr/char definitions\n\n")); /* Dump monsters */ - for (i = 1; i < max_r_idx; i++) + for (i = 0; i < max_r_idx; i++) { monster_race *r_ptr = &r_info[i]; @@ -3808,40 +3234,27 @@ void do_cmd_visuals(void) close_auto_dump(); /* Message */ -#ifdef JP - msg_print("¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£"); -#else - msg_print("Dumped monster attr/chars."); -#endif + msg_print(_("ã¢ã³ã¹ã¿ã¼ã®[è²/æå]ããã¡ã¤ã«ã«æ¸ãåºãã¾ããã", "Dumped monster attr/chars.")); + break; } /* Dump object attr/chars */ - else if (i == '3') + case '2': { static cptr mark = "Object attr/chars"; /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0); -#else - prt("Command: Dump object attr/chars", 15, 0); -#endif - + prt(_("ã³ãã³ã: ã¢ã¤ãã ã®[è²/æå]ããã¡ã¤ã«ã«æ¸ãåºãã¾ã", "Command: Dump object attr/chars"), 15, 0); /* Prompt */ -#ifdef JP - prt("¥Õ¥¡¥¤¥ë: ", 17, 0); -#else - prt("File: ", 17, 0); -#endif - + prt(_("ãã¡ã¤ã«: ", "File: "), 17, 0); /* Default filename */ - sprintf(tmp, "%s.prf", player_name); + sprintf(tmp, "%s.prf", player_base); /* Get a filename */ - if (!askfor_aux(tmp, 70)) continue; + if (!askfor(tmp, 70)) continue; /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp); @@ -3850,14 +3263,10 @@ void do_cmd_visuals(void) if (!open_auto_dump(buf, mark)) continue; /* Start dumping */ -#ifdef JP - auto_dump_printf("\n# ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n"); -#else - auto_dump_printf("\n# Object attr/char definitions\n\n"); -#endif + auto_dump_printf(_("\n# ã¢ã¤ãã ã®[è²/æå]ã®è¨å®\n\n", "\n# Object attr/char definitions\n\n")); /* Dump objects */ - for (i = 1; i < max_k_idx; i++) + for (i = 0; i < max_k_idx; i++) { char o_name[80]; object_kind *k_ptr = &k_info[i]; @@ -3865,11 +3274,21 @@ void do_cmd_visuals(void) /* Skip non-entries */ if (!k_ptr->name) continue; - /* Skip entries with flavor */ - if (k_ptr->flavor) continue; + if (!k_ptr->flavor) + { + /* Tidy name */ + strip_name(o_name, i); + } + else + { + object_type forge; - /* Tidy name */ - strip_name(o_name, i); + /* Prepare dummy object */ + object_prep(&forge, i); + + /* Get un-shuffled flavor name */ + object_desc(o_name, &forge, OD_FORCE_FLAVOR); + } /* Dump a comment */ auto_dump_printf("# %s\n", o_name); @@ -3883,40 +3302,27 @@ void do_cmd_visuals(void) close_auto_dump(); /* Message */ -#ifdef JP - msg_print("¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£"); -#else - msg_print("Dumped object attr/chars."); -#endif + msg_print(_("ã¢ã¤ãã ã®[è²/æå]ããã¡ã¤ã«ã«æ¸ãåºãã¾ããã", "Dumped object attr/chars.")); + break; } /* Dump feature attr/chars */ - else if (i == '4') + case '3': { static cptr mark = "Feature attr/chars"; /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 15, 0); -#else - prt("Command: Dump feature attr/chars", 15, 0); -#endif - + prt(_("ã³ãã³ã: å°å½¢ã®[è²/æå]ããã¡ã¤ã«ã«æ¸ãåºãã¾ã", "Command: Dump feature attr/chars"), 15, 0); /* Prompt */ -#ifdef JP - prt("¥Õ¥¡¥¤¥ë: ", 17, 0); -#else - prt("File: ", 17, 0); -#endif - + prt(_("ãã¡ã¤ã«: ", "File: "), 17, 0); /* Default filename */ - sprintf(tmp, "%s.prf", player_name); + sprintf(tmp, "%s.prf", player_base); /* Get a filename */ - if (!askfor_aux(tmp, 70)) continue; + if (!askfor(tmp, 70)) continue; /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp); @@ -3925,14 +3331,10 @@ void do_cmd_visuals(void) if (!open_auto_dump(buf, mark)) continue; /* Start dumping */ -#ifdef JP - auto_dump_printf("\n# ÃÏ·Á¤Î[¿§/ʸ»ú]¤ÎÀßÄê\n\n"); -#else - auto_dump_printf("\n# Feature attr/char definitions\n\n"); -#endif + auto_dump_printf(_("\n# å°å½¢ã®[è²/æå]ã®è¨å®\n\n", "\n# Feature attr/char definitions\n\n")); /* Dump features */ - for (i = 1; i < max_f_idx; i++) + for (i = 0; i < max_f_idx; i++) { feature_type *f_ptr = &f_info[i]; @@ -3946,105 +3348,62 @@ void do_cmd_visuals(void) auto_dump_printf("# %s\n", (f_name + f_ptr->name)); /* Dump the feature attr/char info */ - auto_dump_printf("F:%d:0x%02X/0x%02X\n\n", i, - (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char)); + auto_dump_printf("F:%d:0x%02X/0x%02X:0x%02X/0x%02X:0x%02X/0x%02X\n\n", i, + (byte)(f_ptr->x_attr[F_LIT_STANDARD]), (byte)(f_ptr->x_char[F_LIT_STANDARD]), + (byte)(f_ptr->x_attr[F_LIT_LITE]), (byte)(f_ptr->x_char[F_LIT_LITE]), + (byte)(f_ptr->x_attr[F_LIT_DARK]), (byte)(f_ptr->x_char[F_LIT_DARK])); } /* Close */ close_auto_dump(); /* Message */ -#ifdef JP - msg_print("ÃÏ·Á¤Î[¿§/ʸ»ú]¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£"); -#else - msg_print("Dumped feature attr/chars."); -#endif + msg_print(_("å°å½¢ã®[è²/æå]ããã¡ã¤ã«ã«æ¸ãåºãã¾ããã", "Dumped feature attr/chars.")); + break; } - /* Modify monster attr/chars */ - else if (i == '6') + /* Modify monster attr/chars (numeric operation) */ + case '4': { + static cptr choice_msg = _("ã¢ã³ã¹ã¿ã¼ã®[è²/æå]ãå¤æ´ãã¾ã", "Change monster attr/chars"); static int r = 0; - /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0); -#else - prt("Command: Change monster attr/chars", 15, 0); -#endif - + prt(format(_("ã³ãã³ã: %s", "Command: %s"), choice_msg), 15, 0); /* Hack -- query until done */ while (1) { monster_race *r_ptr = &r_info[r]; - byte a, a2; - char c, c2; + char c; int t; - byte da = (r_ptr->d_attr); - byte dc = (r_ptr->d_char); - byte ca = (r_ptr->x_attr); - byte cc = (r_ptr->x_char); + byte da = r_ptr->d_attr; + byte dc = r_ptr->d_char; + byte ca = r_ptr->x_attr; + byte cc = r_ptr->x_char; /* Label the object */ -#ifdef JP - Term_putstr(5, 17, -1, TERM_WHITE, - format("¥â¥ó¥¹¥¿¡¼ = %d, ̾Á° = %-40.40s", - r, (r_name + r_ptr->name))); -#else Term_putstr(5, 17, -1, TERM_WHITE, - format("Monster = %d, Name = %-40.40s", - r, (r_name + r_ptr->name))); -#endif - + format(_("ã¢ã³ã¹ã¿ã¼ = %d, åå = %-40.40s", "Monster = %d, Name = %-40.40s"), r, (r_name + r_ptr->name))); /* Label the Default values */ -#ifdef JP Term_putstr(10, 19, -1, TERM_WHITE, - format("½é´üÃÍ ¿§ / ʸ»ú = %3u / %3u", da, dc)); -#else - Term_putstr(10, 19, -1, TERM_WHITE, - format("Default attr/char = %3u / %3u", da, dc)); -#endif + format(_("åæå¤ è² / æå = %3u / %3u", "Default attr/char = %3u / %3u"), da, dc)); Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol); - - a = da; - c = dc; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - - Term_putch(43, 19, a, c); - if (use_bigtile) Term_putch(43 + 1, 19, a2, c2); + Term_queue_bigchar(43, 19, da, dc, 0, 0); /* Label the Current values */ -#ifdef JP Term_putstr(10, 20, -1, TERM_WHITE, - format("¸½ºßÃÍ ¿§ / ʸ»ú = %3u / %3u", ca, cc)); -#else - Term_putstr(10, 20, -1, TERM_WHITE, - format("Current attr/char = %3u / %3u", ca, cc)); -#endif + format(_("ç¾å¨å¤ è² / æå = %3u / %3u", "Current attr/char = %3u / %3u"), ca, cc)); Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol); - - a = ca; - c = cc; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - - Term_putch(43, 20, a, c); - if (use_bigtile) Term_putch(43 + 1, 20, a2, c2); - + Term_queue_bigchar(43, 20, ca, cc, 0, 0); /* Prompt */ -#ifdef JP - Term_putstr(0, 22, -1, TERM_WHITE, - "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): "); -#else - Term_putstr(0, 22, -1, TERM_WHITE, - "Command (n/N/^N/a/A/^A/c/C/^C): "); -#endif + Term_putstr(0, 22, -1, TERM_WHITE, + _("ã³ãã³ã (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ", "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ")); /* Get a command */ i = inkey(); @@ -4059,104 +3418,85 @@ void do_cmd_visuals(void) switch (c) { case 'n': - cmd_visuals_aux(i, &r, max_r_idx); + { + int prev_r = r; + do + { + if (!cmd_visuals_aux(i, &r, max_r_idx)) + { + r = prev_r; + break; + } + } + while (!r_info[r].name); + } break; case 'a': t = (int)r_ptr->x_attr; - cmd_visuals_aux(i, &t, 256); + (void)cmd_visuals_aux(i, &t, 256); r_ptr->x_attr = (byte)t; + need_redraw = TRUE; break; case 'c': t = (int)r_ptr->x_char; - cmd_visuals_aux(i, &t, 256); + (void)cmd_visuals_aux(i, &t, 256); r_ptr->x_char = (byte)t; + need_redraw = TRUE; + break; + case 'v': + do_cmd_knowledge_monsters(&need_redraw, TRUE, r); + + /* Clear screen */ + Term_clear(); + print_visuals_menu(choice_msg); break; } } + + break; } - /* Modify object attr/chars */ - else if (i == '7') + /* Modify object attr/chars (numeric operation) */ + case '5': { + static cptr choice_msg = _("ã¢ã¤ãã ã®[è²/æå]ãå¤æ´ãã¾ã", "Change object attr/chars"); static int k = 0; - - /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0); -#else - prt("Command: Change object attr/chars", 15, 0); -#endif - + prt(format(_("ã³ãã³ã: %s", "Command: %s"), choice_msg), 15, 0); /* Hack -- query until done */ while (1) { object_kind *k_ptr = &k_info[k]; - byte a, a2; - char c, c2; + char c; int t; - byte da = (byte)k_ptr->d_attr; - byte dc = (byte)k_ptr->d_char; - byte ca = (byte)k_ptr->x_attr; - byte cc = (byte)k_ptr->x_char; + byte da = k_ptr->d_attr; + byte dc = k_ptr->d_char; + byte ca = k_ptr->x_attr; + byte cc = k_ptr->x_char; /* Label the object */ -#ifdef JP - Term_putstr(5, 17, -1, TERM_WHITE, - format("¥¢¥¤¥Æ¥à = %d, ̾Á° = %-40.40s", - k, (k_name + k_ptr->name))); -#else Term_putstr(5, 17, -1, TERM_WHITE, - format("Object = %d, Name = %-40.40s", - k, (k_name + k_ptr->name))); -#endif - + format(_("ã¢ã¤ãã = %d, åå = %-40.40s", "Object = %d, Name = %-40.40s"), + k, k_name + (!k_ptr->flavor ? k_ptr->name : k_ptr->flavor_name))); /* Label the Default values */ -#ifdef JP - Term_putstr(10, 19, -1, TERM_WHITE, - format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc)); -#else Term_putstr(10, 19, -1, TERM_WHITE, - format("Default attr/char = %3d / %3d", da, dc)); -#endif + format(_("åæå¤ è² / æå = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc)); Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol); - a = da; - c = dc; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - - Term_putch(43, 19, a, c); - if (use_bigtile) Term_putch(43 + 1, 19, a2, c2); - + Term_queue_bigchar(43, 19, da, dc, 0, 0); /* Label the Current values */ -#ifdef JP - Term_putstr(10, 20, -1, TERM_WHITE, - format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc)); -#else Term_putstr(10, 20, -1, TERM_WHITE, - format("Current attr/char = %3d / %3d", ca, cc)); -#endif + format(_("ç¾å¨å¤ è² / æå = %3d / %3d", "Current attr/char = %3d / %3d"), ca, cc)); Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol); - a = ca; - c = cc; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - - Term_putch(43, 20, a, c); - if (use_bigtile) Term_putch(43 + 1, 20, a2, c2); - + Term_queue_bigchar(43, 20, ca, cc, 0, 0); /* Prompt */ -#ifdef JP - Term_putstr(0, 22, -1, TERM_WHITE, - "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): "); -#else Term_putstr(0, 22, -1, TERM_WHITE, - "Command (n/N/^N/a/A/^A/c/C/^C): "); -#endif + _("ã³ãã³ã (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ", "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ")); /* Get a command */ i = inkey(); @@ -4171,103 +3511,96 @@ void do_cmd_visuals(void) switch (c) { case 'n': - cmd_visuals_aux(i, &k, max_k_idx); + { + int prev_k = k; + do + { + if (!cmd_visuals_aux(i, &k, max_k_idx)) + { + k = prev_k; + break; + } + } + while (!k_info[k].name); + } break; case 'a': - t = (int)k_info[k].x_attr; - cmd_visuals_aux(i, &t, 256); - k_info[k].x_attr = (byte)t; + t = (int)k_ptr->x_attr; + (void)cmd_visuals_aux(i, &t, 256); + k_ptr->x_attr = (byte)t; + need_redraw = TRUE; break; case 'c': - t = (int)k_info[k].x_char; - cmd_visuals_aux(i, &t, 256); - k_info[k].x_char = (byte)t; + t = (int)k_ptr->x_char; + (void)cmd_visuals_aux(i, &t, 256); + k_ptr->x_char = (byte)t; + need_redraw = TRUE; + break; + case 'v': + do_cmd_knowledge_objects(&need_redraw, TRUE, k); + + /* Clear screen */ + Term_clear(); + print_visuals_menu(choice_msg); break; } } + + break; } - /* Modify feature attr/chars */ - else if (i == '8') + /* Modify feature attr/chars (numeric operation) */ + case '6': { + static cptr choice_msg = _("å°å½¢ã®[è²/æå]ãå¤æ´ãã¾ã", "Change feature attr/chars"); static int f = 0; - - /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0); -#else - prt("Command: Change feature attr/chars", 15, 0); -#endif - + static int lighting_level = F_LIT_STANDARD; + prt(format(_("ã³ãã³ã: %s", "Command: %s"), choice_msg), 15, 0); /* Hack -- query until done */ while (1) { feature_type *f_ptr = &f_info[f]; - byte a, a2; - char c, c2; + char c; int t; - byte da = (byte)f_ptr->d_attr; - byte dc = (byte)f_ptr->d_char; - byte ca = (byte)f_ptr->x_attr; - byte cc = (byte)f_ptr->x_char; + byte da = f_ptr->d_attr[lighting_level]; + byte dc = f_ptr->d_char[lighting_level]; + byte ca = f_ptr->x_attr[lighting_level]; + byte cc = f_ptr->x_char[lighting_level]; /* Label the object */ -#ifdef JP + prt("", 17, 5); Term_putstr(5, 17, -1, TERM_WHITE, - format("ÃÏ·Á = %d, ̾Á° = %-40.40s", - f, (f_name + f_ptr->name))); -#else - Term_putstr(5, 17, -1, TERM_WHITE, - format("Terrain = %d, Name = %-40.40s", - f, (f_name + f_ptr->name))); -#endif - + format(_("å°å½¢ = %d, åå = %s, æ度 = %s", "Terrain = %d, Name = %s, Lighting = %s"), + f, (f_name + f_ptr->name), lighting_level_str[lighting_level])); /* Label the Default values */ -#ifdef JP - Term_putstr(10, 19, -1, TERM_WHITE, - format("½é´üÃÍ ¿§ / ʸ»ú = %3d / %3d", da, dc)); -#else Term_putstr(10, 19, -1, TERM_WHITE, - format("Default attr/char = %3d / %3d", da, dc)); -#endif + format(_("åæå¤ è² / æå = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc)); Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol); - a = da; - c = dc; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - - Term_putch(43, 19, a, c); - if (use_bigtile) Term_putch(43 + 1, 19, a2, c2); - + Term_queue_bigchar(43, 19, da, dc, 0, 0); /* Label the Current values */ #ifdef JP Term_putstr(10, 20, -1, TERM_WHITE, - format("¸½ºßÃÍ ¿§ / ʸ»ú = %3d / %3d", ca, cc)); + format("ç¾å¨å¤ è² / æå = %3d / %3d", ca, cc)); #else Term_putstr(10, 20, -1, TERM_WHITE, format("Current attr/char = %3d / %3d", ca, cc)); #endif Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol); - a = ca; - c = cc; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - - Term_putch(43, 20, a, c); - if (use_bigtile) Term_putch(43 + 1, 20, a2, c2); - + Term_queue_bigchar(43, 20, ca, cc, 0, 0); /* Prompt */ #ifdef JP Term_putstr(0, 22, -1, TERM_WHITE, - "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): "); + "ã³ãã³ã (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): "); #else Term_putstr(0, 22, -1, TERM_WHITE, - "Command (n/N/^N/a/A/^A/c/C/^C): "); + "Command (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): "); #endif /* Get a command */ @@ -4283,52 +3616,96 @@ void do_cmd_visuals(void) switch (c) { case 'n': - cmd_visuals_aux(i, &f, max_f_idx); + { + int prev_f = f; + do + { + if (!cmd_visuals_aux(i, &f, max_f_idx)) + { + f = prev_f; + break; + } + } + while (!f_info[f].name || (f_info[f].mimic != f)); + } break; case 'a': - t = (int)f_info[f].x_attr; - cmd_visuals_aux(i, &t, 256); - f_info[f].x_attr = (byte)t; + t = (int)f_ptr->x_attr[lighting_level]; + (void)cmd_visuals_aux(i, &t, 256); + f_ptr->x_attr[lighting_level] = (byte)t; + need_redraw = TRUE; break; case 'c': - t = (int)f_info[f].x_char; - cmd_visuals_aux(i, &t, 256); - f_info[f].x_char = (byte)t; + t = (int)f_ptr->x_char[lighting_level]; + (void)cmd_visuals_aux(i, &t, 256); + f_ptr->x_char[lighting_level] = (byte)t; + need_redraw = TRUE; + break; + case 'l': + (void)cmd_visuals_aux(i, &lighting_level, F_LIT_MAX); + break; + case 'd': + apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char); + need_redraw = TRUE; + break; + case 'v': + do_cmd_knowledge_features(&need_redraw, TRUE, f, &lighting_level); + + /* Clear screen */ + Term_clear(); + print_visuals_menu(choice_msg); break; } } + + break; } -#endif + /* Modify monster attr/chars (visual mode) */ + case '7': + do_cmd_knowledge_monsters(&need_redraw, TRUE, -1); + break; - /* Reset visuals */ - else if (i == '0') + /* Modify object attr/chars (visual mode) */ + case '8': + do_cmd_knowledge_objects(&need_redraw, TRUE, -1); + break; + + /* Modify feature attr/chars (visual mode) */ + case '9': { + int lighting_level = F_LIT_STANDARD; + do_cmd_knowledge_features(&need_redraw, TRUE, -1, &lighting_level); + break; + } + +#endif /* ALLOW_VISUALS */ + + /* Reset visuals */ + case 'R': + case 'r': /* Reset */ reset_visuals(); /* Message */ -#ifdef JP - msg_print("²èÌ̾å¤Î[¿§/ʸ»ú]¤ò½é´üÃͤ˥ꥻ¥Ã¥È¤·¤Þ¤·¤¿¡£"); -#else - msg_print("Visual attr/char tables reset."); -#endif - - } + msg_print(_("ç»é¢ä¸ã®[è²/æå]ãåæå¤ã«ãªã»ãããã¾ããã", "Visual attr/char tables reset.")); + need_redraw = TRUE; + break; /* Unknown option */ - else - { + default: bell(); + break; } /* Flush messages */ msg_print(NULL); } - /* Restore the screen */ screen_load(); + + if (need_redraw) do_cmd_redraw(); } @@ -4359,39 +3736,18 @@ void do_cmd_colors(void) Term_clear(); /* Ask for a choice */ -#ifdef JP - prt("[ ¥«¥é¡¼¤ÎÀßÄê ]", 2, 0); -#else - prt("Interact with Colors", 2, 0); -#endif - + prt(_("[ ã«ã©ã¼ã®è¨å® ]", "Interact with Colors"), 2, 0); /* Give some choices */ -#ifdef JP - prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5); -#else - prt("(1) Load a user pref file", 4, 5); -#endif + prt(_("(1) ã¦ã¼ã¶ã¼è¨å®ãã¡ã¤ã«ã®ãã¼ã", "(1) Load a user pref file"), 4, 5); #ifdef ALLOW_COLORS -#ifdef JP - prt("(2) ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹", 5, 5); - prt("(3) ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤¹¤ë", 6, 5); -#else - prt("(2) Dump colors", 5, 5); - prt("(3) Modify colors", 6, 5); -#endif - + prt(_("(2) ã«ã©ã¼ã®è¨å®ããã¡ã¤ã«ã«æ¸ãåºã", "(2) Dump colors"), 5, 5); + prt(_("(3) ã«ã©ã¼ã®è¨å®ãå¤æ´ãã", "(3) Modify colors"), 6, 5); #endif /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ", 8, 0); -#else - prt("Command: ", 8, 0); -#endif - - + prt(_("ã³ãã³ã: ", "Command: "), 8, 0); /* Prompt */ i = inkey(); @@ -4402,26 +3758,16 @@ void do_cmd_colors(void) if (i == '1') { /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹", 8, 0); -#else - prt("Command: Load a user pref file", 8, 0); -#endif - + prt(_("ã³ãã³ã: ã¦ã¼ã¶ã¼è¨å®ãã¡ã¤ã«ããã¼ããã¾ã", "Command: Load a user pref file"), 8, 0); /* Prompt */ -#ifdef JP - prt("¥Õ¥¡¥¤¥ë: ", 10, 0); -#else - prt("File: ", 10, 0); -#endif - + prt(_("ãã¡ã¤ã«: ", "File: "), 10, 0); /* Default file */ - sprintf(tmp, "%s.prf", player_name); + sprintf(tmp, "%s.prf", player_base); /* Query */ - if (!askfor_aux(tmp, 70)) continue; + if (!askfor(tmp, 70)) continue; /* Process the given filename */ (void)process_pref_file(tmp); @@ -4441,26 +3787,16 @@ void do_cmd_colors(void) static cptr mark = "Colors"; /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤¹", 8, 0); -#else - prt("Command: Dump colors", 8, 0); -#endif - + prt(_("ã³ãã³ã: ã«ã©ã¼ã®è¨å®ããã¡ã¤ã«ã«æ¸ãåºãã¾ã", "Command: Dump colors"), 8, 0); /* Prompt */ -#ifdef JP - prt("¥Õ¥¡¥¤¥ë: ", 10, 0); -#else - prt("File: ", 10, 0); -#endif - + prt(_("ãã¡ã¤ã«: ", "File: "), 10, 0); /* Default filename */ - sprintf(tmp, "%s.prf", player_name); + sprintf(tmp, "%s.prf", player_base); /* Get a filename */ - if (!askfor_aux(tmp, 70)) continue; + if (!askfor(tmp, 70)) continue; /* Build the filename */ path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp); @@ -4469,12 +3805,8 @@ void do_cmd_colors(void) if (!open_auto_dump(buf, mark)) continue; /* Start dumping */ -#ifdef JP - auto_dump_printf("\n# ¥«¥é¡¼¤ÎÀßÄê\n\n"); -#else - auto_dump_printf("\n# Color redefinitions\n\n"); -#endif - + auto_dump_printf(_("\n# ã«ã©ã¼ã®è¨å®\n\n", "\n# Color redefinitions\n\n")); + /* Dump colors */ for (i = 0; i < 256; i++) { @@ -4483,12 +3815,7 @@ void do_cmd_colors(void) int gv = angband_color_table[i][2]; int bv = angband_color_table[i][3]; -#ifdef JP - cptr name = "̤ÃÎ"; -#else - cptr name = "unknown"; -#endif - + cptr name = _("æªç¥", "unknown"); /* Skip non-entries */ if (!kv && !rv && !gv && !bv) continue; @@ -4497,12 +3824,8 @@ void do_cmd_colors(void) if (i < 16) name = color_names[i]; /* Dump a comment */ -#ifdef JP - auto_dump_printf("# ¥«¥é¡¼ '%s'\n", name); -#else - auto_dump_printf("# Color '%s'\n", name); -#endif - + auto_dump_printf(_("# ã«ã©ã¼ '%s'\n", "# Color '%s'\n"), name); + /* Dump the monster attr/char info */ auto_dump_printf("V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n", i, kv, rv, gv, bv); @@ -4512,12 +3835,7 @@ void do_cmd_colors(void) close_auto_dump(); /* Message */ -#ifdef JP - msg_print("¥«¥é¡¼¤ÎÀßÄê¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£"); -#else - msg_print("Dumped color redefinitions."); -#endif - + msg_print(_("ã«ã©ã¼ã®è¨å®ããã¡ã¤ã«ã«æ¸ãåºãã¾ããã", "Dumped color redefinitions.")); } /* Edit colors */ @@ -4526,12 +3844,7 @@ void do_cmd_colors(void) static byte a = 0; /* Prompt */ -#ifdef JP - prt("¥³¥Þ¥ó¥É: ¥«¥é¡¼¤ÎÀßÄê¤òÊѹ¹¤·¤Þ¤¹", 8, 0); -#else - prt("Command: Modify colors", 8, 0); -#endif - + prt(_("ã³ãã³ã: ã«ã©ã¼ã®è¨å®ãå¤æ´ãã¾ã", "Command: Modify colors"), 8, 0); /* Hack -- query until done */ while (1) @@ -4553,22 +3866,11 @@ void do_cmd_colors(void) } /* Describe the color */ -#ifdef JP - name = ((a < 16) ? color_names[a] : "̤ÄêµÁ"); -#else - name = ((a < 16) ? color_names[a] : "undefined"); -#endif - + name = ((a < 16) ? color_names[a] : _("æªå®ç¾©", "undefined")); /* Describe the color */ -#ifdef JP - Term_putstr(5, 10, -1, TERM_WHITE, - format("¥«¥é¡¼ = %d, ̾Á° = %s", a, name)); -#else Term_putstr(5, 10, -1, TERM_WHITE, - format("Color = %d, Name = %s", a, name)); -#endif - + format(_("ã«ã©ã¼ = %d, åå = %s", "Color = %d, Name = %s"), a, name)); /* Label the Current values */ Term_putstr(5, 12, -1, TERM_WHITE, @@ -4579,13 +3881,8 @@ void do_cmd_colors(void) angband_color_table[a][3])); /* Prompt */ -#ifdef JP Term_putstr(0, 14, -1, TERM_WHITE, - "¥³¥Þ¥ó¥É (n/N/k/K/r/R/g/G/b/B): "); -#else - Term_putstr(0, 14, -1, TERM_WHITE, - "Command (n/N/k/K/r/R/g/G/b/B): "); -#endif + _("ã³ãã³ã (n/N/k/K/r/R/g/G/b/B): ", "Command (n/N/k/K/r/R/g/G/b/B): ")); /* Get a command */ @@ -4643,23 +3940,13 @@ void do_cmd_note(void) strcpy(buf, ""); /* Input */ -#ifdef JP - if (!get_string("¥á¥â: ", buf, 60)) return; -#else - if (!get_string("Note: ", buf, 60)) return; -#endif - + if (!get_string(_("ã¡ã¢: ", "Note: "), buf, 60)) return; /* Ignore empty notes */ if (!buf[0] || (buf[0] == ' ')) return; /* Add the note to the message recall */ -#ifdef JP - msg_format("¥á¥â: %s", buf); -#else - msg_format("Note: %s", buf); -#endif - + msg_format(_("ã¡ã¢: %s", "Note: %s"), buf); } @@ -4668,15 +3955,9 @@ void do_cmd_note(void) */ void do_cmd_version(void) { - /* Silly message */ -#ifdef JP - msg_format("ÊѶòÈÚÅÜ(Hengband) %d.%d.%d", - FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH); -#else - msg_format("You are playing Hengband %d.%d.%d.", - FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH); -#endif + msg_format(_("å¤æè®æ(Hengband) %d.%d.%d", "You are playing Hengband %d.%d.%d."), + FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH); } @@ -4686,171 +3967,47 @@ void do_cmd_version(void) */ static cptr do_cmd_feeling_text[11] = { -#ifdef JP - "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...", -#else - "Looks like any other level.", -#endif - -#ifdef JP - "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£", -#else - "You feel there is something special about this level.", -#endif - -#ifdef JP - "¶²¤í¤·¤¤»à¤Î¸¸¤¬ÌܤËÉ⤫¤Ó¡¢µ¤À䤷¤½¤¦¤Ë¤Ê¤Ã¤¿¡ª", -#else - "You nearly faint as horrible visions of death fill your mind!", -#endif - -#ifdef JP - "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£", -#else - "This level looks very dangerous.", -#endif - -#ifdef JP - "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...", -#else - "You have a very bad feeling...", -#endif - -#ifdef JP - "°¤¤Í½´¶¤¬¤¹¤ë...", -#else - "You have a bad feeling...", -#endif - -#ifdef JP - "²¿¤«¶ÛÄ¥¤¹¤ë¡£", -#else - "You feel nervous.", -#endif - -#ifdef JP - "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...", -#else - "You feel your luck is turning...", -#endif - -#ifdef JP - "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£", -#else - "You don't like the look of this place.", -#endif - -#ifdef JP - "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£", -#else - "This level looks reasonably safe.", -#endif - -#ifdef JP - "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..." -#else - "What a boring place..." -#endif - + _("ãã®éã®é°å²æ°ãæãã¨ããªãã£ã...", "Looks like any other level."), + _("ãã®éã«ã¯ä½ãç¹å¥ãªãã®ããããããªæ°ãããã", "You feel there is something special about this level."), + _("æãããæ»ã®å¹»ãç®ã«æµ®ãã³ãæ°çµ¶ãããã«ãªã£ãï¼", "You nearly faint as horrible visions of death fill your mind!"), + _("ãã®éã¯ã¨ã¦ãå±éºãªããã ã", "This level looks very dangerous."), + _("ã¨ã¦ãæªãäºæããã...", "You have a very bad feeling..."), + _("æªãäºæããã...", "You have a bad feeling..."), + _("ä½ãç·å¼µããã", "You feel nervous."), + _("å°ãä¸éãªæ°ããã...", "You feel your luck is turning..."), + _("ãã®å ´æã¯å¥½ãã«ãªããªãã", "You don't like the look of this place."), + _("ãã®éã¯ãããªãã«å®å ¨ãªããã ã", "This level looks reasonably safe."), + _("ãªãã¦éå±ãªã¨ããã ...", "What a boring place...") }; static cptr do_cmd_feeling_text_combat[11] = { -#ifdef JP - "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...", -#else - "Looks like any other level.", -#endif - -#ifdef JP - "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£", -#else - "You feel there is something special about this level.", -#endif - -#ifdef JP - "º£Ìë¤â¤Þ¤¿¡¢Ã¯¤«¤¬Ì¿¤òÍî¤È¤¹...", -#else - "You nearly faint as horrible visions of death fill your mind!", -#endif - -#ifdef JP - "¤³¤Î³¬¤Ï¤È¤Æ¤â´í¸±¤Ê¤è¤¦¤À¡£", -#else - "This level looks very dangerous.", -#endif - -#ifdef JP - "¤È¤Æ¤â°¤¤Í½´¶¤¬¤¹¤ë...", -#else - "You have a very bad feeling...", -#endif - -#ifdef JP - "°¤¤Í½´¶¤¬¤¹¤ë...", -#else - "You have a bad feeling...", -#endif - -#ifdef JP - "²¿¤«¶ÛÄ¥¤¹¤ë¡£", -#else - "You feel nervous.", -#endif - -#ifdef JP - "¾¯¤·ÉÔ±¿¤Êµ¤¤¬¤¹¤ë...", -#else - "You feel your luck is turning...", -#endif - -#ifdef JP - "¤³¤Î¾ì½ê¤Ï¹¥¤¤Ë¤Ê¤ì¤Ê¤¤¡£", -#else - "You don't like the look of this place.", -#endif - -#ifdef JP - "¤³¤Î³¬¤Ï¤½¤ì¤Ê¤ê¤Ë°ÂÁ´¤Ê¤è¤¦¤À¡£", -#else - "This level looks reasonably safe.", -#endif - -#ifdef JP - "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..." -#else - "What a boring place..." -#endif - + _("ãã®éã®é°å²æ°ãæãã¨ããªãã£ã...", "Looks like any other level."), + _("ãã®éã«ã¯ä½ãç¹å¥ãªãã®ããããããªæ°ãããã", "You feel there is something special about this level."), + _("ä»å¤ãã¾ãã誰ããå½ãè½ã¨ã...", "You nearly faint as horrible visions of death fill your mind!"), + _("ãã®éã¯ã¨ã¦ãå±éºãªããã ã", "This level looks very dangerous."), + _("ã¨ã¦ãæªãäºæããã...", "You have a very bad feeling..."), + _("æªãäºæããã...", "You have a bad feeling..."), + _("ä½ãç·å¼µããã", "You feel nervous."), + _("å°ãä¸éãªæ°ããã...", "You feel your luck is turning..."), + _("ãã®å ´æã¯å¥½ãã«ãªããªãã", "You don't like the look of this place."), + _("ãã®éã¯ãããªãã«å®å ¨ãªããã ã", "This level looks reasonably safe."), + _("ãªãã¦éå±ãªã¨ããã ...", "What a boring place...") }; static cptr do_cmd_feeling_text_lucky[11] = { -#ifdef JP - "¤³¤Î³¬¤ÎÊ·°Ïµ¤¤ò´¶¤¸¤È¤ì¤Ê¤«¤Ã¤¿...", - "¤³¤Î³¬¤Ë¤Ï²¿¤«ÆÃÊ̤ʤâ¤Î¤¬¤¢¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£", - "¤³¤Î³¬¤Ï¤³¤Î¾å¤Ê¤¯ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë¡£", - "ÁÇÀ²¤é¤·¤¤´¶¤¸¤¬¤¹¤ë...", - "¤È¤Æ¤âÎɤ¤´¶¤¸¤¬¤¹¤ë...", - "Îɤ¤´¶¤¸¤¬¤¹¤ë...", - "¤Á¤ç¤Ã¤È¹¬±¿¤Ê´¶¤¸¤¬¤¹¤ë...", - "¿¾¯¤Ï±¿¤¬¸þ¤¤¤Æ¤¤¿¤«...", - "¸«¤¿´¶¤¸°¤¯¤Ï¤Ê¤¤...", - "Á´Á³ÂÌÌܤȤ¤¤¦¤³¤È¤Ï¤Ê¤¤¤¬...", - "¤Ê¤ó¤ÆÂà¶þ¤Ê¤È¤³¤í¤À..." -#else - "Looks like any other level.", - "You feel there is something special about this level.", - "You have a superb feeling about this level.", - "You have an excellent feeling...", - "You have a very good feeling...", - "You have a good feeling...", - "You feel strangely lucky...", - "You feel your luck is turning...", - "You like the look of this place...", - "This level can't be all bad...", - "What a boring place..." -#endif + _("ãã®éã®é°å²æ°ãæãã¨ããªãã£ã...", "Looks like any other level."), + _("ãã®éã«ã¯ä½ãç¹å¥ãªãã®ããããããªæ°ãããã", "You feel there is something special about this level."), + _("ãã®éã¯ãã®ä¸ãªãç´ æ´ãããæããããã", "You have a superb feeling about this level."), + _("ç´ æ´ãããæãããã...", "You have an excellent feeling..."), + _("ã¨ã¦ãè¯ãæãããã...", "You have a very good feeling..."), + _("è¯ãæãããã...", "You have a good feeling..."), + _("ã¡ãã£ã¨å¹¸éãªæãããã...", "You feel strangely lucky..."), + _("å¤å°ã¯éãåãã¦ããã...", "You feel your luck is turning..."), + _("è¦ãæãæªãã¯ãªã...", "You like the look of this place..."), + _("å ¨ç¶é§ç®ã¨ãããã¨ã¯ãªãã...", "This level can't be all bad..."), + _("ãªãã¦éå±ãªã¨ããã ...", "What a boring place...") }; @@ -4860,46 +4017,24 @@ static cptr do_cmd_feeling_text_lucky[11] = */ void do_cmd_feeling(void) { - /* Verify the feeling */ - if (feeling > 10) feeling = 10; - /* No useful feeling in quests */ if (p_ptr->inside_quest && !random_quest_number(dun_level)) { -#ifdef JP - msg_print("ŵ·¿Åª¤Ê¥¯¥¨¥¹¥È¤Î¥À¥ó¥¸¥ç¥ó¤Î¤è¤¦¤À¡£"); -#else - msg_print("Looks like a typical quest level."); -#endif - + msg_print(_("å ¸åçãªã¯ã¨ã¹ãã®ãã³ã¸ã§ã³ã®ããã ã", "Looks like a typical quest level.")); return; } /* No useful feeling in town */ else if (p_ptr->town_num && !dun_level) { -#ifdef JP - if (!strcmp(town[p_ptr->town_num].name, "¹ÓÌî")) -#else - if (!strcmp(town[p_ptr->town_num].name, "wilderness")) -#endif + if (!strcmp(town[p_ptr->town_num].name, _("èé", "wilderness"))) { -#ifdef JP - msg_print("²¿¤«¤¢¤ê¤½¤¦¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£"); -#else - msg_print("Looks like a strange wilderness."); -#endif - + msg_print(_("ä½ããããããªèéã®ããã ã", "Looks like a strange wilderness.")); return; } - else - { -#ifdef JP - msg_print("ŵ·¿Åª¤ÊÄ®¤Î¤è¤¦¤À¡£"); -#else - msg_print("Looks like a typical town."); -#endif - + else + { + msg_print(_("å ¸åçãªçºã®ããã ã", "Looks like a typical town.")); return; } } @@ -4907,30 +4042,18 @@ void do_cmd_feeling(void) /* No useful feeling in the wilderness */ else if (!dun_level) { -#ifdef JP - msg_print("ŵ·¿Åª¤Ê¹ÓÌî¤Î¤è¤¦¤À¡£"); -#else - msg_print("Looks like a typical wilderness."); -#endif - + msg_print(_("å ¸åçãªèéã®ããã ã", "Looks like a typical wilderness.")); return; } /* Display the feeling */ - if (turn - old_turn >= (150 - dun_level)*TURNS_PER_TICK || cheat_xtra) - { - if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]); - else { - if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){ - msg_print(do_cmd_feeling_text_combat[feeling]); - }else - msg_print(do_cmd_feeling_text[feeling]); - } - } + if (p_ptr->muta3 & MUT3_GOOD_LUCK) + msg_print(do_cmd_feeling_text_lucky[p_ptr->feeling]); + else if (p_ptr->pseikaku == SEIKAKU_COMBAT || + inventory[INVEN_BOW].name1 == ART_CRIMSON) + msg_print(do_cmd_feeling_text_combat[p_ptr->feeling]); else - { - msg_print(do_cmd_feeling_text[0]); - } + msg_print(do_cmd_feeling_text[p_ptr->feeling]); } @@ -4941,66 +4064,71 @@ void do_cmd_feeling(void) static cptr monster_group_text[] = { #ifdef JP - "¥æ¥Ë¡¼¥¯", /* "Uniques" */ - "¾èÇϲÄǽ¤Ê¥â¥ó¥¹¥¿¡¼", /* "Riding" */ - "¥¢¥ê", - "¥³¥¦¥â¥ê", - "¥à¥«¥Ç", - "¥É¥é¥´¥ó", - "ÌܶÌ", - "¥Í¥³", - "¥´¡¼¥ì¥à", - "ɸ½à¿Í´Ö·¿À¸Êª", - "¥Ù¥È¥Ù¥È", - "¥¼¥ê¡¼", - "¥³¥Ü¥ë¥É", - "¿åÀ³À¸Êª", - "¥â¥ë¥É", - "¥Ê¡¼¥¬", - "¥ª¡¼¥¯", - "¿Í´Ö", - "»Í½Ã", - "¥Í¥º¥ß", - "¥¹¥±¥ë¥È¥ó", - "¥Ç¡¼¥â¥ó", - "¥Ü¥ë¥Æ¥Ã¥¯¥¹", - "¥¤¥â¥à¥·/Âç·²", + "ã¦ãã¼ã¯", /* "Uniques" */ + "ä¹é¦¬å¯è½ãªã¢ã³ã¹ã¿ã¼", /* "Riding" */ + "è³éé¦", /* "Wanted */ + "ã¢ã³ãã¼ã®çæ", /* "Ambertite" */ + "ã¢ãª", + "ã³ã¦ã¢ãª", + "ã ã«ã", + "ãã©ã´ã³", + "ç®ç", + "ãã³", + "ã´ã¼ã¬ã ", + "æ¨æºäººéåçç©", + "ãããã", + "ã¼ãªã¼", + "ã³ãã«ã", + "水棲çç©", + "ã¢ã«ã", + "ãã¼ã¬", + "ãªã¼ã¯", + "人é", + "å足ç£", + "ããºã", + "ã¹ã±ã«ãã³", + "ãã¼ã¢ã³", + "ãã«ããã¯ã¹", + "ã¤ã¢ã ã·/大群", /* "unused", */ - "¥¤¡¼¥¯", - "¥¾¥ó¥Ó/¥ß¥¤¥é", - "Å·»È", - "Ä»", - "¸¤", - /* "¸ÅÂå¥É¥é¥´¥ó/¥ï¥¤¥¢¡¼¥à", */ - "¥¨¥ì¥á¥ó¥¿¥ë", - "¥È¥ó¥Ü", - "¥´¡¼¥¹¥È", - "»¨¼ï", - "º«Ãî", - "¥Ø¥Ó", - "¥¥é¡¼¡¦¥Ó¡¼¥È¥ë", - "¥ê¥Ã¥Á", - "¿¼ó¤Îà¨ÃîÎà", - "Ææ¤ÎÀ¸Êª", - "¥ª¡¼¥¬", - "µðÂç¿Í´Ö·¿À¸Êª", - "¥¯¥¤¥ë¥¹¥ë¥°", - "à¨ÃîÎà/ξÀ¸Îà", - "ÃØéá/¥µ¥½¥ê/¥À¥Ë", - "¥È¥í¥ë", - /* "¾åµé¥Ç¡¼¥â¥ó", */ - "¥Ð¥ó¥Ñ¥¤¥¢", - "¥ï¥¤¥È/¥ì¥¤¥¹/Åù", - "¥¾¡¼¥ó/¥¶¥ì¥ó/Åù", - "¥¤¥¨¥Æ¥£", - "¥Ï¥¦¥ó¥É", - "¥ß¥ß¥Ã¥¯", - "ÊÉ/¿¢Êª/µ¤ÂÎ", - "¤ª¤Ð¤±¥¥Î¥³", - "µåÂÎ", + "ã¤ã¼ã¯", + "ã¾ã³ã/ãã¤ã©", + "天使", + "é³¥", + "ç¬", + /* "å¤ä»£ãã©ã´ã³/ã¯ã¤ã¢ã¼ã ", */ + "ã¨ã¬ã¡ã³ã¿ã«", + "ãã³ã", + "ã´ã¼ã¹ã", + "é種", + "æè«", + "ãã", + "ãã©ã¼ã»ãã¼ãã«", + "ãªãã", + "å¤é¦ã®ç¬è«é¡", + "è¬ã®çç©", + "ãªã¼ã¬", + "巨大人éåçç©", + "ã¯ã¤ã«ã¹ã«ã°", + "ç¬è«é¡/両çé¡", + "èè/ãµã½ãª/ãã", + "ããã«", + /* "ä¸ç´ãã¼ã¢ã³", */ + "ãã³ãã¤ã¢", + "ã¯ã¤ã/ã¬ã¤ã¹/ç", + "ã¾ã¼ã³/ã¶ã¬ã³/ç", + "ã¤ã¨ãã£", + "ãã¦ã³ã", + "ãããã¯", + "å£/æ¤ç©/æ°ä½", + "ãã°ãããã³", + "çä½", + "ãã¬ã¤ã¤ã¼", #else "Uniques", "Ridable monsters", + "Wanted monsters", + "Ambertite", "Ant", "Bat", "Centipede", @@ -5056,6 +4184,7 @@ static cptr monster_group_text[] = "Wall/Plant/Gas", "Mushroom patch", "Ball", + "Player", #endif NULL }; @@ -5065,10 +4194,12 @@ static cptr monster_group_text[] = * Symbols of monsters in each group. Note the "Uniques" group * is handled differently. */ -static cptr monster_group_char[] = +static cptr monster_group_char[] = { (char *) -1L, (char *) -2L, + (char *) -3L, + (char *) -4L, "a", "b", "c", @@ -5120,10 +4251,11 @@ static cptr monster_group_char[] = "X", "Y", "Z", - "$!?=&`.|/\\~[]()>", - "#", + "!$&()+./=>?[\\]`{|~", + "#%", ",", "*", + "@", NULL }; @@ -5157,7 +4289,7 @@ static bool ang_sort_comp_monster_level(vptr u, vptr v, int a, int b) * of monsters in the group. * * mode & 0x01 : check for non-empty group - * mode & 0x02 : cheat? + * mode & 0x02 : visual operation only */ static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode) { @@ -5173,6 +4305,13 @@ static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode) /* XXX Hack -- Check if this is the "Riding" group */ bool grp_riding = (monster_group_char[grp_cur] == (char *) -2L); + /* XXX Hack -- Check if this is the "Wanted" group */ + bool grp_wanted = (monster_group_char[grp_cur] == (char *) -3L); + + /* XXX Hack -- Check if this is the "Amberite" group */ + bool grp_amberite = (monster_group_char[grp_cur] == (char *) -4L); + + /* Check every race */ for (i = 0; i < max_r_idx; i++) { @@ -5183,7 +4322,7 @@ static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode) if (!r_ptr->name) continue ; /* Require known monsters */ - if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights ) continue; + if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights) continue; if (grp_unique) { @@ -5195,10 +4334,31 @@ static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode) if (!(r_ptr->flags7 & RF7_RIDING)) continue; } + else if (grp_wanted) + { + bool wanted = FALSE; + int j; + for (j = 0; j < MAX_KUBI; j++) + { + if (kubi_r_idx[j] == i || kubi_r_idx[j] - 10000 == i || + (p_ptr->today_mon && p_ptr->today_mon == i)) + { + wanted = TRUE; + break; + } + } + if (!wanted) continue; + } + + else if (grp_amberite) + { + if (!(r_ptr->flags3 & RF3_AMBERITE)) continue; + } + else { /* Check for race in the group */ - if (!strchr(group_char, r_ptr->d_char)) continue; + if (!my_strchr(group_char, r_ptr->d_char)) continue; } /* Add the race */ @@ -5209,7 +4369,7 @@ static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode) } /* Terminate the list */ - mon_idx[mon_cnt] = 0; + mon_idx[mon_cnt] = -1; /* Select the sort method */ ang_sort_comp = ang_sort_comp_monster_level; @@ -5229,45 +4389,48 @@ static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode) static cptr object_group_text[] = { #ifdef JP - "¥¥Î¥³", /* "Mushrooms" */ - "Ìô", /* "Potions" */ - "Ìý¤Ä¤Ü", /* "Flasks" */ - "´¬Êª", /* "Scrolls" */ - "»ØÎØ", /* "Rings" */ - "¥¢¥ß¥å¥ì¥Ã¥È", /* "Amulets" */ - "Å«", /* "Whistle" */ - "¸÷¸»", /* "Lanterns" */ - "ËâË¡ËÀ", /* "Wands" */ - "¾ó", /* "Staffs" */ - "¥í¥Ã¥É", /* "Rods" */ - "¥«¡¼¥É", /* "Cards" */ - "¥¥ã¥×¥Á¥ã¡¼¡¦¥Ü¡¼¥ë", - "ÍÓÈé»æ", - "¤¯¤µ¤Ó", - "È¢", - "¿Í·Á", - "Áü", - "¥´¥ß", - "¶õ¤Î¥Ó¥ó", - "¹ü", - "Åá·õÎà", /* "Swords" */ - "Æß´ï", /* "Blunt Weapons" */ - "ĹÊÁÉð´ï", /* "Polearms" */ - "ºÎ·¡Æ»¶ñ", /* "Diggers" */ - "Èô¤ÓÆ»¶ñ", /* "Bows" */ - "ÃÆ", - "Ìð", - "¥Ü¥ë¥È", - "·ÚÁõ³»", /* "Soft Armor" */ - "½ÅÁõ³»", /* "Hard Armor" */ - "¥É¥é¥´¥ó³»", /* "Dragon Armor" */ - "½â", /* "Shields" */ - "¥¯¥í¡¼¥¯", /* "Cloaks" */ - "äƼê", /* "Gloves" */ - "¥Ø¥ë¥á¥Ã¥È", /* "Helms" */ - "´§", /* "Crowns" */ - "¥Ö¡¼¥Ä", /* "Boots" */ - "ËâË¡½ñ", + "ããã³", /* "Mushrooms" */ + "è¬", /* "Potions" */ + "æ²¹ã¤ã¼", /* "Flasks" */ + "å·»ç©", /* "Scrolls" */ + "æ輪", /* "Rings" */ + "ã¢ãã¥ã¬ãã", /* "Amulets" */ + "ç¬", /* "Whistle" */ + "å æº", /* "Lanterns" */ + "éæ³æ£", /* "Wands" */ + "æ", /* "Staffs" */ + "ããã", /* "Rods" */ + "ã«ã¼ã", /* "Cards" */ + "ãã£ããã£ã¼ã»ãã¼ã«", + "ç¾ç®ç´", + "ããã³", + "ç®±", + "人形", + "å", + "ã´ã", + "空ã®ãã³", + "骨", + "æ»ä½", + "åå£é¡", /* "Swords" */ + "éå¨", /* "Blunt Weapons" */ + "é·ææ¦å¨", /* "Polearms" */ + "æ¡æéå ·", /* "Diggers" */ + "é£ã³éå ·", /* "Bows" */ + "å¼¾", + "ç¢", + "ãã«ã", + "è»½è£ é§", /* "Soft Armor" */ + "éè£ é§", /* "Hard Armor" */ + "ãã©ã´ã³é§", /* "Dragon Armor" */ + "ç¾", /* "Shields" */ + "ã¯ãã¼ã¯", /* "Cloaks" */ + "ç± æ", /* "Gloves" */ + "ãã«ã¡ãã", /* "Helms" */ + "å ", /* "Crowns" */ + "ãã¼ã", /* "Boots" */ + "éæ³æ¸", + "財å®", + "ä½ã", #else "Mushrooms", "Potions", @@ -5290,6 +4453,7 @@ static cptr object_group_text[] = "Junks", "Bottles", "Skeletons", + "Corpses", "Swords", "Blunt Weapons", "Polearms", @@ -5308,6 +4472,8 @@ static cptr object_group_text[] = "Crowns", "Boots", "Spellbooks", + "Treasure", + "Something", #endif NULL }; @@ -5339,6 +4505,7 @@ static byte object_group_tval[] = TV_JUNK, TV_BOTTLE, TV_SKELETON, + TV_CORPSE, TV_SWORD, TV_HAFTED, TV_POLEARM, @@ -5357,15 +4524,20 @@ static byte object_group_tval[] = TV_CROWN, TV_BOOTS, TV_LIFE_BOOK, /* Hack -- all spellbooks */ - 0 + TV_GOLD, + 0, + 0, }; /* - * Build a list of monster indexes in the given group. Return the number - * of monsters in the group. + * Build a list of object indexes in the given group. Return the number + * of objects in the group. + * + * mode & 0x01 : check for non-empty group + * mode & 0x02 : visual operation only */ -static int collect_objects(int grp_cur, int object_idx[]) +static int collect_objects(int grp_cur, int object_idx[], byte mode) { int i, j, k, object_cnt = 0; @@ -5375,43 +4547,58 @@ static int collect_objects(int grp_cur, int object_idx[]) /* Check every object */ for (i = 0; i < max_k_idx; i++) { - /* Access the race */ + /* Access the object */ object_kind *k_ptr = &k_info[i]; /* Skip empty objects */ if (!k_ptr->name) continue; - /* Skip non-flavoured objects */ - if (!k_ptr->flavor && !p_ptr->wizard) continue; + if (mode & 0x02) + { + /* Any objects will be displayed */ + } + else + { + if (!p_ptr->wizard) + { + /* Skip non-flavoured objects */ + if (!k_ptr->flavor) continue; - /* Skip items with no distribution (special artifacts) */ - for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j]; - if (!(k)) continue; + /* Require objects ever seen */ + if (!k_ptr->aware) continue; + } - /* Require objects ever seen*/ - if (!k_ptr->aware && !p_ptr->wizard) continue; + /* Skip items with no distribution (special artifacts) */ + for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j]; + if (!k) continue; + } - /* Check for race in the group */ + /* Check for objects in the group */ if (TV_LIFE_BOOK == group_tval) { /* Hack -- All spell books */ - if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HISSATSU_BOOK) + if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HEX_BOOK) { - /* Add the race */ + /* Add the object */ object_idx[object_cnt++] = i; } + else continue; } else if (k_ptr->tval == group_tval) { - /* Add the race */ + /* Add the object */ object_idx[object_cnt++] = i; } + else continue; + + /* XXX Hack -- Just checking for non-empty group */ + if (mode & 0x01) break; } /* Terminate the list */ - object_idx[object_cnt] = 0; + object_idx[object_cnt] = -1; - /* Return the number of races */ + /* Return the number of objects */ return object_cnt; } @@ -5429,8 +4616,10 @@ static cptr feature_group_text[] = /* * Build a list of feature indexes in the given group. Return the number * of features in the group. + * + * mode & 0x01 : check for non-empty group */ -static int collect_features(int grp_cur, int *feat_idx) +static int collect_features(int grp_cur, int *feat_idx, byte mode) { int i, feat_cnt = 0; @@ -5438,7 +4627,7 @@ static int collect_features(int grp_cur, int *feat_idx) (void)grp_cur; /* Check every feature */ - for (i = 1; i < max_f_idx; i++) + for (i = 0; i < max_f_idx; i++) { /* Access the index */ feature_type *f_ptr = &f_info[i]; @@ -5451,10 +4640,13 @@ static int collect_features(int grp_cur, int *feat_idx) /* Add the index */ feat_idx[feat_cnt++] = i; + + /* XXX Hack -- Just checking for non-empty group */ + if (mode & 0x01) break; } /* Terminate the list */ - feat_idx[feat_cnt] = 0; + feat_idx[feat_cnt] = -1; /* Return the number of races */ return feat_cnt; @@ -5508,79 +4700,6 @@ static int collect_artifacts(int grp_cur, int object_idx[]) static char hack[17] = "dwsorgbuDWvyRGBU"; -static errr photo_fgets(FILE *fff, char *buf, huge n) -{ - huge i = 0; - - char *s; - - char tmp[1024]; - - /* Read a line */ - if (fgets(tmp, 1024, fff)) - { - /* Convert weirdness */ - for (s = tmp; *s; s++) - { - /* Handle newline */ - if (*s == '\n') - { - /* Terminate */ - buf[i] = '\0'; - - /* Success */ - return (0); - } - - /* Handle tabs */ - else if (*s == '\t') - { - /* Hack -- require room */ - if (i + 8 >= n) break; - - /* Append a space */ - buf[i++] = ' '; - - /* Append some more spaces */ - while (!(i % 8)) buf[i++] = ' '; - } - -#ifdef JP - else if (iskanji(*s)) - { - if (!s[1]) break; - buf[i++] = *s++; - buf[i++] = *s; - } -# ifndef EUC - /* Ⱦ³Ñ¤«¤Ê¤ËÂбþ */ - else if ((((int)*s & 0xff) > 0xa1) && (((int)*s & 0xff ) < 0xdf)) - { - buf[i++] = *s; - if (i >= n) break; - } -# endif -#endif - /* Handle printables */ - else - { - /* Copy */ - buf[i++] = *s; - - /* Check length */ - if (i >= n) break; - } - } - } - - /* Nothing */ - buf[0] = '\0'; - - /* Failure */ - return (1); -} - - /* * Hack -- load a screen dump from a file */ @@ -5609,11 +4728,7 @@ void do_cmd_load_screen(void) /* Oops */ if (!fff) { -#ifdef JP - msg_format("%s ¤ò³«¤¯¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf); -#else - msg_format("Failed to open %s.", buf); -#endif + msg_format(_("%s ãéããã¨ãã§ãã¾ããã§ããã", "Failed to open %s."), buf); msg_print(NULL); return; } @@ -5627,32 +4742,46 @@ void do_cmd_load_screen(void) /* Load the screen */ - for (y = 0; okay && (y < hgt); y++) + for (y = 0; okay; y++) { - /* Get a line of data */ - if (photo_fgets(fff, buf, 1024)) okay = FALSE; + /* Get a line of data including control code */ + if (!fgets(buf, 1024, fff)) okay = FALSE; + + /* Get the blank line */ + if (buf[0] == '\n' || buf[0] == '\0') break; + + /* Ignore too large screen image */ + if (y >= hgt) continue; /* Show each row */ for (x = 0; x < wid - 1; x++) { + /* End of line */ + if (buf[x] == '\n' || buf[x] == '\0') break; + /* Put the attr/char */ Term_draw(x, y, TERM_WHITE, buf[x]); } } - /* Get the blank line */ - if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE; - - /* Dump the screen */ - for (y = 0; okay && (y < hgt); y++) + for (y = 0; okay; y++) { - /* Get a line of data */ - if (photo_fgets(fff, buf, 1024)) okay = FALSE; + /* Get a line of data including control code */ + if (!fgets(buf, 1024, fff)) okay = FALSE; + + /* Get the blank line */ + if (buf[0] == '\n' || buf[0] == '\0') break; + + /* Ignore too large screen image */ + if (y >= hgt) continue; /* Dump each row */ for (x = 0; x < wid - 1; x++) { + /* End of line */ + if (buf[x] == '\n' || buf[x] == '\0') break; + /* Get the attr/char */ (void)(Term_what(x, y, &a, &c)); @@ -5669,20 +4798,12 @@ void do_cmd_load_screen(void) } - /* Get the blank line */ - if (my_fgets(fff, buf, sizeof(buf))) okay = FALSE; - - /* Close it */ my_fclose(fff); /* Message */ -#ifdef JP - prt("¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤µ¤ì¤¿²èÌÌ(µÇ°»£±Æ)¤ò¥í¡¼¥É¤·¤Þ¤·¤¿¡£", 0, 0); -#else - msg_print("Screen dump loaded."); -#endif + prt(_("ãã¡ã¤ã«ã«æ¸ãåºãããç»é¢(è¨å¿µæ®å½±)ããã¼ããã¾ããã", "Screen dump loaded."), 0, 0); flush(); inkey(); @@ -5695,23 +4816,13 @@ void do_cmd_load_screen(void) -cptr inven_res_label = -#ifdef JP - " »ÀÅŲÐÎäÆǸ÷°ÇÇ˹ì¹ö°øÆÙÎô ÌÕÉÝÍðáãÆ©Ì¿´¶¾ÃÉüÉâ"; -#else - " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv"; -#endif +cptr inven_res_label = _(" é ¸é»ç«å·æ¯å éç ´è½çå æ²å£ ç²æä¹±çºéå½ææ¶å¾©æµ®", + " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv"); -#ifdef JP -#define IM_FLAG_STR "¡ö" -#define HAS_FLAG_STR "¡Ü" -#define NO_FLAG_STR "¡¦" -#else -#define IM_FLAG_STR "* " -#define HAS_FLAG_STR "+ " -#define NO_FLAG_STR ". " -#endif +#define IM_FLAG_STR _("ï¼", "* ") +#define HAS_FLAG_STR _("ï¼", "+ ") +#define NO_FLAG_STR _("ã»", ". ") #define print_im_or_res_flag(IM, RES) \ { \ @@ -5735,23 +4846,23 @@ static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, by if (o_ptr->tval != tval) return; /* Identified items only */ - if (!object_known_p(o_ptr)) return; + if (!object_is_known(o_ptr)) return; /* * HACK:Ring of Lordly protection and Dragon equipment * have random resistances. */ - if (((TV_EQUIP_BEGIN <= tval) && (tval <= TV_EQUIP_END) && o_ptr->name2) + if ((object_is_wearable(o_ptr) && object_is_ego(o_ptr)) || ((tval == TV_AMULET) && (o_ptr->sval == SV_AMULET_RESISTANCE)) || ((tval == TV_RING) && (o_ptr->sval == SV_RING_LORDLY)) || ((tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD)) || ((tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM)) || ((tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES)) || ((tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE)) - || o_ptr->art_name || o_ptr->name1) + || object_is_artifact(o_ptr)) { int i = 0; - object_desc(o_name, o_ptr, TRUE, 0); + object_desc(o_name, o_ptr, OD_NAME_ONLY); while (o_name[i] && (i < 26)) { @@ -5774,11 +4885,8 @@ static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, by if (!(o_ptr->ident & (IDENT_MENTAL))) { -#ifdef JP - fputs("-------ÉÔÌÀ--------------- -------ÉÔÌÀ---------\n", fff); -#else - fputs("-------unknown------------ -------unknown------\n", fff); -#endif + fputs(_("-------ä¸æ--------------- -------ä¸æ---------\n", + "-------unknown------------ -------unknown------\n"), fff); } else { @@ -5805,11 +4913,11 @@ static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, by print_flag(TR_RES_CONF); print_flag(TR_FREE_ACT); print_flag(TR_SEE_INVIS); - print_flag(TR_HOLD_LIFE); + print_flag(TR_HOLD_EXP); print_flag(TR_TELEPATHY); print_flag(TR_SLOW_DIGEST); print_flag(TR_REGEN); - print_flag(TR_FEATHER); + print_flag(TR_LEVITATION); fputc('\n', fff); } @@ -5843,17 +4951,13 @@ static void do_cmd_knowledge_inven(void) fff = my_fopen_temp(file_name, 1024); if (!fff) { -#ifdef JP - msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name); -#else - msg_format("Failed to create temporary file %s.", file_name); -#endif + msg_format(_("ä¸æãã¡ã¤ã« %s ãä½æã§ãã¾ããã§ããã", "Failed to create temporary file %s."), file_name); msg_print(NULL); return; } fprintf(fff, "%s\n", inven_res_label); - for (tval = TV_EQUIP_BEGIN; tval <= TV_EQUIP_END; tval++) + for (tval = TV_WEARABLE_BEGIN; tval <= TV_WEARABLE_END; tval++) { if (j != 0) { @@ -5861,34 +4965,19 @@ static void do_cmd_knowledge_inven(void) j = 0; fprintf(fff, "%s\n", inven_res_label); } - -#ifdef JP - strcpy(where, "Áõ"); -#else - strcpy(where, "E "); -#endif + strcpy(where, _("è£ ", "E ")); for (i = INVEN_RARM; i < INVEN_TOTAL; i++) { do_cmd_knowledge_inven_aux(fff, &inventory[i], &j, tval, where); } - -#ifdef JP - strcpy(where, "»ý"); -#else - strcpy(where, "I "); -#endif + strcpy(where, _("æ", "I ")); for (i = 0; i < INVEN_PACK; i++) { do_cmd_knowledge_inven_aux(fff, &inventory[i], &j, tval, where); } st_ptr = &town[1].store[STORE_HOME]; -#ifdef JP - strcpy(where, "²È"); -#else - strcpy(where, "H "); -#endif - + strcpy(where, _("家", "H ")); for (i = 0; i < st_ptr->stock_num; i++) { do_cmd_knowledge_inven_aux(fff, &st_ptr->stock[i], &j, tval, where); @@ -5899,11 +4988,7 @@ static void do_cmd_knowledge_inven(void) my_fclose(fff); /* Display the file contents */ -#ifdef JP - show_file(TRUE, file_name, "*´ÕÄê*ºÑ¤ßÉð´ï/Ëɶñ¤ÎÂÑÀ¥ê¥¹¥È", 0, 0); -#else - show_file(TRUE, file_name, "Resistances of *identified* equipment", 0, 0); -#endif + show_file(TRUE, file_name, _("*éå®*æ¸ã¿æ¦å¨/é²å ·ã®èæ§ãªã¹ã", "Resistances of *identified* equipment"), 0, 0); /* Remove the file */ fd_kill(file_name); @@ -5952,11 +5037,7 @@ void do_cmd_save_screen_html_aux(char *filename, int message) /* Oops */ if (!fff) { if (message) { -#ifdef JP - msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", filename); -#else - msg_format("Failed to open file %s.", filename); -#endif + msg_format(_("ãã¡ã¤ã« %s ãéãã¾ããã§ããã", "Failed to open file %s."), filename); msg_print(NULL); } @@ -5972,7 +5053,7 @@ void do_cmd_save_screen_html_aux(char *filename, int message) tmpfff = my_fopen(buf, "r"); if (!tmpfff) { for (i = 0; html_head[i]; i++) - fprintf(fff, html_head[i]); + fputs(html_head[i], fff); } else { yomikomu = 0; @@ -6034,7 +5115,7 @@ void do_cmd_save_screen_html_aux(char *filename, int message) if (!tmpfff) { for (i = 0; html_foot[i]; i++) - fprintf(fff, html_foot[i]); + fputs(html_foot[i], fff); } else { rewind(tmpfff); @@ -6061,11 +5142,7 @@ void do_cmd_save_screen_html_aux(char *filename, int message) /* Message */ if (message) { -#ifdef JP - msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£"); -#else - msg_print("Screen dump saved."); -#endif + msg_print(_("ç»é¢(è¨å¿µæ®å½±)ããã¡ã¤ã«ã«æ¸ãåºãã¾ããã", "Screen dump saved.")); msg_print(NULL); } @@ -6081,11 +5158,7 @@ static void do_cmd_save_screen_html(void) { char buf[1024], tmp[256] = "screen.html"; -#ifdef JP - if (!get_string("¥Õ¥¡¥¤¥ë̾: ", tmp, 80)) -#else - if (!get_string("File name: ", tmp, 80)) -#endif + if (!get_string(_("ãã¡ã¤ã«å: ", "File name: "), tmp, 80)) return; /* Build the filename */ @@ -6113,11 +5186,7 @@ void do_cmd_save_screen(void) int wid, hgt; -#ifdef JP - prt("µÇ°»£±Æ¤·¤Þ¤¹¤«¡© [(y)es/(h)tml/(n)o] ", 0, 0); -#else - prt("Save screen dump? [(y)es/(h)tml/(n)o] ", 0, 0); -#endif + prt(_("è¨å¿µæ®å½±ãã¾ããï¼ [(y)es/(h)tml/(n)o] ", "Save screen dump? [(y)es/(h)tml/(n)o] "), 0, 0); while(TRUE) { char c = inkey(); @@ -6184,11 +5253,7 @@ void do_cmd_save_screen(void) /* Oops */ if (!fff) { -#ifdef JP - msg_format("¥Õ¥¡¥¤¥ë %s ¤ò³«¤±¤Þ¤»¤ó¤Ç¤·¤¿¡£", buf); -#else - msg_format("Failed to open file %s.", buf); -#endif + msg_format(_("ãã¡ã¤ã« %s ãéãã¾ããã§ããã", "Failed to open file %s."), buf); msg_print(NULL); return; } @@ -6250,15 +5315,9 @@ void do_cmd_save_screen(void) my_fclose(fff); /* Message */ -#ifdef JP - msg_print("²èÌÌ(µÇ°»£±Æ)¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤·¤Þ¤·¤¿¡£"); -#else - msg_print("Screen dump saved."); -#endif - + msg_print(_("ç»é¢(è¨å¿µæ®å½±)ããã¡ã¤ã«ã«æ¸ãåºãã¾ããã", "Screen dump saved.")); msg_print(NULL); - /* Restore the screen */ screen_load(); } @@ -6381,11 +5440,7 @@ static void do_cmd_knowledge_artifacts(void) fff = my_fopen_temp(file_name, 1024); if (!fff) { -#ifdef JP - msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name); -#else - msg_format("Failed to create temporary file %s.", file_name); -#endif + msg_format(_("ä¸æãã¡ã¤ã« %s ãä½æã§ãã¾ããã§ããã", "Failed to create temporary file %s."), file_name); msg_print(NULL); return; } @@ -6435,10 +5490,10 @@ static void do_cmd_knowledge_artifacts(void) next_o_idx = o_ptr->next_o_idx; /* Ignore non-artifacts */ - if (!artifact_p(o_ptr)) continue; + if (!object_is_fixed_artifact(o_ptr)) continue; /* Ignore known items */ - if (object_known_p(o_ptr)) continue; + if (object_is_known(o_ptr)) continue; /* Note the artifact */ okay[o_ptr->name1] = FALSE; @@ -6455,10 +5510,10 @@ static void do_cmd_knowledge_artifacts(void) if (!o_ptr->k_idx) continue; /* Ignore non-artifacts */ - if (!artifact_p(o_ptr)) continue; + if (!object_is_fixed_artifact(o_ptr)) continue; /* Ignore known items */ - if (object_known_p(o_ptr)) continue; + if (object_is_known(o_ptr)) continue; /* Note the artifact */ okay[o_ptr->name1] = FALSE; @@ -6482,12 +5537,7 @@ static void do_cmd_knowledge_artifacts(void) artifact_type *a_ptr = &a_info[who[k]]; /* Paranoia */ -#ifdef JP - strcpy(base_name, "̤ÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à"); -#else - strcpy(base_name, "Unknown Artifact"); -#endif - + strcpy(base_name, _("æªç¥ã®ä¼èª¬ã®ã¢ã¤ãã ", "Unknown Artifact")); /* Obtain the base object type */ z = lookup_kind(a_ptr->tval, a_ptr->sval); @@ -6507,17 +5557,15 @@ static void do_cmd_knowledge_artifacts(void) /* Make it an artifact */ q_ptr->name1 = (byte)who[k]; + /* Display as if known */ + q_ptr->ident |= IDENT_STORE; + /* Describe the artifact */ - object_desc_store(base_name, q_ptr, FALSE, 0); + object_desc(base_name, q_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY)); } /* Hack -- Build the artifact name */ -#ifdef JP - fprintf(fff, " %s\n", base_name); -#else - fprintf(fff, " The %s\n", base_name); -#endif - + fprintf(fff, _(" %s\n", " The %s\n"), base_name); } /* Free the "who" array */ @@ -6530,12 +5578,7 @@ static void do_cmd_knowledge_artifacts(void) my_fclose(fff); /* Display the file contents */ -#ifdef JP - show_file(TRUE, file_name, "´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à", 0, 0); -#else - show_file(TRUE, file_name, "Artifacts Seen", 0, 0); -#endif - + show_file(TRUE, file_name, _("æ¢ç¥ã®ä¼èª¬ã®ã¢ã¤ãã ", "Artifacts Seen"), 0, 0); /* Remove the file */ fd_kill(file_name); @@ -6544,6 +5587,7 @@ static void do_cmd_knowledge_artifacts(void) /* * Display known uniques + * With "XTRA HACK UNIQHIST" (Originally from XAngband) */ static void do_cmd_knowledge_uniques(void) { @@ -6555,15 +5599,20 @@ static void do_cmd_knowledge_uniques(void) char file_name[1024]; + int n_alive[10]; + int n_alive_surface = 0; + int n_alive_over100 = 0; + int n_alive_total = 0; + int max_lev = -1; + + for (i = 0; i < 10; i++) n_alive[i] = 0; + /* Open a new file */ fff = my_fopen_temp(file_name, 1024); - if (!fff) { -#ifdef JP - msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name); -#else - msg_format("Failed to create temporary file %s.", file_name); -#endif + if (!fff) + { + msg_format(_("ä¸æãã¡ã¤ã« %s ãä½æã§ãã¾ããã§ããã", "Failed to create temporary file %s."), file_name); msg_print(NULL); return; } @@ -6575,9 +5624,36 @@ static void do_cmd_knowledge_uniques(void) for (i = 1; i < max_r_idx; i++) { monster_race *r_ptr = &r_info[i]; + int lev; - /* Use that monster */ - if (r_ptr->name) who[n++] = i; + if (!r_ptr->name) continue; + + /* Require unique monsters */ + if (!(r_ptr->flags1 & RF1_UNIQUE)) continue; + + /* Only display "known" uniques */ + if (!cheat_know && !r_ptr->r_sights) continue; + + /* Only print rarity <= 100 uniques */ + if (!r_ptr->rarity || ((r_ptr->rarity > 100) && !(r_ptr->flags1 & RF1_QUESTOR))) continue; + + /* Only "alive" uniques */ + if (r_ptr->max_num == 0) continue; + + if (r_ptr->level) + { + lev = (r_ptr->level - 1) / 10; + if (lev < 10) + { + n_alive[lev]++; + if (max_lev < lev) max_lev = lev; + } + else n_alive_over100++; + } + else n_alive_surface++; + + /* Collect "appropriate" monsters */ + who[n++] = i; } /* Select the sort method */ @@ -6587,32 +5663,39 @@ static void do_cmd_knowledge_uniques(void) /* Sort the array by dungeon depth of monsters */ ang_sort(who, &why, n); + if (n_alive_surface) + { + fprintf(fff, _(" å°ä¸ çå: %3dä½\n", " Surface alive: %3d\n"), n_alive_surface); + n_alive_total += n_alive_surface; + } + for (i = 0; i <= max_lev; i++) + { + fprintf(fff, _("%3d-%3dé çå: %3dä½\n", "Level %3d-%3d alive: %3d\n"), 1 + i * 10, 10 + i * 10, n_alive[i]); + n_alive_total += n_alive[i]; + } + if (n_alive_over100) + { + fprintf(fff, _("101- é çå: %3dä½\n", "Level 101- alive: %3d\n"), n_alive_over100); + n_alive_total += n_alive_over100; + } + + if (n_alive_total) + { + fputs(_("--------- -----------\n", "------------- ----------\n"), fff); + fprintf(fff, _(" åè¨ çå: %3dä½\n\n", " Total alive: %3d\n\n"), n_alive_total); + } + else + { + fputs(_("ç¾å¨ã¯æ¢ç¥ã®çåã¦ãã¼ã¯ã¯ãã¾ããã\n", "No known uniques alive.\n"), fff); + } + /* Scan the monster races */ for (k = 0; k < n; k++) { monster_race *r_ptr = &r_info[who[k]]; - /* Only print Uniques */ - if (r_ptr->flags1 & (RF1_UNIQUE)) - { - bool dead = (r_ptr->max_num == 0); - - if (dead) continue; - - /* Only display "known" uniques */ - if (dead || cheat_know || r_ptr->r_sights) - { - /* Print a message */ -#ifdef JP - fprintf(fff, " %s¤Ï¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¡£\n", - (r_name + r_ptr->name)); -#else - fprintf(fff, " %s is alive\n", - (r_name + r_ptr->name)); -#endif - - } - } + /* Print a message */ + fprintf(fff, _(" %s (ã¬ãã«%d)\n", " %s (level %d)\n"), r_name + r_ptr->name, r_ptr->level); } /* Free the "who" array */ @@ -6622,12 +5705,7 @@ static void do_cmd_knowledge_uniques(void) my_fclose(fff); /* Display the file contents */ -#ifdef JP - show_file(TRUE, file_name, "¤Þ¤ÀÀ¸¤¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼", 0, 0); -#else - show_file(TRUE, file_name, "Alive Uniques", 0, 0); -#endif - + show_file(TRUE, file_name, _("ã¾ã çãã¦ããã¦ãã¼ã¯ã»ã¢ã³ã¹ã¿ã¼", "Alive Uniques"), 0, 0); /* Remove the file */ fd_kill(file_name); @@ -6649,11 +5727,7 @@ static void do_cmd_knowledge_weapon_exp(void) /* Open a new file */ fff = my_fopen_temp(file_name, 1024); if (!fff) { -#ifdef JP - msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name); -#else - msg_format("Failed to create temporary file %s.", file_name); -#endif + msg_format(_("ä¸æãã¡ã¤ã« %s ãä½æã§ãã¾ããã§ããã", "Failed to create temporary file %s."), file_name); msg_print(NULL); return; } @@ -6668,7 +5742,7 @@ static void do_cmd_knowledge_weapon_exp(void) if ((k_ptr->tval == TV_SWORD - i) && (k_ptr->sval == num)) { - if ((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON)) continue; + if ((k_ptr->tval == TV_BOW) && (k_ptr->sval == SV_CRIMSON || k_ptr->sval == SV_HARP)) continue; weapon_exp = p_ptr->weapon_exp[4 - i][num]; strip_name(tmp, j); @@ -6688,49 +5762,38 @@ static void do_cmd_knowledge_weapon_exp(void) my_fclose(fff); /* Display the file contents */ -#ifdef JP - show_file(TRUE, file_name, "Éð´ï¤Î·Ð¸³ÃÍ", 0, 0); -#else - show_file(TRUE, file_name, "Weapon Proficiency", 0, 0); -#endif - + show_file(TRUE, file_name, _("æ¦å¨ã®çµé¨å¤", "Weapon Proficiency"), 0, 0); /* Remove the file */ fd_kill(file_name); } -/* +/*! + * @brief éæ³ã®çµé¨å¤ã表示ããã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ * Display spell-exp + * @return ãªã */ static void do_cmd_knowledge_spell_exp(void) { int i = 0, spell_exp, exp_level; FILE *fff; - magic_type *s_ptr; + const magic_type *s_ptr; char file_name[1024]; /* Open a new file */ fff = my_fopen_temp(file_name, 1024); if (!fff) { -#ifdef JP - msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name); -#else - msg_format("Failed to create temporary file %s.", file_name); -#endif + msg_format(_("ä¸æãã¡ã¤ã« %s ãä½æã§ãã¾ããã§ããã", "Failed to create temporary file %s."), file_name); msg_print(NULL); return; } if (p_ptr->realm1 != REALM_NONE) { -#ifdef JP - fprintf(fff, "%s¤ÎËâË¡½ñ\n", realm_names[p_ptr->realm1]); -#else - fprintf(fff, "%s Spellbook\n", realm_names[p_ptr->realm1]); -#endif + fprintf(fff, _("%sã®éæ³æ¸\n", "%s Spellbook\n"), realm_names[p_ptr->realm1]); for (i = 0; i < 32; i++) { if (!is_magic(p_ptr->realm1)) @@ -6744,7 +5807,7 @@ static void do_cmd_knowledge_spell_exp(void) if (s_ptr->slevel >= 99) continue; spell_exp = p_ptr->spell_exp[i]; exp_level = spell_exp_level(spell_exp); - fprintf(fff, "%-25s ", spell_names[technic2magic(p_ptr->realm1) - 1][i]); + fprintf(fff, "%-25s ", do_spell(p_ptr->realm1, i, SPELL_NAME)); if (p_ptr->realm1 == REALM_HISSATSU) fprintf(fff, "[--]"); else @@ -6760,11 +5823,7 @@ static void do_cmd_knowledge_spell_exp(void) if (p_ptr->realm2 != REALM_NONE) { -#ifdef JP - fprintf(fff, "%s¤ÎËâË¡½ñ\n", realm_names[p_ptr->realm2]); -#else - fprintf(fff, "\n%s Spellbook\n", realm_names[p_ptr->realm2]); -#endif + fprintf(fff, _("%sã®éæ³æ¸\n", "\n%s Spellbook\n"), realm_names[p_ptr->realm2]); for (i = 0; i < 32; i++) { if (!is_magic(p_ptr->realm1)) @@ -6779,7 +5838,7 @@ static void do_cmd_knowledge_spell_exp(void) spell_exp = p_ptr->spell_exp[i + 32]; exp_level = spell_exp_level(spell_exp); - fprintf(fff, "%-25s ", spell_names[technic2magic(p_ptr->realm2) - 1][i]); + fprintf(fff, "%-25s ", do_spell(p_ptr->realm2, i, SPELL_NAME)); if (exp_level >= EXP_LEVEL_EXPERT) fprintf(fff, "!"); else fprintf(fff, " "); fprintf(fff, "%s", exp_level_str[exp_level]); @@ -6792,20 +5851,17 @@ static void do_cmd_knowledge_spell_exp(void) my_fclose(fff); /* Display the file contents */ -#ifdef JP - show_file(TRUE, file_name, "ËâË¡¤Î·Ð¸³ÃÍ", 0, 0); -#else - show_file(TRUE, file_name, "Spell Proficiency", 0, 0); -#endif - + show_file(TRUE, file_name, _("éæ³ã®çµé¨å¤", "Spell Proficiency"), 0, 0); /* Remove the file */ fd_kill(file_name); } -/* +/*! + * @brief ã¹ãã«æ å ±ã表示ããã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ / * Display skill-exp + * @return ãªã */ static void do_cmd_knowledge_skill_exp(void) { @@ -6814,20 +5870,14 @@ static void do_cmd_knowledge_skill_exp(void) FILE *fff; char file_name[1024]; -#ifdef JP - char skill_name[3][17]={"¥Þ¡¼¥·¥ã¥ë¥¢¡¼¥Ä", "ÆóÅáή ", "¾èÇÏ "}; -#else - char skill_name[3][20]={"Martial Arts ", "Dual Wielding ", "Riding "}; -#endif + char skill_name[3][20]={_("ãã¼ã·ã£ã«ã¢ã¼ã", "Martial Arts "), + _("äºåæµ ", "Dual Wielding "), + _("ä¹é¦¬ ", "Riding ")}; /* Open a new file */ fff = my_fopen_temp(file_name, 1024); if (!fff) { -#ifdef JP - msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name); -#else - msg_format("Failed to create temporary file %s.", file_name); -#endif + msg_format(_("ä¸æãã¡ã¤ã« %s ãä½æã§ãã¾ããã§ããã", "Failed to create temporary file %s."), file_name); msg_print(NULL); return; } @@ -6847,44 +5897,41 @@ static void do_cmd_knowledge_skill_exp(void) my_fclose(fff); /* Display the file contents */ -#ifdef JP - show_file(TRUE, file_name, "µ»Ç½¤Î·Ð¸³ÃÍ", 0, 0); -#else - show_file(TRUE, file_name, "Miscellaneous Proficiency", 0, 0); -#endif - + show_file(TRUE, file_name, _("æè½ã®çµé¨å¤", "Miscellaneous Proficiency"), 0, 0); /* Remove the file */ fd_kill(file_name); } -/* - * Pluralize a monster name +/*! + * @brief è±åèªãå¥ã説ãè¤æ°å½¢ãå¤æãã / Pluralize a monster name + * @param Name å¤æãããæååã®åç §ãã¤ã³ã¿ + * @return ãªã */ void plural_aux(char *Name) { int NameLen = strlen(Name); - if (strstr(Name, "Disembodied hand")) + if (my_strstr(Name, "Disembodied hand")) { strcpy(Name, "Disembodied hands that strangled people"); } - else if (strstr(Name, "Colour out of space")) + else if (my_strstr(Name, "Colour out of space")) { strcpy(Name, "Colours out of space"); } - else if (strstr(Name, "stairway to hell")) + else if (my_strstr(Name, "stairway to hell")) { strcpy(Name, "stairways to hell"); } - else if (strstr(Name, "Dweller on the threshold")) + else if (my_strstr(Name, "Dweller on the threshold")) { strcpy(Name, "Dwellers on the threshold"); } - else if (strstr(Name, " of ")) + else if (my_strstr(Name, " of ")) { - cptr aider = strstr(Name, " of "); + cptr aider = my_strstr(Name, " of "); char dummy[80]; int i = 0; cptr ctr = Name; @@ -6908,7 +5955,7 @@ void plural_aux(char *Name) strcpy(&(dummy[i+1]), aider); strcpy(Name, dummy); } - else if (strstr(Name, "coins")) + else if (my_strstr(Name, "coins")) { char dummy[80]; strcpy(dummy, "piles of "); @@ -6916,7 +5963,7 @@ void plural_aux(char *Name) strcpy(Name, dummy); return; } - else if (strstr(Name, "Manes")) + else if (my_strstr(Name, "Manes")) { return; } @@ -6982,8 +6029,10 @@ void plural_aux(char *Name) } } -/* +/*! + * @brief ç¾å¨ã®ãããã表示ããã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ / * Display current pets + * @return ãªã */ static void do_cmd_knowledge_pets(void) { @@ -6999,11 +6048,7 @@ static void do_cmd_knowledge_pets(void) /* Open a new file */ fff = my_fopen_temp(file_name, 1024); if (!fff) { -#ifdef JP - msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name); -#else - msg_format("Failed to create temporary file %s.", file_name); -#endif + msg_format(_("ä¸æãã¡ã¤ã« %s ãä½æã§ãã¾ããã§ããã", "Failed to create temporary file %s."), file_name); msg_print(NULL); return; } @@ -7030,8 +6075,8 @@ static void do_cmd_knowledge_pets(void) fprintf(fff, "----------------------------------------------\n"); #ifdef JP - fprintf(fff, " ¹ç·×: %d ɤ¤Î¥Ú¥Ã¥È\n", t_friends); - fprintf(fff, " °Ý»ý¥³¥¹¥È: %d%% MP\n", show_upkeep); + fprintf(fff, " åè¨: %d ä½ã®ããã\n", t_friends); + fprintf(fff, " ç¶æã³ã¹ã: %d%% MP\n", show_upkeep); #else fprintf(fff, " Total: %d pet%s.\n", t_friends, (t_friends == 1 ? "" : "s")); @@ -7041,25 +6086,21 @@ static void do_cmd_knowledge_pets(void) /* Close the file */ - my_fclose(fff); - - /* Display the file contents */ -#ifdef JP - show_file(TRUE, file_name, "¸½ºß¤Î¥Ú¥Ã¥È", 0, 0); -#else - show_file(TRUE, file_name, "Current Pets", 0, 0); -#endif + my_fclose(fff); + /* Display the file contents */ + show_file(TRUE, file_name, _("ç¾å¨ã®ããã", "Current Pets"), 0, 0); /* Remove the file */ fd_kill(file_name); } -/* +/*! + * @brief ç¾å¨ã®ãããã表示ããã³ãã³ãã®ã¡ã¤ã³ã«ã¼ãã³ / * Total kill count - * - * Note that the player ghosts are ignored. XXX XXX XXX + * @return ãªã + * @note the player ghosts are ignored. XXX XXX XXX */ static void do_cmd_knowledge_kill_count(void) { @@ -7078,11 +6119,7 @@ static void do_cmd_knowledge_kill_count(void) fff = my_fopen_temp(file_name, 1024); if (!fff) { -#ifdef JP - msg_format("°ì»þ¥Õ¥¡¥¤¥ë %s ¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£", file_name); -#else - msg_format("Failed to create temporary file %s.", file_name); -#endif + msg_format(_("ä¸æãã¡ã¤ã« %s ãä½æã§ãã¾ããã§ããã", "Failed to create temporary file %s."), file_name); msg_print(NULL); return; } @@ -7119,26 +6156,13 @@ static void do_cmd_knowledge_kill_count(void) } if (Total < 1) -#ifdef JP - fprintf(fff,"¤¢¤Ê¤¿¤Ï¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Ê¤¤¡£\n\n"); -#else - fprintf(fff,"You have defeated no enemies yet.\n\n"); -#endif - - else if (Total == 1) -#ifdef JP - fprintf(fff,"¤¢¤Ê¤¿¤Ï°ìɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n"); -#else - fprintf(fff,"You have defeated one enemy.\n\n"); -#endif - + fprintf(fff,_("ããªãã¯ã¾ã æµãåãã¦ããªãã\n\n", "You have defeated no enemies yet.\n\n")); else #ifdef JP - fprintf(fff,"¤¢¤Ê¤¿¤Ï %lu ɤ¤ÎŨ¤òÅݤ·¤Æ¤¤¤ë¡£\n\n", Total); + fprintf(fff,"ããªãã¯%ldä½ã®æµãåãã¦ããã\n\n", (long int)Total); #else - fprintf(fff,"You have defeated %lu enemies.\n\n", Total); + fprintf(fff,"You have defeated %ld %s.\n\n", (long int)Total, (Total == 1) ? "enemy" : "enemies"); #endif - } Total = 0; @@ -7183,15 +6207,15 @@ static void do_cmd_knowledge_kill_count(void) if (This > 0) { #ifdef JP - /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/ - if(strchr("pt",r_ptr->d_char)) - fprintf(fff, " %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name); + /* p,tã¯äººã¨æ°ãã by ita */ + if (my_strchr("pt", r_ptr->d_char)) + fprintf(fff, " %3d 人㮠%s\n", This, r_name + r_ptr->name); else - fprintf(fff, " %3d ɤ¤Î %s\n", This, r_name + r_ptr->name); + fprintf(fff, " %3d ä½ã® %s\n", This, r_name + r_ptr->name); #else if (This < 2) { - if (strstr(r_name + r_ptr->name, "coins")) + if (my_strstr(r_name + r_ptr->name, "coins")) { fprintf(fff, " 1 pile of %s\n", (r_name + r_ptr->name)); } @@ -7217,10 +6241,10 @@ static void do_cmd_knowledge_kill_count(void) fprintf(fff,"----------------------------------------------\n"); #ifdef JP - fprintf(fff," ¹ç·×: %lu ɤ¤òÅݤ·¤¿¡£\n", Total); + fprintf(fff," åè¨: %lu ä½ãåããã\n", (unsigned long int)Total); #else fprintf(fff," Total: %lu creature%s killed.\n", - Total, (Total == 1 ? "" : "s")); + (unsigned long int)Total, (Total == 1 ? "" : "s")); #endif @@ -7231,20 +6255,25 @@ static void do_cmd_knowledge_kill_count(void) my_fclose(fff); /* Display the file contents */ -#ifdef JP - show_file(TRUE, file_name, "Åݤ·¤¿Å¨¤Î¿ô", 0, 0); -#else - show_file(TRUE, file_name, "Kill Count", 0, 0); -#endif - + show_file(TRUE, file_name, _("åããæµã®æ°", "Kill Count"), 0, 0); /* Remove the file */ fd_kill(file_name); } -/* +/*! + * @brief ã¢ã³ã¹ã¿ã¼æ å ±ãªã¹ãä¸ã®ã°ã«ã¼ãã表示ãã / * Display the object groups. + * @param col éå§è¡ + * @param row éå§å + * @param wid 表示æåæ°å¹ + * @param per_page ãªã¹ãã®è¡¨ç¤ºè¡ + * @param grp_idx ã°ã«ã¼ãã®IDé å + * @param group_text ã°ã«ã¼ãåã®æååé å + * @param grp_cur ç¾å¨ã®é¸æID + * @param grp_top ç¾å¨ã®é¸æãªã¹ãæä¸é¨ID + * @return ãªã */ static void display_group_list(int col, int row, int wid, int per_page, int grp_idx[], cptr group_text[], int grp_cur, int grp_top) @@ -7403,8 +6432,8 @@ static void display_visual_list(int col, int row, int height, int width, byte at /* Display columns until done */ for (j = 0; j < width; j++) { - byte a, a2; - char c, c2; + byte a; + char c; int x = col + j; int y = row + i; int ia, ic; @@ -7426,13 +6455,8 @@ static void display_visual_list(int col, int row, int height, int width, byte at /* Force correct code for both ASCII character and tile */ if (c & 0x80) a |= 0x80; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); - /* Display symbol */ - Term_putch(x, y, a, c); - - /* Second byte */ - if (use_bigtile) Term_putch(x + 1, y, a2, c2); + Term_queue_bigchar(x, y, a, c, 0, 0); } } } @@ -7463,13 +6487,17 @@ static void place_visual_list_cursor(int col, int row, byte a, byte c, byte attr static byte attr_idx = 0; static byte char_idx = 0; +/* Hack -- for feature lighting */ +static byte attr_idx_feat[F_LIT_MAX]; +static byte char_idx_feat[F_LIT_MAX]; + /* * Do visual mode command -- Change symbols */ -static bool visual_mode_command(char ch, bool *visual_list_ptr, - int height, int width, - byte *attr_top_ptr, byte *char_left_ptr, - byte *cur_attr_ptr, byte *cur_char_ptr) +static bool visual_mode_command(char ch, bool *visual_list_ptr, + int height, int width, + byte *attr_top_ptr, byte *char_left_ptr, + byte *cur_attr_ptr, byte *cur_char_ptr, bool *need_redraw) { static byte attr_old = 0, char_old = 0; @@ -7485,7 +6513,6 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr, return TRUE; } - break; case '\n': @@ -7494,6 +6521,7 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr, { /* Accept change */ *visual_list_ptr = FALSE; + *need_redraw = TRUE; return TRUE; } @@ -7517,19 +6545,30 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr, case 'C': case 'c': - /* Set the visual */ - attr_idx = *cur_attr_ptr; - char_idx = *cur_char_ptr; + { + int i; + + /* Set the visual */ + attr_idx = *cur_attr_ptr; + char_idx = *cur_char_ptr; + /* Hack -- for feature lighting */ + for (i = 0; i < F_LIT_MAX; i++) + { + attr_idx_feat[i] = 0; + char_idx_feat[i] = 0; + } + } return TRUE; case 'P': case 'p': - if (attr_idx) + if (attr_idx || (!(char_idx & 0x80) && char_idx)) /* Allow TERM_DARK text */ { /* Set the char */ *cur_attr_ptr = attr_idx; *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5); + if (!*visual_list_ptr) *need_redraw = TRUE; } if (char_idx) @@ -7537,6 +6576,7 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr, /* Set the char */ *cur_char_ptr = char_idx; *char_left_ptr = MAX(0, *cur_char_ptr - 10); + if (!*visual_list_ptr) *need_redraw = TRUE; } return TRUE; @@ -7551,7 +6591,7 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr, if (use_bigtile) eff_width = width / 2; else eff_width = width; - + /* Restrict direction */ if ((a == 0) && (ddy[d] < 0)) d = 0; if ((c == 0) && (ddx[d] < 0)) d = 0; @@ -7576,7 +6616,6 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr, if ((ddy[d] > 0) && *attr_top_ptr + height < MIN(0x7f, (a & 0x7f) + 4)) (*attr_top_ptr)++; return TRUE; } - break; } @@ -7589,16 +6628,14 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr, * Display the monsters in a group. */ static void display_monster_list(int col, int row, int per_page, s16b mon_idx[], - int mon_cur, int mon_top) + int mon_cur, int mon_top, bool visual_only) { int i; /* Display lines until done */ - for (i = 0; i < per_page && mon_idx[mon_top + i]; i++) + for (i = 0; i < per_page && (mon_idx[mon_top + i] >= 0); i++) { byte attr; - byte a, a2; - char c, c2; /* Get the race index */ int r_idx = mon_idx[mon_top + i] ; @@ -7606,7 +6643,6 @@ static void display_monster_list(int col, int row, int per_page, s16b mon_idx[], /* Access the race */ monster_race *r_ptr = &r_info[r_idx]; - /* Choose a color */ attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE); @@ -7616,31 +6652,28 @@ static void display_monster_list(int col, int row, int per_page, s16b mon_idx[], /* Hack -- visual_list mode */ if (per_page == 1) { - c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, 60); + c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, (p_ptr->wizard || visual_only) ? 56 : 61); } - else if (p_ptr->wizard) + if (p_ptr->wizard || visual_only) { - c_prt(attr, format("%d", r_idx), row + i, 60); + c_prt(attr, format("%d", r_idx), row + i, 62); } - a = r_ptr->x_attr; - c = r_ptr->x_char; - if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2); + /* Erase chars before overwritten by the race letter */ + Term_erase(69, row + i, 255); /* Display symbol */ - Term_putch(70, row + i, a, c); + Term_queue_bigchar(use_bigtile ? 69 : 70, row + i, r_ptr->x_attr, r_ptr->x_char, 0, 0); - /* Second byte */ - if (use_bigtile) Term_putch(70 + 1, row + i, a2, c2); - - /* Display kills */ - if (!(r_ptr->flags1 & RF1_UNIQUE)) put_str(format("%5d", r_ptr->r_pkills), row + i, 73); -#ifdef JP - else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? "»àË´" : "À¸Â¸"), row + i, 73); -#else - else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? "dead" : "alive"), row + i, 73); -#endif - + if (!visual_only) + { + /* Display kills */ + if (!(r_ptr->flags1 & RF1_UNIQUE)) + put_str(format("%5d", r_ptr->r_pkills), row + i, 73); + else + c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), + (r_ptr->max_num == 0 ? _("æ»äº¡", " dead") : _("çå", "alive")), row + i, 74); + } } /* Clear remaining lines */ @@ -7654,7 +6687,7 @@ static void display_monster_list(int col, int row, int per_page, s16b mon_idx[], /* * Display known monsters. */ -static void do_cmd_knowledge_monsters(void) +static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, int direct_r_idx) { int i, len, max; int grp_cur, grp_top, old_grp_cur; @@ -7662,7 +6695,7 @@ static void do_cmd_knowledge_monsters(void) int grp_cnt, grp_idx[100]; int mon_cnt; s16b *mon_idx; - + int column = 0; bool flag; bool redraw; @@ -7673,6 +6706,8 @@ static void do_cmd_knowledge_monsters(void) int browser_rows; int wid, hgt; + byte mode; + /* Get size */ Term_get_size(&wid, &hgt); @@ -7684,21 +6719,39 @@ static void do_cmd_knowledge_monsters(void) max = 0; grp_cnt = 0; - /* Check every group */ - for (i = 0; monster_group_text[i] != NULL; i++) + if (direct_r_idx < 0) { - /* Measure the label */ - len = strlen(monster_group_text[i]); + mode = visual_only ? 0x03 : 0x01; - /* Save the maximum length */ - if (len > max) max = len; - - /* See if any monsters are known */ - if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, 0x01)) + /* Check every group */ + for (i = 0; monster_group_text[i] != NULL; i++) { - /* Build a list of groups with known monsters */ - grp_idx[grp_cnt++] = i; + /* Measure the label */ + len = strlen(monster_group_text[i]); + + /* Save the maximum length */ + if (len > max) max = len; + + /* See if any monsters are known */ + if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, mode)) + { + /* Build a list of groups with known monsters */ + grp_idx[grp_cnt++] = i; + } } + + mon_cnt = 0; + } + else + { + mon_idx[0] = direct_r_idx; + mon_cnt = 1; + + /* Terminate the list */ + mon_idx[1] = -1; + + (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3), + &attr_top, &char_left, &r_info[direct_r_idx].x_attr, &r_info[direct_r_idx].x_char, need_redraw); } /* Terminate the list */ @@ -7707,11 +6760,12 @@ static void do_cmd_knowledge_monsters(void) old_grp_cur = -1; grp_cur = grp_top = 0; mon_cur = mon_top = 0; - mon_cnt = 0; flag = FALSE; redraw = TRUE; + mode = visual_only ? 0x02 : 0x00; + while (!flag) { char ch; @@ -7720,19 +6774,21 @@ static void do_cmd_knowledge_monsters(void) if (redraw) { clear_from(0); - + #ifdef JP - prt("Ãμ± - ¥â¥ó¥¹¥¿¡¼", 2, 0); - prt("¥°¥ë¡¼¥×", 4, 0); - prt("̾Á°", 4, max + 3); - if (p_ptr->wizard) prt("Idx", 4, 60); - prt("ʸ»ú »¦³²¿ô", 4, 67); + prt(format("%s - ã¢ã³ã¹ã¿ã¼", !visual_only ? "ç¥è" : "表示"), 2, 0); + if (direct_r_idx < 0) prt("ã°ã«ã¼ã", 4, 0); + prt("åå", 4, max + 3); + if (p_ptr->wizard || visual_only) prt("Idx", 4, 62); + prt("æå", 4, 67); + if (!visual_only) prt("殺害æ°", 4, 72); #else - prt("Knowledge - Monsters", 2, 0); - prt("Group", 4, 0); + prt(format("%s - monsters", !visual_only ? "Knowledge" : "Visuals"), 2, 0); + if (direct_r_idx < 0) prt("Group", 4, 0); prt("Name", 4, max + 3); - if (p_ptr->wizard) prt("Idx", 4, 60); - prt("Sym Kills", 4, 67); + if (p_ptr->wizard || visual_only) prt("Idx", 4, 62); + prt("Sym", 4, 68); + if (!visual_only) prt("Kills", 4, 73); #endif for (i = 0; i < 78; i++) @@ -7740,46 +6796,52 @@ static void do_cmd_knowledge_monsters(void) Term_putch(i, 5, TERM_WHITE, '='); } - for (i = 0; i < browser_rows; i++) + if (direct_r_idx < 0) { - Term_putch(max + 1, 6 + i, TERM_WHITE, '|'); + for (i = 0; i < browser_rows; i++) + { + Term_putch(max + 1, 6 + i, TERM_WHITE, '|'); + } } redraw = FALSE; } - /* Scroll group list */ - if (grp_cur < grp_top) grp_top = grp_cur; - if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1; + if (direct_r_idx < 0) + { + /* Scroll group list */ + if (grp_cur < grp_top) grp_top = grp_cur; + if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1; - /* Display a list of monster groups */ - display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top); + /* Display a list of monster groups */ + display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top); - if (old_grp_cur != grp_cur) - { - old_grp_cur = grp_cur; + if (old_grp_cur != grp_cur) + { + old_grp_cur = grp_cur; - /* Get a list of monsters in the current group */ - mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, 0x00); - } + /* Get a list of monsters in the current group */ + mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, mode); + } - /* Scroll monster list */ - while (mon_cur < mon_top) - mon_top = MAX(0, mon_top - browser_rows/2); - while (mon_cur >= mon_top + browser_rows) - mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows/2); + /* Scroll monster list */ + while (mon_cur < mon_top) + mon_top = MAX(0, mon_top - browser_rows/2); + while (mon_cur >= mon_top + browser_rows) + mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows/2); + } if (!visual_list) { /* Display a list of monsters in the current group */ - display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top); + display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top, visual_only); } else { mon_top = mon_cur; /* Display a monster name */ - display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top); + display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top, visual_only); /* Display visual list below first monster */ display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left); @@ -7787,19 +6849,30 @@ static void do_cmd_knowledge_monsters(void) /* Prompt */ #ifdef JP - prt(format("<Êý¸þ>, 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë%s%s, ESC", visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹", (attr_idx||char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"), hgt - 1, 0); + prt(format("<æ¹å>%s%s%s, ESC", + (!visual_list && !visual_only) ? ", 'r'ã§æãåºãè¦ã" : "", + visual_list ? ", ENTERã§æ±ºå®" : ", 'v'ã§ã·ã³ãã«å¤æ´", + (attr_idx || char_idx) ? ", 'c', 'p'ã§ãã¼ã¹ã" : ", 'c'ã§ã³ãã¼"), + hgt - 1, 0); #else - prt(format("