Fixed tabs
This commit is contained in:
parent
59c2eeac21
commit
587ffeeb97
@ -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);
|
||||
}
|
||||
|
||||
@ -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:
|
||||
|
||||
200
src/menu.c
200
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)
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user