d_lyt_meter_z_btn OK

This commit is contained in:
robojumper
2025-04-11 16:17:28 +02:00
parent 62031590fb
commit 736c285811
12 changed files with 441 additions and 82 deletions
+18
View File
@@ -0,0 +1,18 @@
#ifndef D_CAMERA_H
#define D_CAMERA_H
#include "d/d_base.h"
extern "C" bool fn_80081FE0(void*, const char *);
class dCamera_c : public dBase_c {
public:
/* 0x068 */ u8 _0x068[0xD98 - 0x068];
/* 0xD98 */ void *field_0xD98;
bool isCurrentTrend(const char *name) const {
return fn_80081FE0(field_0xD98, name);
}
};
#endif
+4
View File
@@ -6,6 +6,7 @@
#include "d/d_dylink.h"
#include "d/d_fader.h"
#include "d/d_scene.h"
#include "d/d_camera.h"
#include "egg/gfx/eggScreen.h"
#include "f/f_profile_name.h"
#include "m/m2d.h"
@@ -190,6 +191,9 @@ public:
sReloaderType = type;
}
static dCamera_c *getCamera(s32 idx);
static void setCamera(s32 idx, dCamera_c *);
protected:
static u32 sUpdateFrameCount;
static u8 sCurrentLayer;
+16
View File
@@ -2,6 +2,7 @@
#define D_LYT_CONTROL_GAME_H
#include "d/d_base.h"
#include "s/s_State.hpp"
class dLytControlGame_c : public dBase_c {
public:
@@ -17,7 +18,22 @@ public:
return sInstance;
}
STATE_FUNC_DECLARE(dLytControlGame_c, Normal);
STATE_FUNC_DECLARE(dLytControlGame_c, Pause_SetRes);
STATE_FUNC_DECLARE(dLytControlGame_c, Pause_SyncRes);
STATE_FUNC_DECLARE(dLytControlGame_c, Pause);
STATE_FUNC_DECLARE(dLytControlGame_c, Pause_DelRes);
STATE_FUNC_DECLARE(dLytControlGame_c, Map_SetRes);
STATE_FUNC_DECLARE(dLytControlGame_c, Map_SyncRes);
STATE_FUNC_DECLARE(dLytControlGame_c, Map);
STATE_FUNC_DECLARE(dLytControlGame_c, Map_DelRes);
bool isStateNormal() const {
return *mStateMgr.getStateID() == StateID_Normal;
}
private:
/* 0x00068 */ UI_STATE_MGR_DECLARE(dLytControlGame_c);
static dLytControlGame_c *sInstance;
};
+8 -3
View File
@@ -30,11 +30,16 @@ public:
enum DoButton_e {
DO_BUTTON_A = 0,
DO_BUTTON_B = 1,
DO_BUTTON_Z = 3,
};
void set(DoButton_e button, Action_e value) {
field_0x04[button] = value;
field_0x34[button] = true;
static void set(DoButton_e button, Action_e value) {
LytDoButtonRelated *b = sInstance;
if (b != nullptr) {
b->field_0x04[button] = value;
b->field_0x34[button] = true;
}
}
static Action_e get(DoButton_e button) {
+34 -8
View File
@@ -1,9 +1,12 @@
#ifndef D_LYT_METER_Z_BTN_H
#define D_LYT_METER_Z_BTN_H
#include "common.h"
#include "d/lyt/d2d.h"
#include "d/lyt/d_textbox.h"
#include "d/lyt/d_window.h"
#include "nw4r/lyt/lyt_pane.h"
#include "s/s_State.hpp"
#include "s/s_StateMgr.hpp"
class dLytMeterZBtn_c : public d2d::dSubPane {
public:
@@ -11,21 +14,44 @@ public:
virtual bool build(d2d::ResAccIf_c *resAcc) override;
virtual bool remove() override;
virtual bool execute() override;
virtual nw4r::lyt::Pane *getPane() override;
virtual d2d::LytBase_c *getLyt() override;
virtual const char *getName() const override;
virtual nw4r::lyt::Pane *getPane() override {
return mLyt.getLayout()->GetRootPane();
}
virtual d2d::LytBase_c *getLyt() override {
return &mLyt;
}
virtual const char *getName() const override {
return mLyt.getName();
}
virtual ~dLytMeterZBtn_c() {}
bool isCalling() const;
private:
void setMessage(s32 id);
STATE_FUNC_DECLARE(dLytMeterZBtn_c, Wait);
STATE_FUNC_DECLARE(dLytMeterZBtn_c, On);
STATE_FUNC_DECLARE(dLytMeterZBtn_c, Active);
STATE_FUNC_DECLARE(dLytMeterZBtn_c, Off);
UI_STATE_MGR_DECLARE(dLytMeterZBtn_c);
d2d::dLytSub mLyt;
/* 0x0D8 */ d2d::AnmGroup_c mAnmGroups[3];
/* 0x??? */ u8 padding[0x121C8 - 0x12198];
/* 0x008 */ UI_STATE_MGR_DECLARE(dLytMeterZBtn_c);
/* 0x04C */ d2d::dLytSub mLyt;
/* 0x0D8 */ d2d::AnmGroup_c mAnm[3];
/* 0x198 */ nw4r::lyt::Pane *mpPane;
/* 0x19C */ nw4r::lyt::Pane *mpOwnerPane;
/* 0x1A0 */ dTextBox_c *mpTextBoxes[2];
/* 0x1A8 */ dWindow_c *mpWindow[1];
/* 0x1AC */ dTextBox_c *mpSizeBox[1];
/* 0x1B0 */ s32 field_0x1B0;
/* 0x1B4 */ s32 field_0x1B4;
/* 0x1B8 */ BOOL field_0x1B8;
/* 0x1BC */ s32 field_0x1BC;
/* 0x1C0 */ s32 mOnDelay;
/* 0x1C4 */ bool field_0x1C4;
/* 0x1C5 */ u8 field_0x1C5;
/* 0x1C6 */ u8 field_0x1C6;
};
#endif
+2 -1
View File
@@ -213,12 +213,13 @@ public:
void addReadTarget(dAcObjBase_c &actor, u32 flags, f32 field_0x14, f32 ignored, f32 field_0x20, f32 field_0x24);
void addReadTarget2(dAcObjBase_c &actor, u32 flags, f32 field_0x14, f32 field_0x20, f32 field_0x24);
bool checkLink2() const;
private:
bool isInNormalGameState() const;
bool checkZButtonPressed() const;
bool checkZButtonHeld() const;
bool checkLink1() const;
bool checkLink2() const;
bool switchTarget(s32 target);
bool playTargetAnim(s32 target);