1 #include "view/display-util.h"
2 #include "term/term-color-types.h"
6 struct disp_player_line {
13 const std::vector<disp_player_line> disp_player_lines = {
14 { 1, 10, 25, _("打撃修正(格闘)", "Barehanded") },
15 { 1, 10, 25, _("打撃修正(両手)", "Two hands") },
16 { 1, 10, 25, _("打撃修正(右手)", "Right hand") },
17 { 1, 10, 25, _("打撃修正(左手)", "Left hand") },
18 { 1, 11, 25, _("打撃修正(左手)", "Left hand") },
19 { 1, 11, 25, _("打撃修正(右手)", "Right hand") },
20 { 1, 11, 25, _("", "Posture") },
21 { 1, 15, 25, _("射撃攻撃修正", "Shooting") },
22 { 1, 16, 25, _("射撃武器倍率", "Multiplier") },
23 { 1, 20, 25, _("加速", "Speed") },
24 { 1, 19, 25, _("AC", "AC") },
25 { 29, 13, 21, _("レベル", "Level") },
26 { 29, 14, 21, _("経験値", "Experience") },
27 { 29, 15, 21, _("最大経験", "Max Exp") },
28 { 29, 16, 21, _("次レベル", "Exp to Adv") },
29 { 29, 17, 21, _("所持金", "Gold") },
30 { 29, 19, 21, _("日付", "Time") },
31 { 29, 10, 21, _("HP", "Hit points") },
32 { 29, 11, 21, _("MP", "SP (Mana)") },
33 { 29, 20, 21, _("プレイ時間", "Play time") },
34 { 53, 10, -1, _("打撃命中 :", "Fighting : ") },
35 { 53, 11, -1, _("射撃命中 :", "Bows/Throw : ") },
36 { 53, 12, -1, _("魔法防御 :", "SavingThrow: ") },
37 { 53, 13, -1, _("隠密行動 :", "Stealth : ") },
38 { 53, 15, -1, _("知覚 :", "Perception : ") },
39 { 53, 16, -1, _("探索 :", "Searching : ") },
40 { 53, 17, -1, _("解除 :", "Disarming : ") },
41 { 53, 18, -1, _("魔法道具 :", "MagicDevice: ") },
42 { 1, 12, 25, _("打撃回数", "Blows/Round") },
43 { 1, 17, 25, _("射撃回数", "Shots/Round") },
44 { 1, 13, 25, _("平均ダメージ", "AverageDmg/Rnd") },
45 { 53, 20, -1, _("赤外線視力:", "Infravision: ") },
46 { 26, 1, -1, _("名前 : ", "Name : ") },
47 { 1, 3, -1, _("性別 : ", "Sex : ") },
48 { 1, 4, -1, _("種族 : ", "Race : ") },
49 { 1, 5, -1, _("職業 : ", "Class : ") },
50 { 1, 6, -1, _("魔法 : ", "Magic : ") },
51 { 1, 7, -1, _("守護魔神 : ", "Patron : ") },
52 { 29, 3, 21, _("年齢", "Age") },
53 { 29, 4, 21, _("身長", "Height") },
54 { 29, 5, 21, _("体重", "Weight") },
55 { 29, 6, 21, _("社会的地位", "Social Class") },
56 { 29, 7, 21, _("属性", "Align") },
57 { 29, 14, 21, _("強化度", "Construction") },
58 { 29, 16, 21, _("次レベル", "Const to Adv") },
59 { 53, 19, -1, _("掘削 :", "Digging : ") },
64 * @brief プレイヤーのステータス1種を出力する
66 * @param val 値を保管した文字列ポインタ
69 void display_player_one_line(int entry, std::string_view val, TERM_COLOR attr)
71 auto head = disp_player_lines[entry].header;
72 auto head_len = strlen(head);
73 auto row = disp_player_lines[entry].row;
74 auto col = disp_player_lines[entry].col;
75 auto len = disp_player_lines[entry].len;
76 term_putstr(col, row, -1, TERM_WHITE, head);
79 term_putstr(col + head_len, row, -1, attr, val);
83 int val_len = len - head_len;
85 if (val_len > static_cast<int>(val.length())) {
86 str.append(val_len - val.length(), ' ');
89 term_putstr(col + head_len, row, -1, attr, str);