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

Method UpdateOrder

src/scene_order.cpp:54–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void Scene_Order::UpdateOrder() {
55 if (Input::IsTriggered(Input::CANCEL)) {
56 Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Cancel));
57 if (actor_counter == 0) {
58 Scene::Pop();
59 } else {
60 --actor_counter;
61 window_left->SetItemText(actors[actor_counter] - 1, Main_Data::game_party->GetActors()[actors[actor_counter] - 1]->GetName());
62 window_right->SetItemText(actor_counter, "");
63 actors[actor_counter] = 0;
64 }
65 } else if (Input::IsTriggered(Input::DECISION)) {
66 if (std::find(actors.begin(), actors.end(), window_left->GetIndex() + 1) != actors.end()) {
67 Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Cancel));
68 } else {
69 Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Decision));
70 window_left->SetItemText(window_left->GetIndex(), "");
71 window_right->SetItemText(actor_counter, Main_Data::game_party->GetActors()[window_left->GetIndex()]->GetName());
72
73 actors[actor_counter] = window_left->GetIndex() + 1;
74
75 ++actor_counter;
76
77 // Display Confirm/Redo window
78 if (actor_counter == (int)Main_Data::game_party->GetActors().size()) {
79 window_left->SetIndex(-1);
80 window_left->SetActive(false);
81 window_confirm->SetIndex(0);
82 window_confirm->SetActive(true);
83 window_confirm->SetVisible(true);
84 }
85 }
86 }
87}
88
89void Scene_Order::UpdateConfirm() {
90 if (Input::IsTriggered(Input::CANCEL)) {

Callers

nothing calls this directly

Calls 11

SePlayMethod · 0.80
SetItemTextMethod · 0.45
GetNameMethod · 0.45
GetActorsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
GetIndexMethod · 0.45
sizeMethod · 0.45
SetIndexMethod · 0.45
SetActiveMethod · 0.45
SetVisibleMethod · 0.45

Tested by

no test coverage detected