変愚蛮怒のメインリポジトリです
Revisão | 78d8f4106972611d3c5a7b501a03a06df092f388 (tree) |
---|---|
Hora | 2020-02-28 23:24:57 |
Autor | Hourier <hourier@user...> |
Commiter | Hourier |
[Refactor] #39962 display_player() からdisplay_magic_realms() を分離 / Separated display_magic_realms() from display_player()
@@ -77,6 +77,25 @@ static void display_player_basic_info(player_type *creature_ptr) | ||
77 | 77 | |
78 | 78 | |
79 | 79 | /*! |
80 | + * @brief 魔法領域を表示する | |
81 | + * @param creature_ptr プレーヤーへの参照ポインタ | |
82 | + * @return なし | |
83 | + */ | |
84 | +static void display_magic_realms(player_type *creature_ptr) | |
85 | +{ | |
86 | + if (creature_ptr->realm1 == 0) return; | |
87 | + | |
88 | + char tmp[64]; | |
89 | + if (creature_ptr->realm2) | |
90 | + sprintf(tmp, "%s, %s", realm_names[creature_ptr->realm1], realm_names[creature_ptr->realm2]); | |
91 | + else | |
92 | + strcpy(tmp, realm_names[creature_ptr->realm1]); | |
93 | + | |
94 | + display_player_one_line(ENTRY_REALM, tmp, TERM_L_BLUE); | |
95 | +} | |
96 | + | |
97 | + | |
98 | +/*! | |
80 | 99 | * @brief プレイヤーのステータス表示メイン処理 |
81 | 100 | * Display the character on the screen (various modes) |
82 | 101 | * @param creature_ptr プレーヤーへの参照ポインタ |
@@ -103,16 +122,7 @@ void display_player(player_type *creature_ptr, int mode, map_name_pf map_name) | ||
103 | 122 | if (display_player_info(creature_ptr, mode)) return; |
104 | 123 | |
105 | 124 | display_player_basic_info(creature_ptr); |
106 | - | |
107 | - char tmp[64]; | |
108 | - if (creature_ptr->realm1) | |
109 | - { | |
110 | - if (creature_ptr->realm2) | |
111 | - sprintf(tmp, "%s, %s", realm_names[creature_ptr->realm1], realm_names[creature_ptr->realm2]); | |
112 | - else | |
113 | - strcpy(tmp, realm_names[creature_ptr->realm1]); | |
114 | - display_player_one_line(ENTRY_REALM, tmp, TERM_L_BLUE); | |
115 | - } | |
125 | + display_magic_realms(creature_ptr); | |
116 | 126 | |
117 | 127 | if ((creature_ptr->pclass == CLASS_CHAOS_WARRIOR) || (creature_ptr->muta2 & MUT2_CHAOS_GIFT)) |
118 | 128 | display_player_one_line(ENTRY_PATRON, chaos_patrons[creature_ptr->chaos_patron], TERM_L_BLUE); |