summaryrefslogtreecommitdiff
path: root/src/menu.c
diff options
context:
space:
mode:
authoraaaaaa123456789 <aaaaaa123456789@acidch.at>2020-09-13 04:22:50 -0300
committeraaaaaa123456789 <aaaaaa123456789@acidch.at>2020-09-13 06:30:55 -0300
commit7dc95a0103af08c95c9093b6efa6c77af77a2538 (patch)
tree663537916626ab264bbdef4ea3606415457c36a3 /src/menu.c
parent58a2b62bae1406d2c768698ed13efcd6a5ffbeec (diff)
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some harmless or completely superseded PRs have been left alone, as there is not much benefit in attempting to undo them. Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136, #1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179, #1180, #1181, #1182 and #1183.
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c100
1 files changed, 50 insertions, 50 deletions
diff --git a/src/menu.c b/src/menu.c
index 9c5dec024..f3334919c 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -180,7 +180,7 @@ u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed
printer.currentY = 1;
printer.letterSpacing = 0;
printer.lineSpacing = 0;
- printer.style = 0;
+ printer.unk = 0;
printer.fgColor = fgColor;
printer.bgColor = bgColor;
printer.shadowColor = shadowColor;
@@ -981,23 +981,23 @@ u8 Menu_GetCursorPos(void)
s8 Menu_ProcessInput(void)
{
- if (JOY_NEW(A_BUTTON))
+ if (gMain.newKeys & A_BUTTON)
{
if (!sMenu.APressMuted)
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
- else if (JOY_NEW(B_BUTTON))
+ else if (gMain.newKeys & B_BUTTON)
{
return MENU_B_PRESSED;
}
- else if (JOY_NEW(DPAD_UP))
+ else if (gMain.newKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
Menu_MoveCursor(-1);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_NEW(DPAD_DOWN))
+ else if (gMain.newKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
Menu_MoveCursor(1);
@@ -1011,23 +1011,23 @@ s8 Menu_ProcessInputNoWrap(void)
{
u8 oldPos = sMenu.cursorPos;
- if (JOY_NEW(A_BUTTON))
+ if (gMain.newKeys & A_BUTTON)
{
if (!sMenu.APressMuted)
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
- else if (JOY_NEW(B_BUTTON))
+ else if (gMain.newKeys & B_BUTTON)
{
return MENU_B_PRESSED;
}
- else if (JOY_NEW(DPAD_UP))
+ else if (gMain.newKeys & DPAD_UP)
{
if (oldPos != Menu_MoveCursorNoWrapAround(-1))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_NEW(DPAD_DOWN))
+ else if (gMain.newKeys & DPAD_DOWN)
{
if (oldPos != Menu_MoveCursorNoWrapAround(1))
PlaySE(SE_SELECT);
@@ -1039,23 +1039,23 @@ s8 Menu_ProcessInputNoWrap(void)
s8 ProcessMenuInput_other(void)
{
- if (JOY_NEW(A_BUTTON))
+ if (gMain.newKeys & A_BUTTON)
{
if (!sMenu.APressMuted)
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
- else if (JOY_NEW(B_BUTTON))
+ else if (gMain.newKeys & B_BUTTON)
{
return MENU_B_PRESSED;
}
- else if (JOY_REPEAT(DPAD_ANY) == DPAD_UP)
+ else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
{
PlaySE(SE_SELECT);
Menu_MoveCursor(-1);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_REPEAT(DPAD_ANY) == DPAD_DOWN)
+ else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
{
PlaySE(SE_SELECT);
Menu_MoveCursor(1);
@@ -1069,23 +1069,23 @@ s8 Menu_ProcessInputNoWrapAround_other(void)
{
u8 oldPos = sMenu.cursorPos;
- if (JOY_NEW(A_BUTTON))
+ if (gMain.newKeys & A_BUTTON)
{
if (!sMenu.APressMuted)
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
- if (JOY_NEW(B_BUTTON))
+ else if (gMain.newKeys & B_BUTTON)
{
return MENU_B_PRESSED;
}
- if (JOY_REPEAT(DPAD_ANY) == DPAD_UP)
+ else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
{
if (oldPos != Menu_MoveCursorNoWrapAround(-1))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
- if (JOY_REPEAT(DPAD_ANY) == DPAD_DOWN)
+ else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
{
if (oldPos != Menu_MoveCursorNoWrapAround(1))
PlaySE(SE_SELECT);
@@ -1130,7 +1130,7 @@ void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 l
printer.fgColor = GetFontAttribute(fontId, FONTATTR_COLOR_FOREGROUND);
printer.bgColor = GetFontAttribute(fontId, FONTATTR_COLOR_BACKGROUND);
printer.shadowColor = GetFontAttribute(fontId, FONTATTR_COLOR_SHADOW);
- printer.style = GetFontAttribute(fontId, FONTATTR_STYLE);
+ printer.unk = GetFontAttribute(fontId, FONTATTR_UNKNOWN);
printer.letterSpacing = letterSpacing;
printer.lineSpacing = GetFontAttribute(fontId, FONTATTR_LINE_SPACING);
printer.x = left;
@@ -1194,7 +1194,7 @@ void sub_8198AF8(const struct WindowTemplate *window, u8 fontId, u8 left, u8 top
printer.fgColor = GetFontAttribute(fontId, FONTATTR_COLOR_FOREGROUND);
printer.bgColor = GetFontAttribute(fontId, FONTATTR_COLOR_BACKGROUND);
printer.shadowColor = GetFontAttribute(fontId, FONTATTR_COLOR_SHADOW);
- printer.style = GetFontAttribute(fontId, FONTATTR_STYLE);
+ printer.unk = GetFontAttribute(fontId, FONTATTR_UNKNOWN);
printer.letterSpacing = GetFontAttribute(fontId, FONTATTR_LETTER_SPACING);
printer.lineSpacing = GetFontAttribute(fontId, FONTATTR_LINE_SPACING);
@@ -1252,7 +1252,7 @@ void sub_8198DBC(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u
printer.fgColor = GetFontAttribute(fontId, FONTATTR_COLOR_FOREGROUND);
printer.bgColor = GetFontAttribute(fontId, FONTATTR_COLOR_BACKGROUND);
printer.shadowColor = GetFontAttribute(fontId, FONTATTR_COLOR_SHADOW);
- printer.style = GetFontAttribute(fontId, FONTATTR_STYLE);
+ printer.unk = GetFontAttribute(fontId, FONTATTR_UNKNOWN);
printer.letterSpacing = GetFontAttribute(fontId, FONTATTR_LETTER_SPACING);
printer.lineSpacing = GetFontAttribute(fontId, FONTATTR_LINE_SPACING);
@@ -1407,34 +1407,34 @@ u8 ChangeGridMenuCursorPosition(s8 deltaX, s8 deltaY)
s8 sub_8199284(void)
{
- if (JOY_NEW(A_BUTTON))
+ if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
- else if (JOY_NEW(B_BUTTON))
+ else if (gMain.newKeys & B_BUTTON)
{
return MENU_B_PRESSED;
}
- else if (JOY_NEW(DPAD_UP))
+ else if (gMain.newKeys & DPAD_UP)
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_NEW(DPAD_DOWN))
+ else if (gMain.newKeys & DPAD_DOWN)
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_NEW(DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED)
+ else if (gMain.newKeys & DPAD_LEFT || GetLRKeysPressed() == MENU_L_PRESSED)
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED)
+ else if (gMain.newKeys & DPAD_RIGHT || GetLRKeysPressed() == MENU_R_PRESSED)
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
@@ -1448,34 +1448,34 @@ s8 Menu_ProcessInputGridLayout(void)
{
u8 oldPos = sMenu.cursorPos;
- if (JOY_NEW(A_BUTTON))
+ if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
- else if (JOY_NEW(B_BUTTON))
+ else if (gMain.newKeys & B_BUTTON)
{
return MENU_B_PRESSED;
}
- else if (JOY_NEW(DPAD_UP))
+ else if (gMain.newKeys & DPAD_UP)
{
if (oldPos != ChangeGridMenuCursorPosition(0, -1))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_NEW(DPAD_DOWN))
+ else if (gMain.newKeys & DPAD_DOWN)
{
if (oldPos != ChangeGridMenuCursorPosition(0, 1))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_NEW(DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED)
+ else if (gMain.newKeys & DPAD_LEFT || GetLRKeysPressed() == MENU_L_PRESSED)
{
if (oldPos != ChangeGridMenuCursorPosition(-1, 0))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED)
+ else if (gMain.newKeys & DPAD_RIGHT || GetLRKeysPressed() == MENU_R_PRESSED)
{
if (oldPos != ChangeGridMenuCursorPosition(1, 0))
PlaySE(SE_SELECT);
@@ -1487,34 +1487,34 @@ s8 Menu_ProcessInputGridLayout(void)
s8 sub_81993D8(void)
{
- if (JOY_NEW(A_BUTTON))
+ if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
- else if (JOY_NEW(B_BUTTON))
+ else if (gMain.newKeys & B_BUTTON)
{
return MENU_B_PRESSED;
}
- else if (JOY_REPEAT(DPAD_ANY) == DPAD_UP)
+ else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_REPEAT(DPAD_ANY) == DPAD_DOWN)
+ else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_REPEAT(DPAD_ANY) == DPAD_LEFT || GetLRKeysPressedAndHeld() == MENU_L_PRESSED)
+ else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_LEFT || GetLRKeysPressedAndHeld() == MENU_L_PRESSED)
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_REPEAT(DPAD_ANY) == DPAD_RIGHT || GetLRKeysPressedAndHeld() == MENU_R_PRESSED)
+ else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_RIGHT || GetLRKeysPressedAndHeld() == MENU_R_PRESSED)
{
PlaySE(SE_SELECT);
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
@@ -1529,34 +1529,34 @@ s8 sub_8199484(void)
{
u8 oldPos = sMenu.cursorPos;
- if (JOY_NEW(A_BUTTON))
+ if (gMain.newKeys & A_BUTTON)
{
PlaySE(SE_SELECT);
return sMenu.cursorPos;
}
- else if (JOY_NEW(B_BUTTON))
+ else if (gMain.newKeys & B_BUTTON)
{
return MENU_B_PRESSED;
}
- else if (JOY_REPEAT(DPAD_ANY) == DPAD_UP)
+ else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP)
{
if (oldPos != ChangeGridMenuCursorPosition(0, -1))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_REPEAT(DPAD_ANY) == DPAD_DOWN)
+ else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN)
{
if (oldPos != ChangeGridMenuCursorPosition(0, 1))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_REPEAT(DPAD_ANY) == DPAD_LEFT || GetLRKeysPressedAndHeld() == MENU_L_PRESSED)
+ else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_LEFT || GetLRKeysPressedAndHeld() == MENU_L_PRESSED)
{
if (oldPos != ChangeGridMenuCursorPosition(-1, 0))
PlaySE(SE_SELECT);
return MENU_NOTHING_CHOSEN;
}
- else if (JOY_REPEAT(DPAD_ANY) == DPAD_RIGHT || GetLRKeysPressedAndHeld() == MENU_R_PRESSED)
+ else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_RIGHT || GetLRKeysPressedAndHeld() == MENU_R_PRESSED)
{
if (oldPos != ChangeGridMenuCursorPosition(1, 0))
PlaySE(SE_SELECT);
@@ -1616,7 +1616,7 @@ void sub_81995E4(u8 windowId, u8 itemCount, const struct MenuAction *strs, const
printer.fgColor = GetFontAttribute(1, FONTATTR_COLOR_FOREGROUND);
printer.bgColor = GetFontAttribute(1, FONTATTR_COLOR_BACKGROUND);
printer.shadowColor = GetFontAttribute(1, FONTATTR_COLOR_SHADOW);
- printer.style = GetFontAttribute(1, FONTATTR_STYLE);
+ printer.unk = GetFontAttribute(1, FONTATTR_UNKNOWN);
printer.letterSpacing = 0;
printer.lineSpacing = 0;
printer.x = 8;
@@ -1650,7 +1650,7 @@ void CreateYesNoMenu(const struct WindowTemplate *window, u16 baseTileNum, u8 pa
printer.fgColor = GetFontAttribute(1, FONTATTR_COLOR_FOREGROUND);
printer.bgColor = GetFontAttribute(1, FONTATTR_COLOR_BACKGROUND);
printer.shadowColor = GetFontAttribute(1, FONTATTR_COLOR_SHADOW);
- printer.style = GetFontAttribute(1, FONTATTR_STYLE);
+ printer.unk = GetFontAttribute(1, FONTATTR_UNKNOWN);
printer.letterSpacing = 0;
printer.lineSpacing = 0;
@@ -1681,7 +1681,7 @@ void sub_819983C(u8 windowId, u8 a4, u8 itemCount, u8 itemCount2, const struct M
printer.fgColor = GetFontAttribute(1, FONTATTR_COLOR_FOREGROUND);
printer.bgColor = GetFontAttribute(1, FONTATTR_COLOR_BACKGROUND);
printer.shadowColor = GetFontAttribute(1, FONTATTR_COLOR_SHADOW);
- printer.style = GetFontAttribute(1, FONTATTR_STYLE);
+ printer.unk = GetFontAttribute(1, FONTATTR_UNKNOWN);
printer.letterSpacing = 0;
printer.lineSpacing = 0;
@@ -1949,7 +1949,7 @@ void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const
printer.currentY = printer.y;
printer.letterSpacing = GetFontAttribute(fontId, 2);
printer.lineSpacing = GetFontAttribute(fontId, 3);
- printer.style = 0;
+ printer.unk = 0;
printer.fgColor = color[1];
printer.bgColor = color[0];
printer.shadowColor = color[2];
@@ -1970,7 +1970,7 @@ void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 left, u8 top, u8 le
printer.currentY = printer.y;
printer.letterSpacing = letterSpacing;
printer.lineSpacing = lineSpacing;
- printer.style = 0;
+ printer.unk = 0;
printer.fgColor = color[1];
printer.bgColor = color[0];
printer.shadowColor = color[2];
@@ -1991,7 +1991,7 @@ void AddTextPrinterParameterized5(u8 windowId, u8 fontId, const u8 *str, u8 left
printer.currentY = top;
printer.letterSpacing = letterSpacing;
printer.lineSpacing = lineSpacing;
- printer.style = 0;
+ printer.unk = 0;
printer.fgColor = GetFontAttribute(fontId, 5);
printer.bgColor = GetFontAttribute(fontId, 6);