1 #include "core/stuff-handler.h"
2 #include "core/window-redrawer.h"
3 #include "player/player-status.h"
4 #include "system/player-type-definition.h"
5 #include "system/redrawing-flags-updater.h"
8 * @brief 全更新処理をチェックして処理していく
10 void handle_stuff(PlayerType *player_ptr)
12 auto &rfu = RedrawingFlagsUpdater::get_instance();
13 if (rfu.any_stats()) {
14 update_creature(player_ptr);
18 redraw_stuff(player_ptr);
22 window_stuff(player_ptr);
27 * Track the given monster race
29 void monster_race_track(PlayerType *player_ptr, MonsterRaceId r_idx)
31 player_ptr->monster_race_idx = r_idx;
32 RedrawingFlagsUpdater::get_instance().set_flag(SubWindowRedrawingFlag::MONSTER_LORE);
36 * Track the given object kind
38 void object_kind_track(PlayerType *player_ptr, short bi_id)
40 player_ptr->tracking_bi_id = bi_id;
41 RedrawingFlagsUpdater::get_instance().set_flag(SubWindowRedrawingFlag::ITEM_KNOWLEDGE);
46 * @param player_ptr プレイヤーへの参照ポインタ
47 * @param m_idx トラッキング対象のモンスターID。0の時キャンセル
50 void health_track(PlayerType *player_ptr, MONSTER_IDX m_idx)
52 if (m_idx && m_idx == player_ptr->riding) {
56 player_ptr->health_who = m_idx;
57 RedrawingFlagsUpdater::get_instance().set_flag(MainWindowRedrawingFlag::HEALTH);
62 auto &rfu = RedrawingFlagsUpdater::get_instance();
63 static constexpr auto flags_srf = {
64 StatusRecalculatingFlag::COMBINATION,
65 StatusRecalculatingFlag::REORDER,
67 rfu.set_flags(flags_srf);
68 rfu.set_flag(SubWindowRedrawingFlag::INVENTORY);
72 bool redraw_player(PlayerType *player_ptr)
74 if (player_ptr->csp > player_ptr->msp) {
75 player_ptr->csp = player_ptr->msp;
78 auto &rfu = RedrawingFlagsUpdater::get_instance();
79 rfu.set_flag(MainWindowRedrawingFlag::MP);
80 static constexpr auto flags_srf = {
81 StatusRecalculatingFlag::COMBINATION,
82 StatusRecalculatingFlag::REORDER,
84 rfu.set_flags(flags_srf);
85 rfu.set_flag(SubWindowRedrawingFlag::INVENTORY);