OSDN Git Service

[Refactor] #39962 display_player_middle() からdisplay_playtime_in_game() を分離 / Separate...
authorHourier <hourier@users.sourceforge.jp>
Fri, 28 Feb 2020 13:03:30 +0000 (22:03 +0900)
committerHourier <hourier@users.sourceforge.jp>
Fri, 28 Feb 2020 13:03:30 +0000 (22:03 +0900)
src/view/display-player.c

index b09eed7..72adb88 100644 (file)
@@ -260,30 +260,12 @@ static void display_player_exp(player_type *creature_ptr)
 
 
 /*!
- * @brief ã\83\97ã\83¬ã\82¤ã\83¤ã\83¼ã\82¹ã\83\86ã\83¼ã\82¿ã\82¹è¡¨ç¤ºã\81®ä¸­å¤®é\83¨å\88\86ã\82\92表示ã\81\99ã\82\8bã\82µã\83\96ã\83«ã\83¼ã\83\81ã\83³
+ * @brief ã\82²ã\83¼ã\83 å\86\85ã\81®çµ\8cé\81\8eæ\99\82é\96\93ã\82\92表示ã\81\99ã\82\8b
  * @param creature_ptr プレーヤーへの参照ポインタ
- * Prints the following information on the screen.
  * @return なし
  */
-static void display_player_middle(player_type *creature_ptr)
+static void display_playtime_in_game(player_type *creature_ptr)
 {
-       if (creature_ptr->migite)
-               display_player_melee_bonus(creature_ptr, 0, left_hander ? ENTRY_LEFT_HAND1 : ENTRY_RIGHT_HAND1);
-
-       display_left_hand(creature_ptr);
-       display_hit_damage(creature_ptr);
-       display_shoot_magnification(creature_ptr);
-       display_player_one_line(ENTRY_BASE_AC, format("[%d,%+d]", creature_ptr->dis_ac, creature_ptr->dis_to_a), TERM_L_BLUE);
-
-       int base_speed = creature_ptr->pspeed - 110;
-       if (creature_ptr->action == ACTION_SEARCH) base_speed += 10;
-
-       TERM_COLOR attr = decide_speed_color(creature_ptr, base_speed);
-       int tmp_speed = calc_temporary_speed(creature_ptr);
-       display_player_speed(creature_ptr, attr, base_speed, tmp_speed);
-       display_player_exp(creature_ptr);
-       display_player_one_line(ENTRY_GOLD, format("%ld", creature_ptr->au), TERM_L_GREEN);
-
        int day, hour, min;
        extract_day_hour_min(creature_ptr, &day, &hour, &min);
 
@@ -308,6 +290,34 @@ static void display_player_middle(player_type *creature_ptr)
                display_player_one_line(ENTRY_SP, format("%4d/%4d", creature_ptr->csp, creature_ptr->msp), TERM_YELLOW);
        else
                display_player_one_line(ENTRY_SP, format("%4d/%4d", creature_ptr->csp, creature_ptr->msp), TERM_RED);
+}
+
+
+/*!
+ * @brief プレイヤーステータス表示の中央部分を表示するサブルーチン
+ * @param creature_ptr プレーヤーへの参照ポインタ
+ * Prints the following information on the screen.
+ * @return なし
+ */
+static void display_player_middle(player_type *creature_ptr)
+{
+       if (creature_ptr->migite)
+               display_player_melee_bonus(creature_ptr, 0, left_hander ? ENTRY_LEFT_HAND1 : ENTRY_RIGHT_HAND1);
+
+       display_left_hand(creature_ptr);
+       display_hit_damage(creature_ptr);
+       display_shoot_magnification(creature_ptr);
+       display_player_one_line(ENTRY_BASE_AC, format("[%d,%+d]", creature_ptr->dis_ac, creature_ptr->dis_to_a), TERM_L_BLUE);
+
+       int base_speed = creature_ptr->pspeed - 110;
+       if (creature_ptr->action == ACTION_SEARCH) base_speed += 10;
+
+       TERM_COLOR attr = decide_speed_color(creature_ptr, base_speed);
+       int tmp_speed = calc_temporary_speed(creature_ptr);
+       display_player_speed(creature_ptr, attr, base_speed, tmp_speed);
+       display_player_exp(creature_ptr);
+       display_player_one_line(ENTRY_GOLD, format("%ld", creature_ptr->au), TERM_L_GREEN);
+       display_playtime_in_game(creature_ptr);
 
        u32b play_hour = current_world_ptr->play_time / (60 * 60);
        u32b play_min = (current_world_ptr->play_time / 60) % 60;