From 587ffeeb97a53b8ae1123d46690e45af503c37b9 Mon Sep 17 00:00:00 2001 From: pkmnsnfrn Date: Fri, 26 Jul 2024 21:31:04 -0700 Subject: [PATCH] Fixed tabs --- src/field_control_avatar.c | 86 ++++++++-------- src/field_message_box.c | 2 +- src/menu.c | 200 ++++++++++++++++++------------------- src/metatile_behavior.c | 6 +- 4 files changed, 147 insertions(+), 147 deletions(-) diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index 85e9f2cfb4..92e9df1c54 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -183,18 +183,18 @@ int ProcessPlayerFieldInput(struct FieldInput *input) return TRUE; } - if (input->checkStandardWildEncounter) - { - if (input->dpadDirection == 0 || input->dpadDirection == playerDirection) - { - GetInFrontOfPlayerPosition(&position); - metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); - if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE) - return TRUE; - GetPlayerPosition(&position); - metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); - } - } + if (input->checkStandardWildEncounter) + { + if (input->dpadDirection == 0 || input->dpadDirection == playerDirection) + { + GetInFrontOfPlayerPosition(&position); + metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + if (TrySetUpWalkIntoSignpostScript(&position, metatileBehavior, playerDirection) == TRUE) + return TRUE; + GetPlayerPosition(&position); + metatileBehavior = MapGridGetMetatileBehaviorAt(position.x, position.y); + } + } if (input->checkStandardWildEncounter && CheckStandardWildEncounter(metatileBehavior) == TRUE) return TRUE; @@ -376,8 +376,8 @@ static const u8 *GetInteractedBackgroundEventScript(struct MapPosition *position if (bgEvent->bgUnion.script == NULL) return EventScript_TestSignpostMsg; - if (GetFacingSignpostType(metatileBehavior, direction) != NOT_SIGNPOST) - SetMsgSignPostAndVarFacing(direction); + if (GetFacingSignpostType(metatileBehavior, direction) != NOT_SIGNPOST) + SetMsgSignPostAndVarFacing(direction); switch (bgEvent->kind) { @@ -1146,7 +1146,7 @@ static void SetMsgSignPostAndVarFacing(u32 playerDirection) static void SetUpWalkIntoSignScript(const u8 *script, u32 playerDirection) { ScriptContext_SetupScript(script); - SetMsgSignPostAndVarFacing(playerDirection); + SetMsgSignPostAndVarFacing(playerDirection); } static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition *position) @@ -1161,48 +1161,48 @@ static const u8 *GetSignpostScriptAtMapPosition(struct MapPosition *position) static void Task_OpenStartMenu(u8 taskId) { - if (ArePlayerFieldControlsLocked()) - return; + if (ArePlayerFieldControlsLocked()) + return; - PlaySE(SE_WIN_OPEN); - ShowStartMenu(); - DestroyTask(taskId); + PlaySE(SE_WIN_OPEN); + ShowStartMenu(); + DestroyTask(taskId); } bool32 IsDpadPushedToTurnOrMovePlayer(struct FieldInput *input) { - return (input->dpadDirection != 0 && GetPlayerFacingDirection() != input->dpadDirection); + return (input->dpadDirection != 0 && GetPlayerFacingDirection() != input->dpadDirection); } void CancelSignPostMessageBox(struct FieldInput *input) { - if (!ScriptContext_IsEnabled()) - return; + if (!ScriptContext_IsEnabled()) + return; - if (gWalkAwayFromSignpostTimer) - { - gWalkAwayFromSignpostTimer--; - return; - } + if (gWalkAwayFromSignpostTimer) + { + gWalkAwayFromSignpostTimer--; + return; + } - if (!CanWalkAwayToCancelMsgBox()) - return; + if (!CanWalkAwayToCancelMsgBox()) + return; - if (IsDpadPushedToTurnOrMovePlayer(input)) - { - ScriptContext_SetupScript(EventScript_CancelMessageBox); - LockPlayerFieldControls(); - return; - } + if (IsDpadPushedToTurnOrMovePlayer(input)) + { + ScriptContext_SetupScript(EventScript_CancelMessageBox); + LockPlayerFieldControls(); + return; + } - if (!input->pressedStartButton) - return; + if (!input->pressedStartButton) + return; - ScriptContext_SetupScript(EventScript_CancelMessageBox); - LockPlayerFieldControls(); + ScriptContext_SetupScript(EventScript_CancelMessageBox); + LockPlayerFieldControls(); - if (FuncIsActiveTask(Task_OpenStartMenu)) - return; + if (FuncIsActiveTask(Task_OpenStartMenu)) + return; - CreateTask(Task_OpenStartMenu, 8); + CreateTask(Task_OpenStartMenu, 8); } diff --git a/src/field_message_box.c b/src/field_message_box.c index 4f50699a6a..9d07ce24dc 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -41,7 +41,7 @@ static void Task_DrawFieldMessage(u8 taskId) task->tState++; break; case 1: - DrawDialogueFrame(0, TRUE); + DrawDialogueFrame(0, TRUE); task->tState++; break; case 2: diff --git a/src/menu.c b/src/menu.c index c58f72f3e5..441c80250e 100644 --- a/src/menu.c +++ b/src/menu.c @@ -219,116 +219,116 @@ void LoadMessageBoxAndBorderGfx(void) void LoadSignPostWindowFrameGfx(void) { - Menu_LoadStdPal(); + Menu_LoadStdPal(); LoadSignBoxGfx(0, DLG_WINDOW_BASE_TILE_NUM, BG_PLTT_ID(DLG_WINDOW_PALETTE_NUM)); LoadUserWindowBorderGfx(0, STD_WINDOW_BASE_TILE_NUM, BG_PLTT_ID(STD_WINDOW_PALETTE_NUM)); } static void WindowFunc_DrawSignFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { - FillBgTilemapBufferRect(bg, - DLG_WINDOW_BASE_TILE_NUM + 0, - tilemapLeft - 2, - tilemapTop - 1, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - DLG_WINDOW_BASE_TILE_NUM + 1, - tilemapLeft - 1, - tilemapTop - 1, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - DLG_WINDOW_BASE_TILE_NUM + 2, - tilemapLeft - 2, - tilemapTop, - 1, - 4, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - DLG_WINDOW_BASE_TILE_NUM + 3, - tilemapLeft - 1, - tilemapTop, - 1, - 4, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0), - tilemapLeft - 2, - tilemapTop + 4, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1), - tilemapLeft - 1, - tilemapTop + 4, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - DLG_WINDOW_BASE_TILE_NUM + 4, - tilemapLeft, - tilemapTop - 1, - 26, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0), - tilemapLeft + 27, - tilemapTop - 1, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1), - tilemapLeft + 26, - tilemapTop - 1, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 2), - tilemapLeft + 27, - tilemapTop, - 1, - 4, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 3), - tilemapLeft + 26, - tilemapTop, - 1, - 4, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_V_FLIP(BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0)), - tilemapLeft + 27, - tilemapTop + 4, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_V_FLIP(BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1)), - tilemapLeft + 26, - tilemapTop + 4, - 1, - 1, - DLG_WINDOW_PALETTE_NUM); - FillBgTilemapBufferRect(bg, - BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 4), - tilemapLeft, - tilemapTop + 4, - 26, - 1, - DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 0, + tilemapLeft - 2, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 1, + tilemapLeft - 1, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 2, + tilemapLeft - 2, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 3, + tilemapLeft - 1, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0), + tilemapLeft - 2, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1), + tilemapLeft - 1, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + DLG_WINDOW_BASE_TILE_NUM + 4, + tilemapLeft, + tilemapTop - 1, + 26, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0), + tilemapLeft + 27, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1), + tilemapLeft + 26, + tilemapTop - 1, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 2), + tilemapLeft + 27, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 3), + tilemapLeft + 26, + tilemapTop, + 1, + 4, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 0)), + tilemapLeft + 27, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(BG_TILE_H_FLIP(DLG_WINDOW_BASE_TILE_NUM + 1)), + tilemapLeft + 26, + tilemapTop + 4, + 1, + 1, + DLG_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, + BG_TILE_V_FLIP(DLG_WINDOW_BASE_TILE_NUM + 4), + tilemapLeft, + tilemapTop + 4, + 26, + 1, + DLG_WINDOW_PALETTE_NUM); } static inline void *GetWindowFunc_DialogueFrame(void) { - return (IsMsgSignPost() ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); + return (IsMsgSignPost() ? WindowFunc_DrawSignFrame : WindowFunc_DrawDialogueFrame); } void DrawDialogueFrame(u8 windowId, bool8 copyToVram) diff --git a/src/metatile_behavior.c b/src/metatile_behavior.c index 1212457d24..fc7e3a9326 100644 --- a/src/metatile_behavior.c +++ b/src/metatile_behavior.c @@ -1411,7 +1411,7 @@ bool32 MetatileBehavior_IsSignpost(u32 mb) #if OW_AUTO_SIGNPOST == TRUE return (mb == MB_SIGNPOST); #else - return FALSE; + return FALSE; #endif } @@ -1420,7 +1420,7 @@ bool32 MetatileBehavior_IsPokemonCenterSign(u32 mb) #if OW_AUTO_SIGNPOST == TRUE return (mb == MB_POKEMON_CENTER_SIGN); #else - return FALSE; + return FALSE; #endif } @@ -1429,7 +1429,7 @@ bool32 MetatileBehavior_IsPokeMartSign(u32 mb) #if OW_AUTO_SIGNPOST == TRUE return (mb == MB_POKEMART_SIGN); #else - return FALSE; + return FALSE; #endif }