*/
void do_cmd_message_one(void)
{
- prt(format("> %s", message_str(0)), 0, 0);
+ prt(format("> %s", message_str(0).data()), 0, 0);
}
/*!
int j;
int skey;
for (j = 0; (j < num_lines) && (i + j < n); j++) {
- concptr msg = message_str(i + j);
+ const auto msg_str = message_str(i + j);
+ const auto *msg = msg_str.data();
c_prt((i + j < num_now ? TERM_WHITE : TERM_SLATE), msg, num_lines + 1 - j, 0);
if (!shower || !shower[0]) {
continue;
}
- concptr str = msg;
+ const auto *str = msg;
while ((str = angband_strstr(str, shower)) != nullptr) {
int len = strlen(shower);
term_putstr(str - msg, num_lines + 1 - j, len, TERM_YELLOW, shower);
shower = finder_str;
for (int z = i + 1; z < n; z++) {
- concptr msg = message_str(z);
- if (angband_strstr(msg, finder_str)) {
+ const auto msg_str = message_str(z);
+ const auto *msg = msg_str.data();
+ if (angband_strstr(msg, finder_str) != nullptr) {
i = z;
break;
}
if (!w_ptr->total_winner) {
fprintf(fff, _("\n [死ぬ直前のメッセージ]\n\n", "\n [Last Messages]\n\n"));
for (int i = std::min(message_num(), 30); i >= 0; i--) {
- fprintf(fff, "> %s\n", message_str((int16_t)i));
+ fprintf(fff, "> %s\n", message_str((int16_t)i).data());
}
fputc('\n', fff);
* @param age メッセージの世代
* @return メッセージの文字列ポインタ
*/
-concptr message_str(int age)
+std::string message_str(int age)
{
if ((age < 0) || (age >= message_num())) {
return "";
}
- return message_history[age]->data();
+ return *message_history[age];
}
static void message_add_aux(std::string str)
#include "system/angband.h"
#include <concepts>
+#include <string>
#include <string_view>
/*
extern COMMAND_CODE now_message;
int32_t message_num(void);
-concptr message_str(int age);
+std::string message_str(int age);
void message_add(std::string_view msg);
void msg_erase(void);
void msg_print(std::string_view msg);
[] {
TERM_LEN w, h;
term_get_size(&w, &h);
- for (int i = 0; i < h; i++) {
- term_putstr(0, (h - 1) - i, -1, (byte)((i < now_message) ? TERM_WHITE : TERM_SLATE), message_str((int16_t)i));
+ for (short i = 0; i < h; i++) {
+ term_putstr(0, (h - 1) - i, -1, (byte)((i < now_message) ? TERM_WHITE : TERM_SLATE), message_str(i));
TERM_LEN x, y;
term_locate(&x, &y);
term_erase(x, y, 255);