| 176 | } |
| 177 | |
| 178 | void Scene_File::vUpdate() { |
| 179 | UpdateArrows(); |
| 180 | |
| 181 | if (IsWindowMoving()) { |
| 182 | for (auto& fw: file_windows) { |
| 183 | fw->Update(); |
| 184 | } |
| 185 | return; |
| 186 | } |
| 187 | |
| 188 | if (HandleExtraCommandsWindow()) { |
| 189 | return; |
| 190 | } |
| 191 | |
| 192 | if (Input::IsTriggered(Input::CANCEL)) { |
| 193 | Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Cancel)); |
| 194 | Scene::Pop(); |
| 195 | } else if (Input::IsTriggered(Input::DECISION)) { |
| 196 | if (IsSlotValid(index)) { |
| 197 | Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Decision)); |
| 198 | Action(index); |
| 199 | } |
| 200 | else { |
| 201 | Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Buzzer)); |
| 202 | } |
| 203 | } else if (Input::IsTriggered(Input::SHIFT)) { |
| 204 | #ifdef EMSCRIPTEN |
| 205 | extra_commands_window->SetX(SCREEN_TARGET_WIDTH - extra_commands_window->GetWidth() - 8); |
| 206 | extra_commands_window->SetY(file_windows[index]->GetY() + 8); |
| 207 | extra_commands_window->SetItemEnabled(0, file_windows[index]->IsValid() && file_windows[index]->HasParty()); |
| 208 | extra_commands_window->SetVisible(true); |
| 209 | return; |
| 210 | #endif |
| 211 | } |
| 212 | |
| 213 | int old_top_index = top_index; |
| 214 | int old_index = index; |
| 215 | int max_index = static_cast<int>(file_windows.size()) - 1; |
| 216 | |
| 217 | if (Input::IsRepeated(Input::DOWN) || Input::IsTriggered(Input::SCROLL_DOWN)) { |
| 218 | if (Input::IsTriggered(Input::DOWN) || Input::IsTriggered(Input::SCROLL_DOWN) |
| 219 | || index < max_index) { |
| 220 | Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Cursor)); |
| 221 | index = (index + 1) % file_windows.size(); |
| 222 | } |
| 223 | |
| 224 | //top_index = std::max(top_index, index - 3 + 1); |
| 225 | } |
| 226 | if (Input::IsRepeated(Input::UP) || Input::IsTriggered(Input::SCROLL_UP)) { |
| 227 | if (Input::IsTriggered(Input::UP) || Input::IsTriggered(Input::SCROLL_UP) |
| 228 | || index >= 1) { |
| 229 | Main_Data::game_system->SePlay(Main_Data::game_system->GetSystemSE(Main_Data::game_system->SFX_Cursor)); |
| 230 | index = (index + max_index) % file_windows.size(); |
| 231 | } |
| 232 | |
| 233 | //top_index = std::min(top_index, index); |
| 234 | } |
| 235 |
nothing calls this directly
no test coverage detected