| 196 | } |
| 197 | |
| 198 | void 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 | } |