MCPcopy Create free account
hub / github.com/EasyRPG/Player / Refresh

Method Refresh

src/window_targetstatus.cpp:32–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30}
31
32void 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
57void Window_TargetStatus::SetData(int id, bool is_item, int actor_index) {
58 this->id = id;

Callers

nothing calls this directly

Calls 5

TextDrawMethod · 0.80
ClearMethod · 0.45
GetItemCountMethod · 0.45
CalculateSkillCostMethod · 0.45
GetWidthMethod · 0.45

Tested by

no test coverage detected