Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions generated/text_banks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,9 @@ TEXT_BANK_POKETCH_BERRY_SEARCHER
TEXT_BANK_DUMMY_0460
TEXT_BANK_POKETCH_LINK_SEARCHER
TEXT_BANK_UNK_0462
TEXT_BANK_UNK_0463
TEXT_BANK_POFFIN_CASE
TEXT_BANK_POFFIN_MAKING
TEXT_BANK_POFFIN_NAMES
TEXT_BANK_POFFIN_TYPES
TEXT_BANK_ROUTE_201
TEXT_BANK_ROUTE_202
TEXT_BANK_ROUTE_203
Expand Down
57 changes: 57 additions & 0 deletions include/applications/poffin_case/main.h
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Move this file into include/applications/poffin_case, probably as defs.h?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to my other comment, I wonder that if these are to be moved, they should probably just go into include/poffin_case.h as that's where the New and Free functions for these structs are.

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#ifndef POKEPLATINUM_POFFIN_CASE_MAIN_H
#define POKEPLATINUM_POFFIN_CASE_MAIN_H

#include "struct_defs/pokemon.h"

#include "bag.h"
#include "enums.h"
#include "game_options.h"
#include "party.h"
#include "poffin.h"
#include "savedata.h"
#include "trainer_info.h"

typedef struct PoffinCaseAppItem {
u8 caseIndex;
u8 level;
u8 type;
u8 smoothness;
union {
struct {
u8 spiciness : 1;
u8 dryness : 1;
u8 sweetness : 1;
u8 bitterness : 1;
u8 sourness : 1;
u8 isListed : 1;
u8 deleted : 1;
u8 alwaysTrue : 1;
};
u8 flavors;
};
u8 index;
u8 next;
u8 prev;
} PoffinCaseAppItem;

typedef struct PoffinCaseAppData {
u8 poffinCount;
u8 selectedPoffin;
u8 poffinRemoved;
u8 flavorFilter;
u16 listPos;
u16 cursorPos;
PoffinCase *poffinCase;
TrainerInfo *trainerInfo;
Party *party;
Bag *bag;
Options *options;
PoffinCaseAppItem poffins[MAX_POFFINS];
} PoffinCaseAppData;

PoffinCaseAppData *PoffinCaseAppData_New(SaveData *saveData, int heapID);
void PoffinCaseAppData_Free(PoffinCaseAppData *appData);
UnkEnum_02098EAC sub_02098EAC(Poffin *param0, u8 param1);
void sub_02098EF8(Poffin *param0, Pokemon *param1);

#endif // POKEPLATINUM_POFFIN_CASE_MAIN_H
87 changes: 87 additions & 0 deletions include/applications/poffin_case/manager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#ifndef POKEPLATINUM_APPLICATIONS_POFFIN_CASE_MANAGER_H
#define POKEPLATINUM_APPLICATIONS_POFFIN_CASE_MANAGER_H

#include "constants/flavor.h"

#include "applications/poffin_case/main.h"

#include "bg_window.h"
#include "list_menu.h"
#include "menu.h"
#include "message.h"
#include "overlay_manager.h"
#include "poffin_sprite.h"
#include "poffin_types.h"
#include "sprite.h"
#include "sprite_system.h"
#include "string_template.h"

#define POFFIN_LIST_SENTINEL 0xFF

#define NUM_LIST_SPRITES 3
#define LIST_SPRITE_SELECT_BOX 0
#define LIST_SPRITE_UP_ARROW 1
#define LIST_SPRITE_DOWN_ARROW 2

#define NUM_WINDOWS 13

typedef struct PoffinManagerMessages {
StringTemplate *template;
String *string;
String *closeStr;
String *listItemStr;
String *smoothStr;
String *discardStr;
String *thrownOutStr;
String *headerStr;
String *flavorStrs[FLAVOR_MAX + 1];
String *flavorDescs[FLAVOR_MAX];
u8 textDelay;
u8 unused[3];
} PoffinManagerMessages;

typedef struct PoffinManager {
enum HeapID heapID;
int lifecycle;
int loadState;
int dummy;
BOOL givePoffin;
u16 buttonHeld;
u16 dummy2;
u16 state;
u8 selectedPoffin;
u8 flavorFilter;
u8 poffinCount;
u8 lastPoffin;
u8 firstPoffin;
u8 printerID;
PoffinCaseAppData *data;
BgConfig *bgConfig;
PoffinTypeList *poffinTypes;
MessageLoader *msgLoader;
PoffinManagerMessages messages;
u16 listPos;
u16 cursorPos;
ListMenuTemplate menuTemplate;
ListMenuTemplate actionMenuTemplate;
ListMenu *poffinMenu;
ListMenu *actionMenu;
StringList *poffinList;
StringList *actionList;
Menu *yesNoMenu;
u32 unused[4];
Window windows[NUM_WINDOWS];
SpriteSystem *spriteSys;
SpriteManager *spriteMan;
Sprite *listSprites[NUM_LIST_SPRITES];
Sprite *flavorSprites[FLAVOR_MAX];
Sprite *buttonSprites[FLAVOR_MAX + 1];
PoffinSpriteManager *poffinSpriteMan;
PoffinSprite *poffinSprite;
} PoffinManager;

