Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,12 @@ const std::unordered_set<std::string>& 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <iostream>
Expand Down Expand Up @@ -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<ConsoleSettings_Descriptor, ConsoleSettingsPanel>().make_panel()->save_settings();
#endif

return profile;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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();
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,7 @@ ConsoleSettings::ConsoleSettings()
)
, KEYBOARD_SECTION("<font size=4><b>Keyboard to Controller Mappings:</b></font>")
{
#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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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;
Expand Down
Loading