diff options
| author | robojumper <robojumper@gmail.com> | 2024-10-16 03:57:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-15 21:57:41 -0400 |
| commit | ec4d28cd259fd1f452f716ca032d936a62f79393 (patch) | |
| tree | 062fc92645f70fbbeb10a58a3cfab18dc739ec1a /include | |
| parent | bf79fa17fbc106fd06c545732ad875275821376e (diff) | |
Some dLytAreaCaption_c (#63)
Diffstat (limited to 'include')
| -rw-r--r-- | include/d/lyt/d2d.h | 8 | ||||
| -rw-r--r-- | include/d/lyt/d_lyt_area_caption.h | 73 | ||||
| -rw-r--r-- | include/d/lyt/d_lyt_sub.h | 2 | ||||
| -rw-r--r-- | include/d/lyt/d_textbox.h | 4 | ||||
| -rw-r--r-- | include/m/m2d.h | 4 |
5 files changed, 86 insertions, 5 deletions
diff --git a/include/d/lyt/d2d.h b/include/d/lyt/d2d.h index 94836ebe..72c6a7f2 100644 --- a/include/d/lyt/d2d.h +++ b/include/d/lyt/d2d.h @@ -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(); diff --git a/include/d/lyt/d_lyt_area_caption.h b/include/d/lyt/d_lyt_area_caption.h new file mode 100644 index 00000000..f9e22a8e --- /dev/null +++ b/include/d/lyt/d_lyt_area_caption.h @@ -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 diff --git a/include/d/lyt/d_lyt_sub.h b/include/d/lyt/d_lyt_sub.h index 21745ad8..cf19b493 100644 --- a/include/d/lyt/d_lyt_sub.h +++ b/include/d/lyt/d_lyt_sub.h @@ -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 { diff --git a/include/d/lyt/d_textbox.h b/include/d/lyt/d_textbox.h index 2bcf8ee1..423419ae 100644 --- a/include/d/lyt/d_textbox.h +++ b/include/d/lyt/d_textbox.h @@ -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 diff --git a/include/m/m2d.h b/include/m/m2d.h index daf4aa6f..98af84a1 100644 --- a/include/m/m2d.h +++ b/include/m/m2d.h @@ -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(); |
