add r to search

This commit is contained in:
ghoulslash 2021-06-16 09:47:53 -06:00
parent c01ad82008
commit 7405c11934
2 changed files with 8 additions and 2 deletions

View File

@ -11,7 +11,7 @@ struct FieldInput
bool8 heldDirection2:1;
bool8 tookStep:1;
bool8 pressedBButton:1;
bool8 input_field_1_0:1;
bool8 pressedRButton:1;
bool8 input_field_1_1:1;
bool8 input_field_1_2:1;
bool8 input_field_1_3:1;

View File

@ -3,6 +3,7 @@
#include "bike.h"
#include "coord_event_weather.h"
#include "daycare.h"
#include "dexnav.h"
#include "faraway_island.h"
#include "event_data.h"
#include "event_object_movement.h"
@ -80,7 +81,7 @@ void FieldClearPlayerInput(struct FieldInput *input)
input->heldDirection2 = FALSE;
input->tookStep = FALSE;
input->pressedBButton = FALSE;
input->input_field_1_0 = FALSE;
input->pressedRButton = FALSE;
input->input_field_1_1 = FALSE;
input->input_field_1_2 = FALSE;
input->input_field_1_3 = FALSE;
@ -105,6 +106,8 @@ void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys)
input->pressedAButton = TRUE;
if (newKeys & B_BUTTON)
input->pressedBButton = TRUE;
if (newKeys & R_BUTTON && !FlagGet(FLAG_SYS_DEXNAV_SEARCH))
input->pressedRButton = TRUE;
}
if (heldKeys & (DPAD_UP | DPAD_DOWN | DPAD_LEFT | DPAD_RIGHT))
@ -188,6 +191,9 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
}
if (input->pressedSelectButton && UseRegisteredKeyItemOnField() == TRUE)
return TRUE;
if (input->pressedRButton && TryStartDexnavSearch())
return TRUE;
return FALSE;
}