Use Window and WindowTemplate

This commit is contained in:
DizzyEggg
2025-03-02 15:24:33 +01:00
parent c018798262
commit 6cc3f98aaf
146 changed files with 554 additions and 554 deletions

View File

@@ -17,7 +17,7 @@ typedef struct unkStruct_203B230
u8 fill18[0x20 - 0x18];
u32 unk20;
u32 unk24;
Windows unk28;
WindowTemplates unk28;
MenuInputStructSub unk88;
} unkStruct_203B230;

View File

@@ -20,7 +20,7 @@ typedef struct unkStruct_203B234
MenuStruct unk78;
/* 0xC8 */ u32 menuAction;
MenuItem unkCC[5];
Windows windows;
WindowTemplates windows;
} unkStruct_203B234;
bool8 sub_801B60C(u32, u8 id, u8 quantity);

View File

@@ -21,7 +21,7 @@ struct unk_203B250
MenuStruct unk18;
MenuItem unk68[8];
u16 unkA8[8];
Windows windows;
WindowTemplates windows;
};
// size: 0x8

View File

@@ -21,7 +21,7 @@ typedef struct unkStruct_203B270
/* 0x1C */ MenuInputStruct input;
u32 unk50;
u32 unk54;
Windows windows;
WindowTemplates windows;
const u8 *text;
} unkStruct_203B270;

View File

@@ -26,7 +26,7 @@ typedef struct unkStruct_203B294
/* 0xF4 */ u32 menuAction;
MenuItem unkF8[8];
u16 unk138[8];
Windows windows;
WindowTemplates windows;
} unkStruct_203B294;
bool8 sub_80227B8(PokemonStruct1 *pkmn);

View File

@@ -15,8 +15,8 @@ struct unkStruct_203B2AC
struct unkStruct_808FF20 unk4C;
struct UnkInfoTabStruct unkB0;
u32 unkE0;
Window *unkE4;
Windows unkE8;
WindowTemplate *unkE4;
WindowTemplates unkE8;
WindowHeader unk148;
};

View File

@@ -15,7 +15,7 @@ struct unkStruct_203B2FC
/* 0x30 */ u8 jobSlotIndex;
/* 0x34 */ WonderMail *jobInfo;
/* 0x38 */ struct MonPortraitMsg monPortrait;
Windows unk48;
WindowTemplates unk48;
};
bool8 sub_802DB28(u8 jobSlotIndex, u8 dungeon);

View File

@@ -11,8 +11,8 @@ struct unkStruct_203B300
MenuInputStructSub unk0;
/* 0xC */ unkStruct_802C39C *mail;
u32 unk10;
Window *unk14;
Windows unk18;
WindowTemplate *unk14;
WindowTemplates unk18;
u8 unk78[4];
};

View File

@@ -6,7 +6,7 @@
// size: 0x6C
typedef struct Credits1Work
{
Windows unk0;
WindowTemplates unk0;
s32 unk60;
s32 unk64;
/* 0x68 */ s32 creditsCategoryIndex;

View File

@@ -8,7 +8,7 @@
struct DebugMenu
{
MenuStruct unk0[4];
Windows unk140;
WindowTemplates unk140;
u32 fill1A0;
};

View File

@@ -14,7 +14,7 @@ typedef struct unkStruct_203B3F0
MenuStruct unk4C;
unkStructFor8013AA0 unk9C;
u8 fillCC[0xD8 - 0xCC];
Windows unkD8;
WindowTemplates unkD8;
} unkStruct_203B3F0;
#endif // GUARD_DEBUG_MENU2_H

View File

@@ -12,7 +12,7 @@ typedef struct unkStruct_203B3F4
/* 0x8 */ u32 menuAction;
/* 0xC */ MenuItem menuItems[8];
MenuStruct unk4C;
Windows unk9C;
WindowTemplates unk9C;
} unkStruct_203B3F4;
#endif // GUARD_DEBUG_MENU3_H

View File

@@ -17,7 +17,7 @@ typedef struct unkStruct_203B3F8
unkStructFor8013AA0 unk60;
MenuItem unk90[8];
u16 unkD0[8];
Windows unkE0;
WindowTemplates unkE0;
} unkStruct_203B3F8;
#endif // GUARD_DEBUG_MENU4_H

View File

