d_lyt_meter_a_btn OK

This commit is contained in:
robojumper
2025-04-11 14:40:52 +02:00
parent bb3f154aa9
commit 62031590fb
9 changed files with 333 additions and 101 deletions
+15 -2
View File
@@ -1,6 +1,7 @@
#ifndef D_LYT_DO_BUTTON_H
#define D_LYT_DO_BUTTON_H
#include "common.h"
#include "d/lyt/d2d.h"
#include "s/s_State.hpp"
#include "s/s_StateMgr.hpp"
@@ -22,8 +23,20 @@ public:
return sInstance;
}
s32 getField0x47C() const {
return field_0x47C;
static s32 getField0x47C() {
if (sInstance != nullptr) {
return sInstance->field_0x47C;
} else {
return 0x5E;
}
}
static s32 getField0x480() {
if (sInstance != nullptr) {
return sInstance->field_0x480;
} else {
return 0x29;
}
}
private:
+15 -3
View File
@@ -16,6 +16,7 @@ public:
}
enum Action_e {
DO_DASH = 0x5F,
DO_RETURN = 0x7F,
DO_STOP = 0x84,
DO_ITEMS = 0x85,
@@ -27,12 +28,13 @@ public:
};
enum DoButton_e {
DO_BUTTON_B = 1
DO_BUTTON_A = 0,
DO_BUTTON_B = 1,
};
void set(DoButton_e button, Action_e value) {
field_0x04[button] = value;
field_0x34[button] = 1;
field_0x34[button] = true;
}
static Action_e get(DoButton_e button) {
@@ -43,6 +45,14 @@ public:
}
}
static bool getHas(DoButton_e button) {
if (sInstance != nullptr) {
return sInstance->field_0x34[button];
} else {
return false;
}
}
static Action_e get0x08() {
if (sInstance != nullptr) {
@@ -51,12 +61,14 @@ public:
return DO_NONE;
}
}
static Action_e convertDoButton(s32);
private:
static LytDoButtonRelated *sInstance;
/* 0x04 */ Action_e field_0x04[12];
/* 0x34 */ u8 field_0x34[12];
/* 0x34 */ bool field_0x34[12];
};
// size 0x27C
+12
View File
@@ -138,6 +138,8 @@ public:
bool remove();
bool draw();
bool fn_800D5670();
static dLytMeterContainer_c *GetInstance() {
return sInstance;
}
@@ -146,6 +148,14 @@ public:
return &sInstance->mMeter;
}
// Not all of these inlines exist on dLytMeter_c
// because accessing via GetMeter->get... causes
// different instructions sometimes
s32 getMeterField_0x13750() const {
return mMeter.field_0x13750;
}
u8 getMeterField_0x13770() const {
return mMeter.field_0x13770;
}
@@ -162,6 +172,8 @@ public:
}
}
private:
/* 0x00004 */ d2d::ResAccIf_c mResAcc;
/* 0x00374 */ dLytMeterEventSkip_c *mpEventSkip;
+11 -11
View File
@@ -3,7 +3,6 @@
#include "d/lyt/d2d.h"
#include "s/s_State.hpp"
#include "s/s_StateMgr.hpp"
class dLytMeterABtn_c : public d2d::dSubPane {
public:
@@ -26,8 +25,9 @@ public:
mpContainerAnmGroup1 = g1;
mpContainerAnmGroup2 = g2;
}
private:
void fn_800E0870(u32);
void setMessage(s32 id);
STATE_FUNC_DECLARE(dLytMeterABtn_c, InvisibleWait);
STATE_FUNC_DECLARE(dLytMeterABtn_c, In);
@@ -37,24 +37,24 @@ private:
STATE_FUNC_DECLARE(dLytMeterABtn_c, Active);
STATE_FUNC_DECLARE(dLytMeterABtn_c, Off);
UI_STATE_MGR_DECLARE(dLytMeterABtn_c);
d2d::dLytSub mLyt;
/* 0x0D8 */ d2d::AnmGroup_c mAnmGroups[3];
/* 0x008 */ UI_STATE_MGR_DECLARE(dLytMeterABtn_c);
/* 0x044 */ d2d::dLytSub mLyt;
/* 0x0D8 */ d2d::AnmGroup_c mAnm[3];
/* 0x198 */ d2d::AnmGroup_c *mpContainerAnmGroup1;
/* 0x19C */ d2d::AnmGroup_c *mpContainerAnmGroup2;
/* 0x1A0 */ nw4r::lyt::Pane *mpPane;
/* 0x1A4 */ void *field_0x1A4;
/* 0x1A4 */ nw4r::lyt::Pane *mpOwnerPane;
/* 0x1A8 */ dTextBox_c *mpTextBoxes[2];
/* 0x1B0 */ dWindow_c *mpWindow[1];
/* 0x1B4 */ dTextBox_c *mpSizeBox[1];
/* 0x1B8 */ u32 field_0x1B8;
/* 0x1BC */ u32 field_0x1BC;
/* 0x1C0 */ u32 field_0x1C0;
/* 0x1C4 */ u32 field_0x1C4;
/* 0x1B8 */ s32 field_0x1B8;
/* 0x1BC */ s32 field_0x1BC;
/* 0x1C0 */ BOOL field_0x1C0;
/* 0x1C4 */ s32 field_0x1C4;
/* 0x1C8 */ u8 field_0x1C8;
/* 0x1C9 */ u8 field_0x1C9;
/* 0x1CA */ u8 field_0x1CA;
/* 0x1CB */ u8 field_0x1CB;
/* 0x1CB */ bool mOldTextState;
};
#endif