Skip to content

Commit

Permalink
menu.cpp progress
Browse files Browse the repository at this point in the history
  • Loading branch information
PikHacker committed Sep 29, 2023
1 parent 5877b93 commit 145f57c
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 378 deletions.
4 changes: 2 additions & 2 deletions docs/recommended_todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@
### <section id="utilityU">utilityU</section>
| File | Size (bytes) | File | Size (bytes) |
| ---- | ---- | ---- | ---- |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_ObjCalc.cpp">PSMainSide_ObjCalc.cpp</a> | 9412 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_CreaturePrm.cpp">PSMainSide_CreaturePrm.cpp</a> | 14244 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_TrackMap.cpp">PSMainSide_TrackMap.cpp</a> | 17206 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/menu.cpp">menu.cpp</a> | 17991 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_ObjCalc.cpp">PSMainSide_ObjCalc.cpp</a> | 9412 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/menu.cpp">menu.cpp</a> | 13538 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_CreaturePrm.cpp">PSMainSide_CreaturePrm.cpp</a> | 14244 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_TrackMap.cpp">PSMainSide_TrackMap.cpp</a> | 17206 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_BossMgr.cpp">PSMainSide_BossMgr.cpp</a> | 19867 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/utilityU/PSMainSide_Sound.cpp">PSMainSide_Sound.cpp</a> | 28263 |


40 changes: 28 additions & 12 deletions include/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,39 @@
struct JUTGamePad;
struct JUTFont;

struct MenuItem {
int _00;
int _04;
int _08;
int _0C;
JSUPtrLink mLink;
JSUPtrList mList;
};

struct Menu {
struct KeyEvent {
enum cTypeFlag { UNK0 = 16, UNK1 = 32 };

KeyEvent(cTypeFlag, u32, IDelegate1<Menu&>*);

int mType; // _00
int _04;
IDelegate1<Menu&>* mAction;
JSUPtrLink mLink;
};

struct MenuItem {
enum cTypeFlag { UNK0 = 0, UNK1 = 1 };

MenuItem(cTypeFlag, int, char*);

MenuItem* getNext();
MenuItem* getPrev();
void checkEvents(Menu*, int);

int _00; // _00
bool _04; // _04
char* mName; // _08
int _0C; // _0C
int mType;
JSUPtrList mList; // _14
JSUPtrLink mLink; // _20
};

Menu(JUTGamePad*, JUTFont*, bool);
void addKeyEvent(KeyEvent::cTypeFlag, u32, IDelegate1<Menu&>*);
void addOption(int i, char* name, void*, bool);
void addOption(int i, char* name, IDelegate1<Menu&>*, bool);
void doUpdate(bool);

inline void setPosition(int x, int y)
Expand All @@ -39,12 +55,12 @@ struct Menu {
int _0C; // _0C
Menu* mSelf; // _10
Menu* mSelf2; // _14
JSUPtrList mPtrList; // _18
JSUPtrList mItemList; // _18
MenuItem* mCurrentItem; // _24
MenuItem* mLastItem; // _28
int _2C; // _2C
int mItemCount; // _30
int mSelect; // _34
int mState; // _34
f32 mTimer; // _38
f32 mTimer2; // _3C
int _40; // _40
Expand Down
Loading

0 comments on commit 145f57c

Please sign in to comment.