From e88abec2a6344dc348965580e7d19d80d2a426b7 Mon Sep 17 00:00:00 2001 From: bicarus-dev <202771338+bicarus-dev@users.noreply.github.com> Date: Thu, 3 Apr 2025 21:16:48 -0700 Subject: [PATCH] overlay: remove navigator input (#288) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Link to GitHub Issue, if one exists n/a ## Description of change No one uses this, remove them to reduce clutter. This is in preparation to migrate from deprecated ImGui IO model to new one, and this is part of that. ## Compiling 👍 ## Testing --- src/spice2x/games/io.cpp | 12 ------------ src/spice2x/games/io.h | 6 ------ src/spice2x/overlay/imgui/impl_spice.cpp | 21 --------------------- 3 files changed, 39 deletions(-) diff --git a/src/spice2x/games/io.cpp b/src/spice2x/games/io.cpp index d74270a..12e53a0 100644 --- a/src/spice2x/games/io.cpp +++ b/src/spice2x/games/io.cpp @@ -461,18 +461,6 @@ namespace games { vkey_defaults.push_back(0xFF); names.emplace_back("Force Exit Game"); vkey_defaults.push_back(0xFF); - names.emplace_back("Navigator Activate"); - vkey_defaults.push_back(0xFF); - names.emplace_back("Navigator Cancel"); - vkey_defaults.push_back(0xFF); - names.emplace_back("Navigator Up"); - vkey_defaults.push_back(0xFF); - names.emplace_back("Navigator Down"); - vkey_defaults.push_back(0xFF); - names.emplace_back("Navigator Left"); - vkey_defaults.push_back(0xFF); - names.emplace_back("Navigator Right"); - vkey_defaults.push_back(0xFF); names.emplace_back("Hotkey Enable 1"); vkey_defaults.push_back(0xFF); names.emplace_back("Hotkey Enable 2"); diff --git a/src/spice2x/games/io.h b/src/spice2x/games/io.h index 81790ee..43d9958 100644 --- a/src/spice2x/games/io.h +++ b/src/spice2x/games/io.h @@ -30,12 +30,6 @@ namespace games { ScreenResizeScene3, ScreenResizeScene4, SuperExit, - NavigatorActivate, - NavigatorCancel, - NavigatorUp, - NavigatorDown, - NavigatorLeft, - NavigatorRight, HotkeyEnable1, HotkeyEnable2, HotkeyToggle, diff --git a/src/spice2x/overlay/imgui/impl_spice.cpp b/src/spice2x/overlay/imgui/impl_spice.cpp index 1c4ab5f..f4f03b5 100644 --- a/src/spice2x/overlay/imgui/impl_spice.cpp +++ b/src/spice2x/overlay/imgui/impl_spice.cpp @@ -361,27 +361,6 @@ void ImGui_ImplSpice_NewFrame() { } } - // navigator input - auto buttons = games::get_buttons_overlay(eamuse_get_game()); - if (buttons && (!overlay::OVERLAY || overlay::OVERLAY->hotkeys_triggered())) { - struct { - size_t index; - Button &btn; - } NAV_MAPPING[] = { - { ImGuiNavInput_Activate, buttons->at(games::OverlayButtons::NavigatorActivate )}, - { ImGuiNavInput_Cancel, buttons->at(games::OverlayButtons::NavigatorCancel) }, - { ImGuiNavInput_DpadUp, buttons->at(games::OverlayButtons::NavigatorUp) }, - { ImGuiNavInput_DpadDown, buttons->at(games::OverlayButtons::NavigatorDown) }, - { ImGuiNavInput_DpadLeft, buttons->at(games::OverlayButtons::NavigatorLeft) }, - { ImGuiNavInput_DpadRight, buttons->at(games::OverlayButtons::NavigatorRight) }, - }; - for (auto mapping : NAV_MAPPING) { - if (GameAPI::Buttons::getState(RI_MGR, mapping.btn)) { - io.NavInputs[mapping.index] = 1; - } - } - } - // set mouse wheel auto mouse_diff = mouse_wheel - mouse_wheel_last; mouse_wheel_last = mouse_wheel;