| 930 | } |
| 931 | |
| 932 | void SettingsMenuLayout::OnMenuInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const pu::ui::TouchPoint touch_pos) { |
| 933 | UpdateScreenCaptureBackground(false); |
| 934 | |
| 935 | const auto is_in_submenu = this->cur_submenu != SettingSubmenu::None; |
| 936 | const auto can_move_left = !is_in_submenu && (static_cast<u32>(this->cur_menu) > 0) && (this->settings_menu_temp_x_offset == 0); |
| 937 | const auto can_move_right = !is_in_submenu && ((static_cast<u32>(this->cur_menu) + 1) < static_cast<u32>(SettingMenu::Count)) && (this->settings_menu_temp_x_offset == 0); |
| 938 | |
| 939 | if(this->settings_menu_temp_x_offset_incr.Increment(this->settings_menu_temp_x_offset)) { |
| 940 | this->settings_menu_temp_x_offset = 0; |
| 941 | this->settings_menu->SetX(this->base_menu_x); |
| 942 | this->settings_menu_temp->SetVisible(false); |
| 943 | this->cur_menu = this->move_goal_menu; |
| 944 | this->inputs_changed = true; |
| 945 | } |
| 946 | else if(this->settings_menu_temp_x_offset != 0) { |
| 947 | if(this->settings_menu_temp_x_offset > 0) { |
| 948 | this->settings_menu->SetX(this->base_menu_x + this->settings_menu_temp_x_offset - pu::ui::render::ScreenWidth); |
| 949 | } |
| 950 | else { |
| 951 | this->settings_menu->SetX(this->base_menu_x + this->settings_menu_temp_x_offset + pu::ui::render::ScreenWidth); |
| 952 | } |
| 953 | this->settings_menu_temp->SetX(this->base_menu_x + this->settings_menu_temp_x_offset); |
| 954 | } |
| 955 | |
| 956 | if(keys_down & HidNpadButton_B) { |
| 957 | pu::audio::PlaySfx(this->back_sfx); |
| 958 | |
| 959 | if(is_in_submenu) { |
| 960 | g_MenuApplication->SetBackgroundFade(); |
| 961 | g_MenuApplication->FadeOut(); |
| 962 | |
| 963 | for(auto &setting_submenu: g_SettingSubmenuEntries) { |
| 964 | if(setting_submenu.submenu == this->cur_submenu) { |
| 965 | if(setting_submenu.exit_cb != nullptr) { |
| 966 | setting_submenu.exit_cb(); |
| 967 | } |
| 968 | break; |
| 969 | } |
| 970 | } |
| 971 | |
| 972 | this->cur_submenu = SettingSubmenu::None; |
| 973 | this->inputs_changed = true; |
| 974 | this->Reload(false); |
| 975 | |
| 976 | g_MenuApplication->FadeIn(); |
| 977 | } |
| 978 | else { |
| 979 | g_MenuApplication->LoadMenu(MenuType::Main); |
| 980 | } |
| 981 | } |
| 982 | else if((keys_down & HidNpadButton_L) || (keys_down & HidNpadButton_ZL) || (keys_down & HidNpadButton_Left)) { |
| 983 | if(can_move_left) { |
| 984 | pu::audio::PlaySfx(this->setting_menu_move_sfx); |
| 985 | |
| 986 | this->settings_menu_temp->SetVisible(true); |
| 987 | std::swap(this->settings_menu, this->settings_menu_temp); |
| 988 | |
| 989 | const auto old_menu = this->cur_menu; |
nothing calls this directly
no test coverage detected