Address review comments

This commit is contained in:
PikalaxALT
2020-01-25 21:00:51 -05:00
parent 0ebdbcfd5b
commit 52fbc43d73
7 changed files with 74 additions and 41 deletions
+1 -1
View File
@@ -614,7 +614,7 @@ static void ClearDaycareMonMail(struct DayCareMail *mail)
{
s32 i;
for (i = 0; i < PLAYER_NAME_LENGTH + 1/* + 1*/; i++)
for (i = 0; i < PLAYER_NAME_LENGTH + 1; i++)
mail->OT_name[i] = 0;
for (i = 0; i < POKEMON_NAME_LENGTH + 1; i++)
mail->monName[i] = 0;
+1 -1
View File
@@ -5769,7 +5769,7 @@ s8 GetFlavorRelationByPersonality(u32 personality, u8 flavor)
bool8 IsTradedMon(struct Pokemon *mon)
{
u8 otName[7 + 1]; // change PLAYER_NAME_LENGTH + 1 to 7
u8 otName[PLAYER_NAME_LENGTH];
u32 otId;
GetMonData(mon, MON_DATA_OT_NAME, otName);
otId = GetMonData(mon, MON_DATA_OT_ID, 0);
+3 -3
View File
@@ -405,7 +405,7 @@ static void ChatEntryRoutine_HandleInput(void)
static void ChatEntryRoutine_Switch(void)
{
s16 input;
int shouldSwitchPages;
bool32 shouldSwitchPages;
switch (sWork->routineState)
{
@@ -423,9 +423,9 @@ static void ChatEntryRoutine_Switch(void)
{
default:
UnionRoomChat_StartDisplaySubtask(CHATDISPLAYROUTINE_HIDEKBSWAPMENU, 0);
shouldSwitchPages = 1;
shouldSwitchPages = TRUE;
if (sWork->currentPage == input || input > UNION_ROOM_KB_PAGE_COUNT)
shouldSwitchPages = 0;
shouldSwitchPages = FALSE;
break;
case MENU_NOTHING_CHOSEN:
if (JOY_NEW(SELECT_BUTTON))
+9 -8
View File
@@ -600,7 +600,7 @@ static bool32 DisplaySubtask_UpdateMessageBuffer(u8 *state)
UnionRoomChat_GetBufferSelectionRegion(&start, &length);
FillWin1Rect(start, length, PIXEL_FILL(0));
str = UnionRoomChat_GetMessageEntryBuffer();
PrintOnWin1Parameterized(0, str, 3, 1, 2);
PrintOnWin1Parameterized(0, str, TEXT_COLOR_LIGHT_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY);
CopyWindowToVram(1, 2);
break;
case 1:
@@ -629,7 +629,7 @@ static bool32 DisplaySubtask_PrintRegisterWhere(u8 *state)
str = UnionRoomChat_GetEndOfMessageEntryBuffer();
length = StringLength_Multibyte(str);
FillWin1Rect(var0, length, PIXEL_FILL(6));
PrintOnWin1Parameterized(var0, str, 0, 4, 5);
PrintOnWin1Parameterized(var0, str, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_RED, TEXT_COLOR_LIGHT_RED);
CopyWindowToVram(1, 2);
break;
case 1:
@@ -670,7 +670,7 @@ static bool32 DisplaySubtask_CancelRegister(u8 *state)
str = UnionRoomChat_GetEndOfMessageEntryBuffer();
length = StringLength_Multibyte(str);
FillWin1Rect(x, length, PIXEL_FILL(0));
PrintOnWin1Parameterized(x, str, 3, 1, 2);
PrintOnWin1Parameterized(x, str, TEXT_COLOR_LIGHT_GREY, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY);
CopyWindowToVram(1, 2);
break;
case 1:
@@ -1080,7 +1080,7 @@ static void PrintOnWin1Parameterized(u16 x, u8 *str, u8 bgColor, u8 fgColor, u8
u8 color[3];
u8 strbuf[35];
if (bgColor != 0)
if (bgColor != TEXT_COLOR_TRANSPARENT)
FillWin1Rect(x, UnionRoomChat_GetMessageEntryCursorPosition() - x, bgColor);
color[0] = bgColor;
@@ -1105,9 +1105,9 @@ static void PrintCurrentKeyboardPage(void)
FillWindowPixelBuffer(2, PIXEL_FILL(15));
page = GetCurrentKeyboardPage();
color[0] = 0;
color[1] = 14;
color[2] = 13;
color[0] = TEXT_COLOR_TRANSPARENT;
color[1] = TEXT_DYNAMIC_COLOR_5;
color[2] = TEXT_DYNAMIC_COLOR_4;
if (page != UNION_ROOM_KB_PAGE_COUNT)
{
str[0] = EXT_CTRL_CODE_BEGIN;
@@ -1207,9 +1207,10 @@ static void ClearWin3(void)
}
static void PrintTextOnWin0Colorized(u16 row, u8 *str, u8 colorIdx)
// colorIdx: 0 = grey, 1 = red, 2 = green, 3 = blue
{
u8 color[3];
color[0] = 1;
color[0] = TEXT_COLOR_WHITE;
color[1] = colorIdx * 2 + 2;
color[2] = colorIdx * 2 + 3;
FillWindowPixelRect(0, PIXEL_FILL(1), 0, row * 15, 168, 15);
+5 -5
View File
@@ -162,13 +162,13 @@ static const struct SpriteTemplate sSpriteTemplate_UnionRoomChatIcons = {
bool32 UnionRoomChat_TryAllocSpriteWork(void)
{
u32 i;
for (i = 0; i < 5; i++)
int i;
for (i = 0; i < NELEMS(sSpriteSheets); i++)
LoadCompressedSpriteSheet(&sSpriteSheets[i]);
LoadSpritePalette(&sSpritePalette);
sWork = Alloc(0x18);
if (!sWork)
sWork = Alloc(sizeof(struct UnionRoomChat3));
if (sWork == NULL)
return FALSE;
return TRUE;
@@ -176,7 +176,7 @@ bool32 UnionRoomChat_TryAllocSpriteWork(void)
void UnionRoomChat_FreeSpriteWork(void)
{
if (sWork)
if (sWork != NULL)
Free(sWork);
}