2 #include "core/stuff-handler.h"
3 #include "cmd/cmd-draw.h"
6 #include "view/display-main-window.h" // 暫定。後で消す.
7 #include "player-effects.h"
8 #include "view/display-player.h" // 暫定。後で消す.
9 #include "player/process-name.h"
12 * @brief 画面を再描画するコマンドのメインルーチン
13 * Hack -- redraw the screen
14 * @param creature_ptr プレーヤーへの参照ポインタ
18 * This command performs various low level updates, clears all the "extra"
19 * windows, does a total redraw of the main window, and requests all of the
20 * interesting updates and redraws that I can think of.
22 * This command is also used to "instantiate" the results of the user
23 * selecting various things, such as graphics mode, so it must call
24 * the "TERM_XTRA_REACT" hook before redrawing the windows.
27 void do_cmd_redraw(player_type *creature_ptr)
29 Term_xtra(TERM_XTRA_REACT, 0);
31 creature_ptr->update |= (PU_COMBINE | PU_REORDER);
32 creature_ptr->update |= (PU_TORCH);
33 creature_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
34 creature_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
35 creature_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE);
36 creature_ptr->update |= (PU_MONSTERS);
38 creature_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
40 creature_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
41 creature_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
44 handle_stuff(creature_ptr);
45 if (creature_ptr->prace == RACE_ANDROID) calc_android_exp(creature_ptr);
48 for (int j = 0; j < 8; j++)
50 if (!angband_term[j]) continue;
52 Term_activate(angband_term[j]);
61 * @brief プレイヤーのステータス表示
64 void do_cmd_player_status(player_type *creature_ptr)
72 display_player(creature_ptr, mode, map_name);
77 display_player(creature_ptr, mode, map_name);
80 Term_putstr(2, 23, -1, TERM_WHITE,
81 _("['c'で名前変更, 'f'でファイルへ書出, 'h'でモード変更, ESCで終了]", "['c' to change name, 'f' to file, 'h' to change mode, or ESC]"));
83 if (c == ESCAPE) break;
87 get_name(creature_ptr);
88 process_player_name(creature_ptr, FALSE);
92 sprintf(tmp, "%s.txt", creature_ptr->base_name);
93 if (get_string(_("ファイル名: ", "File name: "), tmp, 80))
95 if (tmp[0] && (tmp[0] != ' '))
97 file_character(creature_ptr, tmp, update_playtime, display_player, map_name);
114 creature_ptr->redraw |= (PR_WIPE | PR_BASIC | PR_EXTRA | PR_MAP | PR_EQUIPPY);
115 handle_stuff(creature_ptr);
120 * @brief 最近表示されたメッセージを再表示するコマンドのメインルーチン
121 * Recall the most recent message
124 void do_cmd_message_one(void)
126 prt(format("> %s", message_str(0)), 0, 0);
131 * @brief メッセージのログを表示するコマンドのメインルーチン
132 * Recall the most recent message
136 * Show previous messages to the user -BEN-
138 * The screen format uses line 0 and 23 for headers and prompts,
139 * skips line 1 and 22, and uses line 2 thru 21 for old messages.
141 * This command shows you which commands you are viewing, and allows
142 * you to "search" for strings in the recall.
144 * Note that messages may be longer than 80 characters, but they are
145 * displayed using "infinite" length, with a special sub-command to
146 * "slide" the virtual display to the left or right.
148 * Attempt to only hilite the matching portions of the string.
151 void do_cmd_messages(int num_now)
156 concptr shower = NULL;
158 Term_get_size(&wid, &hgt);
159 int num_lines = hgt - 4;
160 strcpy(finder_str, "");
161 strcpy(shower_str, "");
162 int n = message_num();
170 for (j = 0; (j < num_lines) && (i + j < n); j++)
172 concptr msg = message_str(i + j);
173 c_prt((i + j < num_now ? TERM_WHITE : TERM_SLATE), msg, num_lines + 1 - j, 0);
174 if (!shower || !shower[0]) continue;
177 while ((str = my_strstr(str, shower)) != NULL)
179 int len = strlen(shower);
180 Term_putstr(str - msg, num_lines + 1 - j, len, TERM_YELLOW, shower);
185 for (; j < num_lines; j++)
186 Term_erase(0, num_lines + 1 - j, 255);
188 prt(format(_("以前のメッセージ %d-%d 全部で(%d)", "Message Recall (%d-%d of %d)"),
189 i, i + j - 1, n), 0, 0);
190 prt(_("[ 'p' で更に古いもの, 'n' で更に新しいもの, '/' で検索, ESC で中断 ]",
191 "[Press 'p' for older, 'n' for newer, ..., or ESCAPE]"), hgt - 1, 0);
192 skey = inkey_special(TRUE);
193 if (skey == ESCAPE) break;
199 prt(_("強調: ", "Show: "), hgt - 1, 0);
200 strcpy(back_str, shower_str);
201 if (askfor(shower_str, 80))
202 shower = shower_str[0] ? shower_str : NULL;
204 strcpy(shower_str, back_str);
210 prt(_("検索: ", "Find: "), hgt - 1, 0);
211 strcpy(back_str, finder_str);
212 if (!askfor(finder_str, 80))
214 strcpy(finder_str, back_str);
217 else if (!finder_str[0])
224 for (int z = i + 1; z < n; z++)
226 concptr msg = message_str(z);
227 if (my_strstr(msg, finder_str))
247 i = MIN(i + 1, n - num_lines);
250 i = MIN(i + 10, n - num_lines);
256 i = MIN(i + num_lines, n - num_lines);
261 i = MAX(0, i - num_lines);