diff --git a/SerialPrograms/CMakeLists.txt b/SerialPrograms/CMakeLists.txt index 5f13681a60..0cba2b905b 100644 --- a/SerialPrograms/CMakeLists.txt +++ b/SerialPrograms/CMakeLists.txt @@ -1306,6 +1306,10 @@ file(GLOB MAIN_SOURCES Source/PokemonLA/Resources/PokemonLA_PokemonSprites.h Source/PokemonLA/Resources/PokemonLA_WeatherAndTimeIcons.cpp Source/PokemonLA/Resources/PokemonLA_WeatherAndTimeIcons.h + Source/PokemonRSE/PokemonRSE_Panels.cpp + Source/PokemonRSE/PokemonRSE_Panels.h + Source/PokemonRSE/PokemonRSE_Settings.cpp + Source/PokemonRSE/PokemonRSE_Settings.h Source/PokemonSV/Inference/Battles/PokemonSV_BattleBallReader.cpp Source/PokemonSV/Inference/Battles/PokemonSV_BattleBallReader.h Source/PokemonSV/Inference/Battles/PokemonSV_EncounterWatcher.cpp diff --git a/SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.cpp b/SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.cpp index c53c8899d3..c0bb6fa329 100644 --- a/SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.cpp +++ b/SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.cpp @@ -42,6 +42,7 @@ const std::set TOKENS{ "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08", // jw's token. "e8d168bc482e96553ea9f9ecaea5a817474dbccc2a6a228a6bde67f2b2aa2889", // James' token. "7555b7c63481cad42306718c67e7f9def5bfd1da8f6cd299ccd3d7dc95f307ae", // Kuro's token. + "3d475b46d121fc24559d100de2426feaa53cd6578aac2817c4857a610ccde2dd", // kichi's token. }; diff --git a/SerialPrograms/Source/PanelLists.cpp b/SerialPrograms/Source/PanelLists.cpp index ad73de5baf..de6fafbf13 100644 --- a/SerialPrograms/Source/PanelLists.cpp +++ b/SerialPrograms/Source/PanelLists.cpp @@ -12,11 +12,13 @@ #include "CommonFramework/PersistentSettings.h" #include "CommonFramework/Windows/DpiScaler.h" #include "CommonFramework/Panels/UI/PanelListWidget.h" +#include "CommonFramework/GlobalSettingsPanel.h" #include "NintendoSwitch/NintendoSwitch_Panels.h" #include "PokemonSwSh/PokemonSwSh_Panels.h" #include "PokemonHome/PokemonHome_Panels.h" #include "PokemonBDSP/PokemonBDSP_Panels.h" #include "PokemonLA/PokemonLA_Panels.h" +#include "PokemonRSE/PokemonRSE_Panels.h" #include "PokemonSV/PokemonSV_Panels.h" #include "ZeldaTotK/ZeldaTotK_Panels.h" #include "PanelLists.h" @@ -47,6 +49,9 @@ ProgramSelect::ProgramSelect(QWidget& parent, PanelHolder& holder) add(std::make_unique()); add(std::make_unique()); add(std::make_unique()); + if (PreloadSettings::instance().DEVELOPER_MODE) { + add(std::make_unique()); + } add(std::make_unique()); diff --git a/SerialPrograms/Source/PokemonRSE/PokemonRSE_Panels.cpp b/SerialPrograms/Source/PokemonRSE/PokemonRSE_Panels.cpp new file mode 100644 index 0000000000..a15ff9b50a --- /dev/null +++ b/SerialPrograms/Source/PokemonRSE/PokemonRSE_Panels.cpp @@ -0,0 +1,55 @@ +/* Pokemon RSE Panels + * + * From: https://github.com/PokemonAutomation/Arduino-Source + * + */ + +#include "CommonFramework/GlobalSettingsPanel.h" +#include "Pokemon/Pokemon_Strings.h" +#include "PokemonRSE_Panels.h" + +#include "PokemonRSE_Settings.h" + +//#include "Programs/ShinyHunting/PokemonRSE_AudioStarterReset.h" +//#include "Programs/ShinyHunting/PokemonRSE_StarterReset.h" +//#include "Programs/TestPrograms/PokemonRSE_SoundListener.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonRSE{ + + + +PanelListFactory::PanelListFactory() + : PanelListDescriptor("Pokemon Ruby and Sapphire, Pokemon Emerald") +{} + +std::vector PanelListFactory::make_panels() const{ + std::vector ret; + + ret.emplace_back("---- Settings ----"); + ret.emplace_back(make_settings()); + + //ret.emplace_back("---- General ----"); + + ret.emplace_back("---- Shiny Hunting ----"); + //ret.emplace_back(make_single_switch_program()); + + + if (PreloadSettings::instance().DEVELOPER_MODE){ + ret.emplace_back("---- Test ----"); + //ret.emplace_back(make_single_switch_program()); //outdated early test program + + ret.emplace_back("---- Developer Tools ----"); + //ret.emplace_back(make_single_switch_program()); + } + + return ret; +} + + + + +} +} +} diff --git a/SerialPrograms/Source/PokemonRSE/PokemonRSE_Panels.h b/SerialPrograms/Source/PokemonRSE/PokemonRSE_Panels.h new file mode 100644 index 0000000000..d5a36d12e9 --- /dev/null +++ b/SerialPrograms/Source/PokemonRSE/PokemonRSE_Panels.h @@ -0,0 +1,29 @@ +/* Pokemon RSE Panels + * + * From: https://github.com/PokemonAutomation/Arduino-Source + * + */ + +#ifndef PokemonAutomation_PokemonRSE_Panels_H +#define PokemonAutomation_PokemonRSE_Panels_H + +#include "CommonFramework/Panels/PanelList.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonRSE{ + + + +class PanelListFactory : public PanelListDescriptor{ +public: + PanelListFactory(); + virtual std::vector make_panels() const; +}; + + + +} +} +} +#endif diff --git a/SerialPrograms/Source/PokemonRSE/PokemonRSE_Settings.cpp b/SerialPrograms/Source/PokemonRSE/PokemonRSE_Settings.cpp new file mode 100644 index 0000000000..b4b53cebd7 --- /dev/null +++ b/SerialPrograms/Source/PokemonRSE/PokemonRSE_Settings.cpp @@ -0,0 +1,92 @@ +/* Pokemon RSE Settings + * + * From: https://github.com/PokemonAutomation/Arduino-Source + * + */ + +#include "Common/NintendoSwitch/NintendoSwitch_ControllerDefs.h" +#include "CommonFramework/Globals.h" + +#include "PokemonRSE_Settings.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonRSE{ + + + +GameSettings& GameSettings::instance(){ + static GameSettings settings; + return settings; +} +GameSettings::GameSettings() + : BatchOption(LockMode::LOCK_WHILE_RUNNING) + , m_soft_reset_timings("Soft Reset Timings:") + , START_BUTTON_MASH( + "Start Button Mash:
Mash Start for this long after a soft reset to get to the main menu.", + LockMode::LOCK_WHILE_RUNNING, + TICKS_PER_SECOND, + "5 * TICKS_PER_SECOND" + ) + , ENTER_GAME_WAIT( + "Enter Game Wait:
Wait this long for the game to load.", + LockMode::LOCK_WHILE_RUNNING, + TICKS_PER_SECOND, + "3 * TICKS_PER_SECOND" + ) + , m_shiny_audio_settings("Shiny Audio Settings:") + , SHINY_SOUND_THRESHOLD( + "Shiny Sound Threshold:
Maximum error coefficient to trigger a shiny detection.", + LockMode::LOCK_WHILE_RUNNING, + 0.97, 0, 1.0 + ) + , SHINY_SOUND_LOW_FREQUENCY( + "Shiny Sound Low Frequency (Hz):
High pass filter frequency for shiny sound.", + LockMode::LOCK_WHILE_RUNNING, + 5000, 0, 48000 + ) +{ + PA_ADD_STATIC(m_soft_reset_timings); + PA_ADD_OPTION(START_BUTTON_MASH); + PA_ADD_OPTION(ENTER_GAME_WAIT); + PA_ADD_STATIC(m_shiny_audio_settings); + PA_ADD_OPTION(SHINY_SOUND_THRESHOLD); + PA_ADD_OPTION(SHINY_SOUND_LOW_FREQUENCY); +} + + + + + +GameSettings_Descriptor::GameSettings_Descriptor() + : PanelDescriptor( + Color(), + "PokemonRSE:GlobalSettings", + "Pokemon RSE", "Pokemon Settings", + "ComputerControl/blob/master/Wiki/Programs/PokemonRSE/RSESettings.md", + "Global Pokemon RSE Settings" + ) +{} + + + +GameSettingsPanel::GameSettingsPanel(const GameSettings_Descriptor& descriptor) + : SettingsPanelInstance(descriptor) + , settings(GameSettings::instance()) +{ + PA_ADD_OPTION(settings); +} + + + + + +} +} +} + + + + + + diff --git a/SerialPrograms/Source/PokemonRSE/PokemonRSE_Settings.h b/SerialPrograms/Source/PokemonRSE/PokemonRSE_Settings.h new file mode 100644 index 0000000000..d455f63a9c --- /dev/null +++ b/SerialPrograms/Source/PokemonRSE/PokemonRSE_Settings.h @@ -0,0 +1,56 @@ +/* Pokemon RSE Settings + * + * From: https://github.com/PokemonAutomation/Arduino-Source + * + */ + +#ifndef PokemonAutomation_PokemonRSE_Settings_H +#define PokemonAutomation_PokemonRSE_Settings_H + +#include "Common/Cpp/Options/StaticTextOption.h" +#include "Common/Cpp/Options/BooleanCheckBoxOption.h" +#include "Common/Cpp/Options/FloatingPointOption.h" +#include "Common/Cpp/Options/TimeExpressionOption.h" +#include "CommonFramework/Panels/SettingsPanel.h" + +namespace PokemonAutomation{ +namespace NintendoSwitch{ +namespace PokemonRSE{ + + +class GameSettings : public BatchOption{ + GameSettings(); +public: + static GameSettings& instance(); + + SectionDividerOption m_soft_reset_timings; + TimeExpressionOption START_BUTTON_MASH; + TimeExpressionOption ENTER_GAME_WAIT; + + SectionDividerOption m_shiny_audio_settings; + FloatingPointOption SHINY_SOUND_THRESHOLD; + FloatingPointOption SHINY_SOUND_LOW_FREQUENCY; + +}; + + + + +class GameSettings_Descriptor : public PanelDescriptor{ +public: + GameSettings_Descriptor(); +}; + + +class GameSettingsPanel : public SettingsPanelInstance{ +public: + GameSettingsPanel(const GameSettings_Descriptor& descriptor); +private: + GameSettings& settings; +}; + + +} +} +} +#endif