Some dLytAreaCaption_c (#63)

This commit is contained in:
robojumper
2024-10-16 03:57:41 +02:00
committed by GitHub
parent bf79fa17fb
commit ec4d28cd25
13 changed files with 423 additions and 81 deletions
+4 -4
View File
@@ -118,9 +118,9 @@ struct AnmGroupBase_c {
bool init(const char *fileName, m2d::ResAccIf_c *acc, d2d::Layout_c *layout, const char *animName);
bool init(nw4r::lyt::AnimTransform *transform, const char *fileName, m2d::ResAccIf_c *acc, nw4r::lyt::Group *group);
bool fn_800AC6D0(bool);
bool fn_800AC7D0();
bool fn_800AC860();
bool setDirection(bool backwards);
bool unbind();
bool afterUnbind();
void setAnimEnable(bool);
void setAnmFrame(f32);
void syncAnmFrame();
@@ -128,7 +128,7 @@ struct AnmGroupBase_c {
void setBackward();
inline void setFrameAndControlThings(f32 frame) {
fn_800AC6D0(false);
setDirection(false);
setAnimEnable(true);
mpFrameCtrl->setFrame(frame);
syncAnmFrame();
+73
View File
@@ -0,0 +1,73 @@
#ifndef D_LYT_AREA_CAPTION_H
#define D_LYT_AREA_CAPTION_H
#include <d/lyt/d2d.h>
#include <d/lyt/d_lyt_sub.h>
#include <s/s_State.hpp>
#include <s/s_StateMgr.hpp>
class dLytAreaCaptionParts_c {
public:
dLytAreaCaptionParts_c() : mStateMgr(*this, sStateID::null) {}
~dLytAreaCaptionParts_c() {}
bool init(int first);
void check();
bool update();
bool remove();
bool draw();
void setTextIfWaiting(const char *text);
STATE_FUNC_DECLARE(dLytAreaCaptionParts_c, Wait);
STATE_FUNC_DECLARE(dLytAreaCaptionParts_c, Start);
STATE_FUNC_DECLARE(dLytAreaCaptionParts_c, Out);
private:
/* 0x000 */ UI_STATE_MGR_DECLARE(dLytAreaCaptionParts_c);
/* 0x040 */ d2d::ResAccIf_c mResAcc;
/* 0x0EB */ dLytSub mLyt;
/* 0x110 */ d2d::AnmGroup_c mAnmGroups[4];
/* 0x540 */ dTextBox_c *mTextBoxes[3];
/* 0x54C */ u8 field_0x54C;
/* 0x54D */ u8 field_0x54D;
/* 0x54E */ u8 mFirst;
/* 0x54F */ bool mAnmCtrlInUse[4];
};
class dLytAreaCaption_c {
public:
static dLytAreaCaption_c *sInstance;
static bool create();
static bool remove();
static bool update();
static bool draw();
static void setTextIfWaiting(const char *);
static void setArea(int id);
static void check();
static void set0xAAC(u8 arg);
static u8 get0xAAC();
private:
dLytAreaCaption_c() {
sInstance = this;
}
~dLytAreaCaption_c() {
sInstance = nullptr;
}
bool init();
bool deinit();
bool doUpdate();
bool doDraw();
void doSetTextIfWaiting(const char *);
void doSetArea(int id);
void doCheck();
dLytAreaCaptionParts_c mParts[2];
s32 mPartToDraw;
u8 field_0xAAC;
};
#endif
+1 -1
View File
@@ -8,7 +8,7 @@ public:
dLytSub() {}
virtual bool build(const char *name, m2d::ResAccIf_c *acc) override {
mpName = name;
d2d::LytBase_c::build(name, acc);
return d2d::LytBase_c::build(name, acc);
}
const char *getName() const {
+4
View File
@@ -37,6 +37,10 @@ public:
}
}
void fn_800E0A60(const char *area, ...) {
// TODO
}
static f32 GetTranslateX1_();
// @bug: This does not implement UT's RTTI, so casts to dTextBox_c will
+4
View File
@@ -141,6 +141,10 @@ public:
/* vt 0x08 */ virtual ~Base_c();
/* vt 0x0C */ virtual void draw();
void setPriority(u8 p) {
mPriority = p;
}
/* 0x0C */ u8 mPriority;
void addToDrawList();