void exe_cmd_save_screen_html(const std::filesystem::path &path, bool need_message)
{
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
auto *fff = angband_fopen(path, FileOpenMode::WRITE);
if (!check_screen_html_can_open(fff, path, need_message)) {
return;
return;
}
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
const auto old_use_graphics = update_use_graphics(player_ptr);
if (html_dump) {
*/
void do_cmd_load_screen(void)
{
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
const auto path = path_build(ANGBAND_DIR_USER, "dump.txt");
auto *fff = angband_fopen(path, FileOpenMode::READ);
if (!fff) {
return;
}
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
command_new = 0;
command_gap = wid - 30;
}
return;
}
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
command_new = 0;
command_gap = wid - 30;
}
std::string shower_str("");
std::string finder_str("");
std::string shower("");
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
auto num_lines = hgt - 4;
auto n = message_num();
auto i = 0;
int cy, cx;
display_map(player_ptr, &cy, &cx);
if (autopick_list.empty() || player_ptr->wild_mode) {
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
constexpr auto msg = _("何かキーを押すとゲームに戻ります", "Hit any key to continue");
const auto center_x = (wid - std::string_view(msg).length()) / 2;
put_str(msg, hgt - 1, center_x);
display_autopick = ITEM_DISPLAY;
while (true) {
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
int row_message = hgt - 1;
put_str(_("何かキーを押してください('M':拾う 'N':放置 'D':M+N 'K':壊すアイテムを表示)",
" Hit M, N(for ~), K(for !), or D(same as M+N) to display auto-picker items."),
{
TermCenteredOffsetSetter tcos(MAIN_TERM_MIN_COLS, std::nullopt);
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
char hook[68][32]{};
auto stripped_names = str_split(name_with_tag, '#');
*/
static void print_dungeon(PlayerType *player_ptr)
{
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
c_put_str(TERM_WHITE, " ", hgt + ROW_DUNGEON, COL_DUNGEON);
const auto dungeon_name = map_name(player_ptr);
ITEM_NUMBER floor_num;
char floor_label[52 + 1]{};
auto dont_need_to_show_weights = true;
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
auto len = std::max((*min_width), 20);
floor_num = scan_floor_items(player_ptr, floor_list, y, x, SCAN_FLOOR_ITEM_TESTER | SCAN_FLOOR_ONLY_MARKED, item_tester);
auto *floor_ptr = player_ptr->current_floor_ptr;
if ((ddx[d] > 0) && ddy[d]) {
int browser_rows;
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
browser_rows = hgt - 8;
if (!col) {
int old_grp = grp;
/* プレイホストのマップが大きいときクライアントのマップもリサイズする */
static void update_term_size(int x, int y, int len)
{
- int nx, ny;
- const auto [ox, oy] = term_get_size();
- nx = ox;
- ny = oy;
+ const auto &[ox, oy] = term_get_size();
+ auto nx = ox;
+ auto ny = oy;
/* 横方向のチェック */
if (x + len > ox) {
"</pre>\n"
"</body>\n</html>\n";
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
std::stringstream screen_ss;
auto &rfu = RedrawingFlagsUpdater::get_instance();
*/
static void handle_signal_abort(int sig)
{
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
(void)signal(sig, SIG_IGN);
if (!w_ptr->character_generated || w_ptr->character_saved) {
quit(nullptr);
parse_fixed_map(player_ptr, QUEST_DEFINITION_LIST, 0, 0, 0, 0);
floor.quest_number = old_quest;
- const auto [q_idx, note_level] = write_floor(floor);
+ const auto &[q_idx, note_level] = write_floor(floor);
FILE *fff = nullptr;
if (!open_diary_file(&fff, &disable_diary)) {
}
const auto &floor = *player_ptr->current_floor_ptr;
- const auto [q_idx, note_level] = write_floor(floor);
+ const auto &[q_idx, note_level] = write_floor(floor);
auto do_level = true;
switch (dk) {
case DiaryKind::DIALY:
TERM_COLOR attr_old[F_LIT_MAX] = {};
char char_old[F_LIT_MAX] = {};
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
std::vector<FEAT_IDX> feat_idx(terrains_info.size());
concptr feature_group_text[] = { "terrains", nullptr };
byte char_left = 0;
byte mode;
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
auto browser_rows = hgt - 8;
std::vector<short> object_idx(baseitems_info.size());
{
TermCenteredOffsetSetter tcos(MAIN_TERM_MIN_COLS, std::nullopt);
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
std::vector<MonsterRaceId> r_idx_list;
std::vector<IDX> grp_idx;
}
screen_save();
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
std::string item_name;
if (!(mode & SCROBJ_FAKE_OBJECT)) {
item_name = describe_flavor(player_ptr, o_ptr, 0);
return;
}
TermCenteredOffsetSetter tcos(MAIN_TERM_MIN_COLS, std::nullopt);
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
xtra_stock = std::min(14 + 26, ((hgt > MAIN_TERM_MIN_ROWS) ? (hgt - MAIN_TERM_MIN_ROWS) : 0));
store_bottom = MIN_STOCK + xtra_stock;
*/
void c_roff(TERM_COLOR a, std::string_view str)
{
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
int x, y;
(void)term_locate(&x, &y);
*/
void CandidateSelector::set_max_per_page(size_t max)
{
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
this->max_per_page = std::min<size_t>(max, hgt - 2);
}
char inven_label[52 + 1];
auto col = command_gap;
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
auto len = wid - col - 1;
for (i = 0; i < INVEN_PACK; i++) {
o_ptr = &player_ptr->inventory_list[i];
return;
}
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
for (i = 0; i < INVEN_PACK; i++) {
auto o_ptr = &player_ptr->inventory_list[i];
if (!o_ptr->is_valid()) {
constexpr std::string_view header = _("名前 : ", "Name : ");
const auto length = header.length() + display_name.length();
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
const auto center_col = (wid - length) / 2 - 4; // ヘッダがあるぶん少し左に寄せたほうが見やすい
constexpr auto row = 1;
display_sub_windows(SubWindowRedrawingFlag::SIGHT_MONSTERS,
[player_ptr, &once] {
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
std::call_once(once, target_sensing_monsters_prepare, player_ptr, monster_list);
print_monster_list(player_ptr->current_floor_ptr, monster_list, 0, 0, hgt);
});
{
display_sub_windows(SubWindowRedrawingFlag::PETS,
[player_ptr] {
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
const auto pets = target_pets_prepare(player_ptr);
print_pet_list(player_ptr, pets, 0, 0, wid, hgt);
});
return;
}
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
byte attr = TERM_WHITE;
for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
int cur_row = i - INVEN_MAIN_HAND;
{
display_sub_windows(SubWindowRedrawingFlag::MESSAGE,
[] {
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
for (short i = 0; i < hgt; i++) {
term_putstr(0, (hgt - 1) - i, -1, (byte)((i < now_message) ? TERM_WHITE : TERM_SLATE), *message_str(i));
TERM_LEN x, y;
{
display_sub_windows(SubWindowRedrawingFlag::OVERHEAD,
[player_ptr] {
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
if (wid > COL_MAP + 2 && hgt > ROW_MAP + 2) {
int cy, cx;
display_map(player_ptr, &cy, &cx);
*/
static void display_floor_item_list(PlayerType *player_ptr, const int y, const int x)
{
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
if (hgt <= 0) {
return;
}
*/
static void display_found_item_list(PlayerType *player_ptr)
{
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
if (hgt <= 0) {
return;
}
COMMAND_CODE target_item_label = 0;
char equip_label[52 + 1];
auto col = command_gap;
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
auto len = wid - col - 1;
for (k = 0, i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++) {
o_ptr = &player_ptr->inventory_list[i];
void print_depth(PlayerType *player_ptr)
{
TERM_COLOR attr = TERM_WHITE;
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
TERM_LEN col_depth = wid + COL_DEPTH;
TERM_LEN row_depth = hgt + ROW_DEPTH;
}
const auto max_width = 12; // 表示幅
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
const auto extra_line_count = riding ? 0 : hgt - MAIN_TERM_MIN_ROWS;
for (auto y = row; y < row + extra_line_count + 1; ++y) {
term_erase(col, y, max_width);
return;
}
- const auto [hit_point_bar_color, len] = monster.get_hp_bar_data();
-
+ const auto &[hit_point_bar_color, len] = monster.get_hp_bar_data();
term_putstr(col, row, max_width, TERM_WHITE, "[----------]");
term_putstr(col + 1, row, len, hit_point_bar_color, "**********");
*/
void print_speed(PlayerType *player_ptr)
{
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
auto col_speed = wid + COL_SPEED;
auto row_speed = hgt + ROW_SPEED;
*/
void print_study(PlayerType *player_ptr)
{
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
const auto col_study = wid + COL_STUDY;
const auto row_study = hgt + ROW_STUDY;
if (player_ptr->new_spells) {
*/
void print_imitation(PlayerType *player_ptr)
{
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
const auto col_study = wid + COL_STUDY;
const auto row_study = hgt + ROW_STUDY;
PlayerClass pc(player_ptr);
*/
void print_status(PlayerType *player_ptr)
{
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
const auto row_statbar = hgt + ROW_STATBAR;
const auto max_col_statbar = wid + MAX_COL_STATBAR;
term_erase(0, row_statbar, max_col_statbar);
*/
void do_cmd_debug(PlayerType *player_ptr)
{
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
const auto max_line = debug_menu_table.size();
const auto page_size = hgt - 5;
const auto max_page = max_line / page_size + 1;
*/
void WorldTurnProcessor::print_time()
{
- const auto [wid, hgt] = term_get_size();
+ const auto &[wid, hgt] = term_get_size();
const auto row = hgt + ROW_DAY;
int day;