@@ -3,6 +3,6 @@
#include "structs/str_text.h"
void CreateDungeonMenuSubWindow(Window *mainWindow, s32 subWindowX);
void CreateDungeonMenuSubWindow(WindowTemplate *mainWindow, s32 subWindowX);
#endif

View File

@@ -22,7 +22,7 @@ typedef struct FelicityBankWork
unkStructFor8013AA0 unk64;
/* 0x94 */ struct MonPortraitMsg monPortrait;
struct MonPortraitMsg *monPortraitPtr;
Windows unkA8;
WindowTemplates unkA8;
} FelicityBankWork;
bool8 CreateFelicityBank(s32 mode);

View File

@@ -65,7 +65,7 @@ struct unkStruct_203B2BC
MenuItem menuItems[4];
u8 fill120[0x16C - 0x13C];
u16 unk16C[10];
Windows unk180;
WindowTemplates unk180;
};
u32 sub_8027074(void);

View File

@@ -31,7 +31,7 @@ typedef struct unkStruct_203B2B4
MenuStruct unk78;
MenuItem unkC8[8];
u16 unk108[8];
Windows unk118;
WindowTemplates unk118;
} unkStruct_203B2B4;
bool8 CreateFriendListMenu(s32 param_1);

View File

@@ -23,8 +23,8 @@ typedef struct WonderMailStruct_203B33C
unkStruct_203B480 unk1E8;
u8 unk218;
MenuStruct unk21C[4];
Windows unk35C;
Windows unk3BC;
WindowTemplates unk35C;
WindowTemplates unk3BC;
/* 0x41C */ Item item;
u32 unk420; // Is this supposed to be a File like 203B2C4?
u8 unk424[0x100];

View File

@@ -27,7 +27,7 @@ typedef struct GulpinShopWork
u8 fillC8[0x118 - 0xC8];
/* 0x118 */ struct MonPortraitMsg monPortrait;
struct MonPortraitMsg *monPortraitPtr;
Windows unk12C;
WindowTemplates unk12C;
} GulpinShopWork;
bool8 CreateGulpinShop(u32 mode, s16 pokeSpecies, Move *moves);

View File

@@ -35,7 +35,7 @@ typedef struct unkStruct_203B27C
u8 fill11C[0x16C - 0x11C];
/* 0x16C */ struct MonPortraitMsg monPortrait;
struct MonPortraitMsg *monPortraitPtr;
Windows unk180;
WindowTemplates unk180;
} unkStruct_203B27C;
bool8 sub_801FB50(u32 mode);

View File

@@ -16,7 +16,7 @@ struct IQSkillInfoMenu
u8 fill14[0x20 - 0x18];
u32 unk20;
u32 unk24;
Windows unk28;
WindowTemplates unk28;
MenuInputStructSub unk88;
};

View File

@@ -19,7 +19,7 @@ struct IQSkillMenu
/* 0x30 */ s32 menuAction;
MenuItem unk34[8];
MenuStruct unk74;
Windows unkC4;
WindowTemplates unkC4;
};
bool8 CreateIQSkillMenu(s16 species);

View File

@@ -47,7 +47,7 @@ struct KangaskhanStorageWork
unkStructFor8013AA0 unkA8;
/* 0xD8 */ struct MonPortraitMsg monPortrait;
struct MonPortraitMsg *monPortraitPtr;
Windows unkEC;
WindowTemplates unkEC;
};
bool8 CreateKangaskhanStorage(u32 mode);

View File

@@ -27,7 +27,7 @@ typedef struct unkStruct_203B20C
u16 unk60[8];
MenuStruct unk70;
unkStructFor8013AA0 unkC0;
Windows unkF0;
WindowTemplates unkF0;
} unkStruct_203B20C;
bool8 sub_8017E1C(void);

View File

@@ -65,7 +65,7 @@ typedef struct KecleonBrosWork1
/* 0x84 */ MenuStruct menu;
/* 0xD4 */ struct MonPortraitMsg monPortrait;
struct MonPortraitMsg *monPortraitPtr;
Windows unkE8;
WindowTemplates unkE8;
} KecleonBrosWork1;
// mode corresponds to the enum: KecleonBrosMode

View File

@@ -33,7 +33,7 @@ typedef struct LuminousCaveWork
u8 unk110;
u8 unk111;
u8 unk112;
Windows unk114;
WindowTemplates unk114;
} LuminousCaveWork;
void CleanLuminousCave(void);

