clean up script_menu.c

This commit is contained in:
camthesaxman 2017-09-09 17:28:25 -05:00
parent 37cf348422
commit aa659fe8dd
3 changed files with 392 additions and 375 deletions

View File

@ -1,23 +1,19 @@
#ifndef GUARD_SCRIPTMENU_H
#define GUARD_SCRIPTMENU_H
struct MultichoiceListStruct
{
struct MenuAction *list;
u8 count;
};
struct MenuAction;
extern const u8 *const gUnknown_083CE048[];
bool8 sub_80B5054(u8 left, u8 top, u8 var3, u8 var4);
bool8 sub_80B50B0(u8 left, u8 top, u8 var3, u8 var4, u8 var5);
bool8 ScriptMenu_Multichoice(u8 left, u8 top, u8 var3, u8 var4);
bool8 ScriptMenu_MultichoiceWithDefault(u8 left, u8 top, u8 var3, u8 var4, u8 var5);
u16 GetStringWidthInTilesForScriptMenu(const u8 *str);
void DrawMultichoiceMenu(u8, u8, u8, struct MenuAction *list, u8, u8);
void sub_80B5230(u8, u8, u8, u8, u8, u8);
void sub_80B52B4(u8);
void DrawMultichoiceMenu(u8, u8, u8, const struct MenuAction *list, u8, u8);
void StartScriptMenuTask(u8, u8, u8, u8, u8, u8);
void Task_HandleMenuInput(u8);
bool8 Multichoice(u8 var1, u8 var2, u8 var3, u8 var4);
void sub_80B53B4(u8, u8, u8, struct MenuAction *list, u8);
bool8 yes_no_box(u8 var1, u8 var2);
void sub_80B53B4(u8, u8, u8, const struct MenuAction *list, u8);
bool8 ScriptMenu_YesNo(u8 var1, u8 var2);
bool8 IsScriptActive(void); // unused
void task_yes_no_maybe(u8);
bool8 sub_80B5578(u8 left, u8 top, u8 multichoiceId, u8 a4, u8 columnCount);

View File

@ -1200,7 +1200,7 @@ bool8 ScrCmd_yesnobox(struct ScriptContext *ctx)
{
u8 v1 = ScriptReadByte(ctx);
u8 v2 = ScriptReadByte(ctx);
if (yes_no_box(v1, v2) == 1)
if (ScriptMenu_YesNo(v1, v2) == 1)
{
ScriptContext1_Stop();
return TRUE;
@ -1213,11 +1213,11 @@ bool8 ScrCmd_yesnobox(struct ScriptContext *ctx)
bool8 ScrCmd_multichoice(struct ScriptContext *ctx)
{
u8 v1 = ScriptReadByte(ctx);
u8 v2 = ScriptReadByte(ctx);
u8 v3 = ScriptReadByte(ctx);
u8 v4 = ScriptReadByte(ctx);
if (sub_80B5054(v1, v2, v3, v4) == 1)
u8 left = ScriptReadByte(ctx);
u8 top = ScriptReadByte(ctx);
u8 multichoiceId = ScriptReadByte(ctx);
u8 ignoreBPress = ScriptReadByte(ctx);
if (ScriptMenu_Multichoice(left, top, multichoiceId, ignoreBPress) == TRUE)
{
ScriptContext1_Stop();
return TRUE;
@ -1230,12 +1230,12 @@ bool8 ScrCmd_multichoice(struct ScriptContext *ctx)
bool8 ScrCmd_multichoicedef(struct ScriptContext *ctx)
{
u8 v1 = ScriptReadByte(ctx);
u8 v2 = ScriptReadByte(ctx);
u8 v3 = ScriptReadByte(ctx);
u8 v4 = ScriptReadByte(ctx);
u8 v5 = ScriptReadByte(ctx);
if (sub_80B50B0(v1, v2, v3, v5, v4) == 1)
u8 left = ScriptReadByte(ctx);
u8 top = ScriptReadByte(ctx);
u8 multichoiceId = ScriptReadByte(ctx);
u8 defaultChoice = ScriptReadByte(ctx);
u8 ignoreBPress = ScriptReadByte(ctx);
if (ScriptMenu_MultichoiceWithDefault(left, top, multichoiceId, ignoreBPress, defaultChoice) == TRUE)
{
ScriptContext1_Stop();
return TRUE;
@ -1263,7 +1263,7 @@ bool8 ScrCmd_multichoicerow(struct ScriptContext *ctx)
u8 v3 = ScriptReadByte(ctx);
u8 v4 = ScriptReadByte(ctx);
u8 v5 = ScriptReadByte(ctx);
if (sub_80B5578(v1, v2, v3, v5, v4) == 1)
if (sub_80B5578(v1, v2, v3, v5, v4) == TRUE)
{
ScriptContext1_Stop();
return TRUE;

File diff suppressed because it is too large Load Diff