OSDN Git Service

Replace sprintf() with std::string and/or format(). Does part of the work of resolvi...
[hengbandforosx/hengbandosx.git] / src / view / display-player-misc-info.cpp
1 #include "player-info/class-info.h"
2 #include "player-info/mimic-info-table.h"
3 #include "player/player-personality.h"
4 #include "player/player-sex.h"
5 #include "system/player-type-definition.h"
6 #include "term/screen-processor.h"
7 #include "term/term-color-types.h"
8 #include "term/z-form.h"
9 #include "view/display-player-stat-info.h"
10
11 /*!
12  * @brief プレイヤーの特性フラグ一覧表示2a /
13  * @param player_ptr プレイヤーへの参照ポインタ
14  * Special display, part 2a
15  */
16 void display_player_misc_info(PlayerType *player_ptr)
17 {
18     put_str(_("名前  :", "Name  :"), 1, 26);
19     put_str(_("性別  :", "Sex   :"), 3, 1);
20     put_str(_("種族  :", "Race  :"), 4, 1);
21     put_str(_("職業  :", "Class :"), 5, 1);
22
23     std::string tmp = ap_ptr->title;
24     tmp.append(_(ap_ptr->no == 1 ? "の" : "", " ")).append(player_ptr->name);
25
26     c_put_str(TERM_L_BLUE, tmp, 1, 34);
27     c_put_str(TERM_L_BLUE, sp_ptr->title, 3, 9);
28     c_put_str(TERM_L_BLUE, (player_ptr->mimic_form != MimicKindType::NONE ? mimic_info.at(player_ptr->mimic_form).title : rp_ptr->title), 4, 9);
29     c_put_str(TERM_L_BLUE, cp_ptr->title, 5, 9);
30
31     put_str(_("レベル:", "Level :"), 6, 1);
32     put_str(_("HP  :", "Hits  :"), 7, 1);
33     put_str(_("MP  :", "Mana  :"), 8, 1);
34
35     c_put_str(TERM_L_BLUE, format("%d", (int)player_ptr->lev), 6, 9);
36     c_put_str(TERM_L_BLUE, format("%d/%d", (int)player_ptr->chp, (int)player_ptr->mhp), 7, 9);
37     c_put_str(TERM_L_BLUE, format("%d/%d", (int)player_ptr->csp, (int)player_ptr->msp), 8, 9);
38 }