From 846e8a29daadc96035944250dde9b391e8fe2846 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Sun, 11 Aug 2024 17:49:07 -0700 Subject: [PATCH] Removed IsMsgSignPost per https://github.com/rh-hideout/pokeemerald-expansion/pull/5044\#discussion_r1712963672 --- include/script.h | 4 +++- src/field_message_box.c | 2 +- src/menu.c | 2 +- src/script.c | 9 ++------- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/include/script.h b/include/script.h index 48d1f6c0ec..fc50c9d424 100644 --- a/include/script.h +++ b/include/script.h @@ -63,10 +63,12 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize); // srccmd.h void SetMovingNpcId(u16 npcId); +extern u8 sMsgIsSignPost; +extern u8 sMsgBoxIsCancelable; + void SetWalkingIntoSignVars(void); void MsgSetSignPost(void); void ResetFacingNpcOrSignPostVars(void); -bool32 IsMsgSignPost(void); bool32 CanWalkAwayToCancelMsgBox(void); void ClearMsgBoxCancelableState(void); diff --git a/src/field_message_box.c b/src/field_message_box.c index 9d07ce24dc..c0fc1004e9 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -32,7 +32,7 @@ static void Task_DrawFieldMessage(u8 taskId) switch (task->tState) { case 0: - if (IsMsgSignPost()) + if (sMsgIsSignPost) LoadSignPostWindowFrameGfx(); else LoadMessageBoxAndBorderGfx(); diff --git a/src/menu.c b/src/menu.c index 441c80250e..20b8c4dd97 100644 --- a/src/menu.c +++ b/src/menu.c @@ -328,7 +328,7 @@ static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 wi static inline void *GetWindowFunc_DialogueFrame(void) { - return (IsMsgSignPost() ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); + return (sMsgIsSignPost ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); } void DrawDialogueFrame(u8 windowId, bool8 copyToVram) diff --git a/src/script.c b/src/script.c index 98d679cd9f..632af41ff4 100644 --- a/src/script.c +++ b/src/script.c @@ -27,8 +27,8 @@ static u8 sGlobalScriptContextStatus; static struct ScriptContext sGlobalScriptContext; static struct ScriptContext sImmediateScriptContext; static bool8 sLockFieldControls; -static u8 sMsgIsSignPost; -static u8 sMsgBoxIsCancelable; +EWRAM_DATA u8 sMsgIsSignPost = FALSE; +EWRAM_DATA u8 sMsgBoxIsCancelable = FALSE; extern ScrCmdFunc gScriptCmdTable[]; extern ScrCmdFunc gScriptCmdTableEnd[]; @@ -513,11 +513,6 @@ void SetWalkingIntoSignVars(void) sMsgBoxIsCancelable = TRUE; } -bool32 IsMsgSignPost(void) -{ - return sMsgIsSignPost; -} - void ResetFacingNpcOrSignPostVars(void) { sMsgIsSignPost = FALSE;