Add OW_UNION_DISABLE_CHECK and OW_FLAG_MOVE_UNION_ROOM_CHECK (#5448)
* First addition of both checks * Updated config file * fixed spacing * Updated spacing * Fixed issues where feature was always on * Update overworld.h fixed spacing per https://github.com/rh-hideout/pokeemerald-expansion/pull/5448#discussion_r1789647611
This commit is contained in:
parent
a7fca616b0
commit
0dcb28ba0e
6 changed files with 33 additions and 1 deletions
|
@ -1258,7 +1258,11 @@ EventScript_CloseMossdeepGameCornerBarrier::
|
||||||
|
|
||||||
CableClub_OnResume:
|
CableClub_OnResume:
|
||||||
special InitUnionRoom
|
special InitUnionRoom
|
||||||
|
.if OW_FLAG_MOVE_UNION_ROOM_CHECK != 0
|
||||||
|
return
|
||||||
|
.else
|
||||||
end
|
end
|
||||||
|
.endif
|
||||||
|
|
||||||
MossdeepCity_GameCorner_1F_EventScript_InfoMan2::
|
MossdeepCity_GameCorner_1F_EventScript_InfoMan2::
|
||||||
lock
|
lock
|
||||||
|
|
|
@ -36,6 +36,11 @@ EventScript_PkmnCenterNurse_TakeAndHealPkmn::
|
||||||
applymovement VAR_0x800B, Movement_PkmnCenterNurse_Turn @ Changed from Common_Movement_WalkInPlaceFasterLeft to force the follower to enter their Poké Ball
|
applymovement VAR_0x800B, Movement_PkmnCenterNurse_Turn @ Changed from Common_Movement_WalkInPlaceFasterLeft to force the follower to enter their Poké Ball
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
dofieldeffect FLDEFF_POKECENTER_HEAL
|
dofieldeffect FLDEFF_POKECENTER_HEAL
|
||||||
|
.if OW_UNION_DISABLE_CHECK == FALSE && OW_FLAG_MOVE_UNION_ROOM_CHECK != 0
|
||||||
|
setflag OW_FLAG_MOVE_UNION_ROOM_CHECK
|
||||||
|
call CableClub_OnResume
|
||||||
|
clearflag OW_FLAG_MOVE_UNION_ROOM_CHECK
|
||||||
|
.endif
|
||||||
waitfieldeffect FLDEFF_POKECENTER_HEAL
|
waitfieldeffect FLDEFF_POKECENTER_HEAL
|
||||||
applymovement VAR_0x800B, Common_Movement_WalkInPlaceFasterDown
|
applymovement VAR_0x800B, Common_Movement_WalkInPlaceFasterDown
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
|
|
|
@ -106,6 +106,8 @@
|
||||||
#define OW_POPUP_BW_ALPHA_BLEND FALSE // Enables alpha blending/transparency for the pop-ups. Mainly intended to be used with the black color option.
|
#define OW_POPUP_BW_ALPHA_BLEND FALSE // Enables alpha blending/transparency for the pop-ups. Mainly intended to be used with the black color option.
|
||||||
|
|
||||||
// Pokémon Center
|
// Pokémon Center
|
||||||
#define OW_IGNORE_EGGS_ON_HEAL GEN_LATEST // In Gen 4+, the nurse in the Pokémon Center does not heal Eggs on healing machine.
|
#define OW_IGNORE_EGGS_ON_HEAL GEN_LATEST // In Gen 4+, the nurse in the Pokémon Center does not heal Eggs on healing machine.
|
||||||
|
#define OW_UNION_DISABLE_CHECK FALSE // When TRUE, the nurse does not inform the player if there is a trainer waiting in the Union Room. This speeds up the loading of the Pokémon Center.
|
||||||
|
#define OW_FLAG_MOVE_UNION_ROOM_CHECK 0 // If this flag is set, the game will only check if players are in the Union Room while healing Pokémon, and not when players enter the Pokémon Center. This speeds up the loading of the Pokémon Center. This is ignored if OW_UNION_DISABLE_CHECK is TRUE.
|
||||||
|
|
||||||
#endif // GUARD_CONFIG_OVERWORLD_H
|
#endif // GUARD_CONFIG_OVERWORLD_H
|
||||||
|
|
|
@ -344,5 +344,6 @@ bool8 DoesLinkPlayerCountMatchSaved(void);
|
||||||
void SetCloseLinkCallbackAndType(u16 type);
|
void SetCloseLinkCallbackAndType(u16 type);
|
||||||
bool32 IsSendingKeysToLink(void);
|
bool32 IsSendingKeysToLink(void);
|
||||||
u32 GetLinkRecvQueueLength(void);
|
u32 GetLinkRecvQueueLength(void);
|
||||||
|
bool32 ShouldCheckForUnionRoom(void);
|
||||||
|
|
||||||
#endif // GUARD_LINK_H
|
#endif // GUARD_LINK_H
|
||||||
|
|
14
src/link.c
14
src/link.c
|
@ -2367,3 +2367,17 @@ void ResetRecvBuffer(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool32 ShouldCheckForUnionRoom(void)
|
||||||
|
{
|
||||||
|
if (OW_UNION_DISABLE_CHECK)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (OW_FLAG_MOVE_UNION_ROOM_CHECK == 0)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
if (FlagGet(OW_FLAG_MOVE_UNION_ROOM_CHECK))
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
|
@ -3294,6 +3294,9 @@ void InitUnionRoom(void)
|
||||||
{
|
{
|
||||||
struct WirelessLink_URoom *data;
|
struct WirelessLink_URoom *data;
|
||||||
|
|
||||||
|
if (!ShouldCheckForUnionRoom())
|
||||||
|
return;
|
||||||
|
|
||||||
sUnionRoomPlayerName[0] = EOS;
|
sUnionRoomPlayerName[0] = EOS;
|
||||||
CreateTask(Task_InitUnionRoom, 0);
|
CreateTask(Task_InitUnionRoom, 0);
|
||||||
sWirelessLinkMain.uRoom = sWirelessLinkMain.uRoom; // Needed to match.
|
sWirelessLinkMain.uRoom = sWirelessLinkMain.uRoom; // Needed to match.
|
||||||
|
@ -3377,6 +3380,9 @@ static void Task_InitUnionRoom(u8 taskId)
|
||||||
|
|
||||||
bool16 BufferUnionRoomPlayerName(void)
|
bool16 BufferUnionRoomPlayerName(void)
|
||||||
{
|
{
|
||||||
|
if (!ShouldCheckForUnionRoom())
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
if (sUnionRoomPlayerName[0] != EOS)
|
if (sUnionRoomPlayerName[0] != EOS)
|
||||||
{
|
{
|
||||||
StringCopy(gStringVar1, sUnionRoomPlayerName);
|
StringCopy(gStringVar1, sUnionRoomPlayerName);
|
||||||
|
|
Loading…
Reference in a new issue