Address review comments; struct pointer style fix in scrcmd.c

This commit is contained in:
PikalaxALT
2020-03-06 09:06:44 -05:00
parent 113a817a56
commit fef3383c6c
4 changed files with 243 additions and 243 deletions
+1 -1
View File
@@ -47,7 +47,7 @@ void RemoveStartMenuWindow(void);
u16 GetStdWindowBaseTileNum(void);
void DrawHelpMessageWindowWithText(const u8 * text);
void DestroyHelpMessageWindow_(void);
void sub_80F79A4(void);
void LoadSignPostWindowFrameGfx(void);
void SetDefaultFontsPointer(void);
#endif // GUARD_NEW_MENU_HELPERS_H
+25 -25
View File
@@ -5,26 +5,26 @@
#include "script.h"
#include "text_window.h"
EWRAM_DATA u8 gUnknown_203709C = 0;
static EWRAM_DATA u8 sMessageBoxType = 0;
void textbox_fdecode_auto_and_task_add(const u8 *str);
void textbox_auto_and_task_add(void);
static void textbox_fdecode_auto_and_task_add(const u8 *str);
static void textbox_auto_and_task_add(void);
void sub_8069348(void)
{
gUnknown_203709C = 0;
sMessageBoxType = 0;
gTextFlags.canABSpeedUpPrint = FALSE;
gTextFlags.useAlternateDownArrow = FALSE;
gTextFlags.autoScroll = FALSE;
}
void sub_8069370(u8 taskId)
static void Task_RunFieldMessageBoxPrinter(u8 taskId)
{
struct Task * task = &gTasks[taskId];
switch (task->data[0])
{
case 0:
if (gQuestLogState == 2)
if (gQuestLogState == QL_STATE_2)
{
gTextFlags.autoScroll = TRUE;
TextWindow_LoadTilesStdFrame1(0, 0x200);
@@ -35,7 +35,7 @@ void sub_8069370(u8 taskId)
}
else
{
sub_80F79A4();
LoadSignPostWindowFrameGfx();
}
task->data[0]++;
break;
@@ -46,67 +46,67 @@ void sub_8069370(u8 taskId)
case 2:
if (RunTextPrinters_CheckPrinter0Active() != TRUE)
{
gUnknown_203709C = 0;
sMessageBoxType = 0;
DestroyTask(taskId);
}
break;
}
}
void task_add_textbox(void)
static void task_add_textbox(void)
{
CreateTask(sub_8069370, 80);
CreateTask(Task_RunFieldMessageBoxPrinter, 80);
}
void task_del_textbox(void)
static void task_del_textbox(void)
{
u8 taskId = FindTaskIdByFunc(sub_8069370);
u8 taskId = FindTaskIdByFunc(Task_RunFieldMessageBoxPrinter);
if (taskId != 0xFF)
DestroyTask(taskId);
}
bool8 ShowFieldMessage(const u8 *str)
{
if (gUnknown_203709C != 0)
if (sMessageBoxType != 0)
return FALSE;
textbox_fdecode_auto_and_task_add(str);
gUnknown_203709C = 2;
sMessageBoxType = 2;
return TRUE;
}
bool8 ShowFieldAutoScrollMessage(const u8 *str)
{
if (gUnknown_203709C != 0)
if (sMessageBoxType != 0)
return FALSE;
gUnknown_203709C = 3;
sMessageBoxType = 3;
textbox_fdecode_auto_and_task_add(str);
return TRUE;
}
bool8 sub_806948C(const u8 *str)
{
gUnknown_203709C = 3;
sMessageBoxType = 3;
textbox_fdecode_auto_and_task_add(str);
return TRUE;
}
bool8 sub_80694A4(const u8 *str)
{
if (gUnknown_203709C != 0)
if (sMessageBoxType != 0)
return FALSE;
gUnknown_203709C = 2;
sMessageBoxType = 2;
textbox_auto_and_task_add();
return TRUE;
}
void textbox_fdecode_auto_and_task_add(const u8 *str)
static void textbox_fdecode_auto_and_task_add(const u8 *str)
{
StringExpandPlaceholders(gStringVar4, str);
AddTextPrinterDiffStyle(TRUE);
task_add_textbox();
}
void textbox_auto_and_task_add(void)
static void textbox_auto_and_task_add(void)
{
AddTextPrinterDiffStyle(TRUE);
task_add_textbox();
@@ -116,17 +116,17 @@ void HideFieldMessageBox(void)
{
task_del_textbox();
ClearDialogWindowAndFrame(0, TRUE);
gUnknown_203709C = 0;
sMessageBoxType = 0;
}
u8 textbox_any_visible(void)
{
return gUnknown_203709C;
return sMessageBoxType;
}
bool8 IsFieldMessageBoxHidden(void)
{
if (gUnknown_203709C == 0)
if (sMessageBoxType == 0)
return TRUE;
else
return FALSE;
@@ -136,5 +136,5 @@ void sub_8069538(void)
{
task_del_textbox();
DrawStdWindowFrame(0, TRUE);
gUnknown_203709C = 0;
sMessageBoxType = 0;
}
+1 -1
View File
@@ -716,7 +716,7 @@ void DestroyHelpMessageWindow_(void)
DestroyHelpMessageWindow(2);
}
void sub_80F79A4(void)
void LoadSignPostWindowFrameGfx(void)
{
Menu_LoadStdPal();
sub_814FEEC(0, DLG_WINDOW_BASE_TILE_NUM, 0x10 * DLG_WINDOW_PALETTE_NUM);
+216 -216
View File
File diff suppressed because it is too large Load Diff