MCPcopy Create free account
hub / github.com/XorTroll/uLaunch / OnMenuInput

Method OnMenuInput

projects/uMenu/source/ul/menu/ui/ui_MainMenuLayout.cpp:848–1048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

846 }
847
848 void MainMenuLayout::OnMenuInput(const u64 keys_down, const u64 keys_up, const u64 keys_held, const pu::ui::TouchPoint touch_pos) {
849 const auto quick_menu_on = this->quick_menu->IsOn();
850 if(this->last_quick_menu_on != quick_menu_on) {
851 this->last_quick_menu_on = quick_menu_on;
852 this->entry_menu->SetEnabled(!quick_menu_on);
853
854 if(quick_menu_on) {
855 pu::audio::PlaySfx(this->open_quick_menu_sfx);
856 }
857 else {
858 pu::audio::PlaySfx(this->close_quick_menu_sfx);
859 }
860 }
861 if(quick_menu_on) {
862 return;
863 }
864
865 ////////////////////////////////////////////////////////
866
867 if(this->input_bar_changed) {
868 this->input_bar_changed = false;
869 this->input_bar->ClearInputs();
870
871 if(this->entry_menu->IsFocusedNonemptyEntry()) {
872 if(this->entry_menu->IsAnySelected()) {
873 this->input_bar->AddSetInput(HidNpadButton_A, GetLanguageString("input_move_selected"));
874 }
875 else if(this->entry_menu->IsFocusedEntrySuspended()) {
876 this->input_bar->AddSetInput(HidNpadButton_A | InputBar::MetaHomeNpadButton, GetLanguageString("input_resume_suspended"));
877 }
878 else {
879 const auto &cur_entry = this->entry_menu->GetFocusedEntry();
880 if(cur_entry.Is<EntryType::Folder>()) {
881 this->input_bar->AddSetInput(HidNpadButton_A, GetLanguageString("input_open_folder"));
882 }
883 else {
884 this->input_bar->AddSetInput(HidNpadButton_A, GetLanguageString("input_launch_entry"));
885 }
886 }
887
888 if(this->entry_menu->IsAnySelected()) {
889 this->input_bar->AddSetInput(HidNpadButton_X, GetLanguageString("input_cancel_selection"));
890 }
891 else if(this->entry_menu->IsFocusedEntrySuspended()) {
892 this->input_bar->AddSetInput(HidNpadButton_X, GetLanguageString("input_close_suspended"));
893 }
894 else if(this->entry_menu->IsFocusedNonemptyEntry()) {
895 const auto &cur_entry = this->entry_menu->GetFocusedEntry();
896 if(!cur_entry.IsSpecial()) {
897 this->input_bar->AddSetInput(HidNpadButton_X, GetLanguageString("input_entry_options"));
898 }
899 }
900
901 if(!this->entry_menu->IsAnySelected()) {
902 this->input_bar->AddSetInput(HidNpadButton_Y, GetLanguageString("input_select_entry"));
903 }
904
905 if(this->entry_menu->IsAnySelected()) {

Callers 1

OnLayoutInputMethod · 0.45

Calls 15

MoveToMethod · 0.95
IsNroNonRemovableFunction · 0.85
CreateHomebrewEntryFunction · 0.85
FormatResultDisplayFunction · 0.85
IsOnMethod · 0.80
SetEnabledMethod · 0.80
ClearInputsMethod · 0.80

Tested by

no test coverage detected