• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision53c16184f740c059226541222099081708caa481 (tree)
Time2002-03-09 18:56:33
Authormogami <mogami@0568...>
Commitermogami

Log Message

get_checkの [y/n]のメッセージを履歴に残すようにしてみた。
残って欲しくないところは get_check_strict("...", 4); とすればよい。

Change Summary

Incremental Difference

--- a/src/cmd4.c
+++ b/src/cmd4.c
@@ -5324,9 +5324,9 @@ void do_cmd_save_screen(void)
53245324 }
53255325
53265326 #ifdef JP
5327- if (get_check("HTMLで出力しますか?"))
5327+ if (get_check_strict("HTMLで出力しますか?", 4))
53285328 #else
5329- if (get_check("Save screen dump as HTML? "))
5329+ if (get_check_strict("Save screen dump as HTML? ", 4))
53305330 #endif
53315331 {
53325332 do_cmd_save_screen_html();
--- a/src/effects.c
+++ b/src/effects.c
@@ -5034,7 +5034,7 @@ bool take_hit(int damage_type, int damage, cptr hit_from, int monspell)
50345034 flush();
50355035
50365036 #ifdef JP
5037-if (get_check("画面を保存しますか?"))
5037+if (get_check_strict("画面を保存しますか?", 4))
50385038 #else
50395039 if (get_check("Dump the screen? "))
50405040 #endif
--- a/src/util.c
+++ b/src/util.c
@@ -3322,8 +3322,8 @@ bool get_check(cptr prompt)
33223322 *
33233323 * mode & 0x01 : force user to answer "YES" or "N"
33243324 * mode & 0x02 : don't allow ESCAPE key
3325+ * mode & 0x04 : no message_add
33253326 */
3326-#define CHECK_STRICT 0
33273327 bool get_check_strict(cptr prompt, int mode)
33283328 {
33293329 int i;
@@ -3346,20 +3346,6 @@ bool get_check_strict(cptr prompt, int mode)
33463346 /* Hack -- Build a "useful" prompt */
33473347 if (mode & 1)
33483348 {
3349-#if CHECK_STRICT
3350-#ifdef JP
3351- /* (79-8)バイトの指定, promptが長かった場合,
3352- (79-9)文字の後終端文字が書き込まれる.
3353- 英語の方のstrncpyとは違うので注意.
3354- elseの方の分岐も同様. --henkma
3355- */
3356- mb_strlcpy(buf, prompt, 80-8);
3357-#else
3358- strncpy(buf, prompt, 79-8);
3359- buf[79-8]='\0';
3360-#endif
3361- strcat(buf, "[yes/no]");
3362-#else
33633349 #ifdef JP
33643350 /* (79-8)バイトの指定, promptが長かった場合,
33653351 (79-9)文字の後終端文字が書き込まれる.
@@ -3373,7 +3359,6 @@ bool get_check_strict(cptr prompt, int mode)
33733359 #endif
33743360 strcat(buf, "[(O)k/(C)ancel]");
33753361
3376-#endif
33773362 }
33783363 else
33793364 {
@@ -3389,62 +3374,18 @@ bool get_check_strict(cptr prompt, int mode)
33893374 /* Prompt for it */
33903375 prt(buf, 0, 0);
33913376
3377+ if (!(mode & 4))
3378+ {
3379+ /* HACK : Add the line to message buffer */
3380+ message_add(buf);
3381+ p_ptr->window |= (PW_MESSAGE);
3382+ window_stuff();
3383+ }
3384+
33923385 /* Get an acceptable answer */
33933386 while (TRUE)
33943387 {
33953388 i = inkey();
3396-#if CHECK_STRICT /* ここから(ちょっと長いのでコメント) */
3397- if (i == 'y' || i == 'Y')
3398- {
3399- if (!(mode & 1))
3400- break;
3401- else
3402- {
3403-#ifdef JP
3404- prt("y (YESと入力してください)", 0, strlen(buf));
3405-#else
3406- prt("y (Please answer YES.)", 0, strlen(buf));
3407-#endif
3408- i = inkey();
3409- if (i == 'e' || i == 'E')
3410- {
3411-#ifdef JP
3412- prt("e (YESと入力してください)", 0, strlen(buf)+1);
3413-#else
3414- prt("e (Please answer YES.)", 0, strlen(buf)+1);
3415-#endif
3416- i = inkey();
3417- if (i == 's' || i == 'S')
3418- {
3419- i = 'y';
3420- break;
3421- }
3422- prt("", 0, strlen(buf)+1);
3423- }
3424- prt("", 0, strlen(buf));
3425- }
3426- }
3427- if (!(mode & 2) && (i == ESCAPE)) break;
3428- if (i == 'N' || i == 'n')
3429- {
3430- if (!(mode & 1))
3431- break;
3432- else
3433- {
3434-#ifdef JP
3435- prt("n (NOと入力してください)", 0, strlen(buf));
3436-#else
3437- prt("n (Please answer NO.)", 0, strlen(buf));
3438-#endif
3439- i = inkey();
3440- if (i == 'o' || i == 'O')
3441- {
3442- break;
3443- }
3444- prt("", 0, strlen(buf));
3445- }
3446- }
3447-#else
34483389 if ( mode & 1 )
34493390 {
34503391 if ( i == 'o' || i == 'O' )
@@ -3469,7 +3410,6 @@ bool get_check_strict(cptr prompt, int mode)
34693410 {
34703411 break;
34713412 }
3472-#endif /* ここまで(ちょっと長いのでコメント) */
34733413 bell();
34743414 }
34753415
Show on old repository browser