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

Method UpdateItemSelection

src/scene_equip.cpp:198–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void Scene_Equip::UpdateItemSelection() {
199 if (Input::IsTriggered(Input::CANCEL)) {
200 Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Cancel));
201 equip_window->SetActive(true);
202 item_window->SetActive(false);
203 item_window->SetIndex(-1);
204 } else if (Input::IsTriggered(Input::DECISION)) {
205 Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Decision));
206
207 const lcf::rpg::Item* current_item = item_window->GetItem();
208 int current_item_id = current_item ? current_item->ID : 0;
209 auto& actor = *actors[actor_index];
210
211 actor.ChangeEquipment(
212 equip_window->GetIndex() + 1, current_item_id);
213
214 equip_window->SetActive(true);
215 item_window->SetActive(false);
216 item_window->SetIndex(-1);
217
218 equip_window->Refresh();
219
220 for (size_t i = 0; i < item_windows.size(); ++i) {
221 item_windows[i]->Refresh();
222 }
223 }
224}

Callers

nothing calls this directly

Calls 8

SePlayMethod · 0.80
ChangeEquipmentMethod · 0.80
SetActiveMethod · 0.45
SetIndexMethod · 0.45
GetItemMethod · 0.45
GetIndexMethod · 0.45
RefreshMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected