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

Method Update

src/window_interpreter.cpp:198–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void Window_Interpreter::Update() {
199 if (sub_window_flags->GetActive()) {
200 if (Input::IsTriggered(Input::InputButton::CANCEL)) {
201 sub_window_flags->SetActive(false);
202 sub_window_flags->SetVisible(false);
203 sub_window_flags->SetIndex(-1);
204 } else {
205 sub_window_flags->Update();
206 }
207 return;
208 }
209 Window_Selectable::Update();
210
211 if (IsHoveringSubActionLine()) {
212 sub_actions.Update(*this);
213
214 if (Input::IsTriggered(Input::InputButton::DECISION)) {
215 if (GetSelectedAction() == UiAction::ShowRuntimeFlags) {
216 sub_window_flags->SetActive(true);
217 sub_window_flags->SetVisible(true);
218 this->Refresh();
219
220 Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Decision));
221 } else if (GetSelectedAction() == UiAction::ShowMovementInfo) {
222 Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Buzzer));
223 }
224 }
225 } else {
226 sub_actions.ClearIndex();
227 }
228}
229
230bool Window_Interpreter::IsHoveringSubActionLine() const {
231 return GetIndex() == 1 && sub_actions.IsVisible();

Callers

nothing calls this directly

Calls 11

RefreshMethod · 0.95
GetActiveMethod · 0.80
SePlayMethod · 0.80
ClearIndexMethod · 0.80
SetCursorRectMethod · 0.80
UpdateFunction · 0.70
RectClass · 0.70
SetActiveMethod · 0.45
SetVisibleMethod · 0.45
SetIndexMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected