From cb390d7b07daa5795aa8659be6c0926b30ead63f Mon Sep 17 00:00:00 2001 From: iks Date: Sun, 11 Apr 2021 13:52:07 +0900 Subject: [PATCH] =?utf8?q?[Fix]=20=E3=82=BF=E3=83=BC=E3=82=B2=E3=83=83?= =?utf8?q?=E3=83=86=E3=82=A3=E3=83=B3=E3=82=B0=E7=AD=89=E3=81=AE=E5=85=A5?= =?utf8?q?=E5=8A=9B=E5=BE=85=E3=81=A1=E3=81=A7=E3=82=AB=E3=83=BC=E3=82=BD?= =?utf8?q?=E3=83=AB=E4=BD=8D=E7=BD=AE=E3=81=8C=E3=81=8A=E3=81=8B=E3=81=97?= =?utf8?q?=E3=81=84=20#760?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit #754のエンバグ --- src/io/input-key-acceptor.cpp | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/src/io/input-key-acceptor.cpp b/src/io/input-key-acceptor.cpp index 7d23c0d25..2ec65b983 100644 --- a/src/io/input-key-acceptor.cpp +++ b/src/io/input-key-acceptor.cpp @@ -41,6 +41,22 @@ static bool parse_macro = FALSE; */ static bool parse_under = FALSE; +/*! + * @brief 全てのウィンドウの再描画を行う + * @return なし + * @details + * カーソル位置がずれるので戻す。 + */ +static void all_term_fresh(int x, int y) +{ + p_ptr->window_flags |= PW_ALL; + handle_stuff(p_ptr); + + term_activate(angband_term[0]); + term_gotoxy(x, y); + term_fresh(); +} + /* * Cancel macro action on the queue */ @@ -196,6 +212,8 @@ char inkey(void) } term_activate(angband_term[0]); + auto y = angband_term[0]->scr->cy; + auto x = angband_term[0]->scr->cx; char kk; while (!ch) { if (!inkey_base && inkey_scan && (0 != term_inkey(&kk, FALSE, FALSE))) { @@ -204,9 +222,7 @@ char inkey(void) if (!done && (0 != term_inkey(&kk, FALSE, FALSE))) { start_term_fresh(); - term_activate(old); - term_fresh(); - term_activate(angband_term[0]); + all_term_fresh(x, y); current_world_ptr->character_saved = FALSE; signal_count = 0; @@ -399,6 +415,10 @@ int inkey_special(bool numpad_cursor) return (int)((unsigned char)key); } +/*! + * @brief 全てのウィンドウの描画を止める + * @return なし + */ void stop_term_fresh(void) { for (int j = 0; j < 8; j++) { @@ -407,16 +427,16 @@ void stop_term_fresh(void) } } +/*! + * @brief 全てのウィンドウの描画を再開する + * @return なし + */ void start_term_fresh(void) { for (int j = 0; j < 8; j++) { if (angband_term[j]) angband_term[j]->never_fresh = FALSE; } - p_ptr->window_flags |= PW_ALL; - handle_stuff(p_ptr); - term_fresh(); - term_activate(angband_term[0]); } /*! -- 2.11.0