| 62 | } |
| 63 | |
| 64 | void Window_BattleStatus::Refresh() { |
| 65 | contents->Clear(); |
| 66 | |
| 67 | if (enemy) { |
| 68 | item_max = Main_Data::game_enemyparty->GetBattlerCount(); |
| 69 | } |
| 70 | else { |
| 71 | item_max = Main_Data::game_party->GetBattlerCount(); |
| 72 | } |
| 73 | |
| 74 | item_max = std::min(item_max, 4); |
| 75 | |
| 76 | for (int i = 0; i < item_max; i++) { |
| 77 | // The party only contains valid battlers |
| 78 | const Game_Battler* actor; |
| 79 | if (enemy) { |
| 80 | actor = &(*Main_Data::game_enemyparty)[i]; |
| 81 | } |
| 82 | else { |
| 83 | actor = &(*Main_Data::game_party)[i]; |
| 84 | } |
| 85 | |
| 86 | if (!enemy && lcf::Data::battlecommands.battle_type == lcf::rpg::BattleCommands::BattleType_gauge) { |
| 87 | DrawActorFace(*static_cast<const Game_Actor*>(actor), 80 * i, actor_face_height); |
| 88 | } |
| 89 | else { |
| 90 | int y = menu_item_height / 8 + i * menu_item_height; |
| 91 | |
| 92 | DrawActorName(*actor, 4, y); |
| 93 | if (Feature::HasRpg2kBattleSystem()) { |
| 94 | int hpdigits = (actor->MaxHpValue() >= 1000) ? 4 : 3; |
| 95 | int spdigits = (actor->MaxSpValue() >= 1000) ? 4 : 3; |
| 96 | DrawActorState(*actor, (hpdigits < 4 && spdigits < 4) ? 86 : 80, y); |
| 97 | DrawActorHp(*actor, 178 - hpdigits * 6 - spdigits * 6, y, hpdigits, true); |
| 98 | DrawActorSp(*actor, 220 - spdigits * 6, y, spdigits, false); |
| 99 | } else { |
| 100 | if (lcf::Data::battlecommands.battle_type == lcf::rpg::BattleCommands::BattleType_traditional) { |
| 101 | DrawActorState(*actor, 84, y); |
| 102 | DrawActorHpValue(*actor, 136 + 4 * 6, y); |
| 103 | } else { |
| 104 | DrawActorState(*actor, 80, y); |
| 105 | } |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | RefreshGauge(); |
| 111 | } |
| 112 | |
| 113 | void Window_BattleStatus::RefreshGauge() { |
| 114 | if (Feature::HasRpg2k3BattleSystem()) { |
nothing calls this directly
no test coverage detected