From 0f692e4df873890e3faeeaffca94e8c1a1c50357 Mon Sep 17 00:00:00 2001 From: kichithewolf Date: Sat, 5 Apr 2025 18:22:27 -0400 Subject: [PATCH 1/2] handle extra dialog in gift reset --- .../Programs/ShinyHunting/PokemonLGPE_GiftReset.cpp | 13 ++++++++++++- .../Programs/ShinyHunting/PokemonLGPE_GiftReset.h | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/SerialPrograms/Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_GiftReset.cpp b/SerialPrograms/Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_GiftReset.cpp index 75e16ef3b1..68b72dcd04 100644 --- a/SerialPrograms/Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_GiftReset.cpp +++ b/SerialPrograms/Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_GiftReset.cpp @@ -52,7 +52,11 @@ std::unique_ptr GiftReset_Descriptor::make_stats() const{ } GiftReset::GiftReset() - : GO_HOME_WHEN_DONE(false) + : EXTRA_DIALOG( + "Persian/Arcanine:
Check this if the gift Pokemon is Persian or Arcanine.", + LockMode::UNLOCK_WHILE_RUNNING, false + ) + , GO_HOME_WHEN_DONE(false) , NOTIFICATION_SHINY( "Shiny Found", true, true, ImageAttachmentMode::JPG, @@ -65,6 +69,7 @@ GiftReset::GiftReset() &NOTIFICATION_PROGRAM_FINISH, }) { + PA_ADD_OPTION(EXTRA_DIALOG); PA_ADD_OPTION(GO_HOME_WHEN_DONE); PA_ADD_OPTION(NOTIFICATIONS); } @@ -114,6 +119,12 @@ void GiftReset::program(SingleSwitchProgramEnvironment& env, CancellableScope& s "Received gift Pokemon." ); + if (EXTRA_DIALOG){ + env.log("Persian/Arcanine selected. Mashing B to exit dialog."); + pbf_mash_button(context, BUTTON_B, 3000ms); + context.wait_for_all_requests(); + } + //Wait a bit. pbf_wait(context, 2500ms); context.wait_for_all_requests(); diff --git a/SerialPrograms/Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_GiftReset.h b/SerialPrograms/Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_GiftReset.h index 4d1d8ced2f..c78b69b2f7 100644 --- a/SerialPrograms/Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_GiftReset.h +++ b/SerialPrograms/Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_GiftReset.h @@ -30,6 +30,7 @@ class GiftReset : public SingleSwitchProgramInstance{ virtual void program(SingleSwitchProgramEnvironment& env, CancellableScope& scope) override; private: + BooleanCheckBoxOption EXTRA_DIALOG; GoHomeWhenDoneOption GO_HOME_WHEN_DONE; EventNotificationOption NOTIFICATION_SHINY; From 872aa4b5a1e3934afb442b1ba7026268ca818eea Mon Sep 17 00:00:00 2001 From: kichithewolf Date: Mon, 7 Apr 2025 11:21:55 -0400 Subject: [PATCH 2/2] update wait time --- .../PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_GiftReset.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SerialPrograms/Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_GiftReset.cpp b/SerialPrograms/Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_GiftReset.cpp index 68b72dcd04..cd2a6c813f 100644 --- a/SerialPrograms/Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_GiftReset.cpp +++ b/SerialPrograms/Source/PokemonLGPE/Programs/ShinyHunting/PokemonLGPE_GiftReset.cpp @@ -121,7 +121,7 @@ void GiftReset::program(SingleSwitchProgramEnvironment& env, CancellableScope& s if (EXTRA_DIALOG){ env.log("Persian/Arcanine selected. Mashing B to exit dialog."); - pbf_mash_button(context, BUTTON_B, 3000ms); + pbf_mash_button(context, BUTTON_B, 4100ms); context.wait_for_all_requests(); }