| 30 | } |
| 31 | |
| 32 | void Window_TargetStatus::Refresh() { |
| 33 | contents->Clear(); |
| 34 | |
| 35 | if (id < 0) { |
| 36 | return; |
| 37 | } |
| 38 | |
| 39 | if (use_item) { |
| 40 | contents->TextDraw(0, 2, 1, lcf::Data::terms.possessed_items); |
| 41 | } else { |
| 42 | contents->TextDraw(0, 2, 1, lcf::Data::terms.sp_cost); |
| 43 | } |
| 44 | |
| 45 | // Scene_ActorTarget validates items and skills |
| 46 | std::string str; |
| 47 | if (use_item) { |
| 48 | str = std::to_string(Main_Data::game_party->GetItemCount(id)); |
| 49 | } else { |
| 50 | str = std::to_string((*Main_Data::game_party)[actor_index].CalculateSkillCost(id)); |
| 51 | } |
| 52 | |
| 53 | FontRef font = Font::Default(); |
| 54 | contents->TextDraw(contents->GetWidth(), 2, Font::ColorDefault, str, Text::AlignRight); |
| 55 | } |
| 56 | |
| 57 | void Window_TargetStatus::SetData(int id, bool is_item, int actor_index) { |
| 58 | this->id = id; |
nothing calls this directly
no test coverage detected