Skip to content

Commit bd5e736

Browse files
committed
Navigating to party to use menu navigator.
1 parent a7fbde0 commit bd5e736

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

SerialPrograms/Source/PokemonFRLG/PokemonFRLG_Navigation.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
#include "NintendoSwitch/Commands/NintendoSwitch_Commands_PushButtons.h"
1515
#include "NintendoSwitch/Controllers/Procon/NintendoSwitch_ProController.h"
1616
#include "NintendoSwitch/NintendoSwitch_ConsoleHandle.h"
17+
#include "Pokemon/Pokemon_Strings.h"
18+
#include "PokemonFRLG/PokemonFRLG_Settings.h"
1719
#include "PokemonFRLG/Inference/Dialogs/PokemonFRLG_DialogDetector.h"
1820
#include "PokemonFRLG/Inference/Dialogs/PokemonFRLG_BattleDialogs.h"
1921
#include "PokemonFRLG/Inference/Sounds/PokemonFRLG_ShinySoundDetector.h"
2022
#include "PokemonFRLG/Inference/Menus/PokemonFRLG_StartMenuDetector.h"
2123
#include "PokemonFRLG/Inference/Menus/PokemonFRLG_LoadMenuDetector.h"
2224
#include "PokemonFRLG/Inference/Menus/PokemonFRLG_SummaryDetector.h"
23-
#include "PokemonFRLG/PokemonFRLG_Settings.h"
25+
#include "PokemonFRLG/Programs/PokemonFRLG_StartMenuNavigation.h"
2426
#include "PokemonFRLG_Navigation.h"
2527

2628
namespace PokemonAutomation{
@@ -136,19 +138,18 @@ bool try_open_slot_six(ConsoleHandle& console, ProControllerContext& context){
136138
return false;
137139
}
138140

141+
if (!move_cursor_to_position(console, context, SelectionArrowPositionStartMenu::POKEMON)){
142+
console.log("open_slot_six(): Unable to move menu cursor to: " + Pokemon::STRING_POKEMON, COLOR_RED);
143+
return false;
144+
}
145+
139146
console.log("Navigating to party menu.");
140147
BlackScreenOverWatcher blk1(COLOR_RED);
141148

142149
int pm = run_until<ProControllerContext>(
143150
console, context,
144151
[](ProControllerContext& context){
145-
pbf_wait(context, 200ms);
146-
context.wait_for_all_requests();
147-
pbf_press_dpad(context, DPAD_DOWN, 320ms, 320ms);
148-
context.wait_for_all_requests();
149-
150-
pbf_press_button(context, BUTTON_A, 320ms, 640ms);
151-
pbf_wait(context, 5000ms);
152+
pbf_press_button(context, BUTTON_A, 320ms, 5640ms);
152153
context.wait_for_all_requests();
153154
},
154155
{ blk1 }

0 commit comments

Comments
 (0)