mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 13:47:43 +00:00
Refactor GuiSys (remove general logic handling)
This commit is contained in:
@@ -6,83 +6,30 @@
|
||||
namespace urde
|
||||
{
|
||||
|
||||
struct CCellPos
|
||||
{
|
||||
u32 x0_ = 0;
|
||||
u32 x4_ = 0;
|
||||
bool x8_ = false;
|
||||
};
|
||||
|
||||
class CGuiVirtualBox
|
||||
{
|
||||
int x0_;
|
||||
int x4_;
|
||||
int x8_;
|
||||
int xc_;
|
||||
int x10_;
|
||||
int x14_;
|
||||
int x18_;
|
||||
int x1c_ = 0;
|
||||
std::unique_ptr<CCellPos[]> x20_;
|
||||
std::unique_ptr<CCellPos[]> x24_;
|
||||
std::unique_ptr<CCellPos[]> x28_;
|
||||
std::unique_ptr<CCellPos[]> x2c_;
|
||||
public:
|
||||
CGuiVirtualBox(int a,int b,int c,int d,int e,int f)
|
||||
: x0_(a), x4_(b), x8_(c), xc_(d), x10_(e), x14_(f), x18_(std::max(x10_, x14_)),
|
||||
x20_(new CCellPos[c*d]),
|
||||
x24_(new CCellPos[c*d]),
|
||||
x28_(new CCellPos[x18_]),
|
||||
x2c_(new CCellPos[x18_]) {}
|
||||
|
||||
void GetDifference(int,int,int&,int&);
|
||||
bool ShiftHorizontal(int,bool);
|
||||
bool ShiftVertical(int,bool);
|
||||
void ResolveTransitionCells();
|
||||
void FillCellsInBox(CCellPos* cells);
|
||||
};
|
||||
|
||||
class CGuiTableGroup : public CGuiCompoundWidget
|
||||
{
|
||||
public:
|
||||
enum class ETableGroupModes
|
||||
struct SomeState
|
||||
{
|
||||
float x0_ = 0.f;
|
||||
};
|
||||
|
||||
private:
|
||||
SomeState xb8_;
|
||||
SomeState xbc_;
|
||||
int xc0_;
|
||||
int xc4_;
|
||||
int xc8_;
|
||||
int xcc_;
|
||||
bool xd0_;
|
||||
bool xd1_ = true;
|
||||
std::function<void(const CGuiTableGroup*)> xd4_doMenuAdvance;
|
||||
std::function<void(const CGuiTableGroup*)> xec_doMenuCancel;
|
||||
std::function<void(const CGuiTableGroup*)> x104_doMenuSelChange;
|
||||
int xf8_;
|
||||
int xfc_;
|
||||
int x100_[3][2];
|
||||
bool x118_;
|
||||
bool x119_;
|
||||
float x11c_;
|
||||
float x120_;
|
||||
bool x124_;
|
||||
float x128_;
|
||||
bool x12c_ = false;
|
||||
ETableGroupModes x130_modes;
|
||||
CGuiVirtualBox x134_box;
|
||||
public:
|
||||
CGuiTableGroup(const CGuiWidgetParms& parms, int, int, ETableGroupModes modes,
|
||||
int, int, bool, bool, float, float, bool, float, CGuiVirtualBox&& box);
|
||||
FourCC GetWidgetTypeID() const {return FOURCC('TBGP');}
|
||||
static void LoadWidgetFnMap();
|
||||
|
||||
bool MAF_SelectNextColumn(CGuiFunctionDef* def, CGuiControllerInfo* info);
|
||||
bool MAF_SelectPrevColumn(CGuiFunctionDef* def, CGuiControllerInfo* info);
|
||||
bool MAF_SelectNextRow(CGuiFunctionDef* def, CGuiControllerInfo* info);
|
||||
bool MAF_SelectPrevRow(CGuiFunctionDef* def, CGuiControllerInfo* info);
|
||||
bool MAF_SelectNextColumnSkipUnActivated(CGuiFunctionDef* def, CGuiControllerInfo* info);
|
||||
bool MAF_SelectPrevColumnSkipUnActivated(CGuiFunctionDef* def, CGuiControllerInfo* info);
|
||||
bool MAF_SelectNextRowSkipUnActivated(CGuiFunctionDef* def, CGuiControllerInfo* info);
|
||||
bool MAF_SelectPrevRowSkipUnActivated(CGuiFunctionDef* def, CGuiControllerInfo* info);
|
||||
bool MAF_SelectColumnAtIndex(CGuiFunctionDef* def, CGuiControllerInfo* info);
|
||||
bool MAF_SelectRowAtIndex(CGuiFunctionDef* def, CGuiControllerInfo* info);
|
||||
bool MAF_InitializeTable(CGuiFunctionDef* def, CGuiControllerInfo* info);
|
||||
bool MAF_MenuAdvance(CGuiFunctionDef* def, CGuiControllerInfo* info);
|
||||
bool MAF_MenuCancel(CGuiFunctionDef* def, CGuiControllerInfo* info);
|
||||
public:
|
||||
CGuiTableGroup(const CGuiWidgetParms& parms, int, int, bool);
|
||||
FourCC GetWidgetTypeID() const {return FOURCC('TBGP');}
|
||||
|
||||
void SetMenuAdvanceCallback(std::function<void(const CGuiTableGroup*)>&& cb)
|
||||
{
|
||||
@@ -99,6 +46,8 @@ public:
|
||||
x104_doMenuSelChange = std::move(cb);
|
||||
}
|
||||
|
||||
void SetD1(bool v) { xd1_ = v; }
|
||||
|
||||
static CGuiTableGroup* Create(CGuiFrame* frame, CInputStream& in, bool);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user