From 7d9ac3ad0b2bbdd1f5c9ff5bf552aa38111e23e6 Mon Sep 17 00:00:00 2001 From: jw098 Date: Sun, 30 Aug 2026 16:13:45 -0700 Subject: [PATCH] Add ControllerProfile to Qt-free library. --- .../ResourceDownload/ResourceDownloadHelpers.cpp | 4 ---- .../Controllers/NintendoSwitch_ControllerSettings.cpp | 4 ++++ .../PABotBase2/NintendoSwitch_PABotBase2_OemController.cpp | 4 ---- .../Source/NintendoSwitch/NintendoSwitch_Settings.cpp | 2 -- .../Source/NintendoSwitch/NintendoSwitch_Settings.h | 4 ---- 5 files changed, 4 insertions(+), 14 deletions(-) diff --git a/SerialPrograms/Source/CommonFramework/ResourceDownload/ResourceDownloadHelpers.cpp b/SerialPrograms/Source/CommonFramework/ResourceDownload/ResourceDownloadHelpers.cpp index a0374bf6d5..49a82549b3 100644 --- a/SerialPrograms/Source/CommonFramework/ResourceDownload/ResourceDownloadHelpers.cpp +++ b/SerialPrograms/Source/CommonFramework/ResourceDownload/ResourceDownloadHelpers.cpp @@ -168,16 +168,12 @@ const std::unordered_set& all_resource_names(){ JsonValue fetch_resource_download_list_json_from_remote(){ -#ifdef QT_CORE_LIB Logger& logger = global_logger_tagged(); JsonValue json = FileDownloader::download_json_file( logger, "https://raw.githubusercontent.com/PokemonAutomation/Packages/refs/heads/master/Resources/ResourceDownloadList.json" ); -#else - JsonValue json; // placeholder when no Qt -#endif return json; } diff --git a/SerialPrograms/Source/NintendoSwitch/Controllers/NintendoSwitch_ControllerSettings.cpp b/SerialPrograms/Source/NintendoSwitch/Controllers/NintendoSwitch_ControllerSettings.cpp index 4dce34147e..56c01fbe06 100644 --- a/SerialPrograms/Source/NintendoSwitch/Controllers/NintendoSwitch_ControllerSettings.cpp +++ b/SerialPrograms/Source/NintendoSwitch/Controllers/NintendoSwitch_ControllerSettings.cpp @@ -9,8 +9,10 @@ #include "Common/CRC32/pabb_CRC32.h" #include "CommonFramework/Logging/Logger.h" //#include "CommonFramework/PersistentSettings.h" +#ifdef QT_CORE_LIB #include "CommonFramework/Panels/PanelTools.h" #include "NintendoSwitch/NintendoSwitch_SettingsPanel.h" +#endif #include "NintendoSwitch_ControllerSettings.h" //#include @@ -579,10 +581,12 @@ ControllerProfile ControllerSettingsTable::get_or_make_profile( this->append_row(std::move(row)); // PERSISTENT_SETTINGS().write(); +#ifdef QT_CORE_LIB // This is brutal (tech-debt). The only way to force the settings to save // is to load the panel. TODO: Redesign panels to allow external editing. // This is also coming in from a different thread (not the main Qt thread). PanelDescriptorWrapper().make_panel()->save_settings(); +#endif return profile; } diff --git a/SerialPrograms/Source/NintendoSwitch/Controllers/PABotBase2/NintendoSwitch_PABotBase2_OemController.cpp b/SerialPrograms/Source/NintendoSwitch/Controllers/PABotBase2/NintendoSwitch_PABotBase2_OemController.cpp index 246226a6ff..bc2e522840 100644 --- a/SerialPrograms/Source/NintendoSwitch/Controllers/PABotBase2/NintendoSwitch_PABotBase2_OemController.cpp +++ b/SerialPrograms/Source/NintendoSwitch/Controllers/PABotBase2/NintendoSwitch_PABotBase2_OemController.cpp @@ -308,14 +308,12 @@ bool PABotBase2_OemController::run_preconnect_configure( } } -#ifdef QT_CORE_LIB NintendoSwitch::ControllerProfile profile = PokemonAutomation::NintendoSwitch::ConsoleSettings::instance().CONTROLLER_SETTINGS.get_or_make_profile( controller_mac_address, "", controller_type ); -#endif #if _WIN32 #pragma pack(push, 1) @@ -334,7 +332,6 @@ bool PABotBase2_OemController::run_preconnect_configure( #endif Message message{}; - #ifdef QT_CORE_LIB { Color color(profile.body_color); message.colors.body[0] = color.red(); @@ -359,7 +356,6 @@ bool PABotBase2_OemController::run_preconnect_configure( message.colors.right_grip[1] = color.green(); message.colors.right_grip[2] = color.blue(); } - #endif message.request.message_bytes = sizeof(message); diff --git a/SerialPrograms/Source/NintendoSwitch/NintendoSwitch_Settings.cpp b/SerialPrograms/Source/NintendoSwitch/NintendoSwitch_Settings.cpp index e654990e7f..3e60ada3f1 100644 --- a/SerialPrograms/Source/NintendoSwitch/NintendoSwitch_Settings.cpp +++ b/SerialPrograms/Source/NintendoSwitch/NintendoSwitch_Settings.cpp @@ -161,9 +161,7 @@ ConsoleSettings::ConsoleSettings() ) , KEYBOARD_SECTION("Keyboard to Controller Mappings:") { -#ifdef QT_CORE_LIB PA_ADD_OPTION(CONTROLLER_SETTINGS); -#endif PA_ADD_OPTION(TRUST_USER_CONSOLE_SELECTION); PA_ADD_OPTION(BLIND_START_GAME_MASH); PA_ADD_OPTION(CLOSE_GAME_DELAY); diff --git a/SerialPrograms/Source/NintendoSwitch/NintendoSwitch_Settings.h b/SerialPrograms/Source/NintendoSwitch/NintendoSwitch_Settings.h index 21e5d4927d..a7517f41fb 100644 --- a/SerialPrograms/Source/NintendoSwitch/NintendoSwitch_Settings.h +++ b/SerialPrograms/Source/NintendoSwitch/NintendoSwitch_Settings.h @@ -13,9 +13,7 @@ #include "Common/Cpp/Options/TimeDurationOption.h" // #include "CommonFramework/Panels/SettingsPanel.h" #include "Options/NintendoSwitch_CodeEntrySettingsOption.h" -#ifdef QT_CORE_LIB #include "Controllers/NintendoSwitch_ControllerSettings.h" -#endif #include "Controllers/NintendoSwitch_KeyboardMapping.h" namespace PokemonAutomation{ @@ -42,9 +40,7 @@ class ConsoleSettings : public BatchOption{ public: static ConsoleSettings& instance(); -#ifdef QT_CORE_LIB ControllerSettingsTable CONTROLLER_SETTINGS; -#endif BooleanCheckBoxOption TRUST_USER_CONSOLE_SELECTION; MillisecondsOption BLIND_START_GAME_MASH;