d_lyt_pause largely done

This commit is contained in:
robojumper
2025-08-10 02:47:49 +02:00
parent e08d120f0b
commit de8cc996c6
17 changed files with 1253 additions and 208 deletions
+11 -1
View File
@@ -317,10 +317,14 @@ public:
mCursorActive = val;
}
// TODO - maybe a system for overriding cursor type
void setNextCursorType(CursorType_e cs) {
mNextCursor = 1;
mNextCursor = true;
mNextCursorType = cs;
}
void offNextCursor() {
mNextCursor = false;
}
void changeState(const sFStateID_c<lytItemCursor_c> &newState);
@@ -361,6 +365,12 @@ public:
};
void setNextCursorType(lytItemCursor_c::CursorType_e);
void setCursorTypeNoneMaybe();
void setCursorTypePointer();
void offNextCursor() {
mCursor.offNextCursor();
}
static dCsGame_c *sInstance;
+1 -1
View File
@@ -52,7 +52,7 @@ inline s32 getFSStickNavDirection() {
void init();
void calc();
void setNavEnabled(bool navEnabled, bool autoReturnToPointerNav);
void setNavEnabled(bool navEnabled, bool disableAutoReturnToPointerNav);
// I really wish these returned enums but the codegen requires not-enums
s32 getFSStickDirection();
+25
View File
@@ -0,0 +1,25 @@
#ifndef D_LYT_BASE_H
#define D_LYT_BASE_H
#include "common.h"
#include "d/d_base.h"
#include "m/m_allocator.h"
class dLytBase_c : public dBase_c {
public:
dLytBase_c();
virtual ~dLytBase_c();
/* 0x4C */ virtual bool build();
protected:
bool allocateLytWork1Heap(const char *name, bool exp);
void removeLyt();
private:
/* 0x68 */ mHeapAllocator_c mAllocator;
/* 0x84 */ UNKWORD field_0x84;
/* 0x88 */ u8 field_0x88;
};
#endif
+10 -2
View File
@@ -29,6 +29,14 @@ public:
bool requestIn();
bool requestOut();
void unk() {
field_0x6B8 = mTargetedBounding;
}
void setBackwards(bool b) {
mBackwards = b;
}
private:
void setTranslate(const Vec *);
bool fn_80168760();
@@ -52,8 +60,8 @@ private:
/* 0x6C8 */ bool mInRequested;
/* 0x6C9 */ bool mOutRequested;
/* 0x6CA */ u8 field_0x6CA;
/* 0x6CB */ u8 field_0x6CB;
/* 0x6CC */ u8 field_0x6CC;
/* 0x6CB */ bool mVisible;
/* 0x6CC */ bool mBackwards;
};
#endif
+13
View File
@@ -25,6 +25,14 @@ public:
return field_0x15C2C;
}
void setField_0x15C2C(s32 value) {
field_0x15C2C = value;
}
void setPauseDisp00Tab(s32 tab) {
mPauseDisp00Tab = tab;
}
s32 getPauseDisp00Tab() const {
return mPauseDisp00Tab;
}
@@ -41,6 +49,10 @@ public:
return field_0x15C67;
}
bool getField_0x15C68() const {
return field_0x15C68;
}
STATE_FUNC_DECLARE(dLytControlGame_c, Normal);
STATE_FUNC_DECLARE(dLytControlGame_c, Pause_SetRes);
STATE_FUNC_DECLARE(dLytControlGame_c, Pause_SyncRes);
@@ -71,6 +83,7 @@ private:
/* 0x15C64 */ u16 mItemCountForPauseDemo;
/* 0x15C66 */ u8 field_0x15C66;
/* 0x15C67 */ bool field_0x15C67;
/* 0x15C68 */ bool field_0x15C68;
static dLytControlGame_c *sInstance;
};
+117 -21
View File
@@ -1,12 +1,84 @@
#ifndef D_LYT_PAUSE_H
#define D_LYT_PAUSE_H
#include "common.h"
#include "d/lyt/d2d.h"
#include "d/lyt/d_lyt_base.h"
#include "egg/gfx/eggCpuTexture.h"
#include "egg/gfx/eggTextureBuffer.h"
#include "nw4r/lyt/lyt_bounding.h"
#include "s/s_State.hpp"
class dLytPauseMgr_c {
class dLytPauseBack_c;
class dLytPauseInfo_c;
class dLytPauseText_c;
class dLytCommonArrow_c;
class dLytPauseDisp00_c;
class dLytPauseDisp01_c;
class dLytPauseMain_c {
public:
dLytPauseMain_c();
virtual ~dLytPauseMain_c() {}
bool build();
bool remove();
bool execute();
bool draw();
void drawDirectly();
void requestIn();
void requestOut();
void requestChange();
void requestSelect();
void requestRingToggle();
bool hasSelection() const;
void updateTitle();
bool getField_0x63() const {
return field_0x63;
}
private:
STATE_FUNC_DECLARE(dLytPauseMain_c, None);
STATE_FUNC_DECLARE(dLytPauseMain_c, In);
STATE_FUNC_DECLARE(dLytPauseMain_c, Wait);
STATE_FUNC_DECLARE(dLytPauseMain_c, Change);
STATE_FUNC_DECLARE(dLytPauseMain_c, Select);
STATE_FUNC_DECLARE(dLytPauseMain_c, Ring);
STATE_FUNC_DECLARE(dLytPauseMain_c, GetDemo);
STATE_FUNC_DECLARE(dLytPauseMain_c, Out);
/* 0x04 */ UI_STATE_MGR_DECLARE(dLytPauseMain_c);
/* 0x40 */ dLytPauseBack_c *mpPauseBack;
/* 0x44 */ dLytPauseDisp00_c *mpDisp00;
/* 0x48 */ dLytPauseDisp01_c *mpDisp01;
/* 0x4C */ dLytPauseInfo_c *mpPauseInfo;
/* 0x50 */ dLytPauseText_c *mpPauseText;
/* 0x54 */ dLytCommonArrow_c *mpArrow;
/* 0x58 */ s32 mTimer;
/* 0x5C */ s32 mStep;
/* 0x60 */ u8 mPartStateChangeFlags;
/* 0x61 */ bool mInRequest;
/* 0x62 */ bool mOutRequest;
/* 0x63 */ bool field_0x63;
/* 0x64 */ bool mChangeRequest;
/* 0x65 */ bool mSelectRequest;
/* 0x66 */ bool mRingToggleRequest;
};
class dLytPauseMgr_c : public dLytBase_c {
public:
dLytPauseMgr_c();
~dLytPauseMgr_c();
/* 0x08 */ virtual int create() override;
/* 0x14 */ virtual int doDelete() override;
/* 0x20 */ virtual int execute() override;
/* 0x2C */ virtual int draw() override;
/* 0x4C */ virtual bool build() override;
static dLytPauseMgr_c *GetInstance() {
return sInstance;
}
@@ -43,10 +115,18 @@ public:
return field_0x083B;
}
bool getField_0x083C() const {
return field_0x083C;
}
void setField_0x083C(bool b) {
field_0x083C = b;
}
bool getField_0x083D() const {
return field_0x083D;
}
void setField_0x083D(bool b) {
field_0x083D = b;
}
@@ -55,6 +135,10 @@ public:
return field_0x083E;
}
void setField_0x083E(bool b) {
field_0x083E = b;
}
bool getField_0x0840() const {
return field_0x0840;
}
@@ -101,44 +185,56 @@ public:
nw4r::lyt::Bounding *getArrowBounding(int idx) const;
void setSelectedArrowBounding(int idx) const;
static void setSelectHand(f32 rotation, f32 length);
static f32 sDisp00ArrowRotation;
static f32 sDisp00ArrowLength;
private:
bool checkSelectRing();
bool checkChangeGesture();
bool checkRing();
void saveDispFlag();
void saveTabFlag();
STATE_FUNC_DECLARE(dLytPauseMgr_c, None);
STATE_FUNC_DECLARE(dLytPauseMgr_c, In);
STATE_FUNC_DECLARE(dLytPauseMgr_c, Wait);
STATE_FUNC_DECLARE(dLytPauseMgr_c, Change);
STATE_FUNC_DECLARE(dLytPauseMgr_c, Select);
STATE_FUNC_DECLARE(dLytPauseMgr_c, Ring);
STATE_FUNC_DECLARE(dLytPauseMgr_c, GetDemo);
STATE_FUNC_DECLARE(dLytPauseMgr_c, Out);
static dLytPauseMgr_c *sInstance;
/* 0x0000 */ u8 _0x0000[0x00C8 - 0x0000];
/* 0x008C */ UI_STATE_MGR_DECLARE(dLytPauseMgr_c);
/* 0x00C8 */ d2d::ResAccIf_c mResAcc1;
/* 0x0438 */ d2d::ResAccIf_c mResAcc2;
/* 0x07A8 */ dLytPauseMain_c mMain;
/* 0x07A8 */ u8 _0x0438[0x0814 - 0x07A8];
/* 0x0814 */ EGG::CpuTexture *mpBgTexture;
/* 0x0810 */ EGG::TextureBuffer *mpTexture0x0810;
/* 0x0814 */ EGG::TextureBuffer *mpBgTexture;
/* 0x0818 */ SelectionType_e mCurrentSelectionType;
/* 0x081C */ u8 _0x081C[0x0820 - 0x081C];
/* 0x081C */ SelectionType_e mPrevSelectionType;
/* 0x0820 */ s32 mCurrentDisp00Tab;
/* 0x0824 */ u8 _0x0824[0x082C - 0x0824];
/* 0x0824 */ UNKWORD field_0x0824;
/* 0x0828 */ UNKWORD field_0x0828;
/* 0x082C */ u16 mCurrentSelectionId;
/* 0x082E */ u8 _0x082E[0x0831 - 0x082E];
/* 0x082E */ u16 mPrevSelectionId;
/* 0x0830 */ bool mInRequest;
/* 0x0831 */ bool field_0x0831;
/* 0x0832 */ bool field_0x0832;
/* 0x0833 */ u8 mCurrentSelectionTab;
/* 0x0834 */ u8 _0x0834[0x0837 - 0x0834];
/* 0x0834 */ u8 mTimer;
/* 0x0835 */ u8 field_0x0835;
/* 0x0836 */ bool field_0x0836;
/* 0x0837 */ bool field_0x0837;
/* 0x0838 */ bool field_0x0838;
/* 0x0839 */ u8 _0x0839[0x083B - 0x0839];
/* 0x0839 */ bool field_0x0839;
/* 0x083A */ bool field_0x083A;
/* 0x083B */ bool field_0x083B;
/* 0x083C */ bool field_0x083C;
/* 0x083D */ bool field_0x083D;
/* 0x083E */ bool field_0x083E;
+4
View File
@@ -19,6 +19,10 @@ public:
void requestIn();
void requestOut();
bool getField_0x156() const {
return field_0x156;
}
private:
void startAnim(int idx);
void stopAnim(int idx);
+6 -2
View File
@@ -21,7 +21,7 @@ public:
void requestIn(bool scroll);
void requestOut(bool scroll);
void requestSelect();
void requestRing();
void requestRingToggle();
void requestUnselect();
bool requestSelectGuide();
@@ -35,6 +35,10 @@ public:
STATE_FUNC_DECLARE(dLytPauseDisp00_c, GetDemo);
STATE_FUNC_DECLARE(dLytPauseDisp00_c, Out);
bool getField_0xE36E() const {
return field_0xE36E;
}
private:
void setAnm(int idx, f32 value);
void stopAnm(int idx);
@@ -98,7 +102,7 @@ private:
/* 0xE373 */ bool mSelectGuideRequest;
/* 0xE374 */ bool mStopCallRequest;
/* 0xE375 */ bool mSelectMplsRequest;
/* 0xE376 */ bool field_0xE376;
/* 0xE376 */ bool mReverseTabChangeAnim;
/* 0xE377 */ bool mRingToggleRequest;
};
+4
View File
@@ -31,6 +31,10 @@ public:
STATE_FUNC_DECLARE(dLytPauseDisp01_c, GetDemo);
STATE_FUNC_DECLARE(dLytPauseDisp01_c, Out);
bool getField_0x98CE() const {
return field_0x98CE;
}
private:
void setAnm(int idx, f32 value);
void stopAnm(int idx);
+4
View File
@@ -23,6 +23,10 @@ public:
void setInputInOut(bool inOut);
bool getField_0x19A() const {
return field_0x19A;
}
private:
void updateCaption();
void startAnim(int idx);
+4
View File
@@ -25,6 +25,10 @@ public:
void requestIn();
void requestOut();
bool getField_0x6D7() const {
return field_0x6D7;
}
private:
void startAnim(int idx);
void stopAnim(int idx);
+4
View File
@@ -264,6 +264,10 @@ public:
return mMain.field_0x13750;
}
void setMeterField_0x13750(s32 value) {
mMain.field_0x13750 = value;
}
u8 getMeterField_0x13770() const {
return mMain.field_0x13770;
}