View File

@@ -19,7 +19,7 @@ struct unkStruct_203B304
MenuStruct unk6C;
MenuItem menuItems[8];
u16 unkFC[8];
Windows unk10C;
WindowTemplates unk10C;
};
extern void SetMailboxState(u32);

View File

@@ -38,12 +38,12 @@ void CleanUpMenu(void);
void DeleteMainMenu(void);
MainMenu1Work *GetMainMenu(void);
void InitMainMenu(void);
void SetMenuItems(MenuStruct *, Windows *, s32 index, const Window *, const MenuItem *menuItems, bool8, u32 menuAction, bool8 unused);
void SetMenuItems(MenuStruct *, WindowTemplates *, s32 index, const WindowTemplate *, const MenuItem *menuItems, bool8, u32 menuAction, bool8 unused);
void SetUpMenu(void);
s32 UpdateMenu(void);
void sub_8035C1C(void);
void sub_8035CC0(Windows *dataArray, u32 index);
void sub_8035CC0(WindowTemplates *dataArray, u32 index);
void sub_8035CF4(MenuStruct *menu, u32 index, bool8);
void sub_8035D1C(void);
s16 sub_8035D3C(void);

View File

@@ -9,7 +9,7 @@ typedef struct MainMenu2Work
{
u32 unk0;
MenuStruct unk4[4];
Windows unk144;
WindowTemplates unk144;
/* 0x1A4 */ u32 currMenuChoice;
} MainMenu2Work;

View File

@@ -30,7 +30,7 @@ typedef struct MakuhitaDojoWork1
u8 fill38[0x58 - 0x38];
/* 0x58 */ struct MonPortraitMsg monPortrait;
struct MonPortraitMsg *monPortraitPtr;
Windows unk6C;
WindowTemplates unk6C;
} MakuhitaDojoWork1;
void MakuhitaDojo_Delete(void);

View File

@@ -9,9 +9,9 @@ s32 GetKeyPress(MenuInputStruct *r0);
s32 sub_8012AE8(void);
void sub_8012BC4(u32 x, u32 y, s32 n, s32 len, u32 color, u32 param_6);
void sub_8012C60(u32 x, u32 y, u32 param_3, u32 color, u32 param_5);
void sub_8012CAC(Window *param_1, const MenuItem *param_2);
void sub_8012D08(Window *param_1, s32 param_2);
void sub_8012D34(Window *param_1, s32 param_2);
void sub_8012CAC(WindowTemplate *param_1, const MenuItem *param_2);
void sub_8012D08(WindowTemplate *param_1, s32 param_2);
void sub_8012D34(WindowTemplate *param_1, s32 param_2);
void sub_8012D60(MenuStruct *param_1, const MenuItem *menuItems, const u32 *colorArray, u16 *param_4, s32 menuAction, s32 index);
void sub_8012E04(MenuStruct *param_1, const MenuItem *menuItems, const u32 *colorArray, u16 *param_4, s32 menuAction, s32 index);
void sub_8012EA4(MenuStruct *param_1, bool8 r1);
@@ -49,7 +49,7 @@ void sub_8013C68(unkStructFor8013AA0 *);
void sub_8013D10(unkStructFor8013AA0 *);
void sub_8013E54(void);
void sub_8013F84(void);
void sub_80140B4(Windows *);
void sub_80140B4(WindowTemplates *);
#endif // GUARD_MENU_INPUT_H

View File

@@ -14,7 +14,7 @@ struct unkStruct_203B25C
/* 0x1C */ MenuStruct menu;
/* 0x6C */ MenuItem menuItems[8];
u16 unkAC[8];
Windows unkBC;
WindowTemplates unkBC;
};
bool8 sub_801DCC4(void);

View File

@@ -11,8 +11,8 @@ struct unkStruct_203B260
/* 0x4 */ MenuInputStructSub unk4;
/* 0x10 */ MenuInputStruct input;
u32 unk44;
Window *unk48;
Windows unk4C;
WindowTemplate *unk48;
WindowTemplates unk4C;
};
bool8 sub_801E198(GameOptions *optionsMenu);

View File

