-
Notifications
You must be signed in to change notification settings - Fork 81
rse new panel and settings #527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Mysticial
merged 2 commits into
PokemonAutomation:main
from
kichithewolf:rse-panel-setup
Jan 27, 2025
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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<PanelEntry> PanelListFactory::make_panels() const{ | ||
| std::vector<PanelEntry> ret; | ||
|
|
||
| ret.emplace_back("---- Settings ----"); | ||
| ret.emplace_back(make_settings<GameSettings_Descriptor, GameSettingsPanel>()); | ||
|
|
||
| //ret.emplace_back("---- General ----"); | ||
|
|
||
| ret.emplace_back("---- Shiny Hunting ----"); | ||
| //ret.emplace_back(make_single_switch_program<AudioStarterReset_Descriptor, AudioStarterReset>()); | ||
|
|
||
|
|
||
| if (PreloadSettings::instance().DEVELOPER_MODE){ | ||
| ret.emplace_back("---- Test ----"); | ||
| //ret.emplace_back(make_single_switch_program<StarterReset_Descriptor, StarterReset>()); //outdated early test program | ||
|
|
||
| ret.emplace_back("---- Developer Tools ----"); | ||
| //ret.emplace_back(make_single_switch_program<SoundListener_Descriptor, SoundListener>()); | ||
| } | ||
|
|
||
| return ret; | ||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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<PanelEntry> make_panels() const; | ||
| }; | ||
|
|
||
|
|
||
|
|
||
| } | ||
| } | ||
| } | ||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| /* 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_menu_navigation("<font size=4><b>Menu Navigation Timings:</b></font>") | ||
| , GAME_TO_HOME_DELAY( | ||
| "<b>Game to Home Delay:</b><br>Delay from pressing home to entering the the Switch home menu.", | ||
| LockMode::LOCK_WHILE_RUNNING, | ||
| TICKS_PER_SECOND, | ||
| "125" | ||
| ) | ||
| , m_soft_reset_timings("<font size=4><b>Soft Reset Timings:</b></font>") | ||
| , START_BUTTON_MASH( | ||
| "<b>1. Start Button Mash:</b><br>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( | ||
| "<b>2. Enter Game Wait:</b><br>Wait this long for the game to load.", | ||
| LockMode::LOCK_WHILE_RUNNING, | ||
| TICKS_PER_SECOND, | ||
| "3 * TICKS_PER_SECOND" | ||
| ) | ||
| , m_shiny_audio_settings("<font size=4><b>Shiny Audio Settings:</b></font>") | ||
| , SHINY_SOUND_THRESHOLD( | ||
| "<b>Shiny Sound Threshold:</b><br>Maximum error coefficient to trigger a shiny detection.", | ||
| LockMode::LOCK_WHILE_RUNNING, | ||
| 0.97, 0, 1.0 | ||
| ) | ||
| , SHINY_SOUND_LOW_FREQUENCY( | ||
| "<b>Shiny Sound Low Frequency (Hz):</b><br>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); | ||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| /* 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_menu_navigation; | ||
| TimeExpressionOption<uint16_t> GAME_TO_HOME_DELAY; | ||
|
|
||
| SectionDividerOption m_soft_reset_timings; | ||
| TimeExpressionOption<uint16_t> START_BUTTON_MASH; | ||
| TimeExpressionOption<uint16_t> 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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How many of these are relevant to GBA? Stuff like the Home menu didn't exist on the real thing.