| 29 | } |
| 30 | |
| 31 | void Window_ActorSp::SetBattler(const Game_Battler& battler) { |
| 32 | int cx = 0; |
| 33 | |
| 34 | int digits = (battler.MaxSpValue() >= 1000) ? 4 : 3; |
| 35 | |
| 36 | int color = Font::ColorDefault; |
| 37 | if (battler.GetMaxSp() != 0 && battler.GetSp() <= battler.GetMaxSp() / 4) { |
| 38 | color = Font::ColorCritical; |
| 39 | } |
| 40 | |
| 41 | contents->Clear(); |
| 42 | |
| 43 | // Draw current Sp |
| 44 | contents->TextDraw(cx + digits * 6, 2, color, std::to_string(battler.GetSp()), Text::AlignRight); |
| 45 | |
| 46 | // Draw / |
| 47 | cx += digits * 6; |
| 48 | contents->TextDraw(cx, 2, Font::ColorDefault, "/"); |
| 49 | |
| 50 | // Draw Max Sp |
| 51 | cx += 6; |
| 52 | contents->TextDraw(cx + digits * 6, 2, Font::ColorDefault, std::to_string(battler.GetMaxSp()), Text::AlignRight); |
| 53 | } |
nothing calls this directly
no test coverage detected