Fixed global variable naming conventions

This commit is contained in:
pkmnsnfrn 2024-08-12 06:55:33 -07:00
parent 4387b6ef70
commit 30cc06785d
6 changed files with 12 additions and 12 deletions

View file

@ -63,7 +63,7 @@ void InitRamScript_NoObjectEvent(u8 *script, u16 scriptSize);
// srccmd.h // srccmd.h
void SetMovingNpcId(u16 npcId); void SetMovingNpcId(u16 npcId);
extern u8 sMsgIsSignPost; extern u8 gMsgIsSignPost;
extern u8 sMsgBoxIsCancelable; extern u8 gMsgBoxIsCancelable;
#endif // GUARD_SCRIPT_H #endif // GUARD_SCRIPT_H

View file

@ -160,7 +160,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input)
gSpecialVar_LastTalked = 0; gSpecialVar_LastTalked = 0;
gSelectedObjectEvent = 0; gSelectedObjectEvent = 0;
sMsgIsSignPost = FALSE; gMsgIsSignPost = FALSE;
playerDirection = GetPlayerFacingDirection(); playerDirection = GetPlayerFacingDirection();
GetPlayerPosition(&position); GetPlayerPosition(&position);
metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y);
@ -1128,8 +1128,8 @@ static u32 GetFacingSignpostType(u16 metatileBehavior, u32 playerDirection)
static void SetMsgSignPostAndVarFacing(u32 playerDirection) static void SetMsgSignPostAndVarFacing(u32 playerDirection)
{ {
gWalkAwayFromSignpostTimer = WALK_AWAY_SIGNPOST_FRAMES; gWalkAwayFromSignpostTimer = WALK_AWAY_SIGNPOST_FRAMES;
sMsgBoxIsCancelable = TRUE; gMsgBoxIsCancelable = TRUE;
sMsgIsSignPost = TRUE; gMsgIsSignPost = TRUE;
gSpecialVar_Facing = playerDirection; gSpecialVar_Facing = playerDirection;
} }
@ -1175,7 +1175,7 @@ void CancelSignPostMessageBox(struct FieldInput *input)
return; return;
} }
if (!sMsgBoxIsCancelable) if (!gMsgBoxIsCancelable)
return; return;
if (IsDpadPushedToTurnOrMovePlayer(input)) if (IsDpadPushedToTurnOrMovePlayer(input))

View file

@ -32,7 +32,7 @@ static void Task_DrawFieldMessage(u8 taskId)
switch (task->tState) switch (task->tState)
{ {
case 0: case 0:
if (sMsgIsSignPost) if (gMsgIsSignPost)
LoadSignPostWindowFrameGfx(); LoadSignPostWindowFrameGfx();
else else
LoadMessageBoxAndBorderGfx(); LoadMessageBoxAndBorderGfx();

View file

@ -328,7 +328,7 @@ static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 wi
static inline void *GetWindowFunc_DialogueFrame(void) static inline void *GetWindowFunc_DialogueFrame(void)
{ {
return (sMsgIsSignPost ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); return (gMsgIsSignPost ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame);
} }
void DrawDialogueFrame(u8 windowId, bool8 copyToVram) void DrawDialogueFrame(u8 windowId, bool8 copyToVram)

View file

@ -1290,7 +1290,7 @@ bool8 ScrCmd_releaseall(struct ScriptContext *ctx)
ObjectEventClearHeldMovementIfFinished(&gObjectEvents[playerObjectId]); ObjectEventClearHeldMovementIfFinished(&gObjectEvents[playerObjectId]);
ScriptMovement_UnfreezeObjectEvents(); ScriptMovement_UnfreezeObjectEvents();
UnfreezeObjectEvents(); UnfreezeObjectEvents();
sMsgBoxIsCancelable = FALSE; gMsgBoxIsCancelable = FALSE;
return FALSE; return FALSE;
} }
@ -1309,7 +1309,7 @@ bool8 ScrCmd_release(struct ScriptContext *ctx)
ObjectEventClearHeldMovementIfFinished(&gObjectEvents[playerObjectId]); ObjectEventClearHeldMovementIfFinished(&gObjectEvents[playerObjectId]);
ScriptMovement_UnfreezeObjectEvents(); ScriptMovement_UnfreezeObjectEvents();
UnfreezeObjectEvents(); UnfreezeObjectEvents();
sMsgBoxIsCancelable = FALSE; gMsgBoxIsCancelable = FALSE;
return FALSE; return FALSE;
} }

View file

@ -27,8 +27,8 @@ static u8 sGlobalScriptContextStatus;
static struct ScriptContext sGlobalScriptContext; static struct ScriptContext sGlobalScriptContext;
static struct ScriptContext sImmediateScriptContext; static struct ScriptContext sImmediateScriptContext;
static bool8 sLockFieldControls; static bool8 sLockFieldControls;
EWRAM_DATA u8 sMsgIsSignPost = FALSE; EWRAM_DATA u8 gMsgIsSignPost = FALSE;
EWRAM_DATA u8 sMsgBoxIsCancelable = FALSE; EWRAM_DATA u8 gMsgBoxIsCancelable = FALSE;
extern ScrCmdFunc gScriptCmdTable[]; extern ScrCmdFunc gScriptCmdTable[];
extern ScrCmdFunc gScriptCmdTableEnd[]; extern ScrCmdFunc gScriptCmdTableEnd[];