BOOL PoffinManager_Init(ApplicationManager *appMan, int *unused);
BOOL PoffinManager_Main(ApplicationManager *appMan, int *unused);
BOOL PoffinManager_Exit(ApplicationManager *appMan, int *unused);

#endif // POKEPLATINUM_APPLICATIONS_POFFIN_CASE_MANAGER_H
23 changes: 23 additions & 0 deletions include/applications/poffin_case/menus.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef POKEPLATINUM_APPLICATIONS_POFFIN_CASE_MENUS_H
#define POKEPLATINUM_APPLICATIONS_POFFIN_CASE_MENUS_H

#include "applications/poffin_case/manager.h"

#define BUTTON_ACTION_DESELECT 0
#define BUTTON_ACTION_SELECT 1
#define BUTTON_ACTION_RELEASE_SELECTED 2
#define BUTTON_ACTION_REPRESS_SELECTED 3
#define BUTTON_ACTION_SET_AS_ACTIVE 4

void PoffinManager_InitPoffinList(PoffinManager *app);
void PoffinManager_FreePoffinList(PoffinManager *app, BOOL clear);
void PoffinManager_UpdateFilterButton(PoffinManager *app, u8 poffinType, u8 buttonAction);
void PoffinManager_UpdatePoffinFilter(PoffinManager *app, u8 poffinType);
void PoffinManager_CreateActionMenu(PoffinManager *app);
void PoffinManager_FreeActionMenu(PoffinManager *app);
void PoffinManager_ShowDiscardQuestion(PoffinManager *app);
void PoffinManager_ShowThrownOutMessage(PoffinManager *app);
void PoffinManager_CreateYesNoMenu(PoffinManager *app);
void PoffinManager_PrintHeaderandButtons(PoffinManager *app);

#endif // POKEPLATINUM_APPLICATIONS_POFFIN_CASE_MENUS_H
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef POKEPLATINUM_OV79_021D3768_H
#define POKEPLATINUM_OV79_021D3768_H

#include "overlay079/struct_ov79_021D3820.h"
#include "overlay079/struct_ov79_021D38D0.h"
#include "applications/poffin_case/struct_ov79_021D3820.h"
#include "applications/poffin_case/struct_ov79_021D38D0.h"

void ov79_021D3768(UnkStruct_ov79_021D3820 *param0, UnkStruct_ov79_021D38D0 *param1, int heapID);
void ov79_021D3820(UnkStruct_ov79_021D3820 *param0);
Expand Down
11 changes: 11 additions & 0 deletions include/applications/poffin_case/sprites.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef POKEPLATINUM_APPLICATIONS_POFFIN_CASE_SPRITES_H
#define POKEPLATINUM_APPLICATIONS_POFFIN_CASE_SPRITES_H

#include "applications/poffin_case/manager.h"

void PoffinManager_InitSpriteSystem(PoffinManager *app);
void PoffinManager_FreeSpriteSystem(PoffinManager *app);
void PoffinManager_UpdateSprites(PoffinManager *app);
void PoffinCaseApp_UpdateListSprites(PoffinManager *app, BOOL actionMenuOpen);

#endif // POKEPLATINUM_APPLICATIONS_POFFIN_CASE_SPRITES_H
4 changes: 2 additions & 2 deletions include/constants/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ enum HeapID {
HEAP_ID_41,
HEAP_ID_JOURNAL,
HEAP_ID_43,
HEAP_ID_44,
HEAP_ID_45,
HEAP_ID_POFFIN_CASE,
HEAP_ID_POFFIN_MANAGER,
HEAP_ID_46,
HEAP_ID_CHOOSE_STARTER_APP,
HEAP_ID_48,
Expand Down
2 changes: 1 addition & 1 deletion include/constdata/const_020F6890.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

#include "overlay_manager.h"

extern const ApplicationManagerTemplate Unk_020F6890;
extern const ApplicationManagerTemplate gPoffinCaseAppTemplate;

#endif // POKEPLATINUM_CONST_020F6890_H
10 changes: 0 additions & 10 deletions include/overlay079/ov79_021D0D80.h

This file was deleted.

17 changes: 0 additions & 17 deletions include/overlay079/ov79_021D183C.h

This file was deleted.

11 changes: 0 additions & 11 deletions include/overlay079/ov79_021D20F4.h

This file was deleted.

64 changes: 0 additions & 64 deletions include/overlay079/struct_ov79_021D0E1C.h

This file was deleted.

6 changes: 0 additions & 6 deletions include/overlay079/struct_ov79_021D0E1C_decl.h

This file was deleted.

22 changes: 0 additions & 22 deletions include/overlay079/struct_ov79_021D0E1C_sub1.h

This file was deleted.

7 changes: 3 additions & 4 deletions include/overlay083/struct_ov83_0223F770.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#ifndef POKEPLATINUM_STRUCT_OV83_0223F770_H
#define POKEPLATINUM_STRUCT_OV83_0223F770_H

#include "struct_defs/struct_0209903C.h"
#include "struct_defs/struct_0209916C.h"
#include "poffin_sprite.h"

typedef struct {
UnkStruct_0209903C *unk_00;
UnkStruct_0209916C *unk_04;
PoffinSpriteManager *unk_00;
PoffinSprite *unk_04;
} UnkStruct_ov83_0223F770;

#endif // POKEPLATINUM_STRUCT_OV83_0223F770_H
Loading