| 72 | } |
| 73 | |
| 74 | void Window_Skill::DrawItem(int index) { |
| 75 | Rect rect = GetItemRect(index); |
| 76 | contents->ClearRect(rect); |
| 77 | |
| 78 | int skill_id = data[index]; |
| 79 | |
| 80 | if (skill_id > 0) { |
| 81 | int costs = actor->CalculateSkillCost(skill_id); |
| 82 | |
| 83 | bool enabled = CheckEnable(skill_id); |
| 84 | int color = !enabled ? Font::ColorDisabled : Font::ColorDefault; |
| 85 | |
| 86 | contents->TextDraw(rect.x + rect.width - 24, rect.y, color, fmt::format("{}{:3d}", lcf::rpg::Terms::TermOrDefault(lcf::Data::terms.easyrpg_skill_cost_separator, "-"), costs)); |
| 87 | |
| 88 | // Skills are guaranteed to be valid |
| 89 | DrawSkillName(*lcf::ReaderUtil::GetElement(lcf::Data::skills, skill_id), rect.x, rect.y, enabled); |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | void Window_Skill::UpdateHelp() { |
| 94 | help_window->SetText(GetSkill() == nullptr ? "" : ToString(GetSkill()->description)); |
nothing calls this directly
no test coverage detected