diff --git a/src/battle_main.c b/src/battle_main.c index c34dc0ac57..a5fbae005b 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -16,6 +16,7 @@ #include "bg.h" #include "data.h" #include "decompress.h" +#include "dexnav.h" #include "dma3.h" #include "event_data.h" #include "evolution_scene.h" diff --git a/src/dexnav.c b/src/dexnav.c index 285627ef0d..da456848bd 100644 --- a/src/dexnav.c +++ b/src/dexnav.c @@ -219,8 +219,8 @@ static const struct WindowTemplate sDexNavGuiWindowTemplates[] = }; //gui font -static const u8 sFontColor_Black[3] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GREY, TEXT_COLOR_LIGHT_GREY}; -static const u8 sFontColor_White[3] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY}; +static const u8 sFontColor_Black[3] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY}; +static const u8 sFontColor_White[3] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY}; //search window font static const u8 sSearchFontColor[3] = {0, 15, 13}; diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 9b1f4ceb6c..c1bf9eed11 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -140,6 +140,8 @@ static void AlignFishingAnimationFrames(void); static u8 TrySpinPlayerForWarp(struct ObjectEvent *object, s16 *a1); +static void PlayerGoSlow(u8 direction); + // .rodata static bool8 (*const sForcedMovementTestFuncs[])(u8) = @@ -628,11 +630,20 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) return; } } - + + gPlayerAvatar.creeping = FALSE; if (gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_SURFING) { - // speed 2 is fast, same speed as running - PlayerGoSpeed2(direction); + if (FlagGet(FLAG_SYS_DEXNAV_SEARCH) && (heldKeys & A_BUTTON)) + { + gPlayerAvatar.creeping = TRUE; + PlayerGoSpeed1(direction); + } + else + { + // speed 2 is fast, same speed as running + PlayerGoSpeed2(direction); + } return; } @@ -643,6 +654,11 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_DASH; return; } + else if (FlagGet(FLAG_SYS_DEXNAV_SEARCH) && (heldKeys & A_BUTTON)) + { + gPlayerAvatar.creeping = TRUE; + PlayerGoSlow(direction); + } else { PlayerGoSpeed1(direction); @@ -953,6 +969,12 @@ void PlayerSetAnimId(u8 movementActionId, u8 copyableMovement) } } +// slow +static void PlayerGoSlow(u8 direction) +{ + PlayerSetAnimId(GetWalkSlowMovementAction(direction), 2); +} + // normal speed (1 speed) void PlayerGoSpeed1(u8 a) { diff --git a/src/pokemon.c b/src/pokemon.c index 52bddf5ade..1ba7bf9326 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -10,6 +10,7 @@ #include "battle_setup.h" #include "battle_tower.h" #include "data.h" +#include "dexnav.h" #include "event_data.h" #include "evolution_scene.h" #include "field_specials.h"