|
10 | 10 | #include "CommonFramework/ProgramStats/StatsTracking.h" |
11 | 11 | #include "CommonFramework/VideoPipeline/VideoFeed.h" |
12 | 12 | #include "CommonTools/Async/InferenceRoutines.h" |
13 | | -#include "Pokemon/Pokemon_Strings.h" |
14 | 13 | #include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h" |
| 14 | +#include "Pokemon/Pokemon_Strings.h" |
15 | 15 | #include "PokemonFRLG/Inference/Dialogs/PokemonFRLG_DialogDetector.h" |
16 | 16 | #include "PokemonFRLG/Inference/Menus/PokemonFRLG_StartMenuDetector.h" |
17 | 17 | #include "PokemonFRLG/Inference/Menus/PokemonFRLG_SummaryDetector.h" |
18 | 18 | #include "PokemonFRLG/Inference/PokemonFRLG_ShinySymbolDetector.h" |
19 | 19 | #include "PokemonFRLG/PokemonFRLG_Navigation.h" |
| 20 | +#include "PokemonFRLG/Programs/PokemonFRLG_StartMenuNavigation.h" |
20 | 21 | #include "PokemonFRLG_GiftReset.h" |
21 | 22 |
|
22 | 23 | namespace PokemonAutomation{ |
@@ -263,14 +264,33 @@ bool GiftReset::try_open_summary(SingleSwitchProgramEnvironment& env, ProControl |
263 | 264 | return false; |
264 | 265 | } |
265 | 266 |
|
266 | | - if (TARGET != Target::starters){ |
| 267 | + if (TARGET == Target::starters){ |
| 268 | + // We navigate to pokedex since we don't have it yet so it becomes Pokemon. |
| 269 | + if (!move_cursor_to_position(env.console, context, SelectionArrowPositionStartMenu::POKEDEX)){ |
| 270 | + std::string str = "open_summary(): Unable to move menu cursor to: " + Pokemon::STRING_POKEMON; |
| 271 | + env.log(str, COLOR_RED); |
| 272 | + send_program_recoverable_error_notification( |
| 273 | + env, NOTIFICATION_ERROR_RECOVERABLE, |
| 274 | + str |
| 275 | + ); |
| 276 | + return false; |
| 277 | + } |
| 278 | + }else{ |
267 | 279 | //Pokedex, Pokemon, Bag, Trainer, Save, Option, Exit |
268 | 280 | env.log("Navigating to party menu."); |
269 | 281 | pbf_wait(context, 200ms); |
270 | 282 | context.wait_for_all_requests(); |
271 | | - pbf_press_dpad(context, DPAD_DOWN, 320ms, 320ms); |
272 | | - context.wait_for_all_requests(); |
273 | | - } //For starters, no Pokedex yet, do Pokemon is on top and we skip this |
| 283 | + |
| 284 | + if (!move_cursor_to_position(env.console, context, SelectionArrowPositionStartMenu::POKEMON)){ |
| 285 | + std::string str = "open_summary(): Unable to move menu cursor to: " + Pokemon::STRING_POKEMON; |
| 286 | + env.log(str, COLOR_RED); |
| 287 | + send_program_recoverable_error_notification( |
| 288 | + env, NOTIFICATION_ERROR_RECOVERABLE, |
| 289 | + str |
| 290 | + ); |
| 291 | + return false; |
| 292 | + } |
| 293 | + } |
274 | 294 |
|
275 | 295 | //Open party menu |
276 | 296 | BlackScreenOverWatcher blk1(COLOR_RED); |
|
0 commit comments