@@ -18,7 +18,7 @@ typedef struct unkStruct_203B35C
u32 unk14;
u8 fill18[0x1C - 0x18];
MenuStruct unk1C[4];
Windows unk15C;
WindowTemplates unk15C;
unkStruct_8035D94 unk1BC[2];
unkStruct_203B480 unk1CC;
unkStruct_203B480 unk1FC;

View File

@@ -32,7 +32,7 @@ typedef struct unkStruct_203B2B8
MenuItem unk16C[10];
MenuItem unk1BC[10];
u16 unk20C[10];
Windows unk220;
WindowTemplates unk220;
} unkStruct_203B2B8;
bool8 CreatePartyListMenu(PokemonStruct1 *pokeStruct);

View File

@@ -17,7 +17,7 @@ struct unkStruct_203B308
MenuStruct unk6C;
MenuItem menuItems[8];
u16 unkFC[8];
Windows unk10C;
WindowTemplates unk10C;
};
extern struct unkStruct_203B308 *gPelipperBoard;

View File

@@ -14,7 +14,7 @@ struct unkStruct_203B2D4
const u8 *unk10[4];
u32 unk20;
u32 unk24;
Windows unk28;
WindowTemplates unk28;
MenuInputStructSub unk88;
};

View File

@@ -11,8 +11,8 @@ typedef struct unkStruct_203B330
u8 unkC;
/* 0xD */ u8 dungeonIndex;
u32 unk10;
Window *unk14;
Windows unk18;
WindowTemplate *unk14;
WindowTemplates unk18;
} unkStruct_203B330;
bool8 sub_80319A4(u8, u8 dungeon, s32);

View File

@@ -12,8 +12,8 @@ struct RescuePasswordMenu
u32 currMenu;
u32 state;
MenuStruct unk8[4];
Windows unk148;
Windows unk1A8;
WindowTemplates unk148;
WindowTemplates unk1A8;
SpriteOAM unk208;
u32 unk210;
};

View File

@@ -9,7 +9,7 @@ typedef struct SaveMenuWork
/* 0x0 */ u32 currMenu;
u32 unk4;
MenuStruct unk8[4];
Windows unk148;
WindowTemplates unk148;
SpriteOAM unk1A8;
u32 unk1B0; // Sprite count?
} SaveMenuWork;

View File

@@ -72,7 +72,7 @@ typedef struct unkStructFor8013AA0
s32 unkC; // maxInclusive?
s32 unk10;
s32 unk14; // index of unk18? But read as chosenValue..?
Window *unk18;
WindowTemplate *unk18;
s32 unk1C; // width of prompt?
s32 unk20; // height of prompt?
u8 unk24; // related to unk10

View File

@@ -2,7 +2,7 @@
#define GUARD_STR_TEXT_H
// size: 0x48
typedef struct UnkTextStruct1
typedef struct Window
{
s16 unk0;
s16 unk2;
@@ -26,7 +26,7 @@ typedef struct UnkTextStruct1
u8 unk44;
bool8 unk45;
u8 unk46;
} UnkTextStruct1;
} Window;
typedef struct WindowHeader
{
@@ -39,7 +39,7 @@ typedef struct WindowHeader
#include "structs/str_position.h"
// size: 0x18
typedef struct Window
typedef struct WindowTemplate
{
u8 unk0;
s32 type;
@@ -49,10 +49,10 @@ typedef struct Window
s16 unk10; // In most cases it's the same as height. If it's smaller than height, the window may look glitchy. Maybe something with tile allocation/how the window is filled?
s16 unk12;
const WindowHeader *unk14;
} Window;
} WindowTemplate;
// All fields are zeroed out except for type which is set to WINDOW_TYPE_NORMAL.
#define WINDOW_DUMMY (Window) {.unk0 = 0, .type = WINDOW_TYPE_NORMAL, .width = 0, .pos = {0, 0}, .height = 0, .unk10 = 0, .unk12 = 0, .unk14 = NULL}
#define WINDOW_DUMMY (WindowTemplate) {.unk0 = 0, .type = WINDOW_TYPE_NORMAL, .width = 0, .pos = {0, 0}, .height = 0, .unk10 = 0, .unk12 = 0, .unk14 = NULL}
#define WINDOW_TYPE_0 0
#define WINDOW_TYPE_WITHOUT_BORDER 1
@@ -63,8 +63,8 @@ typedef struct Window
#define MAX_WINDOWS 4
typedef struct Windows {
Window id[MAX_WINDOWS];
} Windows;
typedef struct WindowTemplates {
WindowTemplate id[MAX_WINDOWS];
} WindowTemplates;
#endif // GUARD_STR_TEXT_H

