From 3af3ef6c2cf6ad58aceee3588f5cc26ee12f3003 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Wed, 28 Dec 2016 20:02:09 -0500 Subject: begin decompiling script_menu.c (#140) --- src/script_menu.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/script_menu.c (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c new file mode 100644 index 000000000..d8d76c27c --- /dev/null +++ b/src/script_menu.c @@ -0,0 +1,46 @@ +#include "global.h" +#include "task.h" +#include "text.h" +#include "menu.h" + +extern void sub_80B52B4(u8); +extern void DrawMultichoiceMenu(u8, u8, u8, u8 *, int, int); + +struct MultichoiceStruct +{ + u8 *textPtr; + u8 var; +}; + +extern struct MultichoiceStruct gMultichoiceLists[]; + +extern u16 gScriptResult; + +bool8 sub_80B5054(u8 var1, u8 var2, u8 var3, u8 var4) +{ + if(FuncIsActiveTask(sub_80B52B4) == 1) + return FALSE; + else + { + gScriptResult = 0xFF; + DrawMultichoiceMenu(var1, var2, gMultichoiceLists[var3].var, gMultichoiceLists[var3].textPtr, var4, 0); + return TRUE; + } +} + +bool8 sub_80B50B0(u8 var1, u8 var2, u8 var3, u8 var4, u8 var5) +{ + if(FuncIsActiveTask(sub_80B52B4) == 1) + return FALSE; + else + { + gScriptResult = 0xFF; + DrawMultichoiceMenu(var1, var2, gMultichoiceLists[var3].var, gMultichoiceLists[var3].textPtr, var4, var5); + return TRUE; + } +} + +u8 GetStringWidthInTilesForScriptMenu(u8 *str) +{ + return (GetStringWidthGivenWindowConfig((struct WindowConfig *)&gWindowConfig_81E6CE4, str) + 7) / 8; +} -- cgit v1.2.3 From 6b12bb0b52b2a65b6033b7d1c2eae7a182fc4279 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Thu, 29 Dec 2016 21:02:45 -0500 Subject: decompile more of script_menu.c (#141) * begin decompiling script_menu.c * update MultichoiceStructs to use both structs * decompile 2 more functions * decompile more of script_menu.c * do a bit more of script_menu.c * whoops * decompile task_yes_no_maybe --- src/script_menu.c | 221 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 202 insertions(+), 19 deletions(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index d8d76c27c..1fdaba0c1 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1,46 +1,229 @@ #include "global.h" #include "task.h" -#include "text.h" #include "menu.h" +#include "palette.h" +#include "script.h" +#include "sound.h" -extern void sub_80B52B4(u8); -extern void DrawMultichoiceMenu(u8, u8, u8, u8 *, int, int); - -struct MultichoiceStruct +struct MultichoiceListStruct { - u8 *textPtr; - u8 var; + struct MenuAction *list; + u8 count; }; -extern struct MultichoiceStruct gMultichoiceLists[]; +extern struct MultichoiceListStruct gMultichoiceLists[]; extern u16 gScriptResult; -bool8 sub_80B5054(u8 var1, u8 var2, u8 var3, u8 var4) +void DrawMultichoiceMenu(u8, u8, u8, struct MenuAction *list, u8, u8); +void sub_80B53B4(u8, u8, u8, struct MenuAction *list, u8); +void sub_80B52B4(u8); +void sub_80B5230(u8, u8, u8, u8, u8, u8); +void task_yes_no_maybe(u8); + +bool8 sub_80B5054(u8 left, u8 top, u8 var3, u8 var4) +{ + if(FuncIsActiveTask(sub_80B52B4) == 1) + return FALSE; + else + { + gScriptResult = 0xFF; + DrawMultichoiceMenu(left, top, gMultichoiceLists[var3].count, gMultichoiceLists[var3].list, var4, 0); + return TRUE; + } +} + +bool8 sub_80B50B0(u8 left, u8 top, u8 var3, u8 var4, u8 var5) +{ + if(FuncIsActiveTask(sub_80B52B4) == 1) + return FALSE; + else + { + gScriptResult = 0xFF; + DrawMultichoiceMenu(left, top, gMultichoiceLists[var3].count, gMultichoiceLists[var3].list, var4, var5); + return TRUE; + } +} + +u16 GetStringWidthInTilesForScriptMenu(u8 *str) +{ + // each tile on screen is 8x8, so it needs the number of tiles and not pixels, hence the division by 8. + return (GetStringWidthGivenWindowConfig((struct WindowConfig *)&gWindowConfig_81E6CE4, str) + 7) / 8; +} + +void DrawMultichoiceMenu(u8 left, u8 top, u8 count, struct MenuAction *list, u8 var4, u8 cursorPos) +{ + u16 width = GetStringWidthInTilesForScriptMenu(list[0].text); + u16 newWidth; + u8 i; + u8 right; + u8 bottom; + + for(i = 1; i < count; i++) + { + newWidth = GetStringWidthInTilesForScriptMenu(list[i].text); + if(width < newWidth) + width = newWidth; + } + + right = width; + right = (right + left) + 1; + + if(right > 29) + { + left = left + (29 - right); + right = 29; + } + + bottom = top + (2 * count + 1); + + MenuDrawTextWindow(left, top, right, bottom); + PrintMenuItems(left + 1, top + 1, count, list); + InitMenu(0, left + 1, top + 1, count, cursorPos, right - left - 1); + sub_80B5230(left, top, right, bottom, var4, count); +} + +void sub_80B5230(u8 left, u8 top, u8 right, u8 bottom, u8 unkVar, u8 count) +{ + u8 taskId = CreateTask(sub_80B52B4, 80); + + gTasks[taskId].data[0] = left; + gTasks[taskId].data[1] = top; + gTasks[taskId].data[2] = right; + gTasks[taskId].data[3] = bottom; + gTasks[taskId].data[4] = unkVar; + + if(count > 3) + gTasks[taskId].data[5] = TRUE; + else + gTasks[taskId].data[5] = FALSE; +} + +void sub_80B52B4(u8 taskId) +{ + s8 var; + + if(!gPaletteFade.active) + { + if(!gTasks[taskId].data[5]) + var = ProcessMenuInputNoWrap(); + else + var = ProcessMenuInput(); + + if(var != -2) + { + if(var == -1) + { + if(!gTasks[taskId].data[4]) + { + PlaySE(5); + gScriptResult = 127; + } + else + return; + } + else + { + gScriptResult = var; + } + sub_8072DEC(); + MenuZeroFillWindowRect(gTasks[taskId].data[0], gTasks[taskId].data[1], gTasks[taskId].data[2], gTasks[taskId].data[3]); + DestroyTask(taskId); + EnableBothScriptContexts(); + } + } +} + +bool8 Multichoice(u8 var1, u8 var2, u8 var3, u8 var4) { if(FuncIsActiveTask(sub_80B52B4) == 1) return FALSE; else { gScriptResult = 0xFF; - DrawMultichoiceMenu(var1, var2, gMultichoiceLists[var3].var, gMultichoiceLists[var3].textPtr, var4, 0); + sub_80B53B4(var1, var2, gMultichoiceLists[var3].count, gMultichoiceLists[var3].list, var4); return TRUE; } } -bool8 sub_80B50B0(u8 var1, u8 var2, u8 var3, u8 var4, u8 var5) +void sub_80B53B4(u8 left, u8 top, u8 count, struct MenuAction *list, u8 var4) { - if(FuncIsActiveTask(sub_80B52B4) == 1) - return FALSE; - else + u16 width = GetStringWidthInTilesForScriptMenu(list[0].text); + u16 newWidth; + u8 i; + u8 right; + u8 bottom; + + for(i = 1; i < count; i++) { - gScriptResult = 0xFF; - DrawMultichoiceMenu(var1, var2, gMultichoiceLists[var3].var, gMultichoiceLists[var3].textPtr, var4, var5); - return TRUE; + newWidth = GetStringWidthInTilesForScriptMenu(list[i].text); + if(width < newWidth) + width = newWidth; } + + right = width; + right = (right + left) + 2; + bottom = top + (2 * count + 1); + + PrintMenuItems(left, top, count, list); + InitMenu(0, left, top, count, 0, right - left - 1); + sub_80B5230(left, top, right, bottom, var4, count); } -u8 GetStringWidthInTilesForScriptMenu(u8 *str) +bool8 yes_no_box(u8 var1, u8 var2) { - return (GetStringWidthGivenWindowConfig((struct WindowConfig *)&gWindowConfig_81E6CE4, str) + 7) / 8; + u8 taskId; + + if(FuncIsActiveTask(task_yes_no_maybe) == 1) + return FALSE; + else + { + gScriptResult = 0xFF; + DisplayYesNoMenu(var1, var2, 1); + taskId = CreateTask(task_yes_no_maybe, 0x50); + gTasks[taskId].data[0] = var1; + gTasks[taskId].data[1] = var2; + return TRUE; + } +} + +// unused +bool8 IsScriptActive(void) +{ + if(gScriptResult == 0xFF) + return FALSE; + else + return TRUE; +} + +void task_yes_no_maybe(u8 taskId) +{ + u8 left, top; + + if (gTasks[taskId].data[2] < 5) + { + gTasks[taskId].data[2]++; + return; + } + + switch (ProcessMenuInputNoWrap()) + { + case -2: + return; + case -1: + case 1: + PlaySE(5); + gScriptResult = 0; + break; + case 0: + gScriptResult = 1; + break; + } + + left = gTasks[taskId].data[0]; + top = gTasks[taskId].data[1]; + + MenuZeroFillWindowRect(left, top, left + 6, top + 5); + DestroyTask(taskId); + EnableBothScriptContexts(); } -- cgit v1.2.3 From dd6ae92faca208a03f0f32e47b80f1442f546b35 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Fri, 30 Dec 2016 00:02:01 -0800 Subject: decompile sub_80B5578 and sub_80B5684 --- src/script_menu.c | 133 +++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 102 insertions(+), 31 deletions(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index 1fdaba0c1..d351c3fa4 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -11,7 +11,7 @@ struct MultichoiceListStruct u8 count; }; -extern struct MultichoiceListStruct gMultichoiceLists[]; +extern const struct MultichoiceListStruct gMultichoiceLists[]; extern u16 gScriptResult; @@ -20,6 +20,7 @@ void sub_80B53B4(u8, u8, u8, struct MenuAction *list, u8); void sub_80B52B4(u8); void sub_80B5230(u8, u8, u8, u8, u8, u8); void task_yes_no_maybe(u8); +void sub_80B5684(u8); bool8 sub_80B5054(u8 left, u8 top, u8 var3, u8 var4) { @@ -65,7 +66,7 @@ void DrawMultichoiceMenu(u8 left, u8 top, u8 count, struct MenuAction *list, u8 if(width < newWidth) width = newWidth; } - + right = width; right = (right + left) + 1; @@ -102,14 +103,14 @@ void sub_80B5230(u8 left, u8 top, u8 right, u8 bottom, u8 unkVar, u8 count) void sub_80B52B4(u8 taskId) { s8 var; - + if(!gPaletteFade.active) { if(!gTasks[taskId].data[5]) var = ProcessMenuInputNoWrap(); else var = ProcessMenuInput(); - + if(var != -2) { if(var == -1) @@ -119,8 +120,10 @@ void sub_80B52B4(u8 taskId) PlaySE(5); gScriptResult = 127; } - else - return; + else + { + return; + } } else { @@ -136,14 +139,14 @@ void sub_80B52B4(u8 taskId) bool8 Multichoice(u8 var1, u8 var2, u8 var3, u8 var4) { - if(FuncIsActiveTask(sub_80B52B4) == 1) - return FALSE; - else - { - gScriptResult = 0xFF; - sub_80B53B4(var1, var2, gMultichoiceLists[var3].count, gMultichoiceLists[var3].list, var4); - return TRUE; - } + if(FuncIsActiveTask(sub_80B52B4) == 1) + return FALSE; + else + { + gScriptResult = 0xFF; + sub_80B53B4(var1, var2, gMultichoiceLists[var3].count, gMultichoiceLists[var3].list, var4); + return TRUE; + } } void sub_80B53B4(u8 left, u8 top, u8 count, struct MenuAction *list, u8 var4) @@ -172,28 +175,28 @@ void sub_80B53B4(u8 left, u8 top, u8 count, struct MenuAction *list, u8 var4) bool8 yes_no_box(u8 var1, u8 var2) { - u8 taskId; - - if(FuncIsActiveTask(task_yes_no_maybe) == 1) - return FALSE; - else - { - gScriptResult = 0xFF; - DisplayYesNoMenu(var1, var2, 1); - taskId = CreateTask(task_yes_no_maybe, 0x50); - gTasks[taskId].data[0] = var1; - gTasks[taskId].data[1] = var2; - return TRUE; - } + u8 taskId; + + if(FuncIsActiveTask(task_yes_no_maybe) == 1) + return FALSE; + else + { + gScriptResult = 0xFF; + DisplayYesNoMenu(var1, var2, 1); + taskId = CreateTask(task_yes_no_maybe, 0x50); + gTasks[taskId].data[0] = var1; + gTasks[taskId].data[1] = var2; + return TRUE; + } } // unused bool8 IsScriptActive(void) { - if(gScriptResult == 0xFF) - return FALSE; - else - return TRUE; + if(gScriptResult == 0xFF) + return FALSE; + else + return TRUE; } void task_yes_no_maybe(u8 taskId) @@ -227,3 +230,71 @@ void task_yes_no_maybe(u8 taskId) DestroyTask(taskId); EnableBothScriptContexts(); } + +bool8 sub_80B5578(u8 left, u8 top, u8 multichoiceId, u8 a4, u8 columnCount) +{ + u8 bottom = 0; + + if (FuncIsActiveTask(sub_80B5684) == TRUE) + { + return FALSE; + } + else + { + u8 taskId; + u8 width; + + gScriptResult = 255; + + sub_807274C(left, top, gMultichoiceLists[multichoiceId].count, 0, gMultichoiceLists[multichoiceId].list, columnCount, 0); + + taskId = CreateTask(sub_80B5684, 80); + + if (!((gMultichoiceLists[multichoiceId].count >> 1) < columnCount || (gMultichoiceLists[multichoiceId].count & 1)) + || columnCount == 1 || gMultichoiceLists[multichoiceId].count == columnCount) + { + bottom = (2 * (gMultichoiceLists[multichoiceId].count / columnCount)) + 1 + top; + } + else + { + bottom = (2 * (gMultichoiceLists[multichoiceId].count / columnCount)) + 3 + top; + } + + width = sub_807288C(columnCount); + gTasks[taskId].data[0] = left; + gTasks[taskId].data[1] = top; + gTasks[taskId].data[2] = width + left + 2; + gTasks[taskId].data[3] = bottom; + gTasks[taskId].data[4] = a4; + return TRUE; + } +} + +void sub_80B5684(u8 taskId) +{ + s8 var = sub_80727CC(); + + if (var != -2) + { + if (var == -1) + { + if (!gTasks[taskId].data[4]) + { + PlaySE(5); + gScriptResult = 127; + } + else + { + return; + } + } + else + { + gScriptResult = var; + } + sub_8072DEC(); + MenuZeroFillWindowRect(gTasks[taskId].data[0], gTasks[taskId].data[1], gTasks[taskId].data[2], gTasks[taskId].data[3]); + DestroyTask(taskId); + EnableBothScriptContexts(); + } +} -- cgit v1.2.3 From 9e5c4ef564135e098d7d89c3a980e4077a03b9f8 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Fri, 30 Dec 2016 16:10:47 -0500 Subject: finish decompiling script_menu.c (#142) * begin decompiling script_menu.c * update MultichoiceStructs to use both structs * decompile 2 more functions * decompile more of script_menu.c * do a bit more of script_menu.c * whoops * decompile task_yes_no_maybe * finish decompiling script_menu.c * formatting --- src/script_menu.c | 133 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 132 insertions(+), 1 deletion(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index d351c3fa4..1010435cc 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -4,6 +4,8 @@ #include "palette.h" #include "script.h" #include "sound.h" +#include "flag.h" +#include "sprite.h" struct MultichoiceListStruct { @@ -15,12 +17,24 @@ extern const struct MultichoiceListStruct gMultichoiceLists[]; extern u16 gScriptResult; +extern void FreeResourcesAndDestroySprite(struct Sprite *sprite); +extern u8 CreateMonSprite_PicBox(u16, s16, s16, u8); +extern u8 sub_80B59AC(void); + +extern u8 gPCText_PlayersPC[]; +extern u8 gPCText_SomeonesPC[]; +extern u8 gPCText_HallOfFame[]; +extern u8 gPCText_LogOff[]; +extern u8 gPCText_LanettesPC[]; +extern u8 gPCText_WhichPCShouldBeAccessed[]; + void DrawMultichoiceMenu(u8, u8, u8, struct MenuAction *list, u8, u8); void sub_80B53B4(u8, u8, u8, struct MenuAction *list, u8); void sub_80B52B4(u8); void sub_80B5230(u8, u8, u8, u8, u8, u8); void task_yes_no_maybe(u8); void sub_80B5684(u8); +void CreatePCMenu(void); bool8 sub_80B5054(u8 left, u8 top, u8 var3, u8 var4) { @@ -244,7 +258,7 @@ bool8 sub_80B5578(u8 left, u8 top, u8 multichoiceId, u8 a4, u8 columnCount) u8 taskId; u8 width; - gScriptResult = 255; + gScriptResult = 0xFF; sub_807274C(left, top, gMultichoiceLists[multichoiceId].count, 0, gMultichoiceLists[multichoiceId].list, columnCount, 0); @@ -298,3 +312,120 @@ void sub_80B5684(u8 taskId) EnableBothScriptContexts(); } } + +bool8 TryCreatePCMenu(void) +{ + if(FuncIsActiveTask(sub_80B52B4) == 1) + return FALSE; + else + { + gScriptResult = 0xFF; + CreatePCMenu(); + return TRUE; + } +} + +void CreatePCMenu(void) +{ + u16 playersPCWidth = GetStringWidthInTilesForScriptMenu(gPCText_PlayersPC); + u8 width; + u8 numChoices; + + if(playersPCWidth > GetStringWidthInTilesForScriptMenu(gPCText_SomeonesPC)) + width = playersPCWidth; + else + width = 8; + + if(FlagGet(0x804)) // player has cleared game? + { + numChoices = 4; + MenuDrawTextWindow(0, 0, width + 2, 9); + MenuPrint(gPCText_HallOfFame, 1, 5); + MenuPrint(gPCText_LogOff, 1, 7); + } + else + { + numChoices = 3; + MenuDrawTextWindow(0, 0, width + 2, 7); + MenuPrint(gPCText_LogOff, 1, 5); + } + + if(FlagGet(0x84B)) // player met lanette? + MenuPrint(gPCText_LanettesPC, 1, 1); + else + MenuPrint(gPCText_SomeonesPC, 1, 1); + + MenuPrint(gPCText_PlayersPC, 1, 3); + InitMenu(0, 1, 1, numChoices, 0, width + 1); + sub_80B5230(0, 0, width + 2, 2 * numChoices + 1, 0, numChoices); +} + +void sub_80B5838(void) +{ + MenuDisplayMessageBox(); + MenuPrint(gPCText_WhichPCShouldBeAccessed, 2, 15); +} + +void task_picbox(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + switch(task->data[0]) + { + case 0: + task->data[0]++; + break; + case 1: + break; + case 2: + FreeResourcesAndDestroySprite(&gSprites[task->data[2]]); + task->data[0]++; + break; + case 3: + MenuZeroFillWindowRect(task->data[3], task->data[4], task->data[3] + 9, task->data[4] + 10); + DestroyTask(taskId); + break; + } +} + +bool8 sub_80B58C4(u16 var1, u8 var2, u8 var3) +{ + u8 taskId; + u8 var; + + if(FindTaskIdByFunc(task_picbox) != 0xFF) + return FALSE; + else + { + MenuDrawTextWindow(var2, var3, var2 + 9, var3 + 10); + taskId = CreateTask(task_picbox, 0x50); + gTasks[taskId].data[0] = 0; + gTasks[taskId].data[1] = var1; + var = CreateMonSprite_PicBox(var1, var2 * 8 + 40, var3 * 8 + 40, 0); + gTasks[taskId].data[2] = var; + gTasks[taskId].data[3] = var2; + gTasks[taskId].data[4] = var3; + gSprites[var].callback = SpriteCallbackDummy; + gSprites[var].oam.priority = 0; + return TRUE; + } +} + +void *picbox_close(void) +{ + u8 taskId = FindTaskIdByFunc(task_picbox); + + if(taskId == 0xFF) + return NULL; + + gTasks[taskId].data[0]++; + return (void *)sub_80B59AC; +} + +bool8 sub_80B59AC(void) +{ + if(FindTaskIdByFunc(task_picbox) == 0xFF) + return TRUE; + else + return FALSE; +} -- cgit v1.2.3 From 6983ce9c20821ff70b59b2d18b77aaccbd189f0a Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sun, 1 Jan 2017 22:03:37 -0800 Subject: add flags --- src/script_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index 1010435cc..5c844a6fb 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -336,7 +336,7 @@ void CreatePCMenu(void) else width = 8; - if(FlagGet(0x804)) // player has cleared game? + if(FlagGet(SYS_GAME_CLEAR)) // player has cleared game? { numChoices = 4; MenuDrawTextWindow(0, 0, width + 2, 9); @@ -350,7 +350,7 @@ void CreatePCMenu(void) MenuPrint(gPCText_LogOff, 1, 5); } - if(FlagGet(0x84B)) // player met lanette? + if(FlagGet(SYS_PC_LANETTE)) // player met lanette? MenuPrint(gPCText_LanettesPC, 1, 1); else MenuPrint(gPCText_SomeonesPC, 1, 1); -- cgit v1.2.3 From 145e90483b2a30698f917f62e585aa7fa4794588 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Mon, 2 Jan 2017 00:41:28 -0800 Subject: event_data.c --- src/script_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index 5c844a6fb..c4f0b5292 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -4,7 +4,7 @@ #include "palette.h" #include "script.h" #include "sound.h" -#include "flag.h" +#include "event_data.h" #include "sprite.h" struct MultichoiceListStruct -- cgit v1.2.3 From c9722602cb47eb5b6ecbccddf13df5f286a8ef7b Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Tue, 17 Jan 2017 14:13:04 +0100 Subject: Sort includes --- src/script_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index c4f0b5292..5e1fad808 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1,11 +1,11 @@ #include "global.h" -#include "task.h" +#include "event_data.h" #include "menu.h" #include "palette.h" #include "script.h" #include "sound.h" -#include "event_data.h" #include "sprite.h" +#include "task.h" struct MultichoiceListStruct { -- cgit v1.2.3 From 801877553db80267a62c0c3c0b2805b6716d1ef9 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Tue, 17 Jan 2017 14:38:44 +0100 Subject: Remove trailing whitespace --- src/script_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index 5e1fad808..e1783208c 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -369,7 +369,7 @@ void sub_80B5838(void) void task_picbox(u8 taskId) { struct Task *task = &gTasks[taskId]; - + switch(task->data[0]) { case 0: -- cgit v1.2.3 From bcaab977727ded65c9eeaef9dbef9e9441d26fb7 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 21 Jan 2017 16:48:06 -0800 Subject: formatting --- src/script_menu.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index e1783208c..51230b66b 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -38,7 +38,7 @@ void CreatePCMenu(void); bool8 sub_80B5054(u8 left, u8 top, u8 var3, u8 var4) { - if(FuncIsActiveTask(sub_80B52B4) == 1) + if (FuncIsActiveTask(sub_80B52B4) == 1) return FALSE; else { @@ -50,7 +50,7 @@ bool8 sub_80B5054(u8 left, u8 top, u8 var3, u8 var4) bool8 sub_80B50B0(u8 left, u8 top, u8 var3, u8 var4, u8 var5) { - if(FuncIsActiveTask(sub_80B52B4) == 1) + if (FuncIsActiveTask(sub_80B52B4) == 1) return FALSE; else { @@ -74,17 +74,17 @@ void DrawMultichoiceMenu(u8 left, u8 top, u8 count, struct MenuAction *list, u8 u8 right; u8 bottom; - for(i = 1; i < count; i++) + for (i = 1; i < count; i++) { newWidth = GetStringWidthInTilesForScriptMenu(list[i].text); - if(width < newWidth) + if (width < newWidth) width = newWidth; } right = width; right = (right + left) + 1; - if(right > 29) + if (right > 29) { left = left + (29 - right); right = 29; @@ -108,7 +108,7 @@ void sub_80B5230(u8 left, u8 top, u8 right, u8 bottom, u8 unkVar, u8 count) gTasks[taskId].data[3] = bottom; gTasks[taskId].data[4] = unkVar; - if(count > 3) + if (count > 3) gTasks[taskId].data[5] = TRUE; else gTasks[taskId].data[5] = FALSE; @@ -118,18 +118,18 @@ void sub_80B52B4(u8 taskId) { s8 var; - if(!gPaletteFade.active) + if (!gPaletteFade.active) { - if(!gTasks[taskId].data[5]) + if (!gTasks[taskId].data[5]) var = ProcessMenuInputNoWrap(); else var = ProcessMenuInput(); - if(var != -2) + if (var != -2) { - if(var == -1) + if (var == -1) { - if(!gTasks[taskId].data[4]) + if (!gTasks[taskId].data[4]) { PlaySE(5); gScriptResult = 127; @@ -153,7 +153,7 @@ void sub_80B52B4(u8 taskId) bool8 Multichoice(u8 var1, u8 var2, u8 var3, u8 var4) { - if(FuncIsActiveTask(sub_80B52B4) == 1) + if (FuncIsActiveTask(sub_80B52B4) == 1) return FALSE; else { @@ -171,10 +171,10 @@ void sub_80B53B4(u8 left, u8 top, u8 count, struct MenuAction *list, u8 var4) u8 right; u8 bottom; - for(i = 1; i < count; i++) + for (i = 1; i < count; i++) { newWidth = GetStringWidthInTilesForScriptMenu(list[i].text); - if(width < newWidth) + if (width < newWidth) width = newWidth; } @@ -191,7 +191,7 @@ bool8 yes_no_box(u8 var1, u8 var2) { u8 taskId; - if(FuncIsActiveTask(task_yes_no_maybe) == 1) + if (FuncIsActiveTask(task_yes_no_maybe) == 1) return FALSE; else { @@ -207,7 +207,7 @@ bool8 yes_no_box(u8 var1, u8 var2) // unused bool8 IsScriptActive(void) { - if(gScriptResult == 0xFF) + if (gScriptResult == 0xFF) return FALSE; else return TRUE; @@ -315,7 +315,7 @@ void sub_80B5684(u8 taskId) bool8 TryCreatePCMenu(void) { - if(FuncIsActiveTask(sub_80B52B4) == 1) + if (FuncIsActiveTask(sub_80B52B4) == 1) return FALSE; else { @@ -331,12 +331,12 @@ void CreatePCMenu(void) u8 width; u8 numChoices; - if(playersPCWidth > GetStringWidthInTilesForScriptMenu(gPCText_SomeonesPC)) + if (playersPCWidth > GetStringWidthInTilesForScriptMenu(gPCText_SomeonesPC)) width = playersPCWidth; else width = 8; - if(FlagGet(SYS_GAME_CLEAR)) // player has cleared game? + if (FlagGet(SYS_GAME_CLEAR)) // player has cleared game? { numChoices = 4; MenuDrawTextWindow(0, 0, width + 2, 9); @@ -350,7 +350,7 @@ void CreatePCMenu(void) MenuPrint(gPCText_LogOff, 1, 5); } - if(FlagGet(SYS_PC_LANETTE)) // player met lanette? + if (FlagGet(SYS_PC_LANETTE)) // player met lanette? MenuPrint(gPCText_LanettesPC, 1, 1); else MenuPrint(gPCText_SomeonesPC, 1, 1); @@ -370,7 +370,7 @@ void task_picbox(u8 taskId) { struct Task *task = &gTasks[taskId]; - switch(task->data[0]) + switch (task->data[0]) { case 0: task->data[0]++; @@ -393,7 +393,7 @@ bool8 sub_80B58C4(u16 var1, u8 var2, u8 var3) u8 taskId; u8 var; - if(FindTaskIdByFunc(task_picbox) != 0xFF) + if (FindTaskIdByFunc(task_picbox) != 0xFF) return FALSE; else { @@ -415,7 +415,7 @@ void *picbox_close(void) { u8 taskId = FindTaskIdByFunc(task_picbox); - if(taskId == 0xFF) + if (taskId == 0xFF) return NULL; gTasks[taskId].data[0]++; @@ -424,7 +424,7 @@ void *picbox_close(void) bool8 sub_80B59AC(void) { - if(FindTaskIdByFunc(task_picbox) == 0xFF) + if (FindTaskIdByFunc(task_picbox) == 0xFF) return TRUE; else return FALSE; -- cgit v1.2.3 From 28b5bca0d65756ac7c6d26e995f98178657df6c0 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sat, 18 Mar 2017 03:50:15 +0100 Subject: move multichoice data to script_menu.c --- src/script_menu.c | 583 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 562 insertions(+), 21 deletions(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index 51230b66b..de3dd7269 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -6,35 +6,576 @@ #include "sound.h" #include "sprite.h" #include "task.h" +#include "strings.h" +#include "script_menu.h" -struct MultichoiceListStruct +// multichoice lists +const struct MenuAction MultichoiceList_00[] = { - struct MenuAction *list; - u8 count; + {(u8 *)OtherText_Petalburg, 0}, + {(u8 *)OtherText_Slateport, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; -extern const struct MultichoiceListStruct gMultichoiceLists[]; +const struct MenuAction MultichoiceList_02[] = +{ + {(u8 *)OtherText_Enter, 0}, + {(u8 *)OtherText_Info3, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; -extern u16 gScriptResult; +const struct MenuAction MultichoiceList_03[] = +{ + {(u8 *)OtherText_WhatsAContest, 0}, + {(u8 *)OtherText_TypesOfContest, 0}, + {(u8 *)OtherText_Ranks, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; -extern void FreeResourcesAndDestroySprite(struct Sprite *sprite); -extern u8 CreateMonSprite_PicBox(u16, s16, s16, u8); -extern u8 sub_80B59AC(void); +const struct MenuAction MultichoiceList_04[] = +{ + {(u8 *)OtherText_CoolContest, 0}, + {(u8 *)OtherText_BeautyContest, 0}, + {(u8 *)OtherText_CuteContest, 0}, + {(u8 *)OtherText_SmartContest, 0}, + {(u8 *)OtherText_ToughContest, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_06[] = +{ + {(u8 *)OtherText_Decoration, 0}, + {(u8 *)OtherText_PackUp, 0}, + {(u8 *)OtherText_Registry, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_05[] = +{ + {(u8 *)OtherText_Decoration, 0}, + {(u8 *)OtherText_PackUp, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_07[] = +{ + {(u8 *)OtherText_Register, 0}, + {(u8 *)OtherText_Registry, 0}, + {(u8 *)OtherText_Information, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_12[] = +{ + {(u8 *)OtherText_Mach, 0}, + {(u8 *)OtherText_Acro, 0}, +}; + +const struct MenuAction MultichoiceList_13[] = +{ + {(u8 *)OtherText_Poison, 0}, + {(u8 *)OtherText_Paralysis, 0}, + {(u8 *)OtherText_Sleep, 0}, + {(u8 *)OtherText_Burn, 0}, + {(u8 *)OtherText_Frozen, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_14[] = +{ + {(u8 *)OtherText_Dewford, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_16[] = +{ + {(u8 *)OtherText_SawIt, 0}, + {(u8 *)OtherText_NotYet, 0}, +}; + +const struct MenuAction MultichoiceList_17[] = +{ + {(u8 *)OtherText_Yes, 0}, + {(u8 *)OtherText_No, 0}, + {(u8 *)OtherText_Info3, 0}, +}; + +const struct MenuAction MultichoiceList_18[] = +{ + {(u8 *)OtherText_SingleBattle, 0}, + {(u8 *)OtherText_DoubleBattle, 0}, + {(u8 *)OtherText_MultiBattle, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_19[] = +{ + {(u8 *)OtherText_Littleroot, 0}, + {(u8 *)OtherText_Slateport, 0}, + {(u8 *)OtherText_Lilycove, 0}, +}; + +const struct MenuAction MultichoiceList_20[] = +{ + {(u8 *)OtherText_Yes, 0}, + {(u8 *)OtherText_No, 0}, + {(u8 *)OtherText_Info3, 0}, +}; + +const struct MenuAction MultichoiceList_23[] = +{ + {(u8 *)OtherText_MakeAChallenge, 0}, + {(u8 *)OtherText_ObtainInformation, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_24[] = +{ + {(u8 *)OtherText_Lv50_2, 0}, + {(u8 *)OtherText_Lv100_2, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_25[] = +{ + {(u8 *)OtherText_Zigzagoon, 0}, + {(u8 *)OtherText_Nincada, 0}, + {(u8 *)OtherText_Poochyena, 0}, +}; + +const struct MenuAction MultichoiceList_26[] = +{ + {(u8 *)OtherText_Nincada2, 0}, + {(u8 *)OtherText_Lotad, 0}, + {(u8 *)OtherText_Roselia, 0}, +}; + +const struct MenuAction MultichoiceList_27[] = +{ + {(u8 *)OtherText_Shroomish, 0}, + {(u8 *)OtherText_Nincada3, 0}, + {(u8 *)OtherText_Surskit, 0}, +}; + +const struct MenuAction MultichoiceList_28[] = +{ + {(u8 *)OtherText_Treecko, 0}, + {(u8 *)OtherText_Torchic, 0}, + {(u8 *)OtherText_Mudkip, 0}, +}; + +const struct MenuAction MultichoiceList_29[] = +{ + {(u8 *)OtherText_Seedot, 0}, + {(u8 *)OtherText_Shroomish2, 0}, + {(u8 *)OtherText_Spinda, 0}, +}; + +const struct MenuAction MultichoiceList_30[] = +{ + {(u8 *)OtherText_Shroomish3, 0}, + {(u8 *)OtherText_Zigzagoon2, 0}, + {(u8 *)OtherText_Wurmple, 0}, +}; + +const struct MenuAction MultichoiceList_31[] = +{ + {(u8 *)OtherText_PokeBall, 0}, + {(u8 *)OtherText_SuperPotion, 0}, + {(u8 *)OtherText_SamePrice, 0}, +}; + +const struct MenuAction MultichoiceList_32[] = +{ + {(u8 *)OtherText_Yen135, 0}, + {(u8 *)OtherText_Yen155, 0}, + {(u8 *)OtherText_Yen175, 0}, +}; + +const struct MenuAction MultichoiceList_33[] = +{ + {(u8 *)OtherText_CostMore, 0}, + {(u8 *)OtherText_CostLess, 0}, + {(u8 *)OtherText_SamePrice2, 0}, +}; + +const struct MenuAction MultichoiceList_34[] = +{ + {(u8 *)OtherText_MaleSymbol, 0}, + {(u8 *)OtherText_FemaleSymbol, 0}, + {(u8 *)OtherText_Neither, 0}, +}; + +const struct MenuAction MultichoiceList_35[] = +{ + {(u8 *)OtherText_Males, 0}, + {(u8 *)OtherText_Females, 0}, + {(u8 *)OtherText_SameNumber, 0}, +}; + +const struct MenuAction MultichoiceList_36[] = +{ + {(u8 *)OtherText_Male, 0}, + {(u8 *)OtherText_Female, 0}, + {(u8 *)OtherText_ItDepends, 0}, +}; + +const struct MenuAction MultichoiceList_37[] = +{ + {(u8 *)OtherText_Six2, 0}, + {(u8 *)OtherText_Eight2, 0}, + {(u8 *)OtherText_Ten, 0}, +}; + +const struct MenuAction MultichoiceList_38[] = +{ + {(u8 *)OtherText_One, 0}, + {(u8 *)OtherText_Two, 0}, + {(u8 *)OtherText_Three, 0}, +}; + +const struct MenuAction MultichoiceList_39[] = +{ + {(u8 *)OtherText_Six, 0}, + {(u8 *)OtherText_Seven, 0}, + {(u8 *)OtherText_Eight, 0}, +}; + +const struct MenuAction MultichoiceList_42[] = +{ + {(u8 *)OtherText_FreshWater, 0}, + {(u8 *)OtherText_SodaPop, 0}, + {(u8 *)OtherText_Lemonade, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_43[] = +{ + {(u8 *)OtherText_HowToRide, 0}, + {(u8 *)OtherText_HowToTurn, 0}, + {(u8 *)OtherText_SandySlopes, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_44[] = +{ + {(u8 *)OtherText_Wheelies, 0}, + {(u8 *)OtherText_BunnyHops, 0}, + {(u8 *)OtherText_Jumping, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_45[] = +{ + {(u8 *)OtherText_Satisfied, 0}, + {(u8 *)OtherText_Dissatisfied, 0}, +}; + +const struct MenuAction MultichoiceList_46[] = +{ + {(u8 *)OtherText_Deepseatooth, 0}, + {(u8 *)OtherText_Deepseascale, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_47[] = +{ + {(u8 *)OtherText_BlueFlute2, 0}, + {(u8 *)OtherText_YellowFlute2, 0}, + {(u8 *)OtherText_RedFlute2, 0}, + {(u8 *)OtherText_WhiteFlute2, 0}, + {(u8 *)OtherText_BlackFlute2, 0}, + {(u8 *)OtherText_GlassChair, 0}, + {(u8 *)OtherText_GlassDesk, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_48[] = +{ + {(u8 *)OtherText_TreeckoDoll, 0}, + {(u8 *)OtherText_TorchicDoll, 0}, + {(u8 *)OtherText_MudkipDoll, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_55[] = +{ + {(u8 *)OtherText_TM32, 0}, + {(u8 *)OtherText_TM29, 0}, + {(u8 *)OtherText_TM35, 0}, + {(u8 *)OtherText_TM24, 0}, + {(u8 *)OtherText_TM13, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_49[] = +{ + {(u8 *)OtherText_50Coins, 0}, + {(u8 *)OtherText_500Coins, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_50[] = +{ + {(u8 *)OtherText_Excellent, 0}, + {(u8 *)OtherText_NotSoHot, 0}, +}; + +const struct MenuAction MultichoiceList_52[] = +{ + {(u8 *)OtherText_Lilycove, 0}, + {(u8 *)OtherText_BattleTower, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_53[] = +{ + {(u8 *)OtherText_Slateport, 0}, + {(u8 *)OtherText_Lilycove, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_54[] = +{ + {(u8 *)OtherText_Right, 0}, + {(u8 *)OtherText_Left, 0}, +}; + +const struct MenuAction MultichoiceList_56[] = +{ + {(u8 *)OtherText_Slateport, 0}, + {(u8 *)OtherText_BattleTower, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_57[] = +{ + {(u8 *)OtherText_1F_2, 0}, + {(u8 *)OtherText_2F_2, 0}, + {(u8 *)OtherText_3F_2, 0}, + {(u8 *)OtherText_4F_2, 0}, + {(u8 *)OtherText_5F_2, 0}, +}; + +const struct MenuAction MultichoiceList_58[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_59[] = +{ + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_60[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_61[] = +{ + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_62[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_63[] = +{ + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_64[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_65[] = +{ + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_66[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_67[] = +{ + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_68[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_69[] = +{ + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_70[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_71[] = +{ + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_72[] = +{ + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MenuAction MultichoiceList_01[] = +{ + {(u8 *)gOtherText_CancelNoTerminator, 0}, +}; + +const struct MultichoiceListStruct gMultichoiceLists[] = +{ + {(struct MenuAction *)MultichoiceList_00, 3}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_02, 3}, + {(struct MenuAction *)MultichoiceList_03, 4}, + {(struct MenuAction *)MultichoiceList_04, 6}, + {(struct MenuAction *)MultichoiceList_05, 3}, + {(struct MenuAction *)MultichoiceList_06, 4}, + {(struct MenuAction *)MultichoiceList_07, 4}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_12, 2}, + {(struct MenuAction *)MultichoiceList_13, 6}, + {(struct MenuAction *)MultichoiceList_14, 2}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_16, 2}, + {(struct MenuAction *)MultichoiceList_17, 3}, + {(struct MenuAction *)MultichoiceList_18, 4}, + {(struct MenuAction *)MultichoiceList_19, 3}, + {(struct MenuAction *)MultichoiceList_20, 3}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_23, 3}, + {(struct MenuAction *)MultichoiceList_24, 3}, + {(struct MenuAction *)MultichoiceList_25, 3}, + {(struct MenuAction *)MultichoiceList_26, 3}, + {(struct MenuAction *)MultichoiceList_27, 3}, + {(struct MenuAction *)MultichoiceList_28, 3}, + {(struct MenuAction *)MultichoiceList_29, 3}, + {(struct MenuAction *)MultichoiceList_30, 3}, + {(struct MenuAction *)MultichoiceList_31, 3}, + {(struct MenuAction *)MultichoiceList_32, 3}, + {(struct MenuAction *)MultichoiceList_33, 3}, + {(struct MenuAction *)MultichoiceList_34, 3}, + {(struct MenuAction *)MultichoiceList_35, 3}, + {(struct MenuAction *)MultichoiceList_36, 3}, + {(struct MenuAction *)MultichoiceList_37, 3}, + {(struct MenuAction *)MultichoiceList_38, 3}, + {(struct MenuAction *)MultichoiceList_39, 3}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_42, 4}, + {(struct MenuAction *)MultichoiceList_43, 4}, + {(struct MenuAction *)MultichoiceList_44, 4}, + {(struct MenuAction *)MultichoiceList_45, 2}, + {(struct MenuAction *)MultichoiceList_46, 3}, + {(struct MenuAction *)MultichoiceList_47, 8}, + {(struct MenuAction *)MultichoiceList_48, 4}, + {(struct MenuAction *)MultichoiceList_49, 3}, + {(struct MenuAction *)MultichoiceList_50, 2}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_52, 3}, + {(struct MenuAction *)MultichoiceList_53, 3}, + {(struct MenuAction *)MultichoiceList_54, 2}, + {(struct MenuAction *)MultichoiceList_55, 6}, + {(struct MenuAction *)MultichoiceList_56, 3}, + {(struct MenuAction *)MultichoiceList_57, 5}, + {(struct MenuAction *)MultichoiceList_58, 2}, + {(struct MenuAction *)MultichoiceList_59, 2}, + {(struct MenuAction *)MultichoiceList_60, 3}, + {(struct MenuAction *)MultichoiceList_61, 2}, + {(struct MenuAction *)MultichoiceList_62, 3}, + {(struct MenuAction *)MultichoiceList_63, 3}, + {(struct MenuAction *)MultichoiceList_64, 4}, + {(struct MenuAction *)MultichoiceList_65, 2}, + {(struct MenuAction *)MultichoiceList_66, 3}, + {(struct MenuAction *)MultichoiceList_67, 3}, + {(struct MenuAction *)MultichoiceList_68, 4}, + {(struct MenuAction *)MultichoiceList_69, 3}, + {(struct MenuAction *)MultichoiceList_70, 4}, + {(struct MenuAction *)MultichoiceList_71, 4}, + {(struct MenuAction *)MultichoiceList_72, 5} +}; + +const struct TextStruct gUnknown_083CE048[] = +{ + OtherText_Cool2, + OtherText_Beauty3, + OtherText_Cute2, + OtherText_Smart2, + OtherText_Tough2, + OtherText_Normal, + OtherText_Super, + OtherText_Hyper, + OtherText_Master, + OtherText_Cool3, + OtherText_Beauty4, + OtherText_Cute3, + OtherText_Smart3, + OtherText_Tough3, + OtherText_Items, + OtherText_KeyItems, + OtherText_Balls, + OtherText_TMsHMs, + OtherText_Berries, +}; -extern u8 gPCText_PlayersPC[]; -extern u8 gPCText_SomeonesPC[]; -extern u8 gPCText_HallOfFame[]; -extern u8 gPCText_LogOff[]; -extern u8 gPCText_LanettesPC[]; extern u8 gPCText_WhichPCShouldBeAccessed[]; -void DrawMultichoiceMenu(u8, u8, u8, struct MenuAction *list, u8, u8); -void sub_80B53B4(u8, u8, u8, struct MenuAction *list, u8); -void sub_80B52B4(u8); -void sub_80B5230(u8, u8, u8, u8, u8, u8); -void task_yes_no_maybe(u8); -void sub_80B5684(u8); -void CreatePCMenu(void); +extern u16 gScriptResult; + +// field_effect +extern void FreeResourcesAndDestroySprite(struct Sprite *sprite); +extern u8 CreateMonSprite_PicBox(u16, s16, s16, u8); bool8 sub_80B5054(u8 left, u8 top, u8 var3, u8 var4) { @@ -60,7 +601,7 @@ bool8 sub_80B50B0(u8 left, u8 top, u8 var3, u8 var4, u8 var5) } } -u16 GetStringWidthInTilesForScriptMenu(u8 *str) +u16 GetStringWidthInTilesForScriptMenu(const u8 *str) { // each tile on screen is 8x8, so it needs the number of tiles and not pixels, hence the division by 8. return (GetStringWidthGivenWindowConfig((struct WindowConfig *)&gWindowConfig_81E6CE4, str) + 7) / 8; -- cgit v1.2.3 From ddc846fa6a0d9a13cfba6f52488a66f6f4562a2d Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Thu, 27 Apr 2017 15:43:31 +0200 Subject: Sort includes --- src/script_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index de3dd7269..22afadbce 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1,13 +1,13 @@ #include "global.h" +#include "script_menu.h" #include "event_data.h" #include "menu.h" #include "palette.h" #include "script.h" #include "sound.h" #include "sprite.h" -#include "task.h" #include "strings.h" -#include "script_menu.h" +#include "task.h" // multichoice lists const struct MenuAction MultichoiceList_00[] = -- cgit v1.2.3 From 6b5f5b95bdac53ab4abd93302897d02118738561 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 5 May 2017 16:21:11 +0200 Subject: Convert tabs to spaces --- src/script_menu.c | 598 +++++++++++++++++++++++++++--------------------------- 1 file changed, 299 insertions(+), 299 deletions(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index 22afadbce..eba438397 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -12,561 +12,561 @@ // multichoice lists const struct MenuAction MultichoiceList_00[] = { - {(u8 *)OtherText_Petalburg, 0}, - {(u8 *)OtherText_Slateport, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_Petalburg, 0}, + {(u8 *)OtherText_Slateport, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_02[] = { - {(u8 *)OtherText_Enter, 0}, - {(u8 *)OtherText_Info3, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_Enter, 0}, + {(u8 *)OtherText_Info3, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_03[] = { - {(u8 *)OtherText_WhatsAContest, 0}, - {(u8 *)OtherText_TypesOfContest, 0}, - {(u8 *)OtherText_Ranks, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_WhatsAContest, 0}, + {(u8 *)OtherText_TypesOfContest, 0}, + {(u8 *)OtherText_Ranks, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_04[] = { - {(u8 *)OtherText_CoolContest, 0}, - {(u8 *)OtherText_BeautyContest, 0}, - {(u8 *)OtherText_CuteContest, 0}, - {(u8 *)OtherText_SmartContest, 0}, - {(u8 *)OtherText_ToughContest, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_CoolContest, 0}, + {(u8 *)OtherText_BeautyContest, 0}, + {(u8 *)OtherText_CuteContest, 0}, + {(u8 *)OtherText_SmartContest, 0}, + {(u8 *)OtherText_ToughContest, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_06[] = { - {(u8 *)OtherText_Decoration, 0}, - {(u8 *)OtherText_PackUp, 0}, - {(u8 *)OtherText_Registry, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_Decoration, 0}, + {(u8 *)OtherText_PackUp, 0}, + {(u8 *)OtherText_Registry, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_05[] = { - {(u8 *)OtherText_Decoration, 0}, - {(u8 *)OtherText_PackUp, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_Decoration, 0}, + {(u8 *)OtherText_PackUp, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_07[] = { - {(u8 *)OtherText_Register, 0}, - {(u8 *)OtherText_Registry, 0}, - {(u8 *)OtherText_Information, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_Register, 0}, + {(u8 *)OtherText_Registry, 0}, + {(u8 *)OtherText_Information, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_12[] = { - {(u8 *)OtherText_Mach, 0}, - {(u8 *)OtherText_Acro, 0}, + {(u8 *)OtherText_Mach, 0}, + {(u8 *)OtherText_Acro, 0}, }; const struct MenuAction MultichoiceList_13[] = { - {(u8 *)OtherText_Poison, 0}, - {(u8 *)OtherText_Paralysis, 0}, - {(u8 *)OtherText_Sleep, 0}, - {(u8 *)OtherText_Burn, 0}, - {(u8 *)OtherText_Frozen, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_Poison, 0}, + {(u8 *)OtherText_Paralysis, 0}, + {(u8 *)OtherText_Sleep, 0}, + {(u8 *)OtherText_Burn, 0}, + {(u8 *)OtherText_Frozen, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_14[] = { - {(u8 *)OtherText_Dewford, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_Dewford, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_16[] = { - {(u8 *)OtherText_SawIt, 0}, - {(u8 *)OtherText_NotYet, 0}, + {(u8 *)OtherText_SawIt, 0}, + {(u8 *)OtherText_NotYet, 0}, }; const struct MenuAction MultichoiceList_17[] = { - {(u8 *)OtherText_Yes, 0}, - {(u8 *)OtherText_No, 0}, - {(u8 *)OtherText_Info3, 0}, + {(u8 *)OtherText_Yes, 0}, + {(u8 *)OtherText_No, 0}, + {(u8 *)OtherText_Info3, 0}, }; const struct MenuAction MultichoiceList_18[] = { - {(u8 *)OtherText_SingleBattle, 0}, - {(u8 *)OtherText_DoubleBattle, 0}, - {(u8 *)OtherText_MultiBattle, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_SingleBattle, 0}, + {(u8 *)OtherText_DoubleBattle, 0}, + {(u8 *)OtherText_MultiBattle, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_19[] = { - {(u8 *)OtherText_Littleroot, 0}, - {(u8 *)OtherText_Slateport, 0}, - {(u8 *)OtherText_Lilycove, 0}, + {(u8 *)OtherText_Littleroot, 0}, + {(u8 *)OtherText_Slateport, 0}, + {(u8 *)OtherText_Lilycove, 0}, }; const struct MenuAction MultichoiceList_20[] = { - {(u8 *)OtherText_Yes, 0}, - {(u8 *)OtherText_No, 0}, - {(u8 *)OtherText_Info3, 0}, + {(u8 *)OtherText_Yes, 0}, + {(u8 *)OtherText_No, 0}, + {(u8 *)OtherText_Info3, 0}, }; const struct MenuAction MultichoiceList_23[] = { - {(u8 *)OtherText_MakeAChallenge, 0}, - {(u8 *)OtherText_ObtainInformation, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_MakeAChallenge, 0}, + {(u8 *)OtherText_ObtainInformation, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_24[] = { - {(u8 *)OtherText_Lv50_2, 0}, - {(u8 *)OtherText_Lv100_2, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_Lv50_2, 0}, + {(u8 *)OtherText_Lv100_2, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_25[] = { - {(u8 *)OtherText_Zigzagoon, 0}, - {(u8 *)OtherText_Nincada, 0}, - {(u8 *)OtherText_Poochyena, 0}, + {(u8 *)OtherText_Zigzagoon, 0}, + {(u8 *)OtherText_Nincada, 0}, + {(u8 *)OtherText_Poochyena, 0}, }; const struct MenuAction MultichoiceList_26[] = { - {(u8 *)OtherText_Nincada2, 0}, - {(u8 *)OtherText_Lotad, 0}, - {(u8 *)OtherText_Roselia, 0}, + {(u8 *)OtherText_Nincada2, 0}, + {(u8 *)OtherText_Lotad, 0}, + {(u8 *)OtherText_Roselia, 0}, }; const struct MenuAction MultichoiceList_27[] = { - {(u8 *)OtherText_Shroomish, 0}, - {(u8 *)OtherText_Nincada3, 0}, - {(u8 *)OtherText_Surskit, 0}, + {(u8 *)OtherText_Shroomish, 0}, + {(u8 *)OtherText_Nincada3, 0}, + {(u8 *)OtherText_Surskit, 0}, }; const struct MenuAction MultichoiceList_28[] = { - {(u8 *)OtherText_Treecko, 0}, - {(u8 *)OtherText_Torchic, 0}, - {(u8 *)OtherText_Mudkip, 0}, + {(u8 *)OtherText_Treecko, 0}, + {(u8 *)OtherText_Torchic, 0}, + {(u8 *)OtherText_Mudkip, 0}, }; const struct MenuAction MultichoiceList_29[] = { - {(u8 *)OtherText_Seedot, 0}, - {(u8 *)OtherText_Shroomish2, 0}, - {(u8 *)OtherText_Spinda, 0}, + {(u8 *)OtherText_Seedot, 0}, + {(u8 *)OtherText_Shroomish2, 0}, + {(u8 *)OtherText_Spinda, 0}, }; const struct MenuAction MultichoiceList_30[] = { - {(u8 *)OtherText_Shroomish3, 0}, - {(u8 *)OtherText_Zigzagoon2, 0}, - {(u8 *)OtherText_Wurmple, 0}, + {(u8 *)OtherText_Shroomish3, 0}, + {(u8 *)OtherText_Zigzagoon2, 0}, + {(u8 *)OtherText_Wurmple, 0}, }; const struct MenuAction MultichoiceList_31[] = { - {(u8 *)OtherText_PokeBall, 0}, - {(u8 *)OtherText_SuperPotion, 0}, - {(u8 *)OtherText_SamePrice, 0}, + {(u8 *)OtherText_PokeBall, 0}, + {(u8 *)OtherText_SuperPotion, 0}, + {(u8 *)OtherText_SamePrice, 0}, }; const struct MenuAction MultichoiceList_32[] = { - {(u8 *)OtherText_Yen135, 0}, - {(u8 *)OtherText_Yen155, 0}, - {(u8 *)OtherText_Yen175, 0}, + {(u8 *)OtherText_Yen135, 0}, + {(u8 *)OtherText_Yen155, 0}, + {(u8 *)OtherText_Yen175, 0}, }; const struct MenuAction MultichoiceList_33[] = { - {(u8 *)OtherText_CostMore, 0}, - {(u8 *)OtherText_CostLess, 0}, - {(u8 *)OtherText_SamePrice2, 0}, + {(u8 *)OtherText_CostMore, 0}, + {(u8 *)OtherText_CostLess, 0}, + {(u8 *)OtherText_SamePrice2, 0}, }; const struct MenuAction MultichoiceList_34[] = { - {(u8 *)OtherText_MaleSymbol, 0}, - {(u8 *)OtherText_FemaleSymbol, 0}, - {(u8 *)OtherText_Neither, 0}, + {(u8 *)OtherText_MaleSymbol, 0}, + {(u8 *)OtherText_FemaleSymbol, 0}, + {(u8 *)OtherText_Neither, 0}, }; const struct MenuAction MultichoiceList_35[] = { - {(u8 *)OtherText_Males, 0}, - {(u8 *)OtherText_Females, 0}, - {(u8 *)OtherText_SameNumber, 0}, + {(u8 *)OtherText_Males, 0}, + {(u8 *)OtherText_Females, 0}, + {(u8 *)OtherText_SameNumber, 0}, }; const struct MenuAction MultichoiceList_36[] = { - {(u8 *)OtherText_Male, 0}, - {(u8 *)OtherText_Female, 0}, - {(u8 *)OtherText_ItDepends, 0}, + {(u8 *)OtherText_Male, 0}, + {(u8 *)OtherText_Female, 0}, + {(u8 *)OtherText_ItDepends, 0}, }; const struct MenuAction MultichoiceList_37[] = { - {(u8 *)OtherText_Six2, 0}, - {(u8 *)OtherText_Eight2, 0}, - {(u8 *)OtherText_Ten, 0}, + {(u8 *)OtherText_Six2, 0}, + {(u8 *)OtherText_Eight2, 0}, + {(u8 *)OtherText_Ten, 0}, }; const struct MenuAction MultichoiceList_38[] = { - {(u8 *)OtherText_One, 0}, - {(u8 *)OtherText_Two, 0}, - {(u8 *)OtherText_Three, 0}, + {(u8 *)OtherText_One, 0}, + {(u8 *)OtherText_Two, 0}, + {(u8 *)OtherText_Three, 0}, }; const struct MenuAction MultichoiceList_39[] = { - {(u8 *)OtherText_Six, 0}, - {(u8 *)OtherText_Seven, 0}, - {(u8 *)OtherText_Eight, 0}, + {(u8 *)OtherText_Six, 0}, + {(u8 *)OtherText_Seven, 0}, + {(u8 *)OtherText_Eight, 0}, }; const struct MenuAction MultichoiceList_42[] = { - {(u8 *)OtherText_FreshWater, 0}, - {(u8 *)OtherText_SodaPop, 0}, - {(u8 *)OtherText_Lemonade, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_FreshWater, 0}, + {(u8 *)OtherText_SodaPop, 0}, + {(u8 *)OtherText_Lemonade, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_43[] = { - {(u8 *)OtherText_HowToRide, 0}, - {(u8 *)OtherText_HowToTurn, 0}, - {(u8 *)OtherText_SandySlopes, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_HowToRide, 0}, + {(u8 *)OtherText_HowToTurn, 0}, + {(u8 *)OtherText_SandySlopes, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_44[] = { - {(u8 *)OtherText_Wheelies, 0}, - {(u8 *)OtherText_BunnyHops, 0}, - {(u8 *)OtherText_Jumping, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_Wheelies, 0}, + {(u8 *)OtherText_BunnyHops, 0}, + {(u8 *)OtherText_Jumping, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_45[] = { - {(u8 *)OtherText_Satisfied, 0}, - {(u8 *)OtherText_Dissatisfied, 0}, + {(u8 *)OtherText_Satisfied, 0}, + {(u8 *)OtherText_Dissatisfied, 0}, }; const struct MenuAction MultichoiceList_46[] = { - {(u8 *)OtherText_Deepseatooth, 0}, - {(u8 *)OtherText_Deepseascale, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_Deepseatooth, 0}, + {(u8 *)OtherText_Deepseascale, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_47[] = { - {(u8 *)OtherText_BlueFlute2, 0}, - {(u8 *)OtherText_YellowFlute2, 0}, - {(u8 *)OtherText_RedFlute2, 0}, - {(u8 *)OtherText_WhiteFlute2, 0}, - {(u8 *)OtherText_BlackFlute2, 0}, - {(u8 *)OtherText_GlassChair, 0}, - {(u8 *)OtherText_GlassDesk, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_BlueFlute2, 0}, + {(u8 *)OtherText_YellowFlute2, 0}, + {(u8 *)OtherText_RedFlute2, 0}, + {(u8 *)OtherText_WhiteFlute2, 0}, + {(u8 *)OtherText_BlackFlute2, 0}, + {(u8 *)OtherText_GlassChair, 0}, + {(u8 *)OtherText_GlassDesk, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_48[] = { - {(u8 *)OtherText_TreeckoDoll, 0}, - {(u8 *)OtherText_TorchicDoll, 0}, - {(u8 *)OtherText_MudkipDoll, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_TreeckoDoll, 0}, + {(u8 *)OtherText_TorchicDoll, 0}, + {(u8 *)OtherText_MudkipDoll, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_55[] = { - {(u8 *)OtherText_TM32, 0}, - {(u8 *)OtherText_TM29, 0}, - {(u8 *)OtherText_TM35, 0}, - {(u8 *)OtherText_TM24, 0}, - {(u8 *)OtherText_TM13, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_TM32, 0}, + {(u8 *)OtherText_TM29, 0}, + {(u8 *)OtherText_TM35, 0}, + {(u8 *)OtherText_TM24, 0}, + {(u8 *)OtherText_TM13, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_49[] = { - {(u8 *)OtherText_50Coins, 0}, - {(u8 *)OtherText_500Coins, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_50Coins, 0}, + {(u8 *)OtherText_500Coins, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_50[] = { - {(u8 *)OtherText_Excellent, 0}, - {(u8 *)OtherText_NotSoHot, 0}, + {(u8 *)OtherText_Excellent, 0}, + {(u8 *)OtherText_NotSoHot, 0}, }; const struct MenuAction MultichoiceList_52[] = { - {(u8 *)OtherText_Lilycove, 0}, - {(u8 *)OtherText_BattleTower, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_Lilycove, 0}, + {(u8 *)OtherText_BattleTower, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_53[] = { - {(u8 *)OtherText_Slateport, 0}, - {(u8 *)OtherText_Lilycove, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_Slateport, 0}, + {(u8 *)OtherText_Lilycove, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_54[] = { - {(u8 *)OtherText_Right, 0}, - {(u8 *)OtherText_Left, 0}, + {(u8 *)OtherText_Right, 0}, + {(u8 *)OtherText_Left, 0}, }; const struct MenuAction MultichoiceList_56[] = { - {(u8 *)OtherText_Slateport, 0}, - {(u8 *)OtherText_BattleTower, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_Slateport, 0}, + {(u8 *)OtherText_BattleTower, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_57[] = { - {(u8 *)OtherText_1F_2, 0}, - {(u8 *)OtherText_2F_2, 0}, - {(u8 *)OtherText_3F_2, 0}, - {(u8 *)OtherText_4F_2, 0}, - {(u8 *)OtherText_5F_2, 0}, + {(u8 *)OtherText_1F_2, 0}, + {(u8 *)OtherText_2F_2, 0}, + {(u8 *)OtherText_3F_2, 0}, + {(u8 *)OtherText_4F_2, 0}, + {(u8 *)OtherText_5F_2, 0}, }; const struct MenuAction MultichoiceList_58[] = { - {(u8 *)OtherText_RedShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_59[] = { - {(u8 *)OtherText_YellowShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_60[] = { - {(u8 *)OtherText_RedShard, 0}, - {(u8 *)OtherText_YellowShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_61[] = { - {(u8 *)OtherText_BlueShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_62[] = { - {(u8 *)OtherText_RedShard, 0}, - {(u8 *)OtherText_BlueShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_63[] = { - {(u8 *)OtherText_YellowShard, 0}, - {(u8 *)OtherText_BlueShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_64[] = { - {(u8 *)OtherText_RedShard, 0}, - {(u8 *)OtherText_YellowShard, 0}, - {(u8 *)OtherText_BlueShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_65[] = { - {(u8 *)OtherText_GreenShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_66[] = { - {(u8 *)OtherText_RedShard, 0}, - {(u8 *)OtherText_GreenShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_67[] = { - {(u8 *)OtherText_YellowShard, 0}, - {(u8 *)OtherText_GreenShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_68[] = { - {(u8 *)OtherText_RedShard, 0}, - {(u8 *)OtherText_YellowShard, 0}, - {(u8 *)OtherText_GreenShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_69[] = { - {(u8 *)OtherText_BlueShard, 0}, - {(u8 *)OtherText_GreenShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_70[] = { - {(u8 *)OtherText_RedShard, 0}, - {(u8 *)OtherText_BlueShard, 0}, - {(u8 *)OtherText_GreenShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_71[] = { - {(u8 *)OtherText_YellowShard, 0}, - {(u8 *)OtherText_BlueShard, 0}, - {(u8 *)OtherText_GreenShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_72[] = { - {(u8 *)OtherText_RedShard, 0}, - {(u8 *)OtherText_YellowShard, 0}, - {(u8 *)OtherText_BlueShard, 0}, - {(u8 *)OtherText_GreenShard, 0}, - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)OtherText_RedShard, 0}, + {(u8 *)OtherText_YellowShard, 0}, + {(u8 *)OtherText_BlueShard, 0}, + {(u8 *)OtherText_GreenShard, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MenuAction MultichoiceList_01[] = { - {(u8 *)gOtherText_CancelNoTerminator, 0}, + {(u8 *)gOtherText_CancelNoTerminator, 0}, }; const struct MultichoiceListStruct gMultichoiceLists[] = { - {(struct MenuAction *)MultichoiceList_00, 3}, - {(struct MenuAction *)MultichoiceList_01, 1}, - {(struct MenuAction *)MultichoiceList_02, 3}, - {(struct MenuAction *)MultichoiceList_03, 4}, - {(struct MenuAction *)MultichoiceList_04, 6}, - {(struct MenuAction *)MultichoiceList_05, 3}, - {(struct MenuAction *)MultichoiceList_06, 4}, - {(struct MenuAction *)MultichoiceList_07, 4}, - {(struct MenuAction *)MultichoiceList_01, 1}, - {(struct MenuAction *)MultichoiceList_01, 1}, - {(struct MenuAction *)MultichoiceList_01, 1}, - {(struct MenuAction *)MultichoiceList_01, 1}, - {(struct MenuAction *)MultichoiceList_12, 2}, - {(struct MenuAction *)MultichoiceList_13, 6}, - {(struct MenuAction *)MultichoiceList_14, 2}, - {(struct MenuAction *)MultichoiceList_01, 1}, - {(struct MenuAction *)MultichoiceList_16, 2}, - {(struct MenuAction *)MultichoiceList_17, 3}, - {(struct MenuAction *)MultichoiceList_18, 4}, - {(struct MenuAction *)MultichoiceList_19, 3}, - {(struct MenuAction *)MultichoiceList_20, 3}, - {(struct MenuAction *)MultichoiceList_01, 1}, - {(struct MenuAction *)MultichoiceList_01, 1}, - {(struct MenuAction *)MultichoiceList_23, 3}, - {(struct MenuAction *)MultichoiceList_24, 3}, - {(struct MenuAction *)MultichoiceList_25, 3}, - {(struct MenuAction *)MultichoiceList_26, 3}, - {(struct MenuAction *)MultichoiceList_27, 3}, - {(struct MenuAction *)MultichoiceList_28, 3}, - {(struct MenuAction *)MultichoiceList_29, 3}, - {(struct MenuAction *)MultichoiceList_30, 3}, - {(struct MenuAction *)MultichoiceList_31, 3}, - {(struct MenuAction *)MultichoiceList_32, 3}, - {(struct MenuAction *)MultichoiceList_33, 3}, - {(struct MenuAction *)MultichoiceList_34, 3}, - {(struct MenuAction *)MultichoiceList_35, 3}, - {(struct MenuAction *)MultichoiceList_36, 3}, - {(struct MenuAction *)MultichoiceList_37, 3}, - {(struct MenuAction *)MultichoiceList_38, 3}, - {(struct MenuAction *)MultichoiceList_39, 3}, - {(struct MenuAction *)MultichoiceList_01, 1}, - {(struct MenuAction *)MultichoiceList_01, 1}, - {(struct MenuAction *)MultichoiceList_42, 4}, - {(struct MenuAction *)MultichoiceList_43, 4}, - {(struct MenuAction *)MultichoiceList_44, 4}, - {(struct MenuAction *)MultichoiceList_45, 2}, - {(struct MenuAction *)MultichoiceList_46, 3}, - {(struct MenuAction *)MultichoiceList_47, 8}, - {(struct MenuAction *)MultichoiceList_48, 4}, - {(struct MenuAction *)MultichoiceList_49, 3}, - {(struct MenuAction *)MultichoiceList_50, 2}, - {(struct MenuAction *)MultichoiceList_01, 1}, - {(struct MenuAction *)MultichoiceList_52, 3}, - {(struct MenuAction *)MultichoiceList_53, 3}, - {(struct MenuAction *)MultichoiceList_54, 2}, - {(struct MenuAction *)MultichoiceList_55, 6}, - {(struct MenuAction *)MultichoiceList_56, 3}, - {(struct MenuAction *)MultichoiceList_57, 5}, - {(struct MenuAction *)MultichoiceList_58, 2}, - {(struct MenuAction *)MultichoiceList_59, 2}, - {(struct MenuAction *)MultichoiceList_60, 3}, - {(struct MenuAction *)MultichoiceList_61, 2}, - {(struct MenuAction *)MultichoiceList_62, 3}, - {(struct MenuAction *)MultichoiceList_63, 3}, - {(struct MenuAction *)MultichoiceList_64, 4}, - {(struct MenuAction *)MultichoiceList_65, 2}, - {(struct MenuAction *)MultichoiceList_66, 3}, - {(struct MenuAction *)MultichoiceList_67, 3}, - {(struct MenuAction *)MultichoiceList_68, 4}, - {(struct MenuAction *)MultichoiceList_69, 3}, - {(struct MenuAction *)MultichoiceList_70, 4}, - {(struct MenuAction *)MultichoiceList_71, 4}, - {(struct MenuAction *)MultichoiceList_72, 5} + {(struct MenuAction *)MultichoiceList_00, 3}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_02, 3}, + {(struct MenuAction *)MultichoiceList_03, 4}, + {(struct MenuAction *)MultichoiceList_04, 6}, + {(struct MenuAction *)MultichoiceList_05, 3}, + {(struct MenuAction *)MultichoiceList_06, 4}, + {(struct MenuAction *)MultichoiceList_07, 4}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_12, 2}, + {(struct MenuAction *)MultichoiceList_13, 6}, + {(struct MenuAction *)MultichoiceList_14, 2}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_16, 2}, + {(struct MenuAction *)MultichoiceList_17, 3}, + {(struct MenuAction *)MultichoiceList_18, 4}, + {(struct MenuAction *)MultichoiceList_19, 3}, + {(struct MenuAction *)MultichoiceList_20, 3}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_23, 3}, + {(struct MenuAction *)MultichoiceList_24, 3}, + {(struct MenuAction *)MultichoiceList_25, 3}, + {(struct MenuAction *)MultichoiceList_26, 3}, + {(struct MenuAction *)MultichoiceList_27, 3}, + {(struct MenuAction *)MultichoiceList_28, 3}, + {(struct MenuAction *)MultichoiceList_29, 3}, + {(struct MenuAction *)MultichoiceList_30, 3}, + {(struct MenuAction *)MultichoiceList_31, 3}, + {(struct MenuAction *)MultichoiceList_32, 3}, + {(struct MenuAction *)MultichoiceList_33, 3}, + {(struct MenuAction *)MultichoiceList_34, 3}, + {(struct MenuAction *)MultichoiceList_35, 3}, + {(struct MenuAction *)MultichoiceList_36, 3}, + {(struct MenuAction *)MultichoiceList_37, 3}, + {(struct MenuAction *)MultichoiceList_38, 3}, + {(struct MenuAction *)MultichoiceList_39, 3}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_42, 4}, + {(struct MenuAction *)MultichoiceList_43, 4}, + {(struct MenuAction *)MultichoiceList_44, 4}, + {(struct MenuAction *)MultichoiceList_45, 2}, + {(struct MenuAction *)MultichoiceList_46, 3}, + {(struct MenuAction *)MultichoiceList_47, 8}, + {(struct MenuAction *)MultichoiceList_48, 4}, + {(struct MenuAction *)MultichoiceList_49, 3}, + {(struct MenuAction *)MultichoiceList_50, 2}, + {(struct MenuAction *)MultichoiceList_01, 1}, + {(struct MenuAction *)MultichoiceList_52, 3}, + {(struct MenuAction *)MultichoiceList_53, 3}, + {(struct MenuAction *)MultichoiceList_54, 2}, + {(struct MenuAction *)MultichoiceList_55, 6}, + {(struct MenuAction *)MultichoiceList_56, 3}, + {(struct MenuAction *)MultichoiceList_57, 5}, + {(struct MenuAction *)MultichoiceList_58, 2}, + {(struct MenuAction *)MultichoiceList_59, 2}, + {(struct MenuAction *)MultichoiceList_60, 3}, + {(struct MenuAction *)MultichoiceList_61, 2}, + {(struct MenuAction *)MultichoiceList_62, 3}, + {(struct MenuAction *)MultichoiceList_63, 3}, + {(struct MenuAction *)MultichoiceList_64, 4}, + {(struct MenuAction *)MultichoiceList_65, 2}, + {(struct MenuAction *)MultichoiceList_66, 3}, + {(struct MenuAction *)MultichoiceList_67, 3}, + {(struct MenuAction *)MultichoiceList_68, 4}, + {(struct MenuAction *)MultichoiceList_69, 3}, + {(struct MenuAction *)MultichoiceList_70, 4}, + {(struct MenuAction *)MultichoiceList_71, 4}, + {(struct MenuAction *)MultichoiceList_72, 5} }; const struct TextStruct gUnknown_083CE048[] = { - OtherText_Cool2, - OtherText_Beauty3, - OtherText_Cute2, - OtherText_Smart2, - OtherText_Tough2, - OtherText_Normal, - OtherText_Super, - OtherText_Hyper, - OtherText_Master, - OtherText_Cool3, - OtherText_Beauty4, - OtherText_Cute3, - OtherText_Smart3, - OtherText_Tough3, - OtherText_Items, - OtherText_KeyItems, - OtherText_Balls, - OtherText_TMsHMs, - OtherText_Berries, + OtherText_Cool2, + OtherText_Beauty3, + OtherText_Cute2, + OtherText_Smart2, + OtherText_Tough2, + OtherText_Normal, + OtherText_Super, + OtherText_Hyper, + OtherText_Master, + OtherText_Cool3, + OtherText_Beauty4, + OtherText_Cute3, + OtherText_Smart3, + OtherText_Tough3, + OtherText_Items, + OtherText_KeyItems, + OtherText_Balls, + OtherText_TMsHMs, + OtherText_Berries, }; extern u8 gPCText_WhichPCShouldBeAccessed[]; -- cgit v1.2.3 From 010eb456d63b0d644285f263f310d73bfb9646b2 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sat, 20 May 2017 17:49:54 +0200 Subject: Decrease indentation level of switches --- src/script_menu.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index eba438397..50941f9ac 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -913,19 +913,19 @@ void task_picbox(u8 taskId) switch (task->data[0]) { - case 0: - task->data[0]++; - break; - case 1: - break; - case 2: - FreeResourcesAndDestroySprite(&gSprites[task->data[2]]); - task->data[0]++; - break; - case 3: - MenuZeroFillWindowRect(task->data[3], task->data[4], task->data[3] + 9, task->data[4] + 10); - DestroyTask(taskId); - break; + case 0: + task->data[0]++; + break; + case 1: + break; + case 2: + FreeResourcesAndDestroySprite(&gSprites[task->data[2]]); + task->data[0]++; + break; + case 3: + MenuZeroFillWindowRect(task->data[3], task->data[4], task->data[3] + 9, task->data[4] + 10); + DestroyTask(taskId); + break; } } -- cgit v1.2.3 From 4d2b22a899c11dfcacfec6889968ab01655a3fe3 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 26 May 2017 14:53:51 +0200 Subject: Add headers --- src/script_menu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index 50941f9ac..98c55e678 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1,3 +1,4 @@ +#include "field_effect.h" #include "global.h" #include "script_menu.h" #include "event_data.h" @@ -573,10 +574,6 @@ extern u8 gPCText_WhichPCShouldBeAccessed[]; extern u16 gScriptResult; -// field_effect -extern void FreeResourcesAndDestroySprite(struct Sprite *sprite); -extern u8 CreateMonSprite_PicBox(u16, s16, s16, u8); - bool8 sub_80B5054(u8 left, u8 top, u8 var3, u8 var4) { if (FuncIsActiveTask(sub_80B52B4) == 1) -- cgit v1.2.3 From f26daa3d6954d2db3a7c44b79d319a7a084462c2 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 26 May 2017 15:01:42 +0200 Subject: Sort includes --- src/script_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index 98c55e678..4669a362a 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1,7 +1,7 @@ -#include "field_effect.h" #include "global.h" #include "script_menu.h" #include "event_data.h" +#include "field_effect.h" #include "menu.h" #include "palette.h" #include "script.h" -- cgit v1.2.3 From f5b7921fa3b4356c2d79a117858fc543fd2cf15f Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Fri, 9 Jun 2017 02:43:39 -0400 Subject: cleanup player_pc.c --- src/script_menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index eba438397..f62b62ac7 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -684,7 +684,7 @@ void sub_80B52B4(u8 taskId) { gScriptResult = var; } - sub_8072DEC(); + HandleDestroyMenuCursors(); MenuZeroFillWindowRect(gTasks[taskId].data[0], gTasks[taskId].data[1], gTasks[taskId].data[2], gTasks[taskId].data[3]); DestroyTask(taskId); EnableBothScriptContexts(); @@ -847,7 +847,7 @@ void sub_80B5684(u8 taskId) { gScriptResult = var; } - sub_8072DEC(); + HandleDestroyMenuCursors(); MenuZeroFillWindowRect(gTasks[taskId].data[0], gTasks[taskId].data[1], gTasks[taskId].data[2], gTasks[taskId].data[3]); DestroyTask(taskId); EnableBothScriptContexts(); -- cgit v1.2.3 From ec3fe21936b250b329e58941a47e11afb9b240e0 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sat, 24 Jun 2017 18:06:32 +0200 Subject: first src changes --- src/script_menu.c | 165 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) (limited to 'src/script_menu.c') diff --git a/src/script_menu.c b/src/script_menu.c index 23e8bf2d9..e1ad3f467 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -863,6 +863,7 @@ bool8 TryCreatePCMenu(void) } } +#if ENGLISH void CreatePCMenu(void) { u16 playersPCWidth = GetStringWidthInTilesForScriptMenu(gPCText_PlayersPC); @@ -897,6 +898,170 @@ void CreatePCMenu(void) InitMenu(0, 1, 1, numChoices, 0, width + 1); sub_80B5230(0, 0, width + 2, 2 * numChoices + 1, 0, numChoices); } +#elif GERMAN +__attribute__((naked)) +void CreatePCMenu(void) { + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + sub sp, 0x18\n\ + ldr r0, _080B5748 @ =0x0000084b\n\ + bl FlagGet\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + beq _080B5750\n\ + ldr r0, _080B574C @ =gPCText_LanettesPC\n\ + b _080B5752\n\ + .align 2, 0\n\ +_080B5748: .4byte 0x0000084b\n\ +_080B574C: .4byte gPCText_LanettesPC\n\ +_080B5750:\n\ + ldr r0, _080B57E8 @ =gPCText_SomeonesPC\n\ +_080B5752:\n\ + bl GetStringWidthInTilesForScriptMenu\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + str r0, [sp, 0x8]\n\ + movs r4, 0x1\n\ + ldr r0, _080B57EC @ =gPCText_PlayersPC\n\ + bl GetStringWidthInTilesForScriptMenu\n\ + lsls r1, r4, 2\n\ + add r1, sp\n\ + adds r1, 0x8\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + str r0, [r1]\n\ + ldr r0, _080B57F0 @ =gPCText_LogOff\n\ + bl GetStringWidthInTilesForScriptMenu\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + str r0, [sp, 0x10]\n\ + movs r4, 0x3\n\ + ldr r0, _080B57F4 @ =0x00000804\n\ + bl FlagGet\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + beq _080B5798\n\ + ldr r0, _080B57F8 @ =gPCText_HallOfFame\n\ + bl GetStringWidthInTilesForScriptMenu\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + str r0, [sp, 0x14]\n\ + movs r4, 0x4\n\ +_080B5798:\n\ + movs r5, 0\n\ + cmp r5, r4\n\ + bge _080B57B4\n\ + add r2, sp, 0x8\n\ + adds r1, r4, 0\n\ +_080B57A2:\n\ + ldr r0, [r2]\n\ + cmp r5, r0\n\ + bge _080B57AC\n\ + lsls r0, 24\n\ + lsrs r5, r0, 24\n\ +_080B57AC:\n\ + adds r2, 0x4\n\ + subs r1, 0x1\n\ + cmp r1, 0\n\ + bne _080B57A2\n\ +_080B57B4:\n\ + ldr r0, _080B57F4 @ =0x00000804\n\ + bl FlagGet\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + beq _080B57FC\n\ + movs r7, 0x4\n\ + adds r4, r5, 0x2\n\ + lsls r2, r4, 24\n\ + lsrs r2, 24\n\ + movs r0, 0\n\ + movs r1, 0\n\ + movs r3, 0x9\n\ + bl MenuDrawTextWindow\n\ + ldr r0, _080B57F8 @ =gPCText_HallOfFame\n\ + movs r1, 0x1\n\ + movs r2, 0x5\n\ + bl MenuPrint\n\ + ldr r0, _080B57F0 @ =gPCText_LogOff\n\ + movs r1, 0x1\n\ + movs r2, 0x7\n\ + bl MenuPrint\n\ + b _080B5818\n\ + .align 2, 0\n\ +_080B57E8: .4byte gPCText_SomeonesPC\n\ +_080B57EC: .4byte gPCText_PlayersPC\n\ +_080B57F0: .4byte gPCText_LogOff\n\ +_080B57F4: .4byte 0x00000804\n\ +_080B57F8: .4byte gPCText_HallOfFame\n\ +_080B57FC:\n\ + movs r7, 0x3\n\ + adds r4, r5, 0x2\n\ + lsls r2, r4, 24\n\ + lsrs r2, 24\n\ + movs r0, 0\n\ + movs r1, 0\n\ + movs r3, 0x7\n\ + bl MenuDrawTextWindow\n\ + ldr r0, _080B5834 @ =gPCText_LogOff\n\ + movs r1, 0x1\n\ + movs r2, 0x5\n\ + bl MenuPrint\n\ +_080B5818:\n\ + adds r6, r4, 0\n\ + ldr r0, _080B5838 @ =0x0000084b\n\ + bl FlagGet\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + beq _080B5840\n\ + ldr r0, _080B583C @ =gPCText_LanettesPC\n\ + movs r1, 0x1\n\ + movs r2, 0x1\n\ + bl MenuPrint\n\ + b _080B584A\n\ + .align 2, 0\n\ +_080B5834: .4byte gPCText_LogOff\n\ +_080B5838: .4byte 0x0000084b\n\ +_080B583C: .4byte gPCText_LanettesPC\n\ +_080B5840:\n\ + ldr r0, _080B5888 @ =gPCText_SomeonesPC\n\ + movs r1, 0x1\n\ + movs r2, 0x1\n\ + bl MenuPrint\n\ +_080B584A:\n\ + ldr r0, _080B588C @ =gPCText_PlayersPC\n\ + movs r1, 0x1\n\ + movs r2, 0x3\n\ + bl MenuPrint\n\ + movs r4, 0\n\ + str r4, [sp]\n\ + adds r0, r5, 0x1\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + str r0, [sp, 0x4]\n\ + movs r0, 0\n\ + movs r1, 0x1\n\ + movs r2, 0x1\n\ + adds r3, r7, 0\n\ + bl InitMenu\n\ + lsls r2, r6, 24\n\ + lsrs r2, 24\n\ + lsls r3, r7, 1\n\ + adds r3, 0x1\n\ + str r4, [sp]\n\ + str r7, [sp, 0x4]\n\ + movs r0, 0\n\ + movs r1, 0\n\ + bl sub_80B5230\n\ + add sp, 0x18\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ +_080B5888: .4byte gPCText_SomeonesPC\n\ +_080B588C: .4byte gPCText_PlayersPC\n\ + .syntax divided\n"); +} +#endif void sub_80B5838(void) { -- cgit v1.2.3