diff --git a/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.cpp b/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.cpp index 28fb305c2..e3bcaf6b6 100644 --- a/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.cpp +++ b/SerialPrograms/Source/NintendoSwitch/Programs/NintendoSwitch_GameEntry.cpp @@ -38,21 +38,32 @@ void resume_game_from_home( context.wait_for_all_requests(); while (true){ - UpdateMenuWatcher detector(false); - int ret = wait_until( - console, context, - std::chrono::milliseconds(1000), - { detector } - ); - if (ret < 0){ - return; + { + UpdateMenuWatcher update_detector(false); + int ret = wait_until( + console, context, + std::chrono::milliseconds(1000), + { update_detector } + ); + if (ret == 0){ + console.log("Detected update window.", COLOR_RED); + + pbf_press_dpad(context, DPAD_UP, 5, 0); + pbf_press_button(context, BUTTON_A, 10, 500); + context.wait_for_all_requests(); + continue; + } } - console.log("Detected update window.", COLOR_RED); - - pbf_press_dpad(context, DPAD_UP, 5, 0); - pbf_press_button(context, BUTTON_A, 10, 500); - context.wait_for_all_requests(); + // In case we failed to enter the game. + HomeWatcher home_detector; + if (home_detector.detect(console.video().snapshot())){ + console.log("Failed to re-enter game. Trying again...", COLOR_RED); + pbf_press_button(context, BUTTON_HOME, 10, 10); + continue; + }else{ + break; + } } } diff --git a/SerialPrograms/Source/PokemonSV/PokemonSV_Panels.cpp b/SerialPrograms/Source/PokemonSV/PokemonSV_Panels.cpp index 169a1ab77..b8f6f3e7e 100644 --- a/SerialPrograms/Source/PokemonSV/PokemonSV_Panels.cpp +++ b/SerialPrograms/Source/PokemonSV/PokemonSV_Panels.cpp @@ -11,6 +11,7 @@ #include "PokemonSV_Settings.h" #include "Programs/General/PokemonSV_MassPurchase.h" +#include "Programs/General/PokemonSV_ClothingBuyer.h" #include "Programs/General/PokemonSV_MassRelease.h" #include "Programs/General/PokemonSV_AutonomousBallThrower.h" @@ -20,12 +21,9 @@ #include "Programs/General/PokemonSV_AuctionFarmer.h" #include "Programs/General/PokemonSV_ESPTraining.h" #include "Programs/Trading/PokemonSV_SelfBoxTrade.h" -#include "Programs/General/PokemonSV_StatsReset.h" -#include "Programs/General/PokemonSV_StatsResetBloodmoon.h" #include "Programs/General/PokemonSV_TournamentFarmer.h" #include "Programs/Sandwiches/PokemonSV_SandwichMaker.h" #include "Programs/General/PokemonSV_SizeChecker.h" -#include "Programs/General/PokemonSV_ClothingBuyer.h" #include "Programs/Eggs/PokemonSV_EggFetcher.h" #include "Programs/Eggs/PokemonSV_EggHatcher.h" @@ -40,6 +38,9 @@ #include "Programs/FastCodeEntry/PokemonSV_ClipboardFastCodeEntry.h" #include "Programs/FastCodeEntry/PokemonSV_VideoFastCodeEntry.h" +#include "Programs/General/PokemonSV_StatsReset.h" +#include "Programs/General/PokemonSV_StatsResetBloodmoon.h" + #include "Programs/ShinyHunting/PokemonSV_ShinyHunt-AreaZeroPlatform.h" #include "Programs/ShinyHunting/PokemonSV_ShinyHunt-Scatterbug.h" @@ -70,11 +71,10 @@ std::vector PanelListFactory::make_panels() const{ ret.emplace_back("---- General ----"); ret.emplace_back(make_single_switch_program()); + ret.emplace_back(make_single_switch_program()); ret.emplace_back(make_single_switch_program()); ret.emplace_back(make_single_switch_program()); - ret.emplace_back(make_single_switch_program()); ret.emplace_back(make_single_switch_program()); - ret.emplace_back(make_single_switch_program()); // ret.emplace_back("---- Trading ----"); ret.emplace_back(make_multi_switch_program()); @@ -106,6 +106,10 @@ std::vector PanelListFactory::make_panels() const{ ret.emplace_back(make_multi_switch_program()); ret.emplace_back(make_multi_switch_program()); + ret.emplace_back("---- Stats Hunting ----"); + ret.emplace_back(make_single_switch_program()); + ret.emplace_back(make_single_switch_program()); + ret.emplace_back("---- Shiny Hunting ----"); ret.emplace_back(make_single_switch_program()); @@ -113,9 +117,8 @@ std::vector PanelListFactory::make_panels() const{ ret.emplace_back(make_single_switch_program()); ret.emplace_back(make_single_switch_program()); - ret.emplace_back("---- Untested/Beta/WIP ----"); - ret.emplace_back(make_single_switch_program()); if (PreloadSettings::instance().DEVELOPER_MODE){ + ret.emplace_back("---- Untested/Beta/WIP ----"); ret.emplace_back(make_single_switch_program()); } if (PreloadSettings::instance().DEVELOPER_MODE){