View File

@@ -12,8 +12,8 @@ typedef struct struct_Sub80095E4
{
/* 0x0 */ MenuInputStruct input;
u32 unk34;
Window *unk38;
Windows windows;
WindowTemplate *unk38;
WindowTemplates windows;
// size: 0x9C
} struct_Sub80095E4;

View File

@@ -49,7 +49,7 @@ struct UnkDrawStringStruct
s32 unk30;
};
extern UnkTextStruct1 gUnknown_2027370[4];
extern Window gWindows[MAX_WINDOWS];
extern u8 gUnknown_202749A[11];
extern bool8 gUnknown_20274A5;
extern u16 gUnknown_202B038[4][32][32]; // Usage points to these dimensions
@@ -63,8 +63,8 @@ u32 UpdateFadeInTile(u32 a0);
u32 sub_80063B0(void);
void SelectCharmap(u32 a0);
void SetCharacterMask(int a0);
void ShowWindows(const Windows *windows, bool8 a1, bool8 a2);
void RestoreUnkTextStruct_8006518(Windows *unkData);
void ShowWindows(const WindowTemplates *windows, bool8 a1, bool8 a2);
void RestoreUnkTextStruct_8006518(WindowTemplates *unkData);
u32 sub_8006544(u32 index);
void sub_8007334(s32 a0);
void sub_80073B8(s32 a0);

View File

@@ -22,8 +22,8 @@ typedef struct WonderMailStruct_203B2C4
unkStruct_203B480 unk1E8;
/* 0x218 */ s8 mailIndex;
MenuStruct unk21C[4];
Windows unk35C;
Windows unk3BC;
WindowTemplates unk35C;
WindowTemplates unk3BC;
Item unk41C;
/* 0x420 */ struct MonPortraitMsg monPortrait;
u32 unk430;

View File

@@ -47,8 +47,8 @@ struct TradeItemsMenu
u32 unk10;
unkStructFor8013AA0 unk14;
MenuStruct unk44[4];
Windows unk184;
Windows unk1E4;
WindowTemplates unk184;
WindowTemplates unk1E4;
// TODO These might be structs...
struct TradeItem unk244;

View File

@@ -13,8 +13,8 @@ typedef struct WigglytuffShop2Work
u32 pokemonStatus[0x10];
/* 0x70 */ s32 numPokemoninFriendArea;
s32 unk74;
Window *unk78;
Windows unk7C;
WindowTemplate *unk78;
WindowTemplates unk7C;
u8 unkDC[4];
} WigglytuffShop2Work;

View File

@@ -54,7 +54,7 @@ typedef struct WigglytuffShop3Work
MenuStruct unk6C;
/* 0xBC */ struct MonPortraitMsg monPortrait;
struct MonPortraitMsg *monPortraitPtr;
Windows unkD0;
WindowTemplates unkD0;
u32 unk130;
u32 unk134;
} WigglytuffShop3Work;

View File

@@ -22,8 +22,8 @@ typedef struct WonderMailStruct_203B2C0
u8 fill16A[0x218 - 0x1B8];
/* 0x218 */ u8 mailIndex;
MenuStruct unk21C[4];
Windows unk35C;
Windows unk3BC;
WindowTemplates unk35C;
WindowTemplates unk3BC;
/* 0x41C */ u32 unkfill; // ItemSlot?
/* 0x420 */ struct MonPortraitMsg monPortrait;
/* 0x430 */ u8 padding3[0x534 - 0x430];

View File

@@ -19,7 +19,7 @@ struct unkStruct_203B2F0
MenuItem unk10C[8];
MenuItem unk14C[8];
u8 fill18C[0x19C - 0x18C];
Windows unk19C;
WindowTemplates unk19C;
};
bool8 InitializeJobListMenu(u32);

View File

@@ -34,7 +34,7 @@ typedef struct unkStruct_203B2F8
MenuItem unk118[8];
MenuItem unk158[8];
u16 unk198[8];
Windows unk1A8;
WindowTemplates unk1A8;
} unkStruct_203B2F8;
bool8 GetWonderMailAccepted(void);