mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Cleaned up missing JOY macros
This commit is contained in:
parent
f969effd36
commit
057f76bfe6
@ -331,7 +331,7 @@ static void HandleInputChooseAction(void)
|
||||
SwapHpBarsWithHpText();
|
||||
}
|
||||
#if B_ENABLE_DEBUG == TRUE
|
||||
else if (gMain.newKeys & SELECT_BUTTON)
|
||||
else if (JOY_NEW(SELECT_BUTTON))
|
||||
{
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_DEBUG, 0);
|
||||
PlayerBufferExecCompleted();
|
||||
@ -543,7 +543,7 @@ static void HandleInputShowEntireFieldTargets(void)
|
||||
HideMegaTriggerSprite();
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON || gPlayerDpadHoldFrames > 59)
|
||||
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
HideAllTargets();
|
||||
@ -572,7 +572,7 @@ static void HandleInputShowTargets(void)
|
||||
TryHideLastUsedBall();
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON || gPlayerDpadHoldFrames > 59)
|
||||
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
HideShownTargets();
|
||||
@ -597,12 +597,12 @@ static void HandleInputChooseMove(void)
|
||||
u32 canSelectTarget = 0;
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleResources->bufferA[gActiveBattler][4]);
|
||||
|
||||
if (gMain.heldKeys & DPAD_ANY && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A)
|
||||
if (JOY_HELD(DPAD_ANY) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A)
|
||||
gPlayerDpadHoldFrames++;
|
||||
else
|
||||
gPlayerDpadHoldFrames = 0;
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
if (moveInfo->moves[gMoveSelectionCursor[gActiveBattler]] == MOVE_CURSE)
|
||||
|
@ -813,7 +813,7 @@ static void Task_ShowAiPoints(u8 taskId)
|
||||
break;
|
||||
// Input
|
||||
case 2:
|
||||
if (gMain.newKeys & (SELECT_BUTTON | B_BUTTON))
|
||||
if (JOY_NEW(SELECT_BUTTON | B_BUTTON))
|
||||
{
|
||||
SwitchToDebugView(taskId);
|
||||
HideBg(1);
|
||||
@ -969,7 +969,7 @@ static void Task_ShowAiKnowledge(u8 taskId)
|
||||
break;
|
||||
// Input
|
||||
case 2:
|
||||
if (gMain.newKeys & (SELECT_BUTTON | B_BUTTON))
|
||||
if (JOY_NEW(SELECT_BUTTON | B_BUTTON))
|
||||
{
|
||||
SwitchToDebugView(taskId);
|
||||
HideBg(1);
|
||||
@ -1031,7 +1031,7 @@ static void Task_ShowAiParty(u8 taskId)
|
||||
break;
|
||||
// Input
|
||||
case 2:
|
||||
if (gMain.newKeys & (SELECT_BUTTON | B_BUTTON))
|
||||
if (JOY_NEW(SELECT_BUTTON | B_BUTTON))
|
||||
{
|
||||
SwitchToDebugViewFromAiParty(taskId);
|
||||
HideBg(1);
|
||||
@ -1106,7 +1106,7 @@ static void Task_DebugMenuProcessInput(u8 taskId)
|
||||
struct BattleDebugMenu *data = GetStructPtr(taskId);
|
||||
|
||||
// Exit the menu.
|
||||
if (gMain.newKeys & SELECT_BUTTON)
|
||||
if (JOY_NEW(SELECT_BUTTON))
|
||||
{
|
||||
BeginNormalPaletteFade(-1, 0, 0, 0x10, 0);
|
||||
gTasks[taskId].func = Task_DebugMenuFadeOut;
|
||||
@ -1114,13 +1114,13 @@ static void Task_DebugMenuProcessInput(u8 taskId)
|
||||
}
|
||||
|
||||
// Try changing active battler.
|
||||
if (gMain.newKeys & R_BUTTON)
|
||||
if (JOY_NEW(R_BUTTON))
|
||||
{
|
||||
if (data->battlerId++ == gBattlersCount - 1)
|
||||
data->battlerId = 0;
|
||||
UpdateWindowsOnChangedBattler(data);
|
||||
}
|
||||
else if (gMain.newKeys & L_BUTTON)
|
||||
else if (JOY_NEW(L_BUTTON))
|
||||
{
|
||||
if (data->battlerId-- == 0)
|
||||
data->battlerId = gBattlersCount - 1;
|
||||
@ -1133,17 +1133,17 @@ static void Task_DebugMenuProcessInput(u8 taskId)
|
||||
listItemId = ListMenu_ProcessInput(data->mainListTaskId);
|
||||
if (listItemId != LIST_CANCEL && listItemId != LIST_NOTHING_CHOSEN && listItemId < LIST_ITEM_COUNT)
|
||||
{
|
||||
if (listItemId == LIST_ITEM_AI_MOVES_PTS && gMain.newKeys & A_BUTTON)
|
||||
if (listItemId == LIST_ITEM_AI_MOVES_PTS && JOY_NEW(A_BUTTON))
|
||||
{
|
||||
SwitchToAiPointsView(taskId);
|
||||
return;
|
||||
}
|
||||
else if (listItemId == LIST_ITEM_AI_INFO && gMain.newKeys & A_BUTTON)
|
||||
else if (listItemId == LIST_ITEM_AI_INFO && JOY_NEW(A_BUTTON))
|
||||
{
|
||||
SwitchToAiInfoView(taskId);
|
||||
return;
|
||||
}
|
||||
else if (listItemId == LIST_ITEM_AI_PARTY && gMain.newKeys & A_BUTTON)
|
||||
else if (listItemId == LIST_ITEM_AI_PARTY && JOY_NEW(A_BUTTON))
|
||||
{
|
||||
SwitchToAiPartyView(taskId);
|
||||
return;
|
||||
@ -1182,14 +1182,14 @@ static void Task_DebugMenuProcessInput(u8 taskId)
|
||||
// Handle value modifying.
|
||||
else if (data->activeWindow == ACTIVE_WIN_MODIFY)
|
||||
{
|
||||
if (gMain.newKeys & (B_BUTTON | A_BUTTON))
|
||||
if (JOY_NEW(B_BUTTON | A_BUTTON))
|
||||
{
|
||||
ClearStdWindowAndFrameToTransparent(data->modifyWindowId, TRUE);
|
||||
RemoveWindow(data->modifyWindowId);
|
||||
DestroyModifyArrows(data);
|
||||
data->activeWindow = ACTIVE_WIN_SECONDARY;
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_RIGHT)
|
||||
else if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
if (data->modifyArrows.currentDigit != (data->modifyArrows.maxDigits - 1))
|
||||
{
|
||||
@ -1198,7 +1198,7 @@ static void Task_DebugMenuProcessInput(u8 taskId)
|
||||
gSprites[data->modifyArrows.arrowSpriteId[1]].x2 += 6;
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_LEFT)
|
||||
else if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
if (data->modifyArrows.currentDigit != 0)
|
||||
{
|
||||
@ -1207,7 +1207,7 @@ static void Task_DebugMenuProcessInput(u8 taskId)
|
||||
gSprites[data->modifyArrows.arrowSpriteId[1]].x2 -= 6;
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_UP)
|
||||
else if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
if (TryMoveDigit(&data->modifyArrows, TRUE))
|
||||
{
|
||||
@ -1216,7 +1216,7 @@ static void Task_DebugMenuProcessInput(u8 taskId)
|
||||
PrintSecondaryEntries(data);
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_DOWN)
|
||||
else if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
if (TryMoveDigit(&data->modifyArrows, FALSE))
|
||||
{
|
||||
|
264
src/debug.c
264
src/debug.c
@ -755,13 +755,13 @@ static void DebugTask_HandleMenuInput_Main(u8 taskId)
|
||||
void (*func)(u8);
|
||||
u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]);
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
if ((func = sDebugMenu_Actions_Main[input]) != NULL)
|
||||
func(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Debug_DestroyMenu_Full(taskId);
|
||||
@ -773,13 +773,13 @@ static void DebugTask_HandleMenuInput_Utilities(u8 taskId)
|
||||
void (*func)(u8);
|
||||
u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]);
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
if ((func = sDebugMenu_Actions_Utilities[input]) != NULL)
|
||||
func(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Debug_DestroyMenu(taskId);
|
||||
@ -791,13 +791,13 @@ static void DebugTask_HandleMenuInput_Scripts(u8 taskId)
|
||||
void (*func)(u8);
|
||||
u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]);
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
if ((func = sDebugMenu_Actions_Scripts[input]) != NULL)
|
||||
func(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Debug_DestroyMenu(taskId);
|
||||
@ -809,13 +809,13 @@ static void DebugTask_HandleMenuInput_Flags(u8 taskId)
|
||||
void (*func)(u8);
|
||||
u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]);
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
if ((func = sDebugMenu_Actions_Flags[input]) != NULL)
|
||||
func(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Debug_DestroyMenu(taskId);
|
||||
@ -827,13 +827,13 @@ static void DebugTask_HandleMenuInput_Vars(u8 taskId)
|
||||
void (*func)(u8);
|
||||
u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]);
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
if ((func = sDebugMenu_Actions_Vars[input]) != NULL)
|
||||
func(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Debug_DestroyMenu(taskId);
|
||||
@ -845,13 +845,13 @@ static void DebugTask_HandleMenuInput_Give(u8 taskId)
|
||||
void (*func)(u8);
|
||||
u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]);
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
if ((func = sDebugMenu_Actions_Give[input]) != NULL)
|
||||
func(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Debug_DestroyMenu(taskId);
|
||||
@ -863,13 +863,13 @@ static void DebugTask_HandleMenuInput_Sound(u8 taskId)
|
||||
void (*func)(u8);
|
||||
u32 input = ListMenu_ProcessInput(gTasks[taskId].data[0]);
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
if ((func = sDebugMenu_Actions_Sound[input]) != NULL)
|
||||
func(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Debug_DestroyMenu(taskId);
|
||||
@ -975,27 +975,27 @@ static void DebugAction_Util_Warp_Warp(u8 taskId)
|
||||
}
|
||||
static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] > MAP_GROUPS_COUNT - 1)
|
||||
gTasks[taskId].data[3] = MAP_GROUPS_COUNT - 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < 0)
|
||||
gTasks[taskId].data[3] = 0;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] > 0)
|
||||
gTasks[taskId].data[4] -= 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_RIGHT)
|
||||
if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] < 2)
|
||||
gTasks[taskId].data[4] += 1;
|
||||
@ -1009,7 +1009,7 @@ static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId)
|
||||
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
gTasks[taskId].data[5] = gTasks[taskId].data[3];
|
||||
gTasks[taskId].data[3] = 0;
|
||||
@ -1025,7 +1025,7 @@ static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId)
|
||||
|
||||
gTasks[taskId].func = DebugAction_Util_Warp_SelectMap;
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
DebugAction_DestroyExtraWindow(taskId);
|
||||
@ -1035,27 +1035,27 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId)
|
||||
{
|
||||
u8 max_value = MAP_GROUP_COUNT[gTasks[taskId].data[5]]; //maps in the selected map group
|
||||
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] > max_value - 1)
|
||||
gTasks[taskId].data[3] = max_value - 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < 0)
|
||||
gTasks[taskId].data[3] = 0;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] > 0)
|
||||
gTasks[taskId].data[4] -= 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_RIGHT)
|
||||
if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] < 2)
|
||||
gTasks[taskId].data[4] += 1;
|
||||
@ -1070,7 +1070,7 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId)
|
||||
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
gTasks[taskId].data[6] = gTasks[taskId].data[3];
|
||||
gTasks[taskId].data[3] = 0;
|
||||
@ -1082,7 +1082,7 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId)
|
||||
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
||||
gTasks[taskId].func = DebugAction_Util_Warp_SelectWarp;
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
DebugAction_DestroyExtraWindow(taskId);
|
||||
@ -1090,16 +1090,16 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId)
|
||||
}
|
||||
static void DebugAction_Util_Warp_SelectWarp(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] > 10)
|
||||
gTasks[taskId].data[3] = 10;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < 0)
|
||||
@ -1112,7 +1112,7 @@ static void DebugAction_Util_Warp_SelectWarp(u8 taskId)
|
||||
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
gTasks[taskId].data[7] = gTasks[taskId].data[3];
|
||||
//WARP
|
||||
@ -1122,7 +1122,7 @@ static void DebugAction_Util_Warp_SelectWarp(u8 taskId)
|
||||
ResetInitialPlayerAvatarState();
|
||||
DebugAction_DestroyExtraWindow(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
DebugAction_DestroyExtraWindow(taskId);
|
||||
@ -1222,28 +1222,28 @@ static void DebugAction_Util_Weather(u8 taskId)
|
||||
}
|
||||
static void DebugAction_Util_Weather_SelectId(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] > WEATHER_ROUTE123_CYCLE)
|
||||
gTasks[taskId].data[3] = WEATHER_ROUTE123_CYCLE;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < WEATHER_NONE)
|
||||
gTasks[taskId].data[3] = WEATHER_NONE;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] > 0)
|
||||
gTasks[taskId].data[4] -= 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_RIGHT)
|
||||
if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] < 2)
|
||||
gTasks[taskId].data[4] += 1;
|
||||
@ -1261,7 +1261,7 @@ static void DebugAction_Util_Weather_SelectId(u8 taskId)
|
||||
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
if (gTasks[taskId].data[3] <= 14 || gTasks[taskId].data[3] >= 20)
|
||||
{
|
||||
@ -1269,7 +1269,7 @@ static void DebugAction_Util_Weather_SelectId(u8 taskId)
|
||||
SetWeather(gTasks[taskId].data[5]);
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
DebugAction_DestroyExtraWindow(taskId);
|
||||
@ -1402,16 +1402,16 @@ static void DebugAction_Flags_Flags(u8 taskId)
|
||||
}
|
||||
static void DebugAction_Flags_FlagsSelect(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
FlagToggle(gTasks[taskId].data[3]);
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
DebugAction_DestroyExtraWindow(taskId);
|
||||
return;
|
||||
}
|
||||
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
@ -1419,7 +1419,7 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId)
|
||||
gTasks[taskId].data[3] = FLAGS_COUNT - 1;
|
||||
}
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
@ -1427,7 +1427,7 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId)
|
||||
gTasks[taskId].data[3] = 1;
|
||||
}
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gTasks[taskId].data[4] -= 1;
|
||||
@ -1436,7 +1436,7 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId)
|
||||
gTasks[taskId].data[4] = 0;
|
||||
}
|
||||
}
|
||||
if (gMain.newKeys & DPAD_RIGHT)
|
||||
if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gTasks[taskId].data[4] += 1;
|
||||
@ -1446,7 +1446,7 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
if (gMain.newKeys & DPAD_ANY || gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(DPAD_ANY) || JOY_NEW(A_BUTTON))
|
||||
{
|
||||
ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS);
|
||||
ConvertIntToHexStringN(gStringVar2, gTasks[taskId].data[3], STR_CONV_MODE_LEFT_ALIGN, 3);
|
||||
@ -1660,32 +1660,32 @@ static void DebugAction_Vars_Vars(u8 taskId)
|
||||
|
||||
static void DebugAction_Vars_Select(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] > VARS_END)
|
||||
gTasks[taskId].data[3] = VARS_END;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < VARS_START)
|
||||
gTasks[taskId].data[3] = VARS_START;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
gTasks[taskId].data[4] -= 1;
|
||||
if (gTasks[taskId].data[4] < 0)
|
||||
gTasks[taskId].data[4] = 0;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_RIGHT)
|
||||
if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
gTasks[taskId].data[4] += 1;
|
||||
if (gTasks[taskId].data[4] > DEBUG_NUMBER_DIGITS_VARIABLES - 1)
|
||||
gTasks[taskId].data[4] = DEBUG_NUMBER_DIGITS_VARIABLES - 1;
|
||||
}
|
||||
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
@ -1704,7 +1704,7 @@ static void DebugAction_Vars_Select(u8 taskId)
|
||||
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
gTasks[taskId].data[4] = 0;
|
||||
|
||||
@ -1726,7 +1726,7 @@ static void DebugAction_Vars_Select(u8 taskId)
|
||||
gTasks[taskId].data[6] = gTasks[taskId].data[5]; //New value selector
|
||||
gTasks[taskId].func = DebugAction_Vars_SetValue;
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
DebugAction_DestroyExtraWindow(taskId);
|
||||
@ -1735,7 +1735,7 @@ static void DebugAction_Vars_Select(u8 taskId)
|
||||
}
|
||||
static void DebugAction_Vars_SetValue(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
if (gTasks[taskId].data[6] + sPowersOfTen[gTasks[taskId].data[4]] <= 32000)
|
||||
gTasks[taskId].data[6] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
@ -1745,14 +1745,14 @@ static void DebugAction_Vars_SetValue(u8 taskId)
|
||||
if (gTasks[taskId].data[6] >= 32000)
|
||||
gTasks[taskId].data[6] = 32000 - 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[6] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[6] < 0){
|
||||
gTasks[taskId].data[6] = 0;
|
||||
}
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
gTasks[taskId].data[4] -= 1;
|
||||
if (gTasks[taskId].data[4] < 0)
|
||||
@ -1760,7 +1760,7 @@ static void DebugAction_Vars_SetValue(u8 taskId)
|
||||
gTasks[taskId].data[4] = 0;
|
||||
}
|
||||
}
|
||||
if (gMain.newKeys & DPAD_RIGHT)
|
||||
if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
gTasks[taskId].data[4] += 1;
|
||||
if (gTasks[taskId].data[4] > 4)
|
||||
@ -1769,19 +1769,19 @@ static void DebugAction_Vars_SetValue(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
VarSet(gTasks[taskId].data[3], gTasks[taskId].data[6]);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
DebugAction_DestroyExtraWindow(taskId);
|
||||
return;
|
||||
}
|
||||
|
||||
if (gMain.newKeys & DPAD_ANY || gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(DPAD_ANY) || JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
@ -1834,28 +1834,28 @@ static void DebugAction_Give_Item(u8 taskId)
|
||||
}
|
||||
static void DebugAction_Give_Item_SelectId(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] >= ITEMS_COUNT)
|
||||
gTasks[taskId].data[3] = ITEMS_COUNT - 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < 1)
|
||||
gTasks[taskId].data[3] = 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] > 0)
|
||||
gTasks[taskId].data[4] -= 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_RIGHT)
|
||||
if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1)
|
||||
gTasks[taskId].data[4] += 1;
|
||||
@ -1878,7 +1878,7 @@ static void DebugAction_Give_Item_SelectId(u8 taskId)
|
||||
gSprites[gTasks[taskId].data[6]].oam.priority = 0;
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
gTasks[taskId].data[5] = gTasks[taskId].data[3];
|
||||
gTasks[taskId].data[3] = 1;
|
||||
@ -1892,7 +1892,7 @@ static void DebugAction_Give_Item_SelectId(u8 taskId)
|
||||
|
||||
gTasks[taskId].func = DebugAction_Give_Item_SelectQuantity;
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon
|
||||
FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon
|
||||
@ -1905,28 +1905,28 @@ static void DebugAction_Give_Item_SelectId(u8 taskId)
|
||||
}
|
||||
static void DebugAction_Give_Item_SelectQuantity(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] >= 100)
|
||||
gTasks[taskId].data[3] = 99;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < 1)
|
||||
gTasks[taskId].data[3] = 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] > 0)
|
||||
gTasks[taskId].data[4] -= 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_RIGHT)
|
||||
if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] < 2)
|
||||
gTasks[taskId].data[4] += 1;
|
||||
@ -1939,7 +1939,7 @@ static void DebugAction_Give_Item_SelectQuantity(u8 taskId)
|
||||
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon
|
||||
FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon
|
||||
@ -1950,7 +1950,7 @@ static void DebugAction_Give_Item_SelectQuantity(u8 taskId)
|
||||
AddBagItem(gTasks[taskId].data[5], gTasks[taskId].data[3]);
|
||||
DebugAction_DestroyExtraWindow(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon
|
||||
FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon
|
||||
@ -2070,28 +2070,28 @@ static void DebugAction_Give_PokemonComplex(u8 taskId)
|
||||
|
||||
static void DebugAction_Give_Pokemon_SelectId(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] >= NUM_SPECIES)
|
||||
gTasks[taskId].data[3] = NUM_SPECIES - 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < 1)
|
||||
gTasks[taskId].data[3] = 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] > 0)
|
||||
gTasks[taskId].data[4] -= 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_RIGHT)
|
||||
if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1)
|
||||
gTasks[taskId].data[4] += 1;
|
||||
@ -2111,7 +2111,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId)
|
||||
gSprites[gTasks[taskId].data[6]].oam.priority = 0;
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
sDebugMonData->mon_speciesId = gTasks[taskId].data[3]; //Species ID
|
||||
gTasks[taskId].data[3] = 1;
|
||||
@ -2125,7 +2125,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId)
|
||||
|
||||
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectLevel;
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
||||
@ -2136,28 +2136,28 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId)
|
||||
}
|
||||
static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] > 100)
|
||||
gTasks[taskId].data[3] = 100;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < 1)
|
||||
gTasks[taskId].data[3] = 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] > 0)
|
||||
gTasks[taskId].data[4] -= 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_RIGHT)
|
||||
if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] < 2)
|
||||
gTasks[taskId].data[4] += 1;
|
||||
@ -2170,7 +2170,7 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId)
|
||||
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
FreeMonIconPalettes();
|
||||
FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].data[6]]); //Destroy pokemon sprite
|
||||
@ -2196,7 +2196,7 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId)
|
||||
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectShiny;
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
||||
@ -2208,17 +2208,17 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId)
|
||||
//If complex
|
||||
static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] > 1)
|
||||
gTasks[taskId].data[3] = 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < 0)
|
||||
@ -2235,7 +2235,7 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId)
|
||||
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
sDebugMonData->isShiny = gTasks[taskId].data[3]; //isShiny
|
||||
gTasks[taskId].data[3] = 0;
|
||||
@ -2250,7 +2250,7 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId)
|
||||
|
||||
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectNature;
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
||||
@ -2259,17 +2259,17 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId)
|
||||
}
|
||||
static void DebugAction_Give_Pokemon_SelectNature(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] > NUM_NATURES-1)
|
||||
gTasks[taskId].data[3] = NUM_NATURES-1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < 0)
|
||||
@ -2284,7 +2284,7 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId)
|
||||
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
u8 abilityId;
|
||||
sDebugMonData->mon_natureId = gTasks[taskId].data[3]; //NatureId
|
||||
@ -2301,7 +2301,7 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId)
|
||||
|
||||
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectAbility;
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
||||
@ -2314,17 +2314,17 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId)
|
||||
u8 abilityCount = NUM_ABILITY_SLOTS - 1; //-1 for proper iteration
|
||||
u8 i = 0;
|
||||
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] > abilityCount)
|
||||
gTasks[taskId].data[3] = abilityCount;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < 0)
|
||||
@ -2344,7 +2344,7 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId)
|
||||
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
sDebugMonData->mon_abilityNum = gTasks[taskId].data[3] - i; //AbilityNum
|
||||
gTasks[taskId].data[3] = 0;
|
||||
@ -2358,7 +2358,7 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId)
|
||||
|
||||
gTasks[taskId].func = DebugAction_Give_Pokemon_SelectIVs;
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
||||
@ -2367,28 +2367,28 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId)
|
||||
}
|
||||
static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] > 31)
|
||||
gTasks[taskId].data[3] = 31;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < 0)
|
||||
gTasks[taskId].data[3] = 0;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] > 0)
|
||||
gTasks[taskId].data[4] -= 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_RIGHT)
|
||||
if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] < 2)
|
||||
gTasks[taskId].data[4] += 1;
|
||||
@ -2422,7 +2422,7 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId)
|
||||
}
|
||||
|
||||
//If A or B button
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
switch (gTasks[taskId].data[7])
|
||||
{
|
||||
@ -2497,7 +2497,7 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId)
|
||||
gTasks[taskId].func = DebugAction_Give_Pokemon_Move;
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
||||
@ -2506,28 +2506,28 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId)
|
||||
}
|
||||
static void DebugAction_Give_Pokemon_Move(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] >= MOVES_COUNT)
|
||||
gTasks[taskId].data[3] = MOVES_COUNT - 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < 0)
|
||||
gTasks[taskId].data[3] = 0;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] > 0)
|
||||
gTasks[taskId].data[4] -= 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_RIGHT)
|
||||
if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] < 3)
|
||||
gTasks[taskId].data[4] += 1;
|
||||
@ -2555,7 +2555,7 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId)
|
||||
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
//If MOVE_NONE selected, stop asking for additional moves
|
||||
if (gTasks[taskId].data[3] == 0)
|
||||
@ -2617,7 +2617,7 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId)
|
||||
gTasks[taskId].func = DebugAction_Give_Pokemon_ComplexCreateMon;
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Free(sDebugMonData); //Frees EWRAM of MonData Struct
|
||||
@ -2845,26 +2845,26 @@ static void DebugAction_Sound_SE(u8 taskId)
|
||||
}
|
||||
static void DebugAction_Sound_SE_SelectId(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] > END_SE)
|
||||
gTasks[taskId].data[3] = END_SE;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < 1)
|
||||
gTasks[taskId].data[3] = 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] > 0)
|
||||
gTasks[taskId].data[4] -= 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_RIGHT)
|
||||
if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1)
|
||||
gTasks[taskId].data[4] += 1;
|
||||
@ -2877,13 +2877,13 @@ static void DebugAction_Sound_SE_SelectId(u8 taskId)
|
||||
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
m4aSongNumStop(gTasks[taskId].data[5]);
|
||||
gTasks[taskId].data[5] = gTasks[taskId].data[3];
|
||||
m4aSongNumStart(gTasks[taskId].data[3]);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
m4aSongNumStop(gTasks[taskId].data[5]);
|
||||
@ -2922,26 +2922,26 @@ static void DebugAction_Sound_MUS(u8 taskId)
|
||||
}
|
||||
static void DebugAction_Sound_MUS_SelectId(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & DPAD_ANY)
|
||||
if (JOY_NEW(DPAD_ANY))
|
||||
{
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] > END_MUS)
|
||||
gTasks[taskId].data[3] = END_MUS;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_DOWN)
|
||||
if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]];
|
||||
if (gTasks[taskId].data[3] < START_MUS)
|
||||
gTasks[taskId].data[3] = START_MUS;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_LEFT)
|
||||
if (JOY_NEW(DPAD_LEFT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] > 0)
|
||||
gTasks[taskId].data[4] -= 1;
|
||||
}
|
||||
if (gMain.newKeys & DPAD_RIGHT)
|
||||
if (JOY_NEW(DPAD_RIGHT))
|
||||
{
|
||||
if (gTasks[taskId].data[4] < DEBUG_NUMBER_DIGITS_ITEMS - 1)
|
||||
gTasks[taskId].data[4] += 1;
|
||||
@ -2954,13 +2954,13 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId)
|
||||
AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL);
|
||||
}
|
||||
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
m4aSongNumStop(gTasks[taskId].data[5]);
|
||||
gTasks[taskId].data[5] = gTasks[taskId].data[3];
|
||||
m4aSongNumStart(gTasks[taskId].data[3]);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
// m4aSongNumStop(gTasks[taskId].data[5]); //Uncomment if music should stop after leaving menu
|
||||
|
Loading…
Reference in New Issue
Block a user