diff --git a/libultraship/libultraship/ControlDeck.cpp b/libultraship/libultraship/ControlDeck.cpp index 6e3328053..36e581fc7 100644 --- a/libultraship/libultraship/ControlDeck.cpp +++ b/libultraship/libultraship/ControlDeck.cpp @@ -73,12 +73,7 @@ namespace Ship { } void ControlDeck::WriteToPad(OSContPad* pad) const { - - #ifdef __SWITCH__ - bool shouldBlockGameInput = CVar_GetS32("gOpenMenuBar", 0); - #else bool shouldBlockGameInput = CVar_GetS32("gOpenMenuBar", 0) && CVar_GetS32("gControlNav", 0); - #endif for (size_t i = 0; i < virtualDevices.size(); i++) { const std::shared_ptr backend = physicalDevices[virtualDevices[i]]; diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index b6353a736..b3b8a1c78 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -484,12 +484,7 @@ namespace SohImGui { io->ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; } - #ifdef __SWITCH__ - bool enableControllerNavigation = true; - #else - bool enableControllerNavigation = CVar_GetS32("gControlNav", 0); - #endif - if (enableControllerNavigation && CVar_GetS32("gOpenMenuBar", 0)) { + if (CVar_GetS32("gControlNav", 0) && CVar_GetS32("gOpenMenuBar", 0)) { io->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad | ImGuiConfigFlags_NavEnableKeyboard; } else { io->ConfigFlags &= ~ImGuiConfigFlags_NavEnableGamepad; @@ -921,19 +916,15 @@ namespace SohImGui { ImGui::DockSpace(dockId, ImVec2(0.0f, 0.0f), ImGuiDockNodeFlags_None | ImGuiDockNodeFlags_NoDockingInCentralNode); - if (ImGui::IsKeyPressed(TOGGLE_BTN) || ImGui::IsKeyPressed(TOGGLE_PAD_BTN)) { + if (ImGui::IsKeyPressed(TOGGLE_BTN) || + (ImGui::IsKeyPressed(TOGGLE_PAD_BTN) && CVar_GetS32("gControlNav", 0))) { bool menu_bar = CVar_GetS32("gOpenMenuBar", 0); CVar_SetS32("gOpenMenuBar", !menu_bar); needs_save = true; GlobalCtx2::GetInstance()->GetWindow()->SetMenuBar(menu_bar); ShowCursor(menu_bar, Dialogues::dMenubar); GlobalCtx2::GetInstance()->GetWindow()->GetControlDeck()->SaveControllerSettings(); - #ifdef __SWITCH__ - bool enableControllerNavigation = true; - #else - bool enableControllerNavigation = CVar_GetS32("gControlNav", 0); - #endif - if (enableControllerNavigation && CVar_GetS32("gOpenMenuBar", 0)) { + if (CVar_GetS32("gControlNav", 0) && CVar_GetS32("gOpenMenuBar", 0)) { io->ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad | ImGuiConfigFlags_NavEnableKeyboard; } else { io->ConfigFlags &= ~ImGuiConfigFlags_NavEnableGamepad; diff --git a/soh/soh/Enhancements/bootcommands.c b/soh/soh/Enhancements/bootcommands.c index c766049ae..c5d4fcdbc 100644 --- a/soh/soh/Enhancements/bootcommands.c +++ b/soh/soh/Enhancements/bootcommands.c @@ -25,6 +25,9 @@ void BootCommands_Init() CVar_RegisterS32("gDebugEnabled", 0); CVar_RegisterS32("gLanguages", 0); //0 = English / 1 = German / 2 = French CVar_RegisterS32("gHudColors", 1); //0 = N64 / 1 = NGC / 2 = Custom +#ifdef __SWITCH__ + CVar_RegisterS32("gControlNav", 1); // always enable controller nav on switch +#endif } //void BootCommands_ParseBootArgs(char* str)