From fc89f2b34a626b5d0e0520ad7d0b1afc3ea46f7f Mon Sep 17 00:00:00 2001 From: robojumper Date: Tue, 1 Apr 2025 23:08:44 +0200 Subject: d_lyt_msg_window_wood OK, d_lyt_common_a_btn OK --- include/d/d_sys.h | 1 + include/d/lyt/d2d.h | 48 +++++----- include/d/lyt/d_lyt_common_a_btn.h | 103 +++++++++++++++++++++ include/d/lyt/d_textbox.h | 11 ++- include/d/lyt/msg_window/d_lyt_msg_window_common.h | 27 ++++++ include/d/lyt/msg_window/d_lyt_msg_window_wood.h | 55 +++++++++++ 6 files changed, 221 insertions(+), 24 deletions(-) create mode 100644 include/d/lyt/d_lyt_common_a_btn.h create mode 100644 include/d/lyt/msg_window/d_lyt_msg_window_common.h create mode 100644 include/d/lyt/msg_window/d_lyt_msg_window_wood.h (limited to 'include') diff --git a/include/d/d_sys.h b/include/d/d_sys.h index 02a9c127..a9d6ff9c 100644 --- a/include/d/d_sys.h +++ b/include/d/d_sys.h @@ -7,6 +7,7 @@ namespace dSys { void setFrameRate(u32); +u8 getFrameRate(); void setClearColor(mColor clr); } // namespace dSys_c diff --git a/include/d/lyt/d2d.h b/include/d/lyt/d2d.h index a1015f1f..50dddb7e 100644 --- a/include/d/lyt/d2d.h +++ b/include/d/lyt/d2d.h @@ -44,10 +44,10 @@ class Multi_c : public m2d::Base_c { public: Multi_c(); virtual ~Multi_c() {} - virtual void draw() override; - virtual void animate(); - virtual void calc(); - virtual bool build(const char *name, m2d::ResAccIf_c *acc); + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual void animate(); + /* vt 0x18 */ virtual void calc(); + /* vt 0x18 */ virtual bool build(const char *name, m2d::ResAccIf_c *acc); void calcBefore(); void calcAfter(); @@ -79,11 +79,11 @@ class LytBase_c : public Multi_c { public: LytBase_c(); virtual ~LytBase_c(); - virtual void draw() override { + /* vt 0x0C */ virtual void draw() override { mLayout.Draw(mDrawInfo); }; - virtual bool build(const char *name, m2d::ResAccIf_c *acc) override; + /* vt 0x18 */ virtual bool build(const char *name, m2d::ResAccIf_c *acc) override; dTextBox_c *getTextBox(const char *name); dTextBox_c *getSizeBoxInWindow(const char *windowName); dWindow_c *getWindow(const char *name); @@ -131,9 +131,11 @@ private: class dSubPane; struct SubPaneListNode { - nw4r::ut::LinkListNode mNode; - dSubPane *mpLytPane; - nw4r::lyt::Pane *mpPane; + /* 0x00 */ nw4r::ut::LinkListNode mNode; + /** The d lyt pane, set by the UI element */ + /* 0x08 */ dSubPane *mpLytPane; + /** The nw4r lyt pane, set by linkMeters */ + /* 0x0C */ nw4r::lyt::Pane *mpPane; }; typedef nw4r::ut::LinkList SubPaneList; @@ -141,24 +143,24 @@ typedef nw4r::ut::LinkList Su class dSubPane { public: dSubPane() : field_0x04(false), field_0x05(0) {} - virtual ~dSubPane() {} - virtual bool build(ResAccIf_c *resAcc) = 0; - virtual bool remove() = 0; - virtual bool execute() = 0; - virtual nw4r::lyt::Pane *getPane() = 0; - virtual LytBase_c *getLyt() = 0; - virtual const char *getName() const = 0; - virtual bool LytMeter0x24() const { + /* vt 0x08 */ virtual ~dSubPane() {} + /* vt 0x0C */ virtual bool build(ResAccIf_c *resAcc) = 0; + /* vt 0x10 */ virtual bool remove() = 0; + /* vt 0x14 */ virtual bool execute() = 0; + /* vt 0x18 */ virtual nw4r::lyt::Pane *getPane() = 0; + /* vt 0x1C */ virtual LytBase_c *getLyt() = 0; + /* vt 0x20 */ virtual const char *getName() const = 0; + /* vt 0x24 */ virtual bool LytMeter0x24() const { return field_0x04; } - virtual void LytMeter0x28(bool arg) { + /* vt 0x28 */ virtual void LytMeter0x28(bool arg) { field_0x04 = arg; } - virtual u8 LytMeter0x2C() const { + /* vt 0x2C */ virtual u8 LytMeter0x2C() const { return field_0x05; } - virtual void LytMeter0x30(u8 arg) { + /* vt 0x30 */ virtual void LytMeter0x30(u8 arg) { field_0x05 = arg; } @@ -178,9 +180,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 setDirection(bool backwards); + bool bind(bool bDisable); bool unbind(); - bool afterUnbind(); + bool remove(); void setAnimEnable(bool); void setAnmFrame(f32); void syncAnmFrame(); @@ -188,7 +190,7 @@ struct AnmGroupBase_c { void setBackward(); inline void setFrameAndControlThings(f32 frame) { - setDirection(false); + bind(false); setAnimEnable(true); mpFrameCtrl->setFrame(frame); syncAnmFrame(); diff --git a/include/d/lyt/d_lyt_common_a_btn.h b/include/d/lyt/d_lyt_common_a_btn.h new file mode 100644 index 00000000..dc38a6ae --- /dev/null +++ b/include/d/lyt/d_lyt_common_a_btn.h @@ -0,0 +1,103 @@ +#ifndef D_LYT_COMMON_A_BTN_H +#define D_LYT_COMMON_A_BTN_H + +#include "d/lyt/d2d.h" + +/** + * Made up name. + * + * An A button used in various message windows, as well as + * the title menu. Can be hidden, visible, animating in, animating out. + */ +class dLytCommonABtn_c : public d2d::dSubPane { +public: + virtual bool build(d2d::ResAccIf_c *resAcc) override; + virtual bool remove() override; + virtual bool execute() 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(); + } + + void openMaybe() { + field_0x1B0 = 1; + } + + void closeMaybe() { + field_0x1B0 = 0; + } + + u8 shouldBeOpen() const { + return field_0x1B0; + } + + u8 isDoneOut() const { + return mIsDoneOut; + } + + bool requestIn(); + bool requestOut(bool b); + + enum SoundVariant { + VARIANT_NORMAL, + VARIANT_TITLE, + }; + + void setSoundVariant(SoundVariant); + void resetToInvisble(); + + enum ABtnState { + STATE_INVISIBLE, + STATE_IN, + STATE_VISIBLE, + STATE_OUT, + }; + +private: + + enum OutState { + OUT_STATE_DECIDING, + OUT_STATE_GOTO_OUT, + OUT_STATE_OUT, + OUT_STATE_GOTO_INVISIBLE, + }; + + void setState(ABtnState state); + + void runExecuteFunc(); + + void executeStateInvisible(); + void executeStateIn(); + void executeStateVisible(); + void executeStateDecideOut(); + + void gotoStateInvisible(); + void gotoStateIn(); + void goToStateVisible(); + void goToStateDecideOut(); + + typedef void (dLytCommonABtn_c::*executeFunc)(void); + static const executeFunc sExecuteFuncs[4]; + + /* 0x008 */ d2d::dLytSub mLyt; + /* 0x09C */ d2d::AnmGroup_c mAnm[4]; + /* 0x19C */ ABtnState mState; + /* 0x1A0 */ OutState mOutState; + /* 0x1A4 */ SoundVariant mSoundVariant; + /* 0x1A8 */ u8 field_0x1A8; + /* 0x1A9 */ bool mInRequested; + /* 0x1AA */ bool mOutRequested; + /* 0x1AB */ bool mIsDoneOut; + /* 0x1AC */ u8 field_0x1AC; + /* 0x1AD */ bool mNoDecide; + /* 0x1AE */ u8 field_0x1AE; + /* 0x1AF */ u8 field_0x1AF; + /* 0x1B0 */ u8 field_0x1B0; +}; + +#endif diff --git a/include/d/lyt/d_textbox.h b/include/d/lyt/d_textbox.h index b3a69449..cfbd3396 100644 --- a/include/d/lyt/d_textbox.h +++ b/include/d/lyt/d_textbox.h @@ -5,6 +5,8 @@ #include "nw4r/lyt/lyt_textBox.h" #include "nw4r/lyt/lyt_types.h" +class dTagProcessor_c; + class dTextBox_c : public nw4r::lyt::TextBox { friend class dWindow_c; @@ -26,6 +28,10 @@ public: nw4r::lyt::TextBox::SetFontSize(value); } + void set0x1F6(u8 val) { + field_0x1F6 = val; + } + void set0x1F8(u8 val) { field_0x1F8 = val; } @@ -39,6 +45,7 @@ public: } void fn_800AF930(const wchar_t *); + void fn_800AF540(const wchar_t *text, dTagProcessor_c *tagProcessor, ...); // @bug: This does not implement UT's RTTI, so casts to dTextBox_c will // succeed even if all you have is a lyt::TextBox @@ -49,7 +56,9 @@ private: /* 0x108 */ u8 field_0x108[0x118 - 0x108]; /* 0x118 */ nw4r::lyt::Size mTextScale; /* 0x120 */ f32 mScale; - /* 0x124 */ u8 field_0x124[0x1F8 - 0x124]; + /* 0x124 */ u8 field_0x124[0x1F6 - 0x124]; + /* 0x1F6 */ u8 field_0x1F6; + /* 0x1F7 */ u8 field_0x1F7; /* 0x1F8 */ u8 field_0x1F8; /* 0x1F9 */ u8 field_0x1F9[0x204 - 0x1F9]; }; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h new file mode 100644 index 00000000..907cfbfd --- /dev/null +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -0,0 +1,27 @@ +#ifndef D_LYT_MGS_WINDOW_COMMON_H +#define D_LYT_MGS_WINDOW_COMMON_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "m/m2d.h" + +class dLytMsgWindowSubtype : public m2d::Base_c { +public: + /* vt 0x08 */ virtual ~dLytMsgWindowSubtype() {} + // vt 0x0C = m2d::Base_c::draw + /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor); + /* vt 0x14 */ virtual bool remove(); + /* vt 0x18 */ virtual bool execute(); + /* vt 0x1C */ virtual void vt_0x1C(); + /* vt 0x20 */ virtual bool vt_0x20() const; + /* vt 0x24 */ virtual void vt_0x24(); + /* vt 0x28 */ virtual bool vt_0x28() const; + /* vt 0x2C */ virtual bool setText(const wchar_t *text); + /* vt 0x30 */ virtual dTextBox_c *vt_0x30(); + /* vt 0x34 */ virtual void vt_0x34(); + /* vt 0x38 */ virtual void vt_0x38(bool b); + /* vt 0x3C */ virtual u8 vt_0x3C() const; + /* vt 0x40 */ virtual bool vt_0x40() const; +}; + +#endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h new file mode 100644 index 00000000..b3457fc4 --- /dev/null +++ b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h @@ -0,0 +1,55 @@ +#ifndef D_LYT_MSG_WINDOW_WOOD_H +#define D_LYT_MSG_WINDOW_WOOD_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_a_btn.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +class dLytMsgWindowWood_c : public dLytMsgWindowSubtype { +public: + /* vt 0x08 */ virtual ~dLytMsgWindowWood_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void vt_0x1C() override; + /* vt 0x20 */ virtual bool vt_0x20() const override; + /* vt 0x24 */ virtual void vt_0x24() override; + /* vt 0x28 */ virtual bool vt_0x28() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { + return mpTextboxes[0]; + } + /* vt 0x34 */ virtual void vt_0x34() override { + mCommon.requestIn(); + } + /* vt 0x38 */ virtual void vt_0x38(bool b) override { + mCommon.requestOut(b); + } + /* vt 0x3C */ virtual u8 vt_0x3C() const override { + return mCommon.isDoneOut(); + } + + STATE_FUNC_DECLARE(dLytMsgWindowWood_c, Invisible); + STATE_FUNC_DECLARE(dLytMsgWindowWood_c, In); + STATE_FUNC_DECLARE(dLytMsgWindowWood_c, Visible); + STATE_FUNC_DECLARE(dLytMsgWindowWood_c, Out); + +private: + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowWood_c); + /* 0x04C */ d2d::SubPaneList mSubpaneList; + /* 0x05C */ d2d::SubPaneListNode mNodes[1]; + /* 0x068 */ d2d::ResAccIf_c mResAcc; + /* 0x3D8 */ d2d::LytBase_c mLyt; + /* 0x468 */ d2d::AnmGroup_c mAnm[3]; + /* 0x528 */ dTextBox_c *mpTextboxes[2]; + /* 0x530 */ nw4r::lyt::Pane *mpPanes[2]; + /* 0x538 */ dTagProcessor_c *mpTagProcessor; + /* 0x53C */ dLytCommonABtn_c mCommon; +}; + +#endif -- cgit v1.2.3 From a4ff5b11f771e9375fc8fed3f5b492423a68529b Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 2 Apr 2025 00:06:25 +0200 Subject: Fix and remove probably wrong inline --- include/d/lyt/d2d.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include') diff --git a/include/d/lyt/d2d.h b/include/d/lyt/d2d.h index 50dddb7e..f5dbb2eb 100644 --- a/include/d/lyt/d2d.h +++ b/include/d/lyt/d2d.h @@ -189,13 +189,6 @@ struct AnmGroupBase_c { void setForward(); void setBackward(); - inline void setFrameAndControlThings(f32 frame) { - bind(false); - setAnimEnable(true); - mpFrameCtrl->setFrame(frame); - syncAnmFrame(); - } - inline void play() { mpFrameCtrl->play(); syncAnmFrame(); -- cgit v1.2.3 From a337ae752a4aa67b423baee3d28fb6ae9a28c5be Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 2 Apr 2025 00:29:45 +0200 Subject: Fix variable ownership --- include/d/lyt/d_lyt_common_a_btn.h | 18 ++---------------- include/d/lyt/msg_window/d_lyt_msg_window_common.h | 8 ++++---- include/d/lyt/msg_window/d_lyt_msg_window_wood.h | 9 +++++---- 3 files changed, 11 insertions(+), 24 deletions(-) (limited to 'include') diff --git a/include/d/lyt/d_lyt_common_a_btn.h b/include/d/lyt/d_lyt_common_a_btn.h index dc38a6ae..0a09b4e0 100644 --- a/include/d/lyt/d_lyt_common_a_btn.h +++ b/include/d/lyt/d_lyt_common_a_btn.h @@ -24,18 +24,6 @@ public: return mLyt.getName(); } - void openMaybe() { - field_0x1B0 = 1; - } - - void closeMaybe() { - field_0x1B0 = 0; - } - - u8 shouldBeOpen() const { - return field_0x1B0; - } - u8 isDoneOut() const { return mIsDoneOut; } @@ -59,7 +47,6 @@ public: }; private: - enum OutState { OUT_STATE_DECIDING, OUT_STATE_GOTO_OUT, @@ -70,12 +57,12 @@ private: void setState(ABtnState state); void runExecuteFunc(); - + void executeStateInvisible(); void executeStateIn(); void executeStateVisible(); void executeStateDecideOut(); - + void gotoStateInvisible(); void gotoStateIn(); void goToStateVisible(); @@ -97,7 +84,6 @@ private: /* 0x1AD */ bool mNoDecide; /* 0x1AE */ u8 field_0x1AE; /* 0x1AF */ u8 field_0x1AF; - /* 0x1B0 */ u8 field_0x1B0; }; #endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h index 907cfbfd..cf65fb8e 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_common.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -12,10 +12,10 @@ public: /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor); /* vt 0x14 */ virtual bool remove(); /* vt 0x18 */ virtual bool execute(); - /* vt 0x1C */ virtual void vt_0x1C(); - /* vt 0x20 */ virtual bool vt_0x20() const; - /* vt 0x24 */ virtual void vt_0x24(); - /* vt 0x28 */ virtual bool vt_0x28() const; + /* vt 0x1C */ virtual void open(); + /* vt 0x20 */ virtual bool isOpening() const; + /* vt 0x24 */ virtual void close(); + /* vt 0x28 */ virtual bool isClosing() const; /* vt 0x2C */ virtual bool setText(const wchar_t *text); /* vt 0x30 */ virtual dTextBox_c *vt_0x30(); /* vt 0x34 */ virtual void vt_0x34(); diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h index b3457fc4..b56499ae 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h @@ -16,10 +16,10 @@ public: /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; - /* vt 0x1C */ virtual void vt_0x1C() override; - /* vt 0x20 */ virtual bool vt_0x20() const override; - /* vt 0x24 */ virtual void vt_0x24() override; - /* vt 0x28 */ virtual bool vt_0x28() const override; + /* vt 0x1C */ virtual void open() override; + /* vt 0x20 */ virtual bool isOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isClosing() const override; /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { return mpTextboxes[0]; @@ -50,6 +50,7 @@ private: /* 0x530 */ nw4r::lyt::Pane *mpPanes[2]; /* 0x538 */ dTagProcessor_c *mpTagProcessor; /* 0x53C */ dLytCommonABtn_c mCommon; + /* 0x6EC */ bool mShouldBeOpen; }; #endif -- cgit v1.2.3 From 5e2343afb79863394f5f1487d70cd3492305963e Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 2 Apr 2025 00:57:49 +0200 Subject: d_lyt_msg_window_stone OK --- include/d/lyt/msg_window/d_lyt_msg_window_stone.h | 56 +++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 include/d/lyt/msg_window/d_lyt_msg_window_stone.h (limited to 'include') diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h new file mode 100644 index 00000000..e7b16086 --- /dev/null +++ b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h @@ -0,0 +1,56 @@ +#ifndef D_LYT_MSG_WINDOW_STONE_H +#define D_LYT_MSG_WINDOW_STONE_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_a_btn.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +class dLytMsgWindowStone_c : public dLytMsgWindowSubtype { +public: + /* vt 0x08 */ virtual ~dLytMsgWindowStone_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void open() override; + /* vt 0x20 */ virtual bool isOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isClosing() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { + return mpTextboxes[0]; + } + /* vt 0x34 */ virtual void vt_0x34() override { + mCommon.requestIn(); + } + /* vt 0x38 */ virtual void vt_0x38(bool b) override { + mCommon.requestOut(b); + } + /* vt 0x3C */ virtual u8 vt_0x3C() const override { + return mCommon.isDoneOut(); + } + + STATE_FUNC_DECLARE(dLytMsgWindowStone_c, Invisible); + STATE_FUNC_DECLARE(dLytMsgWindowStone_c, In); + STATE_FUNC_DECLARE(dLytMsgWindowStone_c, Visible); + STATE_FUNC_DECLARE(dLytMsgWindowStone_c, Out); + +private: + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowStone_c); + /* 0x04C */ d2d::SubPaneList mSubpaneList; + /* 0x05C */ d2d::SubPaneListNode mNodes[1]; + /* 0x068 */ d2d::ResAccIf_c mResAcc; + /* 0x3D8 */ d2d::LytBase_c mLyt; + /* 0x468 */ d2d::AnmGroup_c mAnm[3]; + /* 0x528 */ dTextBox_c *mpTextboxes[3]; + /* 0x530 */ nw4r::lyt::Pane *mpPanes[2]; + /* 0x538 */ dTagProcessor_c *mpTagProcessor; + /* 0x53C */ dLytCommonABtn_c mCommon; + /* 0x6EC */ bool mShouldBeOpen; +}; + +#endif -- cgit v1.2.3 From 4e88b4aec785bd1468bbe4716941e2681a8387e9 Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 2 Apr 2025 13:36:11 +0200 Subject: auto_caption, auto_explain largely matching --- include/d/d_tag_processor.h | 10 +++-- include/d/lyt/d_lyt_auto_caption.h | 45 ++++++++++++++++++++++ include/d/lyt/d_lyt_auto_explain.h | 45 ++++++++++++++++++++++ include/d/lyt/d_lyt_common_a_btn.h | 2 +- include/d/lyt/d_textbox.h | 1 + include/d/lyt/msg_window/d_lyt_msg_window_common.h | 14 +++++-- include/d/lyt/msg_window/d_lyt_msg_window_stone.h | 17 ++++---- include/d/lyt/msg_window/d_lyt_msg_window_wood.h | 17 ++++---- include/nw4r/lyt/lyt_textBox.h | 4 ++ 9 files changed, 131 insertions(+), 24 deletions(-) create mode 100644 include/d/lyt/d_lyt_auto_caption.h create mode 100644 include/d/lyt/d_lyt_auto_explain.h (limited to 'include') diff --git a/include/d/d_tag_processor.h b/include/d/d_tag_processor.h index c68ad2f1..bb551637 100644 --- a/include/d/d_tag_processor.h +++ b/include/d/d_tag_processor.h @@ -45,7 +45,7 @@ public: u8 symbolToFontIdx(s32 s); void setStringArg(const wchar_t *arg, s32 index); - static s32 getNumLines(s32 arg); + static s32 getMaxNumLines(s32 arg); static void getTextCommand(wchar_t _0xe, const wchar_t *src, u8 *outCmdLen, s32 *outCmd, wchar_t **outEndPtr); static void process0xFCommand(wchar_t _0xf, const wchar_t *src, s32 *outCmd); @@ -68,6 +68,10 @@ public: s32 tickPauseFrame(); s32 tick0x830(); + s32 getNumLinesMaybe() const { + return mCommandInsert; + } + private: /* 0x004 */ dTextBox_c *field_0x004; /* 0x008 */ wchar_t field_0x008[4][256]; @@ -121,8 +125,8 @@ private: /* 0x90D */ u8 field_0x90D; /* 0x90E */ u8 field_0x90E; /* 0x90F */ u8 field_0x90F[4]; - /* 0x914 */ f32 field_0x914[0x32]; - /* 0x9DC */ s32 mCommandInsert; + /* 0x914 */ f32 field_0x914[0x32]; // Maybe width for each individual line + /* 0x9DC */ s32 mCommandInsert; // Maybe number of lines /* 0x9E0 */ wchar_t mStringArgs[8][64]; /* 0xDE0 */ u8 field_0xDE0[0xEE0 - 0xDE0]; /* 0xEE0 */ u8 field_0xEE0; diff --git a/include/d/lyt/d_lyt_auto_caption.h b/include/d/lyt/d_lyt_auto_caption.h new file mode 100644 index 00000000..d09c86fe --- /dev/null +++ b/include/d/lyt/d_lyt_auto_caption.h @@ -0,0 +1,45 @@ +#ifndef D_LYT_AUTO_CAPTION_H +#define D_LYT_AUTO_CAPTION_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +class dLytAutoCaption_c : public dLytMsgWindowSubtype { +public: + /* vt 0x08 */ virtual ~dLytAutoCaption_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void open() override; + /* vt 0x20 */ virtual bool isOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isClosing() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { + return mpTextboxes[0]; + } + + STATE_FUNC_DECLARE(dLytAutoCaption_c, Invisible); + STATE_FUNC_DECLARE(dLytAutoCaption_c, In); + STATE_FUNC_DECLARE(dLytAutoCaption_c, OutputText); + STATE_FUNC_DECLARE(dLytAutoCaption_c, Out); + +private: + static bool checkSomethingMeter(); + + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytAutoCaption_c); + /* 0x068 */ d2d::ResAccIf_c mResAcc; + /* 0x3C4 */ d2d::LytBase_c mLyt; + /* 0x44C */ d2d::AnmGroup_c mAnm[4]; + /* 0x54C */ dTextBox_c *mpTextboxes[2]; + /* 0x554 */ nw4r::lyt::Pane *mpPane; + /* 0x558 */ dTagProcessor_c *mpTagProcessor; + /* 0x55C */ bool mShouldBeOpen; +}; + +#endif diff --git a/include/d/lyt/d_lyt_auto_explain.h b/include/d/lyt/d_lyt_auto_explain.h new file mode 100644 index 00000000..e9e62e48 --- /dev/null +++ b/include/d/lyt/d_lyt_auto_explain.h @@ -0,0 +1,45 @@ +#ifndef D_LYT_AUTO_EXPLAIN_H +#define D_LYT_AUTO_EXPLAIN_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +class dLytAutoExplain_c : public dLytMsgWindowSubtype { +public: + /* vt 0x08 */ virtual ~dLytAutoExplain_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void open() override; + /* vt 0x20 */ virtual bool isOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isClosing() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { + return mpTextboxes[0]; + } + + STATE_FUNC_DECLARE(dLytAutoExplain_c, Invisible); + STATE_FUNC_DECLARE(dLytAutoExplain_c, In); + STATE_FUNC_DECLARE(dLytAutoExplain_c, OutputText); + STATE_FUNC_DECLARE(dLytAutoExplain_c, Out); + +private: + static bool checkSomethingMeter(); + + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytAutoExplain_c); + /* 0x068 */ d2d::ResAccIf_c mResAcc; + /* 0x3C4 */ d2d::LytBase_c mLyt; + /* 0x44C */ d2d::AnmGroup_c mAnm[3]; + /* 0x50C */ dTextBox_c *mpTextboxes[2]; + /* 0x514 */ nw4r::lyt::Pane *mpPane; + /* 0x518 */ dTagProcessor_c *mpTagProcessor; + /* 0x51C */ bool mShouldBeOpen; +}; + +#endif diff --git a/include/d/lyt/d_lyt_common_a_btn.h b/include/d/lyt/d_lyt_common_a_btn.h index 0a09b4e0..a2f9fe02 100644 --- a/include/d/lyt/d_lyt_common_a_btn.h +++ b/include/d/lyt/d_lyt_common_a_btn.h @@ -24,7 +24,7 @@ public: return mLyt.getName(); } - u8 isDoneOut() const { + bool isDoneOut() const { return mIsDoneOut; } diff --git a/include/d/lyt/d_textbox.h b/include/d/lyt/d_textbox.h index cfbd3396..134ceb75 100644 --- a/include/d/lyt/d_textbox.h +++ b/include/d/lyt/d_textbox.h @@ -44,6 +44,7 @@ public: // TODO } + s32 fn_800AF6B0(const wchar_t *, dTagProcessor_c *tagProcessor); void fn_800AF930(const wchar_t *); void fn_800AF540(const wchar_t *text, dTagProcessor_c *tagProcessor, ...); diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h index cf65fb8e..d8f843e3 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_common.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -9,7 +9,7 @@ class dLytMsgWindowSubtype : public m2d::Base_c { public: /* vt 0x08 */ virtual ~dLytMsgWindowSubtype() {} // vt 0x0C = m2d::Base_c::draw - /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor); + /* vt 0x10 */ virtual bool build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor); /* vt 0x14 */ virtual bool remove(); /* vt 0x18 */ virtual bool execute(); /* vt 0x1C */ virtual void open(); @@ -18,9 +18,15 @@ public: /* vt 0x28 */ virtual bool isClosing() const; /* vt 0x2C */ virtual bool setText(const wchar_t *text); /* vt 0x30 */ virtual dTextBox_c *vt_0x30(); - /* vt 0x34 */ virtual void vt_0x34(); - /* vt 0x38 */ virtual void vt_0x38(bool b); - /* vt 0x3C */ virtual u8 vt_0x3C() const; + /* vt 0x34 */ virtual bool vt_0x34() { + return true; + } + /* vt 0x38 */ virtual bool vt_0x38(bool b) { + return true; + } + /* vt 0x3C */ virtual bool vt_0x3C() const { + return true; + } /* vt 0x40 */ virtual bool vt_0x40() const; }; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h index e7b16086..4a52f910 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h @@ -13,7 +13,8 @@ class dLytMsgWindowStone_c : public dLytMsgWindowSubtype { public: /* vt 0x08 */ virtual ~dLytMsgWindowStone_c() {} /* vt 0x0C */ virtual void draw() override; - /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x10 */ virtual bool + build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; /* vt 0x1C */ virtual void open() override; @@ -24,14 +25,14 @@ public: /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { return mpTextboxes[0]; } - /* vt 0x34 */ virtual void vt_0x34() override { - mCommon.requestIn(); + /* vt 0x34 */ virtual bool vt_0x34() override { + return mBtn.requestIn(); } - /* vt 0x38 */ virtual void vt_0x38(bool b) override { - mCommon.requestOut(b); + /* vt 0x38 */ virtual bool vt_0x38(bool b) override { + return mBtn.requestOut(b); } - /* vt 0x3C */ virtual u8 vt_0x3C() const override { - return mCommon.isDoneOut(); + /* vt 0x3C */ virtual bool vt_0x3C() const override { + return mBtn.isDoneOut(); } STATE_FUNC_DECLARE(dLytMsgWindowStone_c, Invisible); @@ -49,7 +50,7 @@ private: /* 0x528 */ dTextBox_c *mpTextboxes[3]; /* 0x530 */ nw4r::lyt::Pane *mpPanes[2]; /* 0x538 */ dTagProcessor_c *mpTagProcessor; - /* 0x53C */ dLytCommonABtn_c mCommon; + /* 0x53C */ dLytCommonABtn_c mBtn; /* 0x6EC */ bool mShouldBeOpen; }; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h index b56499ae..795fdf97 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h @@ -13,7 +13,8 @@ class dLytMsgWindowWood_c : public dLytMsgWindowSubtype { public: /* vt 0x08 */ virtual ~dLytMsgWindowWood_c() {} /* vt 0x0C */ virtual void draw() override; - /* vt 0x10 */ virtual bool build(void *unk, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x10 */ virtual bool + build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; /* vt 0x1C */ virtual void open() override; @@ -24,14 +25,14 @@ public: /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { return mpTextboxes[0]; } - /* vt 0x34 */ virtual void vt_0x34() override { - mCommon.requestIn(); + /* vt 0x34 */ virtual bool vt_0x34() override { + return mBtn.requestIn(); } - /* vt 0x38 */ virtual void vt_0x38(bool b) override { - mCommon.requestOut(b); + /* vt 0x38 */ virtual bool vt_0x38(bool b) override { + return mBtn.requestOut(b); } - /* vt 0x3C */ virtual u8 vt_0x3C() const override { - return mCommon.isDoneOut(); + /* vt 0x3C */ virtual bool vt_0x3C() const override { + return mBtn.isDoneOut(); } STATE_FUNC_DECLARE(dLytMsgWindowWood_c, Invisible); @@ -49,7 +50,7 @@ private: /* 0x528 */ dTextBox_c *mpTextboxes[2]; /* 0x530 */ nw4r::lyt::Pane *mpPanes[2]; /* 0x538 */ dTagProcessor_c *mpTagProcessor; - /* 0x53C */ dLytCommonABtn_c mCommon; + /* 0x53C */ dLytCommonABtn_c mBtn; /* 0x6EC */ bool mShouldBeOpen; }; diff --git a/include/nw4r/lyt/lyt_textBox.h b/include/nw4r/lyt/lyt_textBox.h index 4dfd0549..f4d5bff9 100644 --- a/include/nw4r/lyt/lyt_textBox.h +++ b/include/nw4r/lyt/lyt_textBox.h @@ -77,6 +77,10 @@ public: mpTagProcessor = pTagProcessor; } + const wchar_t *GetString() const { + return mTextBuf; + } + virtual ~TextBox(); NW4R_UT_RTTI_DECL(TextBox); virtual void DrawSelf(const DrawInfo &drawInfo); // at 0x18 -- cgit v1.2.3 From 010c0a9a3ba79816c0994103f5745757f466acec Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 2 Apr 2025 17:47:19 +0200 Subject: Textbox progress --- include/d/d_tag_processor.h | 26 ++++++++++++++++++-- include/d/lyt/d2d.h | 6 ++--- include/d/lyt/d_textbox.h | 60 ++++++++++++++++++++++++++++++++++++--------- include/libms/commonlib.h | 5 ++-- include/libms/msgfile.h | 11 +++++---- include/nw4r/ut/ut_Font.h | 7 +++++- 6 files changed, 89 insertions(+), 26 deletions(-) (limited to 'include') diff --git a/include/d/d_tag_processor.h b/include/d/d_tag_processor.h index bb551637..930f565a 100644 --- a/include/d/d_tag_processor.h +++ b/include/d/d_tag_processor.h @@ -13,7 +13,9 @@ public: virtual ~dTagProcessor_c(); void - eventFlowTextProcessingRelated(dTextBox_c *textBox, const wchar_t *src, wchar_t *dest, u32 destLen, u32 *pOutLen); + format(dTextBox_c *textBox, const wchar_t *src, wchar_t *dest, u32 destLen, u32 *pOutLen, void *unk, ...); + void + formatV(dTextBox_c *textBox, const wchar_t *src, wchar_t *dest, u32 destLen, u32 *pOutLen, void *unk, va_list list); virtual nw4r::ut::Operation Process(u16 ch, nw4r::ut::PrintContext *ctx) override; virtual nw4r::ut::Operation CalcRect(nw4r::ut::Rect *rect, u16 ch, nw4r::ut::PrintContext *ctx) override; @@ -72,6 +74,26 @@ public: return mCommandInsert; } + u8 getMsgWindowSubtype() const { + return field_0x90C; + } + + void setMsgWindowSubtype(u8 type) { + field_0x90C = type; + } + + void setField_0xEE1(u8 val) { + field_0xEE1 = val; + } + + void setField_0xEE2(u8 val) { + field_0xEE2 = val; + } + + void setField_0xEE3(u8 val) { + field_0xEE3 = val; + } + private: /* 0x004 */ dTextBox_c *field_0x004; /* 0x008 */ wchar_t field_0x008[4][256]; @@ -126,7 +148,7 @@ private: /* 0x90E */ u8 field_0x90E; /* 0x90F */ u8 field_0x90F[4]; /* 0x914 */ f32 field_0x914[0x32]; // Maybe width for each individual line - /* 0x9DC */ s32 mCommandInsert; // Maybe number of lines + /* 0x9DC */ s32 mCommandInsert; // Maybe number of lines /* 0x9E0 */ wchar_t mStringArgs[8][64]; /* 0xDE0 */ u8 field_0xDE0[0xEE0 - 0xDE0]; /* 0xEE0 */ u8 field_0xEE0; diff --git a/include/d/lyt/d2d.h b/include/d/lyt/d2d.h index f5dbb2eb..7f79abcf 100644 --- a/include/d/lyt/d2d.h +++ b/include/d/lyt/d2d.h @@ -92,7 +92,7 @@ public: bool fn_800AB940(const char *name, int arg); bool fn_800AB9A0(dTextBox_c *textbox, int arg); - bool fn_800ABE50(dTextBox_c *textbox, int arg, void *unk); + bool fn_800ABE50(dTextBox_c *textbox, wchar_t *destBuf, u32 maxLen); private: void setPropertiesRecursive(nw4r::lyt::Pane *pane, f32, f32, f32, f32, f32); @@ -101,9 +101,9 @@ private: bool fn_800ABB80(dTextBox_c *textbox1, dTextBox_c *textbox2, int arg); bool fn_800ABCE0(const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *textbox1, dTextBox_c *textbox2, int arg); - bool fn_800AC040(dTextBox_c *textbox1, dTextBox_c *textbox2, int arg, void *unk); + bool fn_800AC040(dTextBox_c *textbox1, dTextBox_c *textbox2, wchar_t *destBuf, u32 maxLen); bool fn_800AC1AC( - const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *textbox1, dTextBox_c *textbox2, int arg, void *unk + const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *textbox1, dTextBox_c *textbox2, wchar_t *destBuf, u32 maxLen ); MsbtInfo *getMsbtInfo() const; bool fn_800AB930(dTextBox_c *box); diff --git a/include/d/lyt/d_textbox.h b/include/d/lyt/d_textbox.h index 134ceb75..6a05bab2 100644 --- a/include/d/lyt/d_textbox.h +++ b/include/d/lyt/d_textbox.h @@ -2,8 +2,12 @@ #define D_LYT_TEXTBOX_H #include "d/lyt/d2d.h" +#include "libms/msgfile.h" +#include "nw4r/lyt/lyt_drawInfo.h" #include "nw4r/lyt/lyt_textBox.h" #include "nw4r/lyt/lyt_types.h" +#include "nw4r/ut/ut_Rect.h" +#include "nw4r/ut/ut_TextWriterBase.h" class dTagProcessor_c; @@ -11,7 +15,8 @@ class dTextBox_c : public nw4r::lyt::TextBox { friend class dWindow_c; public: - dTextBox_c(const nw4r::lyt::res::TextBox *pBlock, const nw4r::lyt::ResBlockSet &ResBlockSet); + dTextBox_c(const nw4r::lyt::res::TextBox *pBlock, const nw4r::lyt::ResBlockSet &resBlockSet); + virtual void DrawSelf(const nw4r::lyt::DrawInfo &drawInfo) override; // at 0x18 f32 GetLineWidth(f32 *pOutSpacing); @@ -20,10 +25,10 @@ public: } void SetScale(f32 scale) { - nw4r::lyt::Size value(mTextScale); + nw4r::lyt::Size value(mMyTextScale); value.width *= scale; value.height *= scale; - mScale = scale; + mMyScale = scale; MySetScale(value); nw4r::lyt::TextBox::SetFontSize(value); } @@ -37,31 +42,62 @@ public: } f32 getMyScale() const { - return mScale; + return mMyScale; } void fn_800E0A60(const char *area, ...) { // TODO } - s32 fn_800AF6B0(const wchar_t *, dTagProcessor_c *tagProcessor); - void fn_800AF930(const wchar_t *); - void fn_800AF540(const wchar_t *text, dTagProcessor_c *tagProcessor, ...); + void setTextWithGlobalTextProcessor(const wchar_t *str); + void setTextWithGlobalTextProcessor(const wchar_t *str, void *, ...); + void setMessageWithGlobalTextProcessor(const char *labelId, void *unused, void *, ...); + void setMessageWithGlobalTextProcessorV(const char *labelId, void *unused, void *, va_list list); + void setTextWithTextProcessor(const wchar_t *str, dTagProcessor_c *tagProcessor, void *, ...); + s32 calcTextLines(const wchar_t *src, dTagProcessor_c *tagProcessor); + + void setMessageWithGlobalTextProcessorAndMsbtInfo(const MsbtInfo *info, const char *labelId, wchar_t *destBuf, u32 maxLen); + + void fn_800B0F40(); // @bug: This does not implement UT's RTTI, so casts to dTextBox_c will // succeed even if all you have is a lyt::TextBox private: + void init(); + void MySetFontSize(const nw4r::lyt::Size &value); void MySetScale(const nw4r::lyt::Size &value); + void setTextWithGlobalTextProcessorV(const wchar_t *str, void *, va_list list); + void setTextWithTextProcessorV(const wchar_t *str, dTagProcessor_c *tagProcessor, void *, va_list list); + + nw4r::ut::Rect GetMyTextDrawRect(nw4r::ut::TextWriterBase *pWriter, bool *pbWideScreenUnk) const; + + void fn_800AFD60(f32); + /* 0x104 */ d2d::LytBase_c *mpLytBase; - /* 0x108 */ u8 field_0x108[0x118 - 0x108]; - /* 0x118 */ nw4r::lyt::Size mTextScale; - /* 0x120 */ f32 mScale; - /* 0x124 */ u8 field_0x124[0x1F6 - 0x124]; + /* 0x108 */ f32 mFixedWidth; + /* 0x10C */ u8 mIsWidthFixed; + /* 0x114 */ nw4r::lyt::Size mMyFontSize; + /* 0x118 */ nw4r::lyt::Size mMyTextScale; + /* 0x120 */ f32 mMyScale; + /* 0x124 */ nw4r::ut::TextWriterBase mTextWriter; + /* 0x188 */ f32 field_0x188; + /* 0x18C */ f32 field_0x18C; + /* 0x190 */ f32 field_0x190; + /* 0x194 */ f32 field_0x194; + /* 0x198 */ u32 field_0x198[10]; + /* 0x1C0 */ u8 mFontIdx; + /* 0x1C1 */ u8 mWindowSubtype; + /* 0x1C4 */ f32 field_0x1C4[10]; + /* 0x1EC */ u8 field_0x1EC[10]; /* 0x1F6 */ u8 field_0x1F6; /* 0x1F7 */ u8 field_0x1F7; /* 0x1F8 */ u8 field_0x1F8; - /* 0x1F9 */ u8 field_0x1F9[0x204 - 0x1F9]; + /* 0x1F9 */ u8 field_0x1F9; + /* 0x1FA */ u8 field_0x1FA; + /* 0x1FC */ dTagProcessor_c *mpMyTagProcessor; + /* 0x200 */ bool mHasTextWriter; + /* 0x201 */ u8 field_0x201; }; #endif diff --git a/include/libms/commonlib.h b/include/libms/commonlib.h index 13e8bcc1..7a0680e4 100644 --- a/include/libms/commonlib.h +++ b/include/libms/commonlib.h @@ -22,8 +22,7 @@ struct MsbBlock { /* 0x0C */ u16 field_0x0C; }; -#pragma push -#pragma pack(2) +#pragma pack(push ,2) struct MsbHeader { /* 0x00 */ unsigned char field_0x00[0x0C - 0x00]; @@ -33,7 +32,7 @@ struct MsbHeader { /* 0x12 */ int fileLength; }; -#pragma pop +#pragma pack(pop) struct MsbInfo { /* 0x00 */ struct MsbHeader *header; diff --git a/include/libms/msgfile.h b/include/libms/msgfile.h index 50121699..bc6f2aaa 100644 --- a/include/libms/msgfile.h +++ b/include/libms/msgfile.h @@ -2,6 +2,7 @@ #define LIBMS_MSGFILE_H #include "common.h" +#include #ifdef __cplusplus extern "C" { @@ -16,11 +17,11 @@ struct MsbtAttrInfo { struct MsbtInfo *LMS_InitMessage(void *data); void LMS_CloseMessage(struct MsbtInfo *info); -int LMS_GetTextIndexByLabel(struct MsbtInfo *info, const char *label); -const char *LMS_GetText(struct MsbtInfo *info, int index); -const char *LMS_GetTextByLabel(struct MsbtInfo *info, const char *label); -const char *LMS_GetLabelByTextIndex(struct MsbtInfo *info, int index); -struct MsbtAttrInfo *LMS_GetAttribute(struct MsbtInfo *info, int index); +int LMS_GetTextIndexByLabel(const struct MsbtInfo *info, const char *label); +const wchar_t *LMS_GetText(const struct MsbtInfo *info, int index); +const wchar_t *LMS_GetTextByLabel(const struct MsbtInfo *info, const char *label); +const char *LMS_GetLabelByTextIndex(const struct MsbtInfo *info, int index); +struct MsbtAttrInfo *LMS_GetAttribute(const struct MsbtInfo *info, int index); #ifdef __cplusplus } diff --git a/include/nw4r/ut/ut_Font.h b/include/nw4r/ut/ut_Font.h index 4df7724e..37b37741 100644 --- a/include/nw4r/ut/ut_Font.h +++ b/include/nw4r/ut/ut_Font.h @@ -1,5 +1,6 @@ #ifndef NW4R_UT_FONT_H #define NW4R_UT_FONT_H +#include "common.h" #include "nw4r/types_nw4r.h" #include "nw4r/ut/ut_CharStrmReader.h" #include "rvl/GX.h" // IWYU pragma: export @@ -67,7 +68,11 @@ public: void InitReaderFunc(FontEncoding encode); - CharStrmReader GetCharStrmReader() const; + // ??? + DECOMP_DONT_INLINE CharStrmReader GetCharStrmReader() const { + CharStrmReader reader(mReadFunc); + return reader; + } private: CharStrmReader::ReadFunc mReadFunc; // at 0x4 -- cgit v1.2.3 From c890868bad79e1d5730859f7c1170fbf7d794c23 Mon Sep 17 00:00:00 2001 From: robojumper Date: Wed, 2 Apr 2025 18:35:21 +0200 Subject: d_textbox almost --- include/d/d_tag_processor.h | 4 ++++ include/d/d_textunk.h | 14 ++++++++++++++ include/d/lyt/d_textbox.h | 20 +++++++++++--------- 3 files changed, 29 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/d/d_tag_processor.h b/include/d/d_tag_processor.h index 930f565a..d2371f18 100644 --- a/include/d/d_tag_processor.h +++ b/include/d/d_tag_processor.h @@ -70,6 +70,10 @@ public: s32 tickPauseFrame(); s32 tick0x830(); + void setTextbox(dTextBox_c *box) { + field_0x004 = box; + } + s32 getNumLinesMaybe() const { return mCommandInsert; } diff --git a/include/d/d_textunk.h b/include/d/d_textunk.h index 5e43e709..f79cf061 100644 --- a/include/d/d_textunk.h +++ b/include/d/d_textunk.h @@ -21,6 +21,20 @@ public: return 0.0f; } + inline static f32 getField0x75C() { + if (sInstance != nullptr) { + return sInstance->field_0x75C; + } + return 0.0f; + } + + inline static f32 getField0x760() { + if (sInstance != nullptr) { + return sInstance->field_0x760; + } + return 0.0f; + } + inline static f32 getField0x768() { if (sInstance != nullptr) { return sInstance->field_0x768; diff --git a/include/d/lyt/d_textbox.h b/include/d/lyt/d_textbox.h index 6a05bab2..aa98bf60 100644 --- a/include/d/lyt/d_textbox.h +++ b/include/d/lyt/d_textbox.h @@ -18,7 +18,9 @@ public: dTextBox_c(const nw4r::lyt::res::TextBox *pBlock, const nw4r::lyt::ResBlockSet &resBlockSet); virtual void DrawSelf(const nw4r::lyt::DrawInfo &drawInfo) override; // at 0x18 - f32 GetLineWidth(f32 *pOutSpacing); + f32 GetLineWidth(f32 *pOutSpacing) const; + f32 GetLinesHeight() const; + f32 GetUnkWidthRatio() const; void setLytBase(d2d::LytBase_c *lytBase) { mpLytBase = lytBase; @@ -58,7 +60,8 @@ public: void setMessageWithGlobalTextProcessorAndMsbtInfo(const MsbtInfo *info, const char *labelId, wchar_t *destBuf, u32 maxLen); - void fn_800B0F40(); + void loadTextFormatVars(); + void setupGX() const; // @bug: This does not implement UT's RTTI, so casts to dTextBox_c will // succeed even if all you have is a lyt::TextBox @@ -72,7 +75,9 @@ private: nw4r::ut::Rect GetMyTextDrawRect(nw4r::ut::TextWriterBase *pWriter, bool *pbWideScreenUnk) const; - void fn_800AFD60(f32); + f32 resizeTextToFit(f32 maxWidth); + bool hasDynamicText(); + void someDebugCheckMaybe(); /* 0x104 */ d2d::LytBase_c *mpLytBase; /* 0x108 */ f32 mFixedWidth; @@ -81,19 +86,16 @@ private: /* 0x118 */ nw4r::lyt::Size mMyTextScale; /* 0x120 */ f32 mMyScale; /* 0x124 */ nw4r::ut::TextWriterBase mTextWriter; - /* 0x188 */ f32 field_0x188; - /* 0x18C */ f32 field_0x18C; - /* 0x190 */ f32 field_0x190; - /* 0x194 */ f32 field_0x194; + /* 0x188 */ nw4r::ut::Rect field_0x188; /* 0x198 */ u32 field_0x198[10]; /* 0x1C0 */ u8 mFontIdx; /* 0x1C1 */ u8 mWindowSubtype; /* 0x1C4 */ f32 field_0x1C4[10]; - /* 0x1EC */ u8 field_0x1EC[10]; + /* 0x1EC */ bool field_0x1EC[10]; /* 0x1F6 */ u8 field_0x1F6; /* 0x1F7 */ u8 field_0x1F7; /* 0x1F8 */ u8 field_0x1F8; - /* 0x1F9 */ u8 field_0x1F9; + /* 0x1F9 */ bool field_0x1F9; /* 0x1FA */ u8 field_0x1FA; /* 0x1FC */ dTagProcessor_c *mpMyTagProcessor; /* 0x200 */ bool mHasTextWriter; -- cgit v1.2.3 From e7e08fa54601900910ea71cc4846db667ed44415 Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 3 Apr 2025 13:26:28 +0200 Subject: Out of ideas --- include/d/lyt/d_textbox.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/d/lyt/d_textbox.h b/include/d/lyt/d_textbox.h index aa98bf60..57b406fc 100644 --- a/include/d/lyt/d_textbox.h +++ b/include/d/lyt/d_textbox.h @@ -79,6 +79,18 @@ private: bool hasDynamicText(); void someDebugCheckMaybe(); + int GetStoredLineStrNum(int i, f32 *pLineWidth, bool *pbOver) const { + *pbOver = mbOvers[i]; + *pLineWidth = mLineWidths[i]; + return mLineStrNums[i]; + } + + void SetStoredLineStrNum(int i, f32 lineWidth, int lineStrNum, bool bOver) { + mLineWidths[i] = lineWidth; + mLineStrNums[i] = lineStrNum; + mbOvers[i] = bOver; + } + /* 0x104 */ d2d::LytBase_c *mpLytBase; /* 0x108 */ f32 mFixedWidth; /* 0x10C */ u8 mIsWidthFixed; @@ -87,11 +99,11 @@ private: /* 0x120 */ f32 mMyScale; /* 0x124 */ nw4r::ut::TextWriterBase mTextWriter; /* 0x188 */ nw4r::ut::Rect field_0x188; - /* 0x198 */ u32 field_0x198[10]; + /* 0x198 */ u32 mLineStrNums[10]; /* 0x1C0 */ u8 mFontIdx; /* 0x1C1 */ u8 mWindowSubtype; - /* 0x1C4 */ f32 field_0x1C4[10]; - /* 0x1EC */ bool field_0x1EC[10]; + /* 0x1C4 */ f32 mLineWidths[10]; + /* 0x1EC */ bool mbOvers[10]; /* 0x1F6 */ u8 field_0x1F6; /* 0x1F7 */ u8 field_0x1F7; /* 0x1F8 */ u8 field_0x1F8; @@ -99,7 +111,7 @@ private: /* 0x1FA */ u8 field_0x1FA; /* 0x1FC */ dTagProcessor_c *mpMyTagProcessor; /* 0x200 */ bool mHasTextWriter; - /* 0x201 */ u8 field_0x201; + /* 0x201 */ bool field_0x201; }; #endif -- cgit v1.2.3 From 832f6a67443d0a72300a7e178621c999ed2f6356 Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 3 Apr 2025 19:09:11 +0200 Subject: A bit of select_btn --- .../d/lyt/msg_window/d_lyt_msg_window_select_btn.h | 117 +++++++++++++++++++++ include/toBeSorted/music_mgrs.h | 2 + 2 files changed, 119 insertions(+) create mode 100644 include/d/lyt/msg_window/d_lyt_msg_window_select_btn.h (limited to 'include') diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_select_btn.h b/include/d/lyt/msg_window/d_lyt_msg_window_select_btn.h new file mode 100644 index 00000000..c3592c59 --- /dev/null +++ b/include/d/lyt/msg_window/d_lyt_msg_window_select_btn.h @@ -0,0 +1,117 @@ +#ifndef D_LYT_MSG_WINDOW_SELECT_BTN_H +#define D_LYT_MSG_WINDOW_SELECT_BTN_H + +#include "d/lyt/d2d.h" +#include "d/lyt/d_window.h" +#include "nw4r/lyt/lyt_pane.h" +#include "s/s_State.hpp" + +// Size 0x54? +struct SelectBtnHelper { + SelectBtnHelper(); + ~SelectBtnHelper(); + + /* 0x00 */ nw4r::lyt::Pane *panes[9]; + /* 0x24 */ u8 _0x24[0x34 - 0x24]; + /* 0x34 */ f32 field_0x34; + /* 0x38 */ f32 field_0x38; + /* 0x3C */ f32 field_0x3C; + /* 0x40 */ f32 field_0x40; + /* 0x44 */ s32 field_0x44; + /* 0x48 */ s32 field_0x48; + /* 0x4C */ s32 field_0x4C; + /* 0x50 */ s8 field_0x50; + /* 0x51 */ s8 field_0x51; + /* 0x52 */ s8 field_0x52; + + f32 fn_8011D690(s32); + void fn_8011C970(); + u8 fn_8011CAC0(); +}; + +class dLytMsgWindowSelectBtnParts_c { + friend class dLytMsgWindowSelectBtn_c; + +public: + dLytMsgWindowSelectBtnParts_c() : mStateMgr(*this) {} + + void init(); + void execute(); + +private: + STATE_FUNC_DECLARE(dLytMsgWindowSelectBtnParts_c, Wait); + STATE_FUNC_DECLARE(dLytMsgWindowSelectBtnParts_c, On); + STATE_FUNC_DECLARE(dLytMsgWindowSelectBtnParts_c, Select); + STATE_FUNC_DECLARE(dLytMsgWindowSelectBtnParts_c, Off); + + /* 0x00 */ UI_STATE_MGR_DECLARE(dLytMsgWindowSelectBtnParts_c); + /* 0x3C */ d2d::AnmGroup_c *mpAnms[3]; + /* 0x48 */ u32 field_0x48; + /* 0x4C */ u32 field_0x4C; + /* 0x50 */ u8 field_0x50; +}; + +class dLytMsgWindowSelectBtn_c : public d2d::dSubPane { +public: + dLytMsgWindowSelectBtn_c() : mStateMgr(*this) {} + virtual bool build(d2d::ResAccIf_c *resAcc) override; + virtual bool remove() override; + virtual bool execute() 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 ~dLytMsgWindowSelectBtn_c() {} + + bool draw(); + +private: + s32 fn_8011FE50(); + + STATE_FUNC_DECLARE(dLytMsgWindowSelectBtn_c, Wait); + STATE_FUNC_DECLARE(dLytMsgWindowSelectBtn_c, In); + STATE_FUNC_DECLARE(dLytMsgWindowSelectBtn_c, WaitSelect); + STATE_FUNC_DECLARE(dLytMsgWindowSelectBtn_c, CursorInOut); + STATE_FUNC_DECLARE(dLytMsgWindowSelectBtn_c, WaitDecide); + STATE_FUNC_DECLARE(dLytMsgWindowSelectBtn_c, WaitCancel); + STATE_FUNC_DECLARE(dLytMsgWindowSelectBtn_c, Out); + + /* 0x008 */ UI_STATE_MGR_DECLARE(dLytMsgWindowSelectBtn_c); + /* 0x044 */ d2d::dLytSub mLyt; + /* 0x0D8 */ d2d::AnmGroup_c mAnm[27]; + /* 0x798 */ nw4r::lyt::Pane *mpSelectPanes[7]; + /* 0x7B4 */ dTextBox_c *mpSelectTextBoxes[4][2]; + /* 0x7D4 */ dTextBox_c *mpDecideTextBoxes[2]; + /* 0x7DC */ nw4r::lyt::Pane *mpBoundings[4]; + /* 0x7EC */ dWindow_c *mpWindow; + /* 0x7F0 */ dTextBox_c *mpSizeBox; + /* 0x7F4 */ dLytMsgWindowSelectBtnParts_c mParts[4]; + /* 0x944 */ SelectBtnHelper mBtnHelper; + /* 0x998 */ void *field_0x998; + /* 0x99C */ s32 field_0x99C; + /* 0x9A0 */ s32 field_0x9A0; + /* 0x9A4 */ u8 field_0x9A4; + /* 0x9A8 */ s32 field_0x9A8; + /* 0x9AC */ void *field_0x9AC; + /* 0x9B0 */ s32 field_0x9B0; + /* 0x9B0 */ s32 field_0x9B4; + /* 0x9B8 */ s32 field_0x9B8; + /* 0x9BC */ s32 field_0x9BC; + /* 0x9C0 */ s32 field_0x9C0; + /* 0x9C4 */ void *field_0x9C4; + /* 0x9C8 */ s32 field_0x9C8; + /* 0x9CC */ s8 field_0x9CC; + /* 0x9CD */ u8 field_0x9CD; + /* 0x9CE */ u8 field_0x9CE; + /* 0x9CF */ u8 field_0x9CF; + /* 0x9D0 */ u8 field_0x9D0; + /* 0x9D1 */ u8 field_0x9D1; +}; + +#endif diff --git a/include/toBeSorted/music_mgrs.h b/include/toBeSorted/music_mgrs.h index 0702156c..5d93a8b1 100644 --- a/include/toBeSorted/music_mgrs.h +++ b/include/toBeSorted/music_mgrs.h @@ -5,7 +5,9 @@ extern "C" void *BGM_MGR; extern "C" void fn_8035E000(); +extern "C" void fn_8035E860(void *); extern "C" void fn_8035E310(void *); +extern "C" void fn_8035E880(void *); extern "C" void *ENEMY_SOUND_MGR; extern "C" void fn_80362150(void *, u16); -- cgit v1.2.3 From 18d7897d764309208033c507980b555a947fbce6 Mon Sep 17 00:00:00 2001 From: robojumper Date: Thu, 3 Apr 2025 23:24:12 +0200 Subject: I keep getting distracted by side quests --- include/d/d_message.h | 60 +++++++++++++++ include/d/d_textunk.h | 4 + include/d/d_textwindow_unk.h | 20 +++++ include/d/lyt/msg_window/d_lyt_msg_window.h | 111 ++++++++++++++++++++++++++++ include/s/s_State.hpp | 4 + include/toBeSorted/global_fi_context.h | 8 ++ 6 files changed, 207 insertions(+) create mode 100644 include/d/d_message.h create mode 100644 include/d/d_textwindow_unk.h create mode 100644 include/d/lyt/msg_window/d_lyt_msg_window.h create mode 100644 include/toBeSorted/global_fi_context.h (limited to 'include') diff --git a/include/d/d_message.h b/include/d/d_message.h new file mode 100644 index 00000000..d9fa29df --- /dev/null +++ b/include/d/d_message.h @@ -0,0 +1,60 @@ +#ifndef D_MESSAGE_H +#define D_MESSAGE_H + +#include "common.h" +#include "d/d_base.h" +#include "d/d_tag_processor.h" +#include "libms/flowfile.h" +#include "sized_string.h" + +class dMessage_c : public dBase_c { +public: + dMessage_c(); + virtual ~dMessage_c() { + sInstance = nullptr; + } + + int create() override; + int doDelete() override; + int execute() override; + int draw() override; + + static const char *getLanguageIdentifier(); + + static dMessage_c *getInstance() { + return sInstance; + } + + static dTagProcessor_c *getGlobalTagProcessor() { + return sTagProcessor; + } + + void reset(); + +private: + static s32 getArcIndexForFile(const char *fileName); + static const char *getArcNameByIndex(s32 idx, bool); + + static void setZevFromMsbArc(); + static const char *getMsbtFileName(s32 index); + static s32 getMsbtNumberByIndex(s32 index); + static const char *getMsbfFileName(s32 index); + static s32 getMsbfNumberByIndex(s32 index); + static void *getDataFromMsbArc(s32 number, const char *fileName, bool); + + static dMessage_c *sInstance; + static dTagProcessor_c *sTagProcessor; + + /* 0x068 */ MsbtInfo *mpMsgs[82]; + /* 0x1B0 */ MsbfInfo *mpFlows[80]; + /* 0x2F0 */ SizedString<8> mLanguage; + /* 0x2F8 */ s32 mCurrentTextFileNumber; + + /* 0x2FC */ s32 field_0x2FC; + + /* 0x334 */ u32 mMinigameResultPoints; + /* 0x338 */ u32 mMinigameTime; + /* 0x344 */ s32 field_0x344; +}; + +#endif diff --git a/include/d/d_textunk.h b/include/d/d_textunk.h index f79cf061..086785cf 100644 --- a/include/d/d_textunk.h +++ b/include/d/d_textunk.h @@ -109,6 +109,10 @@ public: return 0.0f; } + static UnkTextThing *getInstance() { + return sInstance; + } + private: static UnkTextThing *sInstance; diff --git a/include/d/d_textwindow_unk.h b/include/d/d_textwindow_unk.h new file mode 100644 index 00000000..0e929df2 --- /dev/null +++ b/include/d/d_textwindow_unk.h @@ -0,0 +1,20 @@ +#ifndef D_TEXTWINDOW_UNK_H +#define D_TEXTWINDOW_UNK_H + +#include "d/d_tag_processor.h" + +// Size 0x1554 +class TextWindowUnk { +public: + TextWindowUnk(dTagProcessor_c *tagProcessor); + virtual ~TextWindowUnk() {} + +private: + /* 0x0004 */ dTagProcessor_c *mpTagProcessor; + /* 0x0008 */ wchar_t mRawTextBuffer[1023]; + /* 0x0806 */ wchar_t mProcessedTextBuffer[1023]; + /* 0x1004 */ wchar_t mUnkBuffer[679]; // ??? + /* 0x1550 */ void* field_0x1559; +}; + +#endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window.h b/include/d/lyt/msg_window/d_lyt_msg_window.h new file mode 100644 index 00000000..701b22d7 --- /dev/null +++ b/include/d/lyt/msg_window/d_lyt_msg_window.h @@ -0,0 +1,111 @@ +#ifndef D_LYT_MSG_WINDOW_H +#define D_LYT_MSG_WINDOW_H + +#include "d/d_tag_processor.h" +#include "d/d_textwindow_unk.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_auto_caption.h" +#include "d/lyt/d_lyt_auto_explain.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "d/lyt/msg_window/d_lyt_msg_window_select_btn.h" +#include "d/lyt/msg_window/d_lyt_msg_window_stone.h" +#include "d/lyt/msg_window/d_lyt_msg_window_wood.h" +#include "s/s_State.hpp" +#include "sized_string.h" + +class dLytMsgWindow_c { +public: + dLytMsgWindow_c() : mStateMgr(*this) {} + virtual ~dLytMsgWindow_c() {} + + bool build(); + bool remove(); + +private: + + void removeAllWindowSubtypes(); + + static dLytMsgWindow_c *sInstance; + + STATE_FUNC_DECLARE(dLytMsgWindow_c, Invisible); + STATE_FUNC_DECLARE(dLytMsgWindow_c, In); + STATE_FUNC_DECLARE(dLytMsgWindow_c, OutputText); + STATE_FUNC_DECLARE(dLytMsgWindow_c, WaitKeyChangePage0); + STATE_FUNC_DECLARE(dLytMsgWindow_c, WaitKeyChangePage1); + STATE_FUNC_DECLARE(dLytMsgWindow_c, WaitKeyMsgEnd0); + STATE_FUNC_DECLARE(dLytMsgWindow_c, WaitKeyMsgEnd1); + STATE_FUNC_DECLARE(dLytMsgWindow_c, WaitKeyMsgEnd2); + STATE_FUNC_DECLARE(dLytMsgWindow_c, WaitKeySelectQuestion); + STATE_FUNC_DECLARE(dLytMsgWindow_c, MapOpen); + STATE_FUNC_DECLARE(dLytMsgWindow_c, WaitKeyMapClose); + STATE_FUNC_DECLARE(dLytMsgWindow_c, MapClose); + STATE_FUNC_DECLARE(dLytMsgWindow_c, Out); + STATE_FUNC_DECLARE(dLytMsgWindow_c, ExplainIn); + STATE_FUNC_DECLARE(dLytMsgWindow_c, ExplainVisible); + STATE_FUNC_DECLARE(dLytMsgWindow_c, ExplainOut); + STATE_FUNC_DECLARE(dLytMsgWindow_c, DemoIn); + STATE_FUNC_DECLARE(dLytMsgWindow_c, DemoVisible); + STATE_FUNC_DECLARE(dLytMsgWindow_c, DemoOut); + + + /* 0x004 */ UI_STATE_MGR_DECLARE(dLytMsgWindow_c); + /* 0x040 */ d2d::ResAccIf_c mResAcc1; + /* 0x3B0 */ d2d::ResAccIf_c mResAcc2; + + /* 0x720 */ TextWindowUnk *mpMsgWindowUnk; + /* 0x724 */ dTagProcessor_c *mpTagProcessor; + + /* 0x728 */ dLytMsgWindowSubtype *mpCurrentSubtype; + /* 0x72C */ dLytMsgWindowSubtype *mpWindowTalk; + /* 0x730 */ dLytMsgWindowSubtype *mpWindowLink; + /* 0x734 */ dLytMsgWindowSubtype *mpWindowSword; + /* 0x738 */ dLytMsgWindowWood_c *mpWindowWood; + /* 0x73C */ dLytMsgWindowStone_c *mpWindowStone; + /* 0x740 */ dLytMsgWindowSubtype *mpWindowGet; + /* 0x744 */ dLytMsgWindowSubtype *mpWindowDemo; + /* 0x748 */ dLytAutoExplain_c *mpAutoExplain; + /* 0x74C */ dLytAutoCaption_c *mpAutoCaption; + + /* 0x774 */ s32 field_0x774; + /* 0x778 */ s32 field_0x778; + /* 0x77C */ s32 field_0x77C; + /* 0x780 */ s32 field_0x780; + /* 0x784 */ s32 field_0x784; + + /* 0x788 */ u16 mEntryPointToTrigger; + /* 0x78A */ u16 mAlsoEntryPointToTrigger; + + /* 0x78C */ SizedString<0x40> mName; + + /* 0x80C */ u8 field_0x80C; + /* 0x80D */ u8 field_0x80D; + /* 0x80E */ u8 field_0x80E; + /* 0x80F */ u8 mShowAutoMessage; + /* 0x810 */ u8 field_0x810; + /* 0x811 */ u8 field_0x811; + /* 0x812 */ u8 field_0x812; + /* 0x813 */ u8 field_0x813; + /* 0x814 */ u8 field_0x814; + /* 0x815 */ u8 field_0x815; + /* 0x816 */ u8 field_0x816; + /* 0x817 */ u8 field_0x817; + /* 0x818 */ u8 field_0x818; + /* 0x819 */ u8 field_0x819; + /* 0x81A */ u8 field_0x81A; + /* 0x81B */ u8 field_0x81B; + /* 0x81C */ u8 field_0x81C; + /* 0x81D */ u8 field_0x81D; + /* 0x81E */ u8 field_0x81E; + + /* 0x820 */ u16 field_0x820; + /* 0x824 */ void *field_0x824; + /* 0x828 */ s32 field_0x828; + + /* 0x82C */ u32 mTextOptionSelection; + /* 0x830 */ u32 mSpecialFiMenuValue; + + /* 0x834 */ dLytMsgWindowSelectBtn_c mSelectBtn; + /* 0x1220 */ u8 field_0x1220; +}; + +#endif diff --git a/include/s/s_State.hpp b/include/s/s_State.hpp index 3a8c4ec5..23dbc2f8 100644 --- a/include/s/s_State.hpp +++ b/include/s/s_State.hpp @@ -8,6 +8,10 @@ // Note: Ported from https://github.com/NSMBW-Community/NSMBW-Decomp/tree/master/include/dol/sLib // See include/s/README.txt for changes made +// Handy search and replace regex to generate functions based on define macros +// STATE_DEFINE\(([A-Za-z_0-9]+), ([A-Za-z_0-9]+)\); +// void $1::initializeState_$2() {}\nvoid $1::executeState_$2() {}\nvoid $1::finalizeState_$2() {}\n + #define STATE_FUNC_DECLARE(class, name) \ void initializeState_##name(); \ void executeState_##name(); \ diff --git a/include/toBeSorted/global_fi_context.h b/include/toBeSorted/global_fi_context.h new file mode 100644 index 00000000..be63a65f --- /dev/null +++ b/include/toBeSorted/global_fi_context.h @@ -0,0 +1,8 @@ +#ifndef GLOBAL_FI_CONTEXT_H +#define GLOBAL_FI_CONTEXT_H + +extern "C" void *GLOBAL_FI_CONTEXT; +extern "C" void fn_8016C9F0(void*); +extern "C" void createGlobalFiContext(); + +#endif -- cgit v1.2.3 From e5a24391fbc463716883664fe709520d76d48520 Mon Sep 17 00:00:00 2001 From: robojumper Date: Fri, 4 Apr 2025 00:48:00 +0200 Subject: Another file that'll have painful weak function order it seems --- include/d/d_message.h | 13 +++++++++++++ include/d/d_textunk.h | 12 ++++++++++++ include/d/d_textwindow_unk.h | 8 ++++++++ include/d/lyt/d_lyt_auto_caption.h | 8 +++++--- include/d/lyt/d_lyt_auto_explain.h | 8 +++++--- include/d/lyt/msg_window/d_lyt_msg_window.h | 19 +++++++++++-------- include/d/lyt/msg_window/d_lyt_msg_window_common.h | 9 ++++++--- include/d/lyt/msg_window/d_lyt_msg_window_stone.h | 5 +++-- include/d/lyt/msg_window/d_lyt_msg_window_wood.h | 5 +++-- 9 files changed, 66 insertions(+), 21 deletions(-) (limited to 'include') diff --git a/include/d/d_message.h b/include/d/d_message.h index d9fa29df..ffc2864a 100644 --- a/include/d/d_message.h +++ b/include/d/d_message.h @@ -31,6 +31,16 @@ public: void reset(); + bool getField_0x329() const { + return field_0x329; + } + + bool getField_0x32A() const { + return field_0x32A; + } + + static void loadTextByLabel(const char *label, dTagProcessor_c *tagProcessor, bool, u32, u32); + private: static s32 getArcIndexForFile(const char *fileName); static const char *getArcNameByIndex(s32 idx, bool); @@ -52,6 +62,9 @@ private: /* 0x2FC */ s32 field_0x2FC; + /* 0x329 */ bool field_0x329; + /* 0x32A */ bool field_0x32A; + /* 0x334 */ u32 mMinigameResultPoints; /* 0x338 */ u32 mMinigameTime; /* 0x344 */ s32 field_0x344; diff --git a/include/d/d_textunk.h b/include/d/d_textunk.h index 086785cf..587d5376 100644 --- a/include/d/d_textunk.h +++ b/include/d/d_textunk.h @@ -113,6 +113,18 @@ public: return sInstance; } + void reset0(const char *str) { + field_0x004 = str; + } + + void reset1(const char *str) { + field_0x084 = str; + } + + void reset2(const char *str) { + field_0x104 = str; + } + private: static UnkTextThing *sInstance; diff --git a/include/d/d_textwindow_unk.h b/include/d/d_textwindow_unk.h index 0e929df2..e0754ab4 100644 --- a/include/d/d_textwindow_unk.h +++ b/include/d/d_textwindow_unk.h @@ -2,12 +2,20 @@ #define D_TEXTWINDOW_UNK_H #include "d/d_tag_processor.h" +#include "d/lyt/d_textbox.h" // Size 0x1554 class TextWindowUnk { public: TextWindowUnk(dTagProcessor_c *tagProcessor); virtual ~TextWindowUnk() {} + + void fn_800B2130(const char *, dTextBox_c *, void*, bool); + void textAdvancingRelated(bool, bool); + + const wchar_t *getProcessedText() const { + return mProcessedTextBuffer; + } private: /* 0x0004 */ dTagProcessor_c *mpTagProcessor; diff --git a/include/d/lyt/d_lyt_auto_caption.h b/include/d/lyt/d_lyt_auto_caption.h index d09c86fe..8996d0e0 100644 --- a/include/d/lyt/d_lyt_auto_caption.h +++ b/include/d/lyt/d_lyt_auto_caption.h @@ -10,15 +10,17 @@ class dLytAutoCaption_c : public dLytMsgWindowSubtype { public: + dLytAutoCaption_c() : mStateMgr(*this) {} /* vt 0x08 */ virtual ~dLytAutoCaption_c() {} /* vt 0x0C */ virtual void draw() override; - /* vt 0x10 */ virtual bool build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x10 */ virtual bool + build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; /* vt 0x1C */ virtual void open() override; - /* vt 0x20 */ virtual bool isOpening() const override; + /* vt 0x20 */ virtual bool isDoneOpening() const override; /* vt 0x24 */ virtual void close() override; - /* vt 0x28 */ virtual bool isClosing() const override; + /* vt 0x28 */ virtual bool isDoneClosing() const override; /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { return mpTextboxes[0]; diff --git a/include/d/lyt/d_lyt_auto_explain.h b/include/d/lyt/d_lyt_auto_explain.h index e9e62e48..5d1a2091 100644 --- a/include/d/lyt/d_lyt_auto_explain.h +++ b/include/d/lyt/d_lyt_auto_explain.h @@ -10,15 +10,17 @@ class dLytAutoExplain_c : public dLytMsgWindowSubtype { public: + dLytAutoExplain_c() : mStateMgr(*this) {} /* vt 0x08 */ virtual ~dLytAutoExplain_c() {} /* vt 0x0C */ virtual void draw() override; - /* vt 0x10 */ virtual bool build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x10 */ virtual bool + build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; /* vt 0x1C */ virtual void open() override; - /* vt 0x20 */ virtual bool isOpening() const override; + /* vt 0x20 */ virtual bool isDoneOpening() const override; /* vt 0x24 */ virtual void close() override; - /* vt 0x28 */ virtual bool isClosing() const override; + /* vt 0x28 */ virtual bool isDoneClosing() const override; /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { return mpTextboxes[0]; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window.h b/include/d/lyt/msg_window/d_lyt_msg_window.h index 701b22d7..d3fc6287 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window.h @@ -4,15 +4,16 @@ #include "d/d_tag_processor.h" #include "d/d_textwindow_unk.h" #include "d/lyt/d2d.h" -#include "d/lyt/d_lyt_auto_caption.h" -#include "d/lyt/d_lyt_auto_explain.h" #include "d/lyt/msg_window/d_lyt_msg_window_common.h" #include "d/lyt/msg_window/d_lyt_msg_window_select_btn.h" -#include "d/lyt/msg_window/d_lyt_msg_window_stone.h" -#include "d/lyt/msg_window/d_lyt_msg_window_wood.h" #include "s/s_State.hpp" #include "sized_string.h" +class dLytMsgWindowWood_c; +class dLytMsgWindowStone_c; +class dLytAutoExplain_c; +class dLytAutoCaption_c; + class dLytMsgWindow_c { public: dLytMsgWindow_c() : mStateMgr(*this) {} @@ -22,8 +23,10 @@ public: bool remove(); private: - - void removeAllWindowSubtypes(); + static bool isValidTextLabel(const char *name); + void setTextToDisplay(const wchar_t *text); + void createSubMsgManager(u8 type); + void removeSubMsgManagers(); static dLytMsgWindow_c *sInstance; @@ -47,7 +50,6 @@ private: STATE_FUNC_DECLARE(dLytMsgWindow_c, DemoVisible); STATE_FUNC_DECLARE(dLytMsgWindow_c, DemoOut); - /* 0x004 */ UI_STATE_MGR_DECLARE(dLytMsgWindow_c); /* 0x040 */ d2d::ResAccIf_c mResAcc1; /* 0x3B0 */ d2d::ResAccIf_c mResAcc2; @@ -76,6 +78,7 @@ private: /* 0x78A */ u16 mAlsoEntryPointToTrigger; /* 0x78C */ SizedString<0x40> mName; + /* 0x7CC */ SizedString<0x40> mNameCopy; /* 0x80C */ u8 field_0x80C; /* 0x80D */ u8 field_0x80D; @@ -99,7 +102,7 @@ private: /* 0x820 */ u16 field_0x820; /* 0x824 */ void *field_0x824; - /* 0x828 */ s32 field_0x828; + /* 0x828 */ void *field_0x828; /* 0x82C */ u32 mTextOptionSelection; /* 0x830 */ u32 mSpecialFiMenuValue; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h index d8f843e3..7e1544ec 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_common.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -1,6 +1,7 @@ #ifndef D_LYT_MGS_WINDOW_COMMON_H #define D_LYT_MGS_WINDOW_COMMON_H +#include "common.h" #include "d/d_tag_processor.h" #include "d/lyt/d2d.h" #include "m/m2d.h" @@ -13,11 +14,13 @@ public: /* vt 0x14 */ virtual bool remove(); /* vt 0x18 */ virtual bool execute(); /* vt 0x1C */ virtual void open(); - /* vt 0x20 */ virtual bool isOpening() const; + /* vt 0x20 */ virtual bool isDoneOpening() const; /* vt 0x24 */ virtual void close(); - /* vt 0x28 */ virtual bool isClosing() const; + /* vt 0x28 */ virtual bool isDoneClosing() const; /* vt 0x2C */ virtual bool setText(const wchar_t *text); - /* vt 0x30 */ virtual dTextBox_c *vt_0x30(); + /* vt 0x30 */ virtual dTextBox_c *vt_0x30() { + return nullptr; + } /* vt 0x34 */ virtual bool vt_0x34() { return true; } diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h index 4a52f910..3b7cc3dd 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h @@ -11,6 +11,7 @@ class dLytMsgWindowStone_c : public dLytMsgWindowSubtype { public: + dLytMsgWindowStone_c() : mStateMgr(*this) {} /* vt 0x08 */ virtual ~dLytMsgWindowStone_c() {} /* vt 0x0C */ virtual void draw() override; /* vt 0x10 */ virtual bool @@ -18,9 +19,9 @@ public: /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; /* vt 0x1C */ virtual void open() override; - /* vt 0x20 */ virtual bool isOpening() const override; + /* vt 0x20 */ virtual bool isDoneOpening() const override; /* vt 0x24 */ virtual void close() override; - /* vt 0x28 */ virtual bool isClosing() const override; + /* vt 0x28 */ virtual bool isDoneClosing() const override; /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { return mpTextboxes[0]; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h index 795fdf97..a43f9e08 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h @@ -11,6 +11,7 @@ class dLytMsgWindowWood_c : public dLytMsgWindowSubtype { public: + dLytMsgWindowWood_c() : mStateMgr(*this) {} /* vt 0x08 */ virtual ~dLytMsgWindowWood_c() {} /* vt 0x0C */ virtual void draw() override; /* vt 0x10 */ virtual bool @@ -18,9 +19,9 @@ public: /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; /* vt 0x1C */ virtual void open() override; - /* vt 0x20 */ virtual bool isOpening() const override; + /* vt 0x20 */ virtual bool isDoneOpening() const override; /* vt 0x24 */ virtual void close() override; - /* vt 0x28 */ virtual bool isClosing() const override; + /* vt 0x28 */ virtual bool isDoneClosing() const override; /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { return mpTextboxes[0]; -- cgit v1.2.3 From 3535968370828d3336eca3f1233dd7de89d70529 Mon Sep 17 00:00:00 2001 From: robojumper Date: Fri, 4 Apr 2025 01:41:19 +0200 Subject: Progress --- include/d/d_message.h | 1 + include/d/d_tag_processor.h | 12 ++++++++++++ include/d/d_textwindow_unk.h | 1 + include/d/lyt/d_lyt_auto_caption.h | 2 +- include/d/lyt/d_lyt_auto_explain.h | 2 +- include/d/lyt/msg_window/d_lyt_msg_window.h | 6 +++++- include/d/lyt/msg_window/d_lyt_msg_window_common.h | 3 ++- include/d/lyt/msg_window/d_lyt_msg_window_stone.h | 2 +- include/d/lyt/msg_window/d_lyt_msg_window_wood.h | 3 ++- include/toBeSorted/d_d3d.h | 4 ++++ include/toBeSorted/event_manager.h | 5 +++-- include/toBeSorted/music_mgrs.h | 1 + 12 files changed, 34 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/d/d_message.h b/include/d/d_message.h index ffc2864a..bf641ffd 100644 --- a/include/d/d_message.h +++ b/include/d/d_message.h @@ -39,6 +39,7 @@ public: return field_0x32A; } + static bool isValidTextLabel(const char *name); static void loadTextByLabel(const char *label, dTagProcessor_c *tagProcessor, bool, u32, u32); private: diff --git a/include/d/d_tag_processor.h b/include/d/d_tag_processor.h index d2371f18..d5f6ddc0 100644 --- a/include/d/d_tag_processor.h +++ b/include/d/d_tag_processor.h @@ -82,6 +82,18 @@ public: return field_0x90C; } + u8 getField_0x90D() const { + return field_0x90D; + } + + u8 getField_0x90E() const { + return field_0x90E; + } + + s32 getField_0x830() const { + return field_0x830; + } + void setMsgWindowSubtype(u8 type) { field_0x90C = type; } diff --git a/include/d/d_textwindow_unk.h b/include/d/d_textwindow_unk.h index e0754ab4..e9ce7093 100644 --- a/include/d/d_textwindow_unk.h +++ b/include/d/d_textwindow_unk.h @@ -11,6 +11,7 @@ public: virtual ~TextWindowUnk() {} void fn_800B2130(const char *, dTextBox_c *, void*, bool); + void fn_800B2AA0(); void textAdvancingRelated(bool, bool); const wchar_t *getProcessedText() const { diff --git a/include/d/lyt/d_lyt_auto_caption.h b/include/d/lyt/d_lyt_auto_caption.h index 8996d0e0..115d0a40 100644 --- a/include/d/lyt/d_lyt_auto_caption.h +++ b/include/d/lyt/d_lyt_auto_caption.h @@ -17,7 +17,7 @@ public: build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; - /* vt 0x1C */ virtual void open() override; + /* vt 0x1C */ virtual void open(dAcObjBase_c *obj, u32 param) override; /* vt 0x20 */ virtual bool isDoneOpening() const override; /* vt 0x24 */ virtual void close() override; /* vt 0x28 */ virtual bool isDoneClosing() const override; diff --git a/include/d/lyt/d_lyt_auto_explain.h b/include/d/lyt/d_lyt_auto_explain.h index 5d1a2091..44433591 100644 --- a/include/d/lyt/d_lyt_auto_explain.h +++ b/include/d/lyt/d_lyt_auto_explain.h @@ -17,7 +17,7 @@ public: build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; - /* vt 0x1C */ virtual void open() override; + /* vt 0x1C */ virtual void open(dAcObjBase_c *obj, u32 param) override; /* vt 0x20 */ virtual bool isDoneOpening() const override; /* vt 0x24 */ virtual void close() override; /* vt 0x28 */ virtual bool isDoneClosing() const override; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window.h b/include/d/lyt/msg_window/d_lyt_msg_window.h index d3fc6287..7aba7161 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window.h @@ -6,6 +6,7 @@ #include "d/lyt/d2d.h" #include "d/lyt/msg_window/d_lyt_msg_window_common.h" #include "d/lyt/msg_window/d_lyt_msg_window_select_btn.h" +#include "m/m_vec.h" #include "s/s_State.hpp" #include "sized_string.h" @@ -23,10 +24,10 @@ public: bool remove(); private: - static bool isValidTextLabel(const char *name); void setTextToDisplay(const wchar_t *text); void createSubMsgManager(u8 type); void removeSubMsgManagers(); + bool fn_8011A5D0() const; static dLytMsgWindow_c *sInstance; @@ -68,6 +69,9 @@ private: /* 0x748 */ dLytAutoExplain_c *mpAutoExplain; /* 0x74C */ dLytAutoCaption_c *mpAutoCaption; + /* 0x750 */ u8 _0x750[0x768 - 0x750]; + + /* 0x768 */ mVec3_c field_0x768; /* 0x774 */ s32 field_0x774; /* 0x778 */ s32 field_0x778; /* 0x77C */ s32 field_0x77C; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h index 7e1544ec..718fbdaa 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_common.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -2,6 +2,7 @@ #define D_LYT_MGS_WINDOW_COMMON_H #include "common.h" +#include "d/a/obj/d_a_obj_base.h" #include "d/d_tag_processor.h" #include "d/lyt/d2d.h" #include "m/m2d.h" @@ -13,7 +14,7 @@ public: /* vt 0x10 */ virtual bool build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor); /* vt 0x14 */ virtual bool remove(); /* vt 0x18 */ virtual bool execute(); - /* vt 0x1C */ virtual void open(); + /* vt 0x1C */ virtual void open(dAcObjBase_c *obj, u32 param); /* vt 0x20 */ virtual bool isDoneOpening() const; /* vt 0x24 */ virtual void close(); /* vt 0x28 */ virtual bool isDoneClosing() const; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h index 3b7cc3dd..6a533581 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h @@ -18,7 +18,7 @@ public: build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; - /* vt 0x1C */ virtual void open() override; + /* vt 0x1C */ virtual void open(dAcObjBase_c *obj, u32 param) override; /* vt 0x20 */ virtual bool isDoneOpening() const override; /* vt 0x24 */ virtual void close() override; /* vt 0x28 */ virtual bool isDoneClosing() const override; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h index a43f9e08..9404283b 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h @@ -1,6 +1,7 @@ #ifndef D_LYT_MSG_WINDOW_WOOD_H #define D_LYT_MSG_WINDOW_WOOD_H +#include "d/a/obj/d_a_obj_base.h" #include "d/d_tag_processor.h" #include "d/lyt/d2d.h" #include "d/lyt/d_lyt_common_a_btn.h" @@ -18,7 +19,7 @@ public: build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; /* vt 0x14 */ virtual bool remove() override; /* vt 0x18 */ virtual bool execute() override; - /* vt 0x1C */ virtual void open() override; + /* vt 0x1C */ virtual void open(dAcObjBase_c *obj, u32 param) override; /* vt 0x20 */ virtual bool isDoneOpening() const override; /* vt 0x24 */ virtual void close() override; /* vt 0x28 */ virtual bool isDoneClosing() const override; diff --git a/include/toBeSorted/d_d3d.h b/include/toBeSorted/d_d3d.h index f02b4480..605c998c 100644 --- a/include/toBeSorted/d_d3d.h +++ b/include/toBeSorted/d_d3d.h @@ -10,6 +10,7 @@ #include "m/m3d/m_proc.h" #include "m/m_color.h" #include "m/m_mtx.h" +#include "m/m_vec.h" #include "nw4r/g3d/res/g3d_resfile.h" #include "toBeSorted/tlist.h" @@ -17,6 +18,9 @@ namespace d3d { +f32 fn_80016960(const mVec3_c&, const mVec3_c& pos); +bool fn_80016A90(const mVec3_c& pos); + class AnmMdlWrapper : protected m3d::mdlAnmChr { public: AnmMdlWrapper(); diff --git a/include/toBeSorted/event_manager.h b/include/toBeSorted/event_manager.h index c3117290..9c524aec 100644 --- a/include/toBeSorted/event_manager.h +++ b/include/toBeSorted/event_manager.h @@ -3,11 +3,11 @@ #define EVENT_MANAGER_H #include "common.h" +#include "d/a/obj/d_a_obj_base.h" +#include "f/f_base.h" #include "sized_string.h" #include "toBeSorted/event.h" -#include - class dAcBase_c; class EventManager { @@ -16,6 +16,7 @@ public: static bool finishEvent(dAcBase_c *actor, const char *eventName); static void changeOwnEvent(dAcBase_c *actor1, dAcBase_c *actor2, Event *event, UNKWORD); static bool alsoSetAsCurrentEvent(dAcBase_c *actor, Event *event, void *unknown); + static dAcObjBase_c *fn_800A08F0(fBase_c::GROUP_TYPE_e); static EventManager *sInstance; diff --git a/include/toBeSorted/music_mgrs.h b/include/toBeSorted/music_mgrs.h index 5d93a8b1..7beeb58e 100644 --- a/include/toBeSorted/music_mgrs.h +++ b/include/toBeSorted/music_mgrs.h @@ -7,6 +7,7 @@ extern "C" void *BGM_MGR; extern "C" void fn_8035E000(); extern "C" void fn_8035E860(void *); extern "C" void fn_8035E310(void *); +extern "C" void fn_8035E820(void *); extern "C" void fn_8035E880(void *); extern "C" void *ENEMY_SOUND_MGR; -- cgit v1.2.3 From 01d1c8c66a3f6083f04e6bc0e2cc38aeb77e939e Mon Sep 17 00:00:00 2001 From: robojumper Date: Fri, 4 Apr 2025 12:59:20 +0200 Subject: More d_message cleanup --- include/d/d_message.h | 21 ++++++++++++++++++++- include/d/d_tag_processor.h | 4 ++++ include/d/d_textunk.h | 8 ++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/d/d_message.h b/include/d/d_message.h index bf641ffd..d5e1b2f9 100644 --- a/include/d/d_message.h +++ b/include/d/d_message.h @@ -5,6 +5,7 @@ #include "d/d_base.h" #include "d/d_tag_processor.h" #include "libms/flowfile.h" +#include "libms/msgfile.h" #include "sized_string.h" class dMessage_c : public dBase_c { @@ -42,10 +43,23 @@ public: static bool isValidTextLabel(const char *name); static void loadTextByLabel(const char *label, dTagProcessor_c *tagProcessor, bool, u32, u32); + static const wchar_t *getTextMessageByLabel(const char *label, bool global, wchar_t *dstBuf, u32 maxLen); + static const wchar_t * + getTextMessageByLabel(const char *label, dTagProcessor_c *pTagProcessor, bool global, wchar_t *dstBuf, u32 maxLen); + + static const wchar_t *formatText(const wchar_t *text); + private: + const wchar_t *formatTextInternal(const wchar_t *text); + const wchar_t *getTextMessageByLabelInternal( + const char *label, dTagProcessor_c *pTagProcessor, bool global, wchar_t *dstBuf, u32 maxLen + ); + static s32 getArcIndexForFile(const char *fileName); static const char *getArcNameByIndex(s32 idx, bool); + bool checkIsValidTextLabel(const char *name); + static void setZevFromMsbArc(); static const char *getMsbtFileName(s32 index); static s32 getMsbtNumberByIndex(s32 index); @@ -53,13 +67,18 @@ private: static s32 getMsbfNumberByIndex(s32 index); static void *getDataFromMsbArc(s32 number, const char *fileName, bool); + s32 getTextIndexForLabel(const char *label); + s32 getMsbtIndexForLabelInternal(const char *label); + static MsbtInfo *getMsbtInfoForIndex(s32 index); + MsbtInfo *getMsbtInfoForIndexInternal(s32 index); + static dMessage_c *sInstance; static dTagProcessor_c *sTagProcessor; /* 0x068 */ MsbtInfo *mpMsgs[82]; /* 0x1B0 */ MsbfInfo *mpFlows[80]; /* 0x2F0 */ SizedString<8> mLanguage; - /* 0x2F8 */ s32 mCurrentTextFileNumber; + /* 0x2F8 */ u32 mCurrentTextFileNumber; /* 0x2FC */ s32 field_0x2FC; diff --git a/include/d/d_tag_processor.h b/include/d/d_tag_processor.h index d5f6ddc0..56cc29e1 100644 --- a/include/d/d_tag_processor.h +++ b/include/d/d_tag_processor.h @@ -98,6 +98,10 @@ public: field_0x90C = type; } + void setField_0x90D(u8 val) { + field_0x90D = val; + } + void setField_0xEE1(u8 val) { field_0xEE1 = val; } diff --git a/include/d/d_textunk.h b/include/d/d_textunk.h index 587d5376..c2ceddf5 100644 --- a/include/d/d_textunk.h +++ b/include/d/d_textunk.h @@ -125,6 +125,14 @@ public: field_0x104 = str; } + bool getField_0x7B4() const { + return field_0x7B4; + } + + MsbtInfo *getMsbtInfo(s32 index) const { + return field_buf2[index]; + } + private: static UnkTextThing *sInstance; -- cgit v1.2.3 From 4612c35f458f524c65e7c87ac3e4f955a44759a9 Mon Sep 17 00:00:00 2001 From: robojumper Date: Fri, 4 Apr 2025 16:34:21 +0200 Subject: Progress --- include/d/d_message.h | 4 +++ include/d/d_stage_mgr.h | 4 +++ include/d/d_tag_processor.h | 26 +++++++++++++++++ include/d/d_textwindow_unk.h | 18 ++++++++++-- include/d/lyt/d_lyt_auto_caption.h | 4 +-- include/d/lyt/d_lyt_auto_explain.h | 4 +-- include/d/lyt/d_lyt_control_game.h | 25 ++++++++++++++++ include/d/lyt/d_lyt_map.h | 10 +++++++ include/d/lyt/msg_window/d_lyt_msg_window.h | 20 ++++++++++--- .../d/lyt/msg_window/d_lyt_msg_window_select_btn.h | 34 +++++++++++++++++++++- include/m/m_fader_base.h | 16 +++++----- include/toBeSorted/global_fi_context.h | 13 +++++++-- include/toBeSorted/small_sound_mgr.h | 2 ++ 13 files changed, 159 insertions(+), 21 deletions(-) create mode 100644 include/d/lyt/d_lyt_control_game.h (limited to 'include') diff --git a/include/d/d_message.h b/include/d/d_message.h index d5e1b2f9..527ab61c 100644 --- a/include/d/d_message.h +++ b/include/d/d_message.h @@ -36,6 +36,10 @@ public: return field_0x329; } + void setField_0x329(bool v) { + field_0x329 = v; + } + bool getField_0x32A() const { return field_0x32A; } diff --git a/include/d/d_stage_mgr.h b/include/d/d_stage_mgr.h index aa4b277f..9160b33d 100644 --- a/include/d/d_stage_mgr.h +++ b/include/d/d_stage_mgr.h @@ -114,6 +114,10 @@ public: void addObjId(u16 id); void addActorId(u16 actorId); + dFader_c *getFader() { + return &mFader; + } + private: static void lastExecuteCallback(); diff --git a/include/d/d_tag_processor.h b/include/d/d_tag_processor.h index 56cc29e1..eea3e08f 100644 --- a/include/d/d_tag_processor.h +++ b/include/d/d_tag_processor.h @@ -69,6 +69,7 @@ public: f32 getFloat(s32 i); s32 tickPauseFrame(); s32 tick0x830(); + void execute(); void setTextbox(dTextBox_c *box) { field_0x004 = box; @@ -90,6 +91,14 @@ public: return field_0x90E; } + s32 getField_0x828() const { + return field_0x828; + } + + s32 getField_0x82C() const { + return field_0x82C; + } + s32 getField_0x830() const { return field_0x830; } @@ -98,10 +107,23 @@ public: field_0x90C = type; } + void setField_0x828(s32 val) { + field_0x828 = val; + } + + void setField_0x82C(s32 val) { + field_0x82C = val; + } + + void setField_0x90D(u8 val) { field_0x90D = val; } + void setField_0x90E(u8 val) { + field_0x90E = val; + } + void setField_0xEE1(u8 val) { field_0xEE1 = val; } @@ -114,6 +136,10 @@ public: field_0xEE3 = val; } + wchar_t *getBuf(s32 idx) { + return field_0x008[idx]; + } + private: /* 0x004 */ dTextBox_c *field_0x004; /* 0x008 */ wchar_t field_0x008[4][256]; diff --git a/include/d/d_textwindow_unk.h b/include/d/d_textwindow_unk.h index e9ce7093..1ab9c6f4 100644 --- a/include/d/d_textwindow_unk.h +++ b/include/d/d_textwindow_unk.h @@ -17,13 +17,27 @@ public: const wchar_t *getProcessedText() const { return mProcessedTextBuffer; } + + u16 getField_0x147A() const { + return field_0x147A; + } + + u16 getField_0x147C() const { + return field_0x147C; + } + + bool checkEndReached() const; + bool checkLastLineReachedMaybe() const; private: /* 0x0004 */ dTagProcessor_c *mpTagProcessor; /* 0x0008 */ wchar_t mRawTextBuffer[1023]; /* 0x0806 */ wchar_t mProcessedTextBuffer[1023]; - /* 0x1004 */ wchar_t mUnkBuffer[679]; // ??? - /* 0x1550 */ void* field_0x1559; + /* 0x1004 */ wchar_t mUnkBuffer[571]; // ??? + /* 0x147A */ u16 field_0x147A; + /* 0x147C */ u16 field_0x147C; + /* 0x147E */ u8 _0x147E[0x1550 - 0x147E]; + /* 0x1550 */ void* field_0x1550; }; #endif diff --git a/include/d/lyt/d_lyt_auto_caption.h b/include/d/lyt/d_lyt_auto_caption.h index 115d0a40..f66462f7 100644 --- a/include/d/lyt/d_lyt_auto_caption.h +++ b/include/d/lyt/d_lyt_auto_caption.h @@ -31,9 +31,9 @@ public: STATE_FUNC_DECLARE(dLytAutoCaption_c, OutputText); STATE_FUNC_DECLARE(dLytAutoCaption_c, Out); -private: - static bool checkSomethingMeter(); + bool checkSomethingMeter(); +private: /* 0x010 */ UI_STATE_MGR_DECLARE(dLytAutoCaption_c); /* 0x068 */ d2d::ResAccIf_c mResAcc; /* 0x3C4 */ d2d::LytBase_c mLyt; diff --git a/include/d/lyt/d_lyt_auto_explain.h b/include/d/lyt/d_lyt_auto_explain.h index 44433591..1f6edf93 100644 --- a/include/d/lyt/d_lyt_auto_explain.h +++ b/include/d/lyt/d_lyt_auto_explain.h @@ -31,9 +31,9 @@ public: STATE_FUNC_DECLARE(dLytAutoExplain_c, OutputText); STATE_FUNC_DECLARE(dLytAutoExplain_c, Out); -private: - static bool checkSomethingMeter(); + bool checkSomethingMeter(); +private: /* 0x010 */ UI_STATE_MGR_DECLARE(dLytAutoExplain_c); /* 0x068 */ d2d::ResAccIf_c mResAcc; /* 0x3C4 */ d2d::LytBase_c mLyt; diff --git a/include/d/lyt/d_lyt_control_game.h b/include/d/lyt/d_lyt_control_game.h new file mode 100644 index 00000000..5802522f --- /dev/null +++ b/include/d/lyt/d_lyt_control_game.h @@ -0,0 +1,25 @@ +#ifndef D_LYT_CONTROL_GAME_H +#define D_LYT_CONTROL_GAME_H + +#include "d/d_base.h" + +class dLytControlGame_c : public dBase_c { +public: + dLytControlGame_c(); + virtual ~dLytControlGame_c(); + + bool isInSomeMapState() const; + bool isNotInStateMap() const; + + void fn_802CCD40(bool); + + static dLytControlGame_c *getInstance() { + return sInstance; + } + +private: + + static dLytControlGame_c *sInstance; +}; + +#endif diff --git a/include/d/lyt/d_lyt_map.h b/include/d/lyt/d_lyt_map.h index 81e3f3d2..fbe85483 100644 --- a/include/d/lyt/d_lyt_map.h +++ b/include/d/lyt/d_lyt_map.h @@ -263,6 +263,8 @@ public: void build(); + bool isOpenMaybe() const; + STATE_FUNC_DECLARE(dLytMapMain_c, Invisible); STATE_FUNC_DECLARE(dLytMapMain_c, RenderingWait); STATE_FUNC_DECLARE(dLytMapMain_c, In); @@ -369,6 +371,14 @@ public: return &sInstance->mResAcc; } + static dLytMap_c *getInstance() { + return sInstance; + } + + bool isOpenMaybe() const { + return mMapMain.isOpenMaybe(); + } + void build(); private: diff --git a/include/d/lyt/msg_window/d_lyt_msg_window.h b/include/d/lyt/msg_window/d_lyt_msg_window.h index 7aba7161..c764ce53 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window.h @@ -22,13 +22,23 @@ public: bool build(); bool remove(); + bool execute(); + bool draw(); + + bool isVisible() const; + bool isOutputtingText() const; + + void setCurrentLabelName(const char *name, bool storeFile); + void setCurrentEntrypointName(const char *name); + void setCurrentFlowFilename(const char *name); private: - void setTextToDisplay(const wchar_t *text); + bool setTextToDisplay(const wchar_t *text); void createSubMsgManager(u8 type); void removeSubMsgManagers(); bool fn_8011A5D0() const; + static dLytMsgWindow_c *sInstance; STATE_FUNC_DECLARE(dLytMsgWindow_c, Invisible); @@ -69,8 +79,8 @@ private: /* 0x748 */ dLytAutoExplain_c *mpAutoExplain; /* 0x74C */ dLytAutoCaption_c *mpAutoCaption; - /* 0x750 */ u8 _0x750[0x768 - 0x750]; - + /* 0x750 */ u8 _0x750[0x75C - 0x750]; + /* 0x75C */ mVec3_c field_0x75C; /* 0x768 */ mVec3_c field_0x768; /* 0x774 */ s32 field_0x774; /* 0x778 */ s32 field_0x778; @@ -105,13 +115,15 @@ private: /* 0x81E */ u8 field_0x81E; /* 0x820 */ u16 field_0x820; - /* 0x824 */ void *field_0x824; + /* 0x824 */ s32 field_0x824; /* 0x828 */ void *field_0x828; /* 0x82C */ u32 mTextOptionSelection; /* 0x830 */ u32 mSpecialFiMenuValue; /* 0x834 */ dLytMsgWindowSelectBtn_c mSelectBtn; + /* 0x1208 */ SizedString<8> mCurrentEntrypointName; + /* 0x1210 */ SizedString<16> mCurrentFlowFileName; /* 0x1220 */ u8 field_0x1220; }; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_select_btn.h b/include/d/lyt/msg_window/d_lyt_msg_window_select_btn.h index c3592c59..3d69201e 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_select_btn.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_select_btn.h @@ -1,7 +1,9 @@ #ifndef D_LYT_MSG_WINDOW_SELECT_BTN_H #define D_LYT_MSG_WINDOW_SELECT_BTN_H +#include "d/d_tag_processor.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" @@ -71,6 +73,36 @@ public: bool draw(); + s32 getField_0x9B4() const { + return field_0x9B4; + } + + void setField_0x9B8(s32 value) { + field_0x9B8 = value; + } + + void setField_0x9BC(s32 value) { + field_0x9BC = value; + } + + void setField_0x990(s32 value) { + mBtnHelper.field_0x4C = value; + } + + void setField_0x998(dTagProcessor_c *value) { + mpTagProcessor = value; + } + + void fn_8011E5D0(u32, bool); + + dTextBox_c *getSelectTextBox(s32 option, s32 idx) const { + return mpSelectTextBoxes[option][idx]; + } + + BOOL isStateWait() { + return *mStateMgr.getStateID() == StateID_Wait; + } + private: s32 fn_8011FE50(); @@ -93,7 +125,7 @@ private: /* 0x7F0 */ dTextBox_c *mpSizeBox; /* 0x7F4 */ dLytMsgWindowSelectBtnParts_c mParts[4]; /* 0x944 */ SelectBtnHelper mBtnHelper; - /* 0x998 */ void *field_0x998; + /* 0x998 */ dTagProcessor_c *mpTagProcessor; /* 0x99C */ s32 field_0x99C; /* 0x9A0 */ s32 field_0x9A0; /* 0x9A4 */ u8 field_0x9A4; diff --git a/include/m/m_fader_base.h b/include/m/m_fader_base.h index fcef4dfd..61869523 100644 --- a/include/m/m_fader_base.h +++ b/include/m/m_fader_base.h @@ -19,14 +19,14 @@ public: }; mFaderBase_c(const mColor &color, EStatus status); - virtual ~mFaderBase_c(); - - virtual void setStatus(EStatus status) = 0; - virtual EStatus getStatus() const; - virtual bool fadeIn(); - virtual bool fadeOut(); - virtual bool calc(); - virtual void draw() = 0; + /* vt 0x08 */ virtual ~mFaderBase_c(); + + /* vt 0x0C */ virtual void setStatus(EStatus status) = 0; + /* vt 0x10 */ virtual EStatus getStatus() const; + /* vt 0x14 */ virtual bool fadeIn(); + /* vt 0x18 */ virtual bool fadeOut(); + /* vt 0x1C */ virtual bool calc(); + /* vt 0x20 */ virtual void draw() = 0; void setFrame(u16 frame); void setColor(const mColor &color); diff --git a/include/toBeSorted/global_fi_context.h b/include/toBeSorted/global_fi_context.h index be63a65f..585f416d 100644 --- a/include/toBeSorted/global_fi_context.h +++ b/include/toBeSorted/global_fi_context.h @@ -1,8 +1,17 @@ #ifndef GLOBAL_FI_CONTEXT_H #define GLOBAL_FI_CONTEXT_H -extern "C" void *GLOBAL_FI_CONTEXT; -extern "C" void fn_8016C9F0(void*); +#include "common.h" + +struct FiContext { + /* 0x00 */ u8 _0x00[0x4B - 0x00]; + /* 0x4B */ bool mDoSpecialFiMenuHandling; + + static s32 getGlobalFiInfo0(s32); +}; + +extern "C" FiContext *GLOBAL_FI_CONTEXT; +extern "C" void fn_8016C9F0(FiContext *); extern "C" void createGlobalFiContext(); #endif diff --git a/include/toBeSorted/small_sound_mgr.h b/include/toBeSorted/small_sound_mgr.h index 444f1572..9c56dab9 100644 --- a/include/toBeSorted/small_sound_mgr.h +++ b/include/toBeSorted/small_sound_mgr.h @@ -3,6 +3,7 @@ // Thanks kiwi! https://gist.github.com/kiwi515/47bb17b07ed502bdfa7faa60bc48a3c7 +#include "common.h" enum WZSound { /* 0x0000 */ SE_L_FLIPED, /* 0x0001 */ SE_L_FS_START, @@ -6471,6 +6472,7 @@ enum WZSound { class SmallSoundManager { public: void playSound(WZSound id); + void playButtonPressSoundWhenAdvancingTextBoxes(f32); static SmallSoundManager *GetInstance() { return sInstance; -- cgit v1.2.3 From af4a1cfdb0842ee4ac440b3c98308b0d68da6897 Mon Sep 17 00:00:00 2001 From: robojumper Date: Fri, 4 Apr 2025 21:14:40 +0200 Subject: Sword somewhat ok, though not well understood --- include/d/d_textunk.h | 4 + include/d/lyt/d2d.h | 4 + include/d/lyt/d_lyt_auto_caption.h | 2 +- include/d/lyt/d_lyt_auto_explain.h | 2 +- include/d/lyt/d_lyt_common_icon_item.h | 6 +- include/d/lyt/msg_window/d_lyt_msg_window.h | 15 ++-- include/d/lyt/msg_window/d_lyt_msg_window_common.h | 35 +++++++- include/d/lyt/msg_window/d_lyt_msg_window_demo.h | 48 +++++++++++ include/d/lyt/msg_window/d_lyt_msg_window_get.h | 46 +++++++++++ include/d/lyt/msg_window/d_lyt_msg_window_link.h | 46 +++++++++++ include/d/lyt/msg_window/d_lyt_msg_window_stone.h | 8 +- include/d/lyt/msg_window/d_lyt_msg_window_sword.h | 92 ++++++++++++++++++++++ include/d/lyt/msg_window/d_lyt_msg_window_talk.h | 46 +++++++++++ include/d/lyt/msg_window/d_lyt_msg_window_wood.h | 8 +- include/m/m2d.h | 5 ++ 15 files changed, 345 insertions(+), 22 deletions(-) create mode 100644 include/d/lyt/msg_window/d_lyt_msg_window_demo.h create mode 100644 include/d/lyt/msg_window/d_lyt_msg_window_get.h create mode 100644 include/d/lyt/msg_window/d_lyt_msg_window_link.h create mode 100644 include/d/lyt/msg_window/d_lyt_msg_window_sword.h create mode 100644 include/d/lyt/msg_window/d_lyt_msg_window_talk.h (limited to 'include') diff --git a/include/d/d_textunk.h b/include/d/d_textunk.h index c2ceddf5..d3f7240e 100644 --- a/include/d/d_textunk.h +++ b/include/d/d_textunk.h @@ -125,6 +125,10 @@ public: field_0x104 = str; } + s16 getField_0x7AE() const { + return field_0x7AE; + } + bool getField_0x7B4() const { return field_0x7B4; } diff --git a/include/d/lyt/d2d.h b/include/d/lyt/d2d.h index 7f79abcf..ce23507e 100644 --- a/include/d/lyt/d2d.h +++ b/include/d/lyt/d2d.h @@ -270,6 +270,10 @@ struct AnmGroupBase_c { syncAnmFrame(); } + inline f32 getRatio() const { + return mpFrameCtrl->getRatio(); + } + inline void setBackwardsRatio(f32 ratio) { mpFrameCtrl->setBackwardsRatio(ratio); syncAnmFrame(); diff --git a/include/d/lyt/d_lyt_auto_caption.h b/include/d/lyt/d_lyt_auto_caption.h index f66462f7..1a2bbfcd 100644 --- a/include/d/lyt/d_lyt_auto_caption.h +++ b/include/d/lyt/d_lyt_auto_caption.h @@ -22,7 +22,7 @@ public: /* vt 0x24 */ virtual void close() override; /* vt 0x28 */ virtual bool isDoneClosing() const override; /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; - /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { + /* vt 0x30 */ virtual dTextBox_c *getTextBox() override { return mpTextboxes[0]; } diff --git a/include/d/lyt/d_lyt_auto_explain.h b/include/d/lyt/d_lyt_auto_explain.h index 1f6edf93..538bd2be 100644 --- a/include/d/lyt/d_lyt_auto_explain.h +++ b/include/d/lyt/d_lyt_auto_explain.h @@ -22,7 +22,7 @@ public: /* vt 0x24 */ virtual void close() override; /* vt 0x28 */ virtual bool isDoneClosing() const override; /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; - /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { + /* vt 0x30 */ virtual dTextBox_c *getTextBox() override { return mpTextboxes[0]; } diff --git a/include/d/lyt/d_lyt_common_icon_item.h b/include/d/lyt/d_lyt_common_icon_item.h index 7e5712c7..66be9d60 100644 --- a/include/d/lyt/d_lyt_common_icon_item.h +++ b/include/d/lyt/d_lyt_common_icon_item.h @@ -56,7 +56,7 @@ public: void setNumberColor(u8 color); void setOn(); void setOff(); - void startDecide(); + void startConfirm(); bool isDoneDeciding() const; private: @@ -129,7 +129,7 @@ public: void setNumberColor(u8 color); void setOn(); void setOff(); - void startDecide(); + void startConfirm(); bool isDoneDeciding() const; void setShieldOnOff(bool onOff); @@ -264,7 +264,7 @@ public: /** The "decide" animation in the scrap shop makes the selected item flash for a short time before showing the upgrade screen */ - void startDecide(); + void startConfirm(); bool isDoneDeciding() const; void setShieldOnOff(bool onOff); diff --git a/include/d/lyt/msg_window/d_lyt_msg_window.h b/include/d/lyt/msg_window/d_lyt_msg_window.h index c764ce53..2ee9b484 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window.h @@ -10,8 +10,13 @@ #include "s/s_State.hpp" #include "sized_string.h" +class dLytMsgWindowTalk_c; +class dLytMsgWindowLink_c; +class dLytMsgWindowGet_c; +class dLytMsgWindowSword_c; class dLytMsgWindowWood_c; class dLytMsgWindowStone_c; +class dLytMsgWindowDemo_c; class dLytAutoExplain_c; class dLytAutoCaption_c; @@ -69,13 +74,13 @@ private: /* 0x724 */ dTagProcessor_c *mpTagProcessor; /* 0x728 */ dLytMsgWindowSubtype *mpCurrentSubtype; - /* 0x72C */ dLytMsgWindowSubtype *mpWindowTalk; - /* 0x730 */ dLytMsgWindowSubtype *mpWindowLink; - /* 0x734 */ dLytMsgWindowSubtype *mpWindowSword; + /* 0x72C */ dLytMsgWindowTalk_c *mpWindowTalk; + /* 0x730 */ dLytMsgWindowLink_c *mpWindowLink; + /* 0x734 */ dLytMsgWindowSword_c *mpWindowSword; /* 0x738 */ dLytMsgWindowWood_c *mpWindowWood; /* 0x73C */ dLytMsgWindowStone_c *mpWindowStone; - /* 0x740 */ dLytMsgWindowSubtype *mpWindowGet; - /* 0x744 */ dLytMsgWindowSubtype *mpWindowDemo; + /* 0x740 */ dLytMsgWindowGet_c *mpWindowGet; + /* 0x744 */ dLytMsgWindowDemo_c *mpWindowDemo; /* 0x748 */ dLytAutoExplain_c *mpAutoExplain; /* 0x74C */ dLytAutoCaption_c *mpAutoCaption; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h index 718fbdaa..d3ea5db9 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_common.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -6,6 +6,8 @@ #include "d/d_tag_processor.h" #include "d/lyt/d2d.h" #include "m/m2d.h" +#include "m/m_vec.h" +#include "nw4r/lyt/lyt_pane.h" class dLytMsgWindowSubtype : public m2d::Base_c { public: @@ -19,19 +21,44 @@ public: /* vt 0x24 */ virtual void close(); /* vt 0x28 */ virtual bool isDoneClosing() const; /* vt 0x2C */ virtual bool setText(const wchar_t *text); - /* vt 0x30 */ virtual dTextBox_c *vt_0x30() { + /* vt 0x30 */ virtual dTextBox_c *getTextBox() { return nullptr; } - /* vt 0x34 */ virtual bool vt_0x34() { + /* vt 0x34 */ virtual bool startConfirm() { return true; } - /* vt 0x38 */ virtual bool vt_0x38(bool b) { + /* vt 0x38 */ virtual bool startDecide(bool b) { return true; } - /* vt 0x3C */ virtual bool vt_0x3C() const { + /* vt 0x3C */ virtual bool isDoneDecide() const { return true; } /* vt 0x40 */ virtual bool vt_0x40() const; }; +class dLytTextSword { +public: + enum ESwordType { + FI, + GHIRAHIM, + LASTBOSS, + }; + + dLytTextSword() {} + /* vt at 0x00 */ + virtual ~dLytTextSword() {} + + bool build(d2d::ResAccIf_c *pResAcc, ESwordType type); + bool remove(); + void draw(const wchar_t *str, s8, const mVec3_c&, f32); + f32 fn_80120DB0() const; + +private: + /* 0x04 */ d2d::LytBase_c mLyt; + /* 0x90 */ d2d::AnmGroup_c mAnm; + /* 0xD4 */ dTextBox_c *mpTexts[3]; + /* 0xE0 */ nw4r::lyt::Pane *mpPane; + /* 0xE4 */ ESwordType mType; +}; + #endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_demo.h b/include/d/lyt/msg_window/d_lyt_msg_window_demo.h new file mode 100644 index 00000000..2c3beb6d --- /dev/null +++ b/include/d/lyt/msg_window/d_lyt_msg_window_demo.h @@ -0,0 +1,48 @@ +#ifndef D_LYT_MSG_WINDOW_DEMO_H +#define D_LYT_MSG_WINDOW_DEMO_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_a_btn.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "nw4r/lyt/lyt_types.h" +#include "s/s_State.hpp" + +class dLytMsgWindowDemo_c : public dLytMsgWindowSubtype { +public: + dLytMsgWindowDemo_c() : mStateMgr(*this) {} + /* vt 0x08 */ virtual ~dLytMsgWindowDemo_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool + build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void open(dAcObjBase_c *obj, u32 param) override; + /* vt 0x20 */ virtual bool isDoneOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isDoneClosing() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *getTextBox() override { + return nullptr; + } + /* vt 0x34 */ virtual bool startConfirm() override { + return true; + } + /* vt 0x38 */ virtual bool startDecide(bool b) override { + return true; + } + /* vt 0x3C */ virtual bool isDoneDecide() const override { + return true; + } + + STATE_FUNC_DECLARE(dLytMsgWindowDemo_c, Invisible); + STATE_FUNC_DECLARE(dLytMsgWindowDemo_c, In); + STATE_FUNC_DECLARE(dLytMsgWindowDemo_c, Visible); + STATE_FUNC_DECLARE(dLytMsgWindowDemo_c, Out); + +private: + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowDemo_c); +}; + +#endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_get.h b/include/d/lyt/msg_window/d_lyt_msg_window_get.h new file mode 100644 index 00000000..0f36ac58 --- /dev/null +++ b/include/d/lyt/msg_window/d_lyt_msg_window_get.h @@ -0,0 +1,46 @@ +#ifndef D_LYT_MSG_WINDOW_GET_H +#define D_LYT_MSG_WINDOW_GET_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "s/s_State.hpp" + +class dLytMsgWindowGet_c : public dLytMsgWindowSubtype { +public: + dLytMsgWindowGet_c() : mStateMgr(*this) {} + /* vt 0x08 */ virtual ~dLytMsgWindowGet_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool + build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void open(dAcObjBase_c *obj, u32 param) override; + /* vt 0x20 */ virtual bool isDoneOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isDoneClosing() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *getTextBox() override { + return nullptr; + } + /* vt 0x34 */ virtual bool startConfirm() override { + return true; + } + /* vt 0x38 */ virtual bool startDecide(bool b) override { + return true; + } + /* vt 0x3C */ virtual bool isDoneDecide() const override { + return true; + } + + STATE_FUNC_DECLARE(dLytMsgWindowGet_c, Invisible); + STATE_FUNC_DECLARE(dLytMsgWindowGet_c, In); + STATE_FUNC_DECLARE(dLytMsgWindowGet_c, Visible); + STATE_FUNC_DECLARE(dLytMsgWindowGet_c, Out); + +private: + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowGet_c); +}; + +#endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_link.h b/include/d/lyt/msg_window/d_lyt_msg_window_link.h new file mode 100644 index 00000000..35f3e7d7 --- /dev/null +++ b/include/d/lyt/msg_window/d_lyt_msg_window_link.h @@ -0,0 +1,46 @@ +#ifndef D_LYT_MSG_WINDOW_LINK_H +#define D_LYT_MSG_WINDOW_LINK_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "s/s_State.hpp" + +class dLytMsgWindowLink_c : public dLytMsgWindowSubtype { +public: + dLytMsgWindowLink_c() : mStateMgr(*this) {} + /* vt 0x08 */ virtual ~dLytMsgWindowLink_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool + build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void open(dAcObjBase_c *obj, u32 param) override; + /* vt 0x20 */ virtual bool isDoneOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isDoneClosing() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *getTextBox() override { + return nullptr; + } + /* vt 0x34 */ virtual bool startConfirm() override { + return true; + } + /* vt 0x38 */ virtual bool startDecide(bool b) override { + return true; + } + /* vt 0x3C */ virtual bool isDoneDecide() const override { + return true; + } + + STATE_FUNC_DECLARE(dLytMsgWindowLink_c, Invisible); + STATE_FUNC_DECLARE(dLytMsgWindowLink_c, In); + STATE_FUNC_DECLARE(dLytMsgWindowLink_c, Visible); + STATE_FUNC_DECLARE(dLytMsgWindowLink_c, Out); + +private: + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowLink_c); +}; + +#endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h index 6a533581..cc98a9d3 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h @@ -23,16 +23,16 @@ public: /* vt 0x24 */ virtual void close() override; /* vt 0x28 */ virtual bool isDoneClosing() const override; /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; - /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { + /* vt 0x30 */ virtual dTextBox_c *getTextBox() override { return mpTextboxes[0]; } - /* vt 0x34 */ virtual bool vt_0x34() override { + /* vt 0x34 */ virtual bool startConfirm() override { return mBtn.requestIn(); } - /* vt 0x38 */ virtual bool vt_0x38(bool b) override { + /* vt 0x38 */ virtual bool startDecide(bool b) override { return mBtn.requestOut(b); } - /* vt 0x3C */ virtual bool vt_0x3C() const override { + /* vt 0x3C */ virtual bool isDoneDecide() const override { return mBtn.isDoneOut(); } diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_sword.h b/include/d/lyt/msg_window/d_lyt_msg_window_sword.h new file mode 100644 index 00000000..81518c9c --- /dev/null +++ b/include/d/lyt/msg_window/d_lyt_msg_window_sword.h @@ -0,0 +1,92 @@ +#ifndef D_LYT_MSG_WINDOW_SWORD_H +#define D_LYT_MSG_WINDOW_SWORD_H + +#include "d/a/obj/d_a_obj_base.h" +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_a_btn.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "m/m_vec.h" +#include "s/s_State.hpp" + +struct dLytMsgWindowSwordLetterDataMaybe { + /* 0x00 */ f32 posX; + /* 0x04 */ f32 posY; + /* 0x08 */ f32 field_0x08; + /* 0x0C */ s16 field_0x0C; + /* 0x0E */ wchar_t character; + /* 0x10 */ s8 displayTimerMaybe; +}; + +class dLytMsgWindowSword_c : public dLytMsgWindowSubtype { +public: + dLytMsgWindowSword_c() : mStateMgr(*this) {} + /* vt 0x08 */ virtual ~dLytMsgWindowSword_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool + build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void open(dAcObjBase_c *obj, u32 param) override; + /* vt 0x20 */ virtual bool isDoneOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isDoneClosing() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *getTextBox() override { + return mpTextboxes[0]; + } + /* vt 0x34 */ virtual bool startConfirm() override { + return mBtn.requestIn(); + } + /* vt 0x38 */ virtual bool startDecide(bool b) override { + return mBtn.requestOut(b); + } + /* vt 0x3C */ virtual bool isDoneDecide() const override { + return mBtn.isDoneOut(); + } + + STATE_FUNC_DECLARE(dLytMsgWindowSword_c, Invisible); + STATE_FUNC_DECLARE(dLytMsgWindowSword_c, In); + STATE_FUNC_DECLARE(dLytMsgWindowSword_c, Wait); + STATE_FUNC_DECLARE(dLytMsgWindowSword_c, Visible); + STATE_FUNC_DECLARE(dLytMsgWindowSword_c, Out); + + void setSwordType(dLytTextSword::ESwordType type) { + mSwordType = type; + } + +private: + /* 0x0010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowSword_c); + /* 0x004C */ d2d::SubPaneList mSubpaneList; + /* 0x005C */ d2d::SubPaneListNode mNodes[1]; + /* 0x0068 */ d2d::ResAccIf_c mResAcc; + /* 0x03D8 */ d2d::LytBase_c mLyt; + /* 0x0468 */ d2d::AnmGroup_c mAnm[5]; + /* 0x05A8 */ dTextBox_c *mpTextboxes[2]; + /* 0x05B0 */ nw4r::lyt::Pane *mpPanes[3]; + /* 0x05BC */ dTagProcessor_c *mpTagProcessor; + /* 0x05C0 */ mVec3_c mTranslationOrig; + /* 0x05CC */ mVec3_c mTranslationTo; + /* 0x05D8 */ mVec3_c mTranslationFrom; + + /* 0x05E4 */ f32 field_0x05E4; + /* 0x05E8 */ f32 field_0x05E8; + + /* 0x05EC */ dAcObjBase_c *mpActor; + /* 0x05F0 */ s32 mParam; + + /* 0x05F4 */ s32 field_0x5F4; + + /* 0x05F8 */ dLytCommonABtn_c mBtn; + + /* 0x07A8 */ dLytMsgWindowSwordLetterDataMaybe mCharacterData[1023]; + /* 0x5794 */ wchar_t mTextBuf[1023]; + + /* 0x5F94 */ dLytTextSword mSwordText; + /* 0x607C */ dLytTextSword::ESwordType mSwordType; + /* 0x6080 */ bool mShouldBeOpen; + /* 0x6081 */ bool mHasDrawnThisTick; +}; + +#endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_talk.h b/include/d/lyt/msg_window/d_lyt_msg_window_talk.h new file mode 100644 index 00000000..05bc5095 --- /dev/null +++ b/include/d/lyt/msg_window/d_lyt_msg_window_talk.h @@ -0,0 +1,46 @@ +#ifndef D_LYT_MSG_WINDOW_TALK_H +#define D_LYT_MSG_WINDOW_TALK_H + +#include "d/d_tag_processor.h" +#include "d/lyt/d2d.h" +#include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "s/s_State.hpp" + +class dLytMsgWindowTalk_c : public dLytMsgWindowSubtype { +public: + dLytMsgWindowTalk_c() : mStateMgr(*this) {} + /* vt 0x08 */ virtual ~dLytMsgWindowTalk_c() {} + /* vt 0x0C */ virtual void draw() override; + /* vt 0x10 */ virtual bool + build(d2d::ResAccIf_c *resAcc1, d2d::ResAccIf_c *resAcc, dTagProcessor_c *tagProcessor) override; + /* vt 0x14 */ virtual bool remove() override; + /* vt 0x18 */ virtual bool execute() override; + /* vt 0x1C */ virtual void open(dAcObjBase_c *obj, u32 param) override; + /* vt 0x20 */ virtual bool isDoneOpening() const override; + /* vt 0x24 */ virtual void close() override; + /* vt 0x28 */ virtual bool isDoneClosing() const override; + /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; + /* vt 0x30 */ virtual dTextBox_c *getTextBox() override { + return nullptr; + } + /* vt 0x34 */ virtual bool startConfirm() override { + return true; + } + /* vt 0x38 */ virtual bool startDecide(bool b) override { + return true; + } + /* vt 0x3C */ virtual bool isDoneDecide() const override { + return true; + } + + STATE_FUNC_DECLARE(dLytMsgWindowTalk_c, Invisible); + STATE_FUNC_DECLARE(dLytMsgWindowTalk_c, In); + STATE_FUNC_DECLARE(dLytMsgWindowTalk_c, Visible); + STATE_FUNC_DECLARE(dLytMsgWindowTalk_c, Out); + +private: + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowTalk_c); +}; + +#endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h index 9404283b..45f43937 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h @@ -24,16 +24,16 @@ public: /* vt 0x24 */ virtual void close() override; /* vt 0x28 */ virtual bool isDoneClosing() const override; /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; - /* vt 0x30 */ virtual dTextBox_c *vt_0x30() override { + /* vt 0x30 */ virtual dTextBox_c *getTextBox() override { return mpTextboxes[0]; } - /* vt 0x34 */ virtual bool vt_0x34() override { + /* vt 0x34 */ virtual bool startConfirm() override { return mBtn.requestIn(); } - /* vt 0x38 */ virtual bool vt_0x38(bool b) override { + /* vt 0x38 */ virtual bool startDecide(bool b) override { return mBtn.requestOut(b); } - /* vt 0x3C */ virtual bool vt_0x3C() const override { + /* vt 0x3C */ virtual bool isDoneDecide() const override { return mBtn.isDoneOut(); } diff --git a/include/m/m2d.h b/include/m/m2d.h index cf0936e1..639df15f 100644 --- a/include/m/m2d.h +++ b/include/m/m2d.h @@ -94,6 +94,11 @@ public: setFrame(actualEnd * ratio); } + inline f32 getRatio() const { + f32 actualEnd = mEndFrame - 1.0f; + return mCurrFrame / actualEnd; + } + inline void setBackwardsRatio(f32 ratio) { f32 actualEnd = mEndFrame - 1.0f; setFrame(actualEnd - (ratio * actualEnd)); -- cgit v1.2.3 From f2bcb0da52cd6c3e0ed18315c155d57ec71d805f Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 5 Apr 2025 00:11:00 +0200 Subject: More demo --- include/d/d_textwindow_unk.h | 36 ++++++++++++++++++++-- include/d/lyt/msg_window/d_lyt_msg_window.h | 13 ++++++-- include/d/lyt/msg_window/d_lyt_msg_window_common.h | 26 +++++++++++++++- include/d/lyt/msg_window/d_lyt_msg_window_demo.h | 33 +++++++++++++------- include/d/lyt/msg_window/d_lyt_msg_window_sword.h | 16 ++++------ include/m/m2d.h | 2 +- include/toBeSorted/lyt_vec2f.h | 14 +++++++++ 7 files changed, 112 insertions(+), 28 deletions(-) create mode 100644 include/toBeSorted/lyt_vec2f.h (limited to 'include') diff --git a/include/d/d_textwindow_unk.h b/include/d/d_textwindow_unk.h index 1ab9c6f4..0eb68014 100644 --- a/include/d/d_textwindow_unk.h +++ b/include/d/d_textwindow_unk.h @@ -3,14 +3,18 @@ #include "d/d_tag_processor.h" #include "d/lyt/d_textbox.h" +#include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "toBeSorted/lyt_vec2f.h" // Size 0x1554 +// Probably responsible for emitting characters +// one by one in the text boxes class TextWindowUnk { public: TextWindowUnk(dTagProcessor_c *tagProcessor); virtual ~TextWindowUnk() {} - void fn_800B2130(const char *, dTextBox_c *, void*, bool); + void fn_800B2130(const char *, dTextBox_c *, void *, bool); void fn_800B2AA0(); void textAdvancingRelated(bool, bool); @@ -28,7 +32,7 @@ public: bool checkEndReached() const; bool checkLastLineReachedMaybe() const; - + private: /* 0x0004 */ dTagProcessor_c *mpTagProcessor; /* 0x0008 */ wchar_t mRawTextBuffer[1023]; @@ -37,7 +41,33 @@ private: /* 0x147A */ u16 field_0x147A; /* 0x147C */ u16 field_0x147C; /* 0x147E */ u8 _0x147E[0x1550 - 0x147E]; - /* 0x1550 */ void* field_0x1550; + /* 0x1550 */ void *field_0x1550; +}; + +struct dLytMsgWindowCharData { + /* 0x00 */ f32 posX; + /* 0x04 */ f32 posY; + /* 0x08 */ f32 field_0x08; + /* 0x0C */ s16 field_0x0C; + /* 0x0E */ wchar_t character; + /* 0x10 */ s8 displayTimerMaybe; +}; + +class MsgWindowBlurRelated { +public: + MsgWindowBlurRelated() {} + virtual ~MsgWindowBlurRelated() {} + + void build(); + void remove(); + void drawTextBlur(dLytTextLight *thing, LytVec2f size, u8 alpha); + + dLytMsgWindowCharData *getCharData() { + return mData; + } + +private: + dLytMsgWindowCharData mData[1023]; }; #endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window.h b/include/d/lyt/msg_window/d_lyt_msg_window.h index 2ee9b484..b3130433 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window.h @@ -20,6 +20,8 @@ class dLytMsgWindowDemo_c; class dLytAutoExplain_c; class dLytAutoCaption_c; +struct dLytMsgWindowCharData; + class dLytMsgWindow_c { public: dLytMsgWindow_c() : mStateMgr(*this) {} @@ -37,13 +39,20 @@ public: void setCurrentEntrypointName(const char *name); void setCurrentFlowFilename(const char *name); + static dLytMsgWindow_c *getInstance() { + return sInstance; + } + + SizedString<64> getLabel() const { + return mNameCopy; + } + private: bool setTextToDisplay(const wchar_t *text); void createSubMsgManager(u8 type); void removeSubMsgManagers(); bool fn_8011A5D0() const; - static dLytMsgWindow_c *sInstance; STATE_FUNC_DECLARE(dLytMsgWindow_c, Invisible); @@ -121,7 +130,7 @@ private: /* 0x820 */ u16 field_0x820; /* 0x824 */ s32 field_0x824; - /* 0x828 */ void *field_0x828; + /* 0x828 */ dLytMsgWindowCharData *field_0x828; /* 0x82C */ u32 mTextOptionSelection; /* 0x830 */ u32 mSpecialFiMenuValue; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h index d3ea5db9..7c04d57b 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_common.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -50,7 +50,7 @@ public: bool build(d2d::ResAccIf_c *pResAcc, ESwordType type); bool remove(); - void draw(const wchar_t *str, s8, const mVec3_c&, f32); + void draw(const wchar_t *str, s8, const mVec3_c &, f32); f32 fn_80120DB0() const; private: @@ -61,4 +61,28 @@ private: /* 0xE4 */ ESwordType mType; }; +class dLytTextLight { +public: + enum ETextType { + NORMAL, + DEMO, + }; + + dLytTextLight() {} + /* vt at 0x00 */ + virtual ~dLytTextLight() {} + + bool build(d2d::ResAccIf_c *pResAcc, ETextType type); + bool remove(); + void draw(const wchar_t *str, s8, const mVec3_c &, f32); + f32 fn_80120DB0() const; + +private: + /* 0x04 */ d2d::LytBase_c mLyt; + // ??? + /* 0x94 */ d2d::AnmGroup_c mAnm; + /* 0xD4 */ nw4r::lyt::Pane *mpPane; + /* 0xD8 */ ETextType mType; +}; + #endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_demo.h b/include/d/lyt/msg_window/d_lyt_msg_window_demo.h index 2c3beb6d..952912f4 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_demo.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_demo.h @@ -2,12 +2,14 @@ #define D_LYT_MSG_WINDOW_DEMO_H #include "d/d_tag_processor.h" +#include "d/d_textwindow_unk.h" #include "d/lyt/d2d.h" -#include "d/lyt/d_lyt_common_a_btn.h" #include "d/lyt/d_textbox.h" #include "d/lyt/msg_window/d_lyt_msg_window_common.h" -#include "nw4r/lyt/lyt_types.h" +#include "nw4r/lyt/lyt_pane.h" #include "s/s_State.hpp" +#include "sized_string.h" +#include "toBeSorted/lyt_vec2f.h" class dLytMsgWindowDemo_c : public dLytMsgWindowSubtype { public: @@ -24,16 +26,11 @@ public: /* vt 0x28 */ virtual bool isDoneClosing() const override; /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; /* vt 0x30 */ virtual dTextBox_c *getTextBox() override { - return nullptr; + return mpTextboxes[0]; } - /* vt 0x34 */ virtual bool startConfirm() override { - return true; - } - /* vt 0x38 */ virtual bool startDecide(bool b) override { - return true; - } - /* vt 0x3C */ virtual bool isDoneDecide() const override { - return true; + + dLytMsgWindowCharData *getCharData() { + return mBlurRelated.getCharData(); } STATE_FUNC_DECLARE(dLytMsgWindowDemo_c, Invisible); @@ -42,7 +39,21 @@ public: STATE_FUNC_DECLARE(dLytMsgWindowDemo_c, Out); private: + static SizedString<64> getTextLabel(); + /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowDemo_c); + /* 0x04C */ d2d::ResAccIf_c mResAcc; + /* 0x3BC */ d2d::LytBase_c mLyt; + /* 0x44C */ d2d::AnmGroup_c mAnm[2]; + + /* 0x4CC */ nw4r::lyt::Pane *mpPane; + /* 0x4D0 */ dTextBox_c *mpTextboxes[2]; + /* 0x4D8 */ dTagProcessor_c *mpTagProcessor; + /* 0x4DC */ LytVec2f mOffsets[2]; + /* 0x4EC */ dLytTextLight mText; + /* 0x5C8 */ MsgWindowBlurRelated mBlurRelated; + + /* 0x55B8 */ bool mShouldBeOpen; }; #endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_sword.h b/include/d/lyt/msg_window/d_lyt_msg_window_sword.h index 81518c9c..772dd631 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_sword.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_sword.h @@ -3,6 +3,7 @@ #include "d/a/obj/d_a_obj_base.h" #include "d/d_tag_processor.h" +#include "d/d_textwindow_unk.h" #include "d/lyt/d2d.h" #include "d/lyt/d_lyt_common_a_btn.h" #include "d/lyt/d_textbox.h" @@ -10,15 +11,6 @@ #include "m/m_vec.h" #include "s/s_State.hpp" -struct dLytMsgWindowSwordLetterDataMaybe { - /* 0x00 */ f32 posX; - /* 0x04 */ f32 posY; - /* 0x08 */ f32 field_0x08; - /* 0x0C */ s16 field_0x0C; - /* 0x0E */ wchar_t character; - /* 0x10 */ s8 displayTimerMaybe; -}; - class dLytMsgWindowSword_c : public dLytMsgWindowSubtype { public: dLytMsgWindowSword_c() : mStateMgr(*this) {} @@ -56,6 +48,10 @@ public: mSwordType = type; } + dLytMsgWindowCharData *getCharData() { + return mCharacterData; + } + private: /* 0x0010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowSword_c); /* 0x004C */ d2d::SubPaneList mSubpaneList; @@ -80,7 +76,7 @@ private: /* 0x05F8 */ dLytCommonABtn_c mBtn; - /* 0x07A8 */ dLytMsgWindowSwordLetterDataMaybe mCharacterData[1023]; + /* 0x07A8 */ dLytMsgWindowCharData mCharacterData[1023]; /* 0x5794 */ wchar_t mTextBuf[1023]; /* 0x5F94 */ dLytTextSword mSwordText; diff --git a/include/m/m2d.h b/include/m/m2d.h index 639df15f..7247ba0a 100644 --- a/include/m/m2d.h +++ b/include/m/m2d.h @@ -167,7 +167,7 @@ public: Base_c(u8 priority) : mPriority(priority) {} /* 0x00 */ nw4r::ut::Node mLink; - /* vt offset 0x04 */ + /* vt offset 0x08 */ /* vt 0x08 */ virtual ~Base_c(); /* vt 0x0C */ virtual void draw(); diff --git a/include/toBeSorted/lyt_vec2f.h b/include/toBeSorted/lyt_vec2f.h new file mode 100644 index 00000000..54bc65c4 --- /dev/null +++ b/include/toBeSorted/lyt_vec2f.h @@ -0,0 +1,14 @@ +#ifndef D_LYT_VEC2F_H +#define D_LYT_VEC2F_H + +#include "common.h" + +// This better not be mVec2_c or something stupid +struct LytVec2f { + LytVec2f() {} + ~LytVec2f() {} + f32 x; + f32 y; +}; + +#endif -- cgit v1.2.3 From 2892dd467a0e21827411d7966ebf9f1c377f55e2 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 5 Apr 2025 18:19:37 +0200 Subject: Progress --- include/d/d_message.h | 4 +- include/d/d_tag_processor.h | 41 ++++++++++++----- include/d/d_textunk.h | 24 ++++++++++ include/d/d_textwindow_unk.h | 51 ++++++++++++++++------ include/d/lyt/msg_window/d_lyt_msg_window.h | 3 ++ include/d/lyt/msg_window/d_lyt_msg_window_common.h | 2 + include/toBeSorted/lyt_related_floats.h | 11 +++++ include/toBeSorted/other_sound_stuff.h | 9 ++++ 8 files changed, 119 insertions(+), 26 deletions(-) create mode 100644 include/toBeSorted/lyt_related_floats.h create mode 100644 include/toBeSorted/other_sound_stuff.h (limited to 'include') diff --git a/include/d/d_message.h b/include/d/d_message.h index 527ab61c..eaab2918 100644 --- a/include/d/d_message.h +++ b/include/d/d_message.h @@ -47,6 +47,9 @@ public: static bool isValidTextLabel(const char *name); static void loadTextByLabel(const char *label, dTagProcessor_c *tagProcessor, bool, u32, u32); + static s32 getMsbtIndexForLabel(const char *name); + static const char *getMsbtFileName(s32 index); + static const wchar_t *getTextMessageByLabel(const char *label, bool global, wchar_t *dstBuf, u32 maxLen); static const wchar_t * getTextMessageByLabel(const char *label, dTagProcessor_c *pTagProcessor, bool global, wchar_t *dstBuf, u32 maxLen); @@ -65,7 +68,6 @@ private: bool checkIsValidTextLabel(const char *name); static void setZevFromMsbArc(); - static const char *getMsbtFileName(s32 index); static s32 getMsbtNumberByIndex(s32 index); static const char *getMsbfFileName(s32 index); static s32 getMsbfNumberByIndex(s32 index); diff --git a/include/d/d_tag_processor.h b/include/d/d_tag_processor.h index eea3e08f..f4195865 100644 --- a/include/d/d_tag_processor.h +++ b/include/d/d_tag_processor.h @@ -5,6 +5,13 @@ #include "nw4r/ut/ut_TagProcessorBase.h" #include "nw4r/ut/ut_TextWriterBase.h" +struct dLytMsgWindowCharData; + +struct LineData { + f32 mLineWidths[0x32]; + u32 mNumLines; +}; + // inofficial name // size: 0xEF4 class dTagProcessor_c : public nw4r::ut::TagProcessorBase { @@ -12,8 +19,7 @@ public: dTagProcessor_c(); virtual ~dTagProcessor_c(); - void - format(dTextBox_c *textBox, const wchar_t *src, wchar_t *dest, u32 destLen, u32 *pOutLen, void *unk, ...); + void format(dTextBox_c *textBox, const wchar_t *src, wchar_t *dest, u32 destLen, u32 *pOutLen, void *unk, ...); void formatV(dTextBox_c *textBox, const wchar_t *src, wchar_t *dest, u32 destLen, u32 *pOutLen, void *unk, va_list list); @@ -62,11 +68,14 @@ public: char fn_800B7880(u32); void fn_800B70D0(nw4r::ut::TextWriterBase *, nw4r::ut::PrintContext *ctx, u16 c, s32); + void + fn_800B4290(dTextBox_c *textBox, const wchar_t *src, wchar_t *dest, s32, u16 *, dLytMsgWindowCharData *charData); + void resetSomething(); - void resetSomeFloats(); + void resetLineData(); void setNumericArg0(s32 arg); void setNumericArgs(const s32 *args, s32 numArgs); - f32 getFloat(s32 i); + f32 getLineWidth(s32 i); s32 tickPauseFrame(); s32 tick0x830(); void execute(); @@ -76,11 +85,11 @@ public: } s32 getNumLinesMaybe() const { - return mCommandInsert; + return mLineData.mNumLines; } u8 getMsgWindowSubtype() const { - return field_0x90C; + return mMsgWindowSubtype; } u8 getField_0x90D() const { @@ -91,6 +100,10 @@ public: return field_0x90E; } + s32 getField_0x824() const { + return field_0x824; + } + s32 getField_0x828() const { return field_0x828; } @@ -104,7 +117,7 @@ public: } void setMsgWindowSubtype(u8 type) { - field_0x90C = type; + mMsgWindowSubtype = type; } void setField_0x828(s32 val) { @@ -115,7 +128,6 @@ public: field_0x82C = val; } - void setField_0x90D(u8 val) { field_0x90D = val; } @@ -124,6 +136,10 @@ public: field_0x90E = val; } + void setField_0xEE0(u8 val) { + field_0xEE0 = val; + } + void setField_0xEE1(u8 val) { field_0xEE1 = val; } @@ -140,6 +156,10 @@ public: return field_0x008[idx]; } + LineData getLineData() const { + return mLineData; + } + private: /* 0x004 */ dTextBox_c *field_0x004; /* 0x008 */ wchar_t field_0x008[4][256]; @@ -189,12 +209,11 @@ private: /* 0x900 */ s32 field_0x900; /* 0x904 */ f32 field_0x904; /* 0x908 */ f32 field_0x908; - /* 0x90C */ u8 field_0x90C; + /* 0x90C */ u8 mMsgWindowSubtype; /* 0x90D */ u8 field_0x90D; /* 0x90E */ u8 field_0x90E; /* 0x90F */ u8 field_0x90F[4]; - /* 0x914 */ f32 field_0x914[0x32]; // Maybe width for each individual line - /* 0x9DC */ s32 mCommandInsert; // Maybe number of lines + /* 0x914 */ LineData mLineData; /* 0x9E0 */ wchar_t mStringArgs[8][64]; /* 0xDE0 */ u8 field_0xDE0[0xEE0 - 0xDE0]; /* 0xEE0 */ u8 field_0xEE0; diff --git a/include/d/d_textunk.h b/include/d/d_textunk.h index d3f7240e..bc820fd7 100644 --- a/include/d/d_textunk.h +++ b/include/d/d_textunk.h @@ -137,6 +137,30 @@ public: return field_buf2[index]; } + const char *getStr1() const { + return field_0x004; + } + + const char *getStr2() const { + return field_0x084; + } + + const char *getStr3() const { + return field_0x104; + } + + void setStr1(const char *s) { + field_0x004 = s; + } + + void setStr2(const char *s) { + field_0x084 = s; + } + + void setStr3(const char *s) { + field_0x104 = s; + } + private: static UnkTextThing *sInstance; diff --git a/include/d/d_textwindow_unk.h b/include/d/d_textwindow_unk.h index 0eb68014..f7143fb4 100644 --- a/include/d/d_textwindow_unk.h +++ b/include/d/d_textwindow_unk.h @@ -4,8 +4,27 @@ #include "d/d_tag_processor.h" #include "d/lyt/d_textbox.h" #include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "sized_string.h" #include "toBeSorted/lyt_vec2f.h" +struct dLytMsgWindowCharData { + /* 0x00 */ f32 posX; + /* 0x04 */ f32 posY; + /* 0x08 */ f32 field_0x08; + /* 0x0C */ s16 field_0x0C; + /* 0x0E */ wchar_t character; + /* 0x10 */ s8 displayTimerMaybe; + + void reset() { + posX = 0.0f; + posY = 0.0f; + field_0x08 = dTagProcessor_c::fn_800B8040(0, 0); + character = L'\0'; + field_0x0C = 1023; + displayTimerMaybe = -1; + } +}; + // Size 0x1554 // Probably responsible for emitting characters // one by one in the text boxes @@ -14,7 +33,7 @@ public: TextWindowUnk(dTagProcessor_c *tagProcessor); virtual ~TextWindowUnk() {} - void fn_800B2130(const char *, dTextBox_c *, void *, bool); + bool fn_800B2130(const char *, dTextBox_c *, dLytMsgWindowCharData *data, bool); void fn_800B2AA0(); void textAdvancingRelated(bool, bool); @@ -31,26 +50,29 @@ public: } bool checkEndReached() const; - bool checkLastLineReachedMaybe() const; + bool checkLastLineReached(); + bool reset(); private: /* 0x0004 */ dTagProcessor_c *mpTagProcessor; /* 0x0008 */ wchar_t mRawTextBuffer[1023]; /* 0x0806 */ wchar_t mProcessedTextBuffer[1023]; - /* 0x1004 */ wchar_t mUnkBuffer[571]; // ??? + /* 0x1004 */ wchar_t mUnkBuffer[511]; // ??? + /* 0x1402 */ SizedString<64> field_0x1402; + /* 0x1442 */ u8 _0x1442[0x144C - 0x1442]; + + /* 0x144C */ s32 mRawTextPos; + /* 0x1450 */ s32 mRawTextEndPos; + /* 0x1454 */ s32 mCurrentLine; + /* 0x1458 */ s32 field_0x1458; + /* 0x145C */ u8 _0x145C[0x1478 - 0x145C]; + /* 0x1478 */ u16 field_0x1478; /* 0x147A */ u16 field_0x147A; /* 0x147C */ u16 field_0x147C; - /* 0x147E */ u8 _0x147E[0x1550 - 0x147E]; - /* 0x1550 */ void *field_0x1550; -}; - -struct dLytMsgWindowCharData { - /* 0x00 */ f32 posX; - /* 0x04 */ f32 posY; - /* 0x08 */ f32 field_0x08; - /* 0x0C */ s16 field_0x0C; - /* 0x0E */ wchar_t character; - /* 0x10 */ s8 displayTimerMaybe; + /* 0x147E */ u8 _0x147E[0x1480 - 0x147E]; + /* 0x1480 */ dTextBox_c *mpTextBox; + /* 0x1484 */ LineData mLineWidths; + /* 0x1550 */ dLytMsgWindowCharData *mpCharacterData; }; class MsgWindowBlurRelated { @@ -61,6 +83,7 @@ public: void build(); void remove(); void drawTextBlur(dLytTextLight *thing, LytVec2f size, u8 alpha); + void reset(); dLytMsgWindowCharData *getCharData() { return mData; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window.h b/include/d/lyt/msg_window/d_lyt_msg_window.h index b3130433..ad6be3c2 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window.h @@ -10,6 +10,7 @@ #include "s/s_State.hpp" #include "sized_string.h" +// Forward declarations required for vtable order class dLytMsgWindowTalk_c; class dLytMsgWindowLink_c; class dLytMsgWindowGet_c; @@ -47,6 +48,8 @@ public: return mNameCopy; } + const char *fn_80117390(bool) const; + private: bool setTextToDisplay(const wchar_t *text); void createSubMsgManager(u8 type); diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h index 7c04d57b..ce24b9eb 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_common.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -75,7 +75,9 @@ public: bool build(d2d::ResAccIf_c *pResAcc, ETextType type); bool remove(); void draw(const wchar_t *str, s8, const mVec3_c &, f32); + void draw2(s8, const mVec3_c &, u8, f32); f32 fn_80120DB0() const; + f32 fn_80121050() const; private: /* 0x04 */ d2d::LytBase_c mLyt; diff --git a/include/toBeSorted/lyt_related_floats.h b/include/toBeSorted/lyt_related_floats.h new file mode 100644 index 00000000..17f92f6a --- /dev/null +++ b/include/toBeSorted/lyt_related_floats.h @@ -0,0 +1,11 @@ +#ifndef LYT_RELATED_FLOATS_H +#define LYT_RELATED_FLOATS_H + +#include "common.h" + +extern "C" f32 lbl_805751A4; +inline f32 get_805751A4() { + return lbl_805751A4; +} + +#endif diff --git a/include/toBeSorted/other_sound_stuff.h b/include/toBeSorted/other_sound_stuff.h new file mode 100644 index 00000000..de8d083e --- /dev/null +++ b/include/toBeSorted/other_sound_stuff.h @@ -0,0 +1,9 @@ +#ifndef OTHER_SOUND_STUFF_H +#define OTHER_SOUND_STUFF_H + +#include "common.h" + +extern "C" void *lbl_80575DE0; +extern "C" void fn_803996B0(void *, const char *msgLabelName, u16, s32); + +#endif -- cgit v1.2.3 From 131eb322e884e65a569d826b852bea915d467725 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 5 Apr 2025 19:59:59 +0200 Subject: d_lyt_msg_window_common OK --- include/d/lyt/d2d.h | 15 ++++++++++----- include/d/lyt/msg_window/d_lyt_msg_window_common.h | 14 +++++++------- include/m/m2d.h | 2 +- include/nw4r/lyt/lyt_pane.h | 6 ++++++ include/nw4r/lyt/lyt_types.h | 4 ++-- 5 files changed, 26 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/include/d/lyt/d2d.h b/include/d/lyt/d2d.h index ce23507e..d7a7bc8d 100644 --- a/include/d/lyt/d2d.h +++ b/include/d/lyt/d2d.h @@ -68,6 +68,10 @@ public: mpResAcc = resAcc; } + const nw4r::lyt::DrawInfo &getDrawInfo() { + return mDrawInfo; + } + protected: Layout_c mLayout; nw4r::lyt::DrawInfo mDrawInfo; @@ -103,7 +107,8 @@ private: bool fn_800AC040(dTextBox_c *textbox1, dTextBox_c *textbox2, wchar_t *destBuf, u32 maxLen); bool fn_800AC1AC( - const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *textbox1, dTextBox_c *textbox2, wchar_t *destBuf, u32 maxLen + const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *textbox1, dTextBox_c *textbox2, wchar_t *destBuf, + u32 maxLen ); MsbtInfo *getMsbtInfo() const; bool fn_800AB930(dTextBox_c *box); @@ -200,12 +205,12 @@ struct AnmGroupBase_c { } inline void setFrameRatio(f32 frame) { - f32 end = getEndFrameRaw() - 1.0f; + f32 end = getAnimDuration() - 1.0f; setFrame(end * frame); } - inline f32 getEndFrameRaw() const { - return mpFrameCtrl->getEndFrameRaw(); + inline f32 getAnimDuration() const { + return mpFrameCtrl->getAnimDuration(); } inline f32 getFrame() const { @@ -245,7 +250,7 @@ struct AnmGroupBase_c { return mpFrameCtrl->getFlags() == (FLAG_NO_LOOP | FLAG_BACKWARDS); } - inline bool isPlayingForwardsOnce() const { + inline bool isPlayingForwardsOnce() const { return mpFrameCtrl->getFlags() == FLAG_NO_LOOP; } diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h index ce24b9eb..6278730e 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_common.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -33,7 +33,9 @@ public: /* vt 0x3C */ virtual bool isDoneDecide() const { return true; } - /* vt 0x40 */ virtual bool vt_0x40() const; + /* vt 0x40 */ virtual bool vt_0x40() const { + return true; + } }; class dLytTextSword { @@ -50,8 +52,8 @@ public: bool build(d2d::ResAccIf_c *pResAcc, ESwordType type); bool remove(); - void draw(const wchar_t *str, s8, const mVec3_c &, f32); - f32 fn_80120DB0() const; + void draw(const wchar_t *str, s8 frame, mVec3_c pos, f32 scale); + f32 getAnimDuration() const; private: /* 0x04 */ d2d::LytBase_c mLyt; @@ -74,10 +76,8 @@ public: bool build(d2d::ResAccIf_c *pResAcc, ETextType type); bool remove(); - void draw(const wchar_t *str, s8, const mVec3_c &, f32); - void draw2(s8, const mVec3_c &, u8, f32); - f32 fn_80120DB0() const; - f32 fn_80121050() const; + void draw(s8 frame, mVec3_c pos, u8 alpha, f32 scale); + f32 getAnimDuration() const; private: /* 0x04 */ d2d::LytBase_c mLyt; diff --git a/include/m/m2d.h b/include/m/m2d.h index 7247ba0a..3f839d91 100644 --- a/include/m/m2d.h +++ b/include/m/m2d.h @@ -110,7 +110,7 @@ public: return f >= end ? 0.0f : f; } - inline f32 getEndFrameRaw() const { + inline f32 getAnimDuration() const { return mEndFrame; } diff --git a/include/nw4r/lyt/lyt_pane.h b/include/nw4r/lyt/lyt_pane.h index a1fa6327..87c760be 100644 --- a/include/nw4r/lyt/lyt_pane.h +++ b/include/nw4r/lyt/lyt_pane.h @@ -41,9 +41,15 @@ public: bool IsInfluencedAlpha() const { return detail::TestBit(mFlag, INFLUENCED_ALPHA); } + void SetInfluencedAlpha(bool bInfluenced) { + detail::SetBit(&mFlag, INFLUENCED_ALPHA, bInfluenced); + } bool IsLocationAdjust() const { return detail::TestBit(mFlag, LOCATION_ADJUST); } + void SetLocationAdjust(bool bAdjust) { + detail::SetBit(&mFlag, LOCATION_ADJUST, bAdjust); + } bool IsUserAllocated() const { return mbUserAllocated; } diff --git a/include/nw4r/lyt/lyt_types.h b/include/nw4r/lyt/lyt_types.h index 047638e2..36bf2c71 100644 --- a/include/nw4r/lyt/lyt_types.h +++ b/include/nw4r/lyt/lyt_types.h @@ -31,8 +31,8 @@ inline bool TestBit(T bits, int index) { } template inline void SetBit(T *bits, int pos, bool val) { - T mask = T(1 << pos); - *bits = T((*bits & ~mask)) | (val << pos); + T mask = ~T(1 << pos); + *bits = T((*bits & mask)) | (val << pos); } template -- cgit v1.2.3 From 2881889b93c7fb6e558f9a010f20803547b1abb7 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 5 Apr 2025 21:28:31 +0200 Subject: d_lyt_msg_window 91% --- include/d/d_message.h | 2 ++ include/d/d_pad.h | 6 +++++- include/d/lyt/d_lyt_auto_caption.h | 1 + include/d/lyt/d_lyt_auto_explain.h | 1 + include/d/lyt/msg_window/d_lyt_msg_window_common.h | 2 ++ include/d/lyt/msg_window/d_lyt_msg_window_demo.h | 1 + include/d/lyt/msg_window/d_lyt_msg_window_get.h | 24 +++++++++++++++++++++- include/d/lyt/msg_window/d_lyt_msg_window_link.h | 22 +++++++++++++++++++- include/d/lyt/msg_window/d_lyt_msg_window_stone.h | 1 + include/d/lyt/msg_window/d_lyt_msg_window_sword.h | 1 + include/d/lyt/msg_window/d_lyt_msg_window_talk.h | 22 +++++++++++++++++++- include/d/lyt/msg_window/d_lyt_msg_window_wood.h | 1 + include/toBeSorted/lyt_related_floats.h | 10 +++++++++ include/toBeSorted/other_sound_stuff.h | 1 + 14 files changed, 91 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/d/d_message.h b/include/d/d_message.h index eaab2918..47b0fe4d 100644 --- a/include/d/d_message.h +++ b/include/d/d_message.h @@ -88,6 +88,8 @@ private: /* 0x2FC */ s32 field_0x2FC; + /* 0x300 */ u8 _0x300[0x329 - 0x300]; + /* 0x329 */ bool field_0x329; /* 0x32A */ bool field_0x32A; diff --git a/include/d/d_pad.h b/include/d/d_pad.h index e158fafb..5175dbca 100644 --- a/include/d/d_pad.h +++ b/include/d/d_pad.h @@ -3,8 +3,12 @@ class dPad { public: - + static bool checkButtonAPressed(); + static bool checkButtonBPressed(); static bool checkButtonZPressed(); + static bool checkButtonPlusPressed(); + + static bool checkButtonAHeld(); static bool checkButtonZHeld(); }; diff --git a/include/d/lyt/d_lyt_auto_caption.h b/include/d/lyt/d_lyt_auto_caption.h index 1a2bbfcd..7ad26cba 100644 --- a/include/d/lyt/d_lyt_auto_caption.h +++ b/include/d/lyt/d_lyt_auto_caption.h @@ -34,6 +34,7 @@ public: bool checkSomethingMeter(); private: + MSG_WINDOW_STATE_MGR_INLINE(dLytAutoCaption_c) /* 0x010 */ UI_STATE_MGR_DECLARE(dLytAutoCaption_c); /* 0x068 */ d2d::ResAccIf_c mResAcc; /* 0x3C4 */ d2d::LytBase_c mLyt; diff --git a/include/d/lyt/d_lyt_auto_explain.h b/include/d/lyt/d_lyt_auto_explain.h index 538bd2be..b3988de4 100644 --- a/include/d/lyt/d_lyt_auto_explain.h +++ b/include/d/lyt/d_lyt_auto_explain.h @@ -34,6 +34,7 @@ public: bool checkSomethingMeter(); private: + MSG_WINDOW_STATE_MGR_INLINE(dLytAutoExplain_c) /* 0x010 */ UI_STATE_MGR_DECLARE(dLytAutoExplain_c); /* 0x068 */ d2d::ResAccIf_c mResAcc; /* 0x3C4 */ d2d::LytBase_c mLyt; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h index 6278730e..70548d3c 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_common.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -9,6 +9,8 @@ #include "m/m_vec.h" #include "nw4r/lyt/lyt_pane.h" +#define MSG_WINDOW_STATE_MGR_INLINE(className) void changeState(const sFStateID_c &newState) { mStateMgr.changeState(newState); } + class dLytMsgWindowSubtype : public m2d::Base_c { public: /* vt 0x08 */ virtual ~dLytMsgWindowSubtype() {} diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_demo.h b/include/d/lyt/msg_window/d_lyt_msg_window_demo.h index 952912f4..3b930056 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_demo.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_demo.h @@ -41,6 +41,7 @@ public: private: static SizedString<64> getTextLabel(); + MSG_WINDOW_STATE_MGR_INLINE(dLytMsgWindowDemo_c) /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowDemo_c); /* 0x04C */ d2d::ResAccIf_c mResAcc; /* 0x3BC */ d2d::LytBase_c mLyt; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_get.h b/include/d/lyt/msg_window/d_lyt_msg_window_get.h index 0f36ac58..fbfa1f6a 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_get.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_get.h @@ -2,10 +2,13 @@ #define D_LYT_MSG_WINDOW_GET_H #include "d/d_tag_processor.h" +#include "d/d_textwindow_unk.h" #include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_a_btn.h" #include "d/lyt/d_textbox.h" #include "d/lyt/msg_window/d_lyt_msg_window_common.h" #include "s/s_State.hpp" +#include "toBeSorted/lyt_vec2f.h" class dLytMsgWindowGet_c : public dLytMsgWindowSubtype { public: @@ -39,8 +42,27 @@ public: STATE_FUNC_DECLARE(dLytMsgWindowGet_c, Visible); STATE_FUNC_DECLARE(dLytMsgWindowGet_c, Out); + dLytMsgWindowCharData *getCharData() { + return mBlurRelated.getCharData(); + } + private: - /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowGet_c); + MSG_WINDOW_STATE_MGR_INLINE(dLytMsgWindowGet_c) + /* 0x0010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowGet_c); + /* 0x004C */ d2d::SubPaneList mSubpaneList; + /* 0x005C */ d2d::SubPaneListNode mNodes[1]; + /* 0x0068 */ d2d::ResAccIf_c mResAcc; + /* 0x03D8 */ d2d::LytBase_c mLyt; + /* 0x0468 */ d2d::AnmGroup_c mAnm[3]; + /* 0x0528 */ dTextBox_c *mpTextboxes[2]; + /* 0x0530 */ nw4r::lyt::Pane *mpPanes[6]; + /* 0x0548 */ dTagProcessor_c *mpTagProcessor; + /* 0x054C */ u8 _0x054C[8]; + /* 0x0554 */ dLytCommonABtn_c mBtn; + /* 0x06E8 */ dLytTextLight mText; + /* 0x07C4 */ MsgWindowBlurRelated mBlurRelated; + + /* 0x55B8 */ bool mShouldBeOpen; }; #endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_link.h b/include/d/lyt/msg_window/d_lyt_msg_window_link.h index 35f3e7d7..3d517d26 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_link.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_link.h @@ -2,7 +2,9 @@ #define D_LYT_MSG_WINDOW_LINK_H #include "d/d_tag_processor.h" +#include "d/d_textwindow_unk.h" #include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_a_btn.h" #include "d/lyt/d_textbox.h" #include "d/lyt/msg_window/d_lyt_msg_window_common.h" #include "s/s_State.hpp" @@ -39,8 +41,26 @@ public: STATE_FUNC_DECLARE(dLytMsgWindowLink_c, Visible); STATE_FUNC_DECLARE(dLytMsgWindowLink_c, Out); + dLytMsgWindowCharData *getCharData() { + return mBlurRelated.getCharData(); + } + private: - /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowLink_c); + MSG_WINDOW_STATE_MGR_INLINE(dLytMsgWindowLink_c) + /* 0x0010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowLink_c); + /* 0x004C */ d2d::SubPaneList mSubpaneList; + /* 0x005C */ d2d::SubPaneListNode mNodes[1]; + /* 0x0068 */ d2d::ResAccIf_c mResAcc; + /* 0x03D8 */ d2d::LytBase_c mLyt; + /* 0x0468 */ d2d::AnmGroup_c mAnm[4]; + /* 0x0568 */ dTextBox_c *mpTextboxes[2]; + /* 0x0570 */ nw4r::lyt::Pane *mpPanes[5]; + /* 0x0584 */ dTagProcessor_c *mpTagProcessor; + /* 0x0588 */ u8 _0x0588[0x05C0 - 0x0588]; + /* 0x05C0 */ dLytCommonABtn_c mBtn; + /* 0x0770 */ dLytTextLight mText; + /* 0x084C */ MsgWindowBlurRelated mBlurRelated; + /* 0x583C */ bool mShouldBeOpen; }; #endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h index cc98a9d3..4e2b4e71 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_stone.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_stone.h @@ -42,6 +42,7 @@ public: STATE_FUNC_DECLARE(dLytMsgWindowStone_c, Out); private: + MSG_WINDOW_STATE_MGR_INLINE(dLytMsgWindowStone_c) /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowStone_c); /* 0x04C */ d2d::SubPaneList mSubpaneList; /* 0x05C */ d2d::SubPaneListNode mNodes[1]; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_sword.h b/include/d/lyt/msg_window/d_lyt_msg_window_sword.h index 772dd631..268a5bf5 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_sword.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_sword.h @@ -53,6 +53,7 @@ public: } private: + MSG_WINDOW_STATE_MGR_INLINE(dLytMsgWindowSword_c) /* 0x0010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowSword_c); /* 0x004C */ d2d::SubPaneList mSubpaneList; /* 0x005C */ d2d::SubPaneListNode mNodes[1]; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_talk.h b/include/d/lyt/msg_window/d_lyt_msg_window_talk.h index 05bc5095..abf23061 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_talk.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_talk.h @@ -2,7 +2,9 @@ #define D_LYT_MSG_WINDOW_TALK_H #include "d/d_tag_processor.h" +#include "d/d_textwindow_unk.h" #include "d/lyt/d2d.h" +#include "d/lyt/d_lyt_common_a_btn.h" #include "d/lyt/d_textbox.h" #include "d/lyt/msg_window/d_lyt_msg_window_common.h" #include "s/s_State.hpp" @@ -39,8 +41,26 @@ public: STATE_FUNC_DECLARE(dLytMsgWindowTalk_c, Visible); STATE_FUNC_DECLARE(dLytMsgWindowTalk_c, Out); + dLytMsgWindowCharData *getCharData() { + return mBlurRelated.getCharData(); + } + private: - /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowTalk_c); + MSG_WINDOW_STATE_MGR_INLINE(dLytMsgWindowTalk_c) + /* 0x0010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowTalk_c); + /* 0x004C */ d2d::SubPaneList mSubpaneList; + /* 0x005C */ d2d::SubPaneListNode mNodes[1]; + /* 0x0068 */ d2d::ResAccIf_c mResAcc; + /* 0x03D8 */ d2d::LytBase_c mLyt; + /* 0x0468 */ d2d::AnmGroup_c mAnm[4]; + /* 0x0568 */ dTextBox_c *mpTextboxes[2]; + /* 0x0570 */ nw4r::lyt::Pane *mpPanes[5]; + /* 0x0584 */ dTagProcessor_c *mpTagProcessor; + /* 0x0588 */ u8 _0x0588[0x05C0 - 0x0588]; + /* 0x05C0 */ dLytCommonABtn_c mBtn; + /* 0x0770 */ dLytTextLight mText; + /* 0x084C */ MsgWindowBlurRelated mBlurRelated; + /* 0x583C */ bool mShouldBeOpen; }; #endif diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h index 45f43937..d1a31ff6 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_wood.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_wood.h @@ -43,6 +43,7 @@ public: STATE_FUNC_DECLARE(dLytMsgWindowWood_c, Out); private: + MSG_WINDOW_STATE_MGR_INLINE(dLytMsgWindowWood_c) /* 0x010 */ UI_STATE_MGR_DECLARE(dLytMsgWindowWood_c); /* 0x04C */ d2d::SubPaneList mSubpaneList; /* 0x05C */ d2d::SubPaneListNode mNodes[1]; diff --git a/include/toBeSorted/lyt_related_floats.h b/include/toBeSorted/lyt_related_floats.h index 17f92f6a..5b12e937 100644 --- a/include/toBeSorted/lyt_related_floats.h +++ b/include/toBeSorted/lyt_related_floats.h @@ -8,4 +8,14 @@ inline f32 get_805751A4() { return lbl_805751A4; } +extern "C" s32 lbl_80575134; +inline s32 get_80575134() { + return lbl_80575134; +} + +extern "C" s32 lbl_8057511C; +inline s32 get_8057511C() { + return lbl_8057511C; +} + #endif diff --git a/include/toBeSorted/other_sound_stuff.h b/include/toBeSorted/other_sound_stuff.h index de8d083e..9de21cee 100644 --- a/include/toBeSorted/other_sound_stuff.h +++ b/include/toBeSorted/other_sound_stuff.h @@ -5,5 +5,6 @@ extern "C" void *lbl_80575DE0; extern "C" void fn_803996B0(void *, const char *msgLabelName, u16, s32); +extern "C" void fn_803998A0(void *, u16, u16); #endif -- cgit v1.2.3 From 144533e9f97274393d58ee324eca71b9da3ede59 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 5 Apr 2025 22:35:43 +0200 Subject: d_lyt_msg_window_demo OK --- include/toBeSorted/lyt_vec2f.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/toBeSorted/lyt_vec2f.h b/include/toBeSorted/lyt_vec2f.h index 54bc65c4..cdab4f91 100644 --- a/include/toBeSorted/lyt_vec2f.h +++ b/include/toBeSorted/lyt_vec2f.h @@ -7,6 +7,15 @@ struct LytVec2f { LytVec2f() {} ~LytVec2f() {} + + LytVec2f(const LytVec2f &other) { + set(other.x, other.y); + } + void set(f32 fx, f32 fy) { + x = fx; + y = fy; + } + f32 x; f32 y; }; -- cgit v1.2.3 From a5b91ef55dbad74c82ffdfee028ff77b8355fe29 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 5 Apr 2025 23:29:00 +0200 Subject: get - idk --- include/d/lyt/msg_window/d_lyt_msg_window_get.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_get.h b/include/d/lyt/msg_window/d_lyt_msg_window_get.h index fbfa1f6a..c9109841 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_get.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_get.h @@ -25,16 +25,16 @@ public: /* vt 0x28 */ virtual bool isDoneClosing() const override; /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; /* vt 0x30 */ virtual dTextBox_c *getTextBox() override { - return nullptr; + return mpTextboxes[0]; } /* vt 0x34 */ virtual bool startConfirm() override { - return true; + return mBtn.requestIn(); } /* vt 0x38 */ virtual bool startDecide(bool b) override { - return true; + return mBtn.requestOut(b); } /* vt 0x3C */ virtual bool isDoneDecide() const override { - return true; + return mBtn.isDoneOut(); } STATE_FUNC_DECLARE(dLytMsgWindowGet_c, Invisible); @@ -57,9 +57,9 @@ private: /* 0x0528 */ dTextBox_c *mpTextboxes[2]; /* 0x0530 */ nw4r::lyt::Pane *mpPanes[6]; /* 0x0548 */ dTagProcessor_c *mpTagProcessor; - /* 0x054C */ u8 _0x054C[8]; + /* 0x054C */ LytVec2f mOffset; /* 0x0554 */ dLytCommonABtn_c mBtn; - /* 0x06E8 */ dLytTextLight mText; + /* 0x06E0 */ dLytTextLight mText; /* 0x07C4 */ MsgWindowBlurRelated mBlurRelated; /* 0x55B8 */ bool mShouldBeOpen; -- cgit v1.2.3 From cd5fd322f87ee57526f2be706e668418c435258b Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 5 Apr 2025 23:36:55 +0200 Subject: Introduce mVec2_c --- include/d/d_textwindow_unk.h | 4 ++-- include/d/lyt/msg_window/d_lyt_msg_window_demo.h | 4 ++-- include/d/lyt/msg_window/d_lyt_msg_window_get.h | 4 ++-- include/egg/math/eggVector.h | 5 +++++ include/m/m_vec.h | 10 ++++++++++ include/toBeSorted/lyt_vec2f.h | 23 ----------------------- 6 files changed, 21 insertions(+), 29 deletions(-) delete mode 100644 include/toBeSorted/lyt_vec2f.h (limited to 'include') diff --git a/include/d/d_textwindow_unk.h b/include/d/d_textwindow_unk.h index f7143fb4..a599b2d0 100644 --- a/include/d/d_textwindow_unk.h +++ b/include/d/d_textwindow_unk.h @@ -4,8 +4,8 @@ #include "d/d_tag_processor.h" #include "d/lyt/d_textbox.h" #include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "m/m_vec.h" #include "sized_string.h" -#include "toBeSorted/lyt_vec2f.h" struct dLytMsgWindowCharData { /* 0x00 */ f32 posX; @@ -82,7 +82,7 @@ public: void build(); void remove(); - void drawTextBlur(dLytTextLight *thing, LytVec2f size, u8 alpha); + void drawTextBlur(dLytTextLight *thing, mVec2_c size, u8 alpha); void reset(); dLytMsgWindowCharData *getCharData() { diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_demo.h b/include/d/lyt/msg_window/d_lyt_msg_window_demo.h index 3b930056..dad4d332 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_demo.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_demo.h @@ -6,10 +6,10 @@ #include "d/lyt/d2d.h" #include "d/lyt/d_textbox.h" #include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "m/m_vec.h" #include "nw4r/lyt/lyt_pane.h" #include "s/s_State.hpp" #include "sized_string.h" -#include "toBeSorted/lyt_vec2f.h" class dLytMsgWindowDemo_c : public dLytMsgWindowSubtype { public: @@ -50,7 +50,7 @@ private: /* 0x4CC */ nw4r::lyt::Pane *mpPane; /* 0x4D0 */ dTextBox_c *mpTextboxes[2]; /* 0x4D8 */ dTagProcessor_c *mpTagProcessor; - /* 0x4DC */ LytVec2f mOffsets[2]; + /* 0x4DC */ mVec2_c mOffsets[2]; /* 0x4EC */ dLytTextLight mText; /* 0x5C8 */ MsgWindowBlurRelated mBlurRelated; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_get.h b/include/d/lyt/msg_window/d_lyt_msg_window_get.h index c9109841..7aabba08 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_get.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_get.h @@ -7,8 +7,8 @@ #include "d/lyt/d_lyt_common_a_btn.h" #include "d/lyt/d_textbox.h" #include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "m/m_vec.h" #include "s/s_State.hpp" -#include "toBeSorted/lyt_vec2f.h" class dLytMsgWindowGet_c : public dLytMsgWindowSubtype { public: @@ -57,7 +57,7 @@ private: /* 0x0528 */ dTextBox_c *mpTextboxes[2]; /* 0x0530 */ nw4r::lyt::Pane *mpPanes[6]; /* 0x0548 */ dTagProcessor_c *mpTagProcessor; - /* 0x054C */ LytVec2f mOffset; + /* 0x054C */ mVec2_c mOffset; /* 0x0554 */ dLytCommonABtn_c mBtn; /* 0x06E0 */ dLytTextLight mText; /* 0x07C4 */ MsgWindowBlurRelated mBlurRelated; diff --git a/include/egg/math/eggVector.h b/include/egg/math/eggVector.h index 2d030d45..f509ad85 100644 --- a/include/egg/math/eggVector.h +++ b/include/egg/math/eggVector.h @@ -136,6 +136,11 @@ public: static const Vector2f ex; static const Vector2f ey; + void set(f32 fx, f32 fy) { + x = fx; + y = fy; + } + Vector2f operator-(const Vector2f &v) { return Vector2f(x - v.x, y - v.y); } diff --git a/include/m/m_vec.h b/include/m/m_vec.h index 011679b0..0ec12fd4 100644 --- a/include/m/m_vec.h +++ b/include/m/m_vec.h @@ -254,4 +254,14 @@ public: static mVec3_c Ez; }; +class mVec2_c : public EGG::Vector2f { +public: + mVec2_c() {} + ~mVec2_c() {} + + mVec2_c(const mVec2_c &other) { + set(other.x, other.y); + } +}; + #endif diff --git a/include/toBeSorted/lyt_vec2f.h b/include/toBeSorted/lyt_vec2f.h deleted file mode 100644 index cdab4f91..00000000 --- a/include/toBeSorted/lyt_vec2f.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef D_LYT_VEC2F_H -#define D_LYT_VEC2F_H - -#include "common.h" - -// This better not be mVec2_c or something stupid -struct LytVec2f { - LytVec2f() {} - ~LytVec2f() {} - - LytVec2f(const LytVec2f &other) { - set(other.x, other.y); - } - void set(f32 fx, f32 fy) { - x = fx; - y = fy; - } - - f32 x; - f32 y; -}; - -#endif -- cgit v1.2.3 From 53516393862178faabd19a4d659782fa2e5a6ebc Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 6 Apr 2025 11:05:19 +0200 Subject: _talk and _link with the same problems as _get and _sword --- include/d/lyt/msg_window/d_lyt_msg_window_link.h | 17 ++++++++++++----- include/d/lyt/msg_window/d_lyt_msg_window_talk.h | 18 +++++++++++++----- 2 files changed, 25 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_link.h b/include/d/lyt/msg_window/d_lyt_msg_window_link.h index 3d517d26..ffb99c91 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_link.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_link.h @@ -24,20 +24,21 @@ public: /* vt 0x28 */ virtual bool isDoneClosing() const override; /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; /* vt 0x30 */ virtual dTextBox_c *getTextBox() override { - return nullptr; + return mpTextboxes[0]; } /* vt 0x34 */ virtual bool startConfirm() override { - return true; + return mBtn.requestIn(); } /* vt 0x38 */ virtual bool startDecide(bool b) override { - return true; + return mBtn.requestOut(b); } /* vt 0x3C */ virtual bool isDoneDecide() const override { - return true; + return mBtn.isDoneOut(); } STATE_FUNC_DECLARE(dLytMsgWindowLink_c, Invisible); STATE_FUNC_DECLARE(dLytMsgWindowLink_c, In); + STATE_FUNC_DECLARE(dLytMsgWindowLink_c, Wait); STATE_FUNC_DECLARE(dLytMsgWindowLink_c, Visible); STATE_FUNC_DECLARE(dLytMsgWindowLink_c, Out); @@ -56,7 +57,13 @@ private: /* 0x0568 */ dTextBox_c *mpTextboxes[2]; /* 0x0570 */ nw4r::lyt::Pane *mpPanes[5]; /* 0x0584 */ dTagProcessor_c *mpTagProcessor; - /* 0x0588 */ u8 _0x0588[0x05C0 - 0x0588]; + /* 0x0588 */ mVec3_c mTranslationOrig; + /* 0x0594 */ mVec3_c mTranslationTo; + /* 0x05A0 */ mVec3_c mTranslationFrom; + /* 0x05AC */ mVec2_c mOffset; + /* 0x05B4 */ dAcObjBase_c *mpActor; + /* 0x05B8 */ s32 mParam; + /* 0x05BC */ s32 field_0x05BC; /* 0x05C0 */ dLytCommonABtn_c mBtn; /* 0x0770 */ dLytTextLight mText; /* 0x084C */ MsgWindowBlurRelated mBlurRelated; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_talk.h b/include/d/lyt/msg_window/d_lyt_msg_window_talk.h index abf23061..f7770bfa 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_talk.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_talk.h @@ -7,6 +7,7 @@ #include "d/lyt/d_lyt_common_a_btn.h" #include "d/lyt/d_textbox.h" #include "d/lyt/msg_window/d_lyt_msg_window_common.h" +#include "m/m_vec.h" #include "s/s_State.hpp" class dLytMsgWindowTalk_c : public dLytMsgWindowSubtype { @@ -24,20 +25,21 @@ public: /* vt 0x28 */ virtual bool isDoneClosing() const override; /* vt 0x2C */ virtual bool setText(const wchar_t *text) override; /* vt 0x30 */ virtual dTextBox_c *getTextBox() override { - return nullptr; + return mpTextboxes[0]; } /* vt 0x34 */ virtual bool startConfirm() override { - return true; + return mBtn.requestIn(); } /* vt 0x38 */ virtual bool startDecide(bool b) override { - return true; + return mBtn.requestOut(b); } /* vt 0x3C */ virtual bool isDoneDecide() const override { - return true; + return mBtn.isDoneOut(); } STATE_FUNC_DECLARE(dLytMsgWindowTalk_c, Invisible); STATE_FUNC_DECLARE(dLytMsgWindowTalk_c, In); + STATE_FUNC_DECLARE(dLytMsgWindowTalk_c, Wait); STATE_FUNC_DECLARE(dLytMsgWindowTalk_c, Visible); STATE_FUNC_DECLARE(dLytMsgWindowTalk_c, Out); @@ -56,7 +58,13 @@ private: /* 0x0568 */ dTextBox_c *mpTextboxes[2]; /* 0x0570 */ nw4r::lyt::Pane *mpPanes[5]; /* 0x0584 */ dTagProcessor_c *mpTagProcessor; - /* 0x0588 */ u8 _0x0588[0x05C0 - 0x0588]; + /* 0x0588 */ mVec3_c mTranslationOrig; + /* 0x0594 */ mVec3_c mTranslationTo; + /* 0x05A0 */ mVec3_c mTranslationFrom; + /* 0x05AC */ mVec2_c mOffset; + /* 0x05B4 */ dAcObjBase_c *mpActor; + /* 0x05B8 */ s32 mParam; + /* 0x05BC */ s32 field_0x05BC; /* 0x05C0 */ dLytCommonABtn_c mBtn; /* 0x0770 */ dLytTextLight mText; /* 0x084C */ MsgWindowBlurRelated mBlurRelated; -- cgit v1.2.3 From ba2d56981819c82cd45d7d805c248c3368d9cc24 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 6 Apr 2025 11:55:14 +0200 Subject: _sword OK --- include/toBeSorted/d_d3d.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/toBeSorted/d_d3d.h b/include/toBeSorted/d_d3d.h index 605c998c..f088d007 100644 --- a/include/toBeSorted/d_d3d.h +++ b/include/toBeSorted/d_d3d.h @@ -18,7 +18,7 @@ namespace d3d { -f32 fn_80016960(const mVec3_c&, const mVec3_c& pos); +f32 fn_80016960(mVec3_c&, const mVec3_c& pos); bool fn_80016A90(const mVec3_c& pos); class AnmMdlWrapper : protected m3d::mdlAnmChr { -- cgit v1.2.3 From 45bc91d2636900dc0e279dcdc4b298fe0840e3dd Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 6 Apr 2025 12:19:05 +0200 Subject: Cleanup --- include/d/lyt/d_lyt_common_arrow.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/d/lyt/d_lyt_common_arrow.h b/include/d/lyt/d_lyt_common_arrow.h index 16415e5a..c6dd34ea 100644 --- a/include/d/lyt/d_lyt_common_arrow.h +++ b/include/d/lyt/d_lyt_common_arrow.h @@ -12,7 +12,7 @@ public: dLytCommonArrow_c(); virtual ~dLytCommonArrow_c() {} - bool init(); + bool build(); STATE_FUNC_DECLARE(dLytCommonArrow_c, None); STATE_FUNC_DECLARE(dLytCommonArrow_c, In); @@ -20,20 +20,20 @@ public: STATE_FUNC_DECLARE(dLytCommonArrow_c, Out); void setState(s32 state); - bool addToDrawList(); + bool draw(); - bool fn_80168490(); - bool fn_80168500(); - void setTranslate(const Vec *); + bool remove(); + bool execute(); bool requestIn(); bool requestOut(); + +private: + void setTranslate(const Vec *); bool fn_80168760(); void displayElement(s32, f32); - void fn_80168800(s32); - void fn_80168810(d2d::AnmGroup_c *); + void unbindAt(s32); + void tickDown(d2d::AnmGroup_c *); void fn_80168880(); - -private: UI_STATE_MGR_DECLARE(dLytCommonArrow_c); /* 0x40 */ d2d::LytBase_c mLytBase; d2d::ResAccIf_c mResAcc; -- cgit v1.2.3 From d14d64ef672bab94f835fe894d8dc83094075809 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sun, 6 Apr 2025 23:15:50 +0200 Subject: some d_message additions --- include/d/d_message.h | 17 +++++++++++++++++ include/d/d_textunk.h | 21 +++++++++++++++++++-- include/libms/flowfile.h | 2 +- 3 files changed, 37 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/d/d_message.h b/include/d/d_message.h index 47b0fe4d..cd075bb0 100644 --- a/include/d/d_message.h +++ b/include/d/d_message.h @@ -57,6 +57,14 @@ public: static const wchar_t *formatText(const wchar_t *text); private: + static void *sZev0; + static void *sZevStage; + + static void *getZev0Internal(); + static void *getZevStageInternal(); + + void executeMinigame(); + const wchar_t *formatTextInternal(const wchar_t *text); const wchar_t *getTextMessageByLabelInternal( const char *label, dTagProcessor_c *pTagProcessor, bool global, wchar_t *dstBuf, u32 maxLen @@ -68,6 +76,7 @@ private: bool checkIsValidTextLabel(const char *name); static void setZevFromMsbArc(); + static void setStageZevFromMsbArc(); static s32 getMsbtNumberByIndex(s32 index); static const char *getMsbfFileName(s32 index); static s32 getMsbfNumberByIndex(s32 index); @@ -78,6 +87,11 @@ private: static MsbtInfo *getMsbtInfoForIndex(s32 index); MsbtInfo *getMsbtInfoForIndexInternal(s32 index); + static MsbfInfo *getMsbfInfoForIndex(s32 index); + MsbfInfo *getMsbfInfoForIndexInternal(s32 index); + + static const char *getArcNameByIndexInternal(s32 idx, bool global); + static dMessage_c *sInstance; static dTagProcessor_c *sTagProcessor; @@ -93,8 +107,11 @@ private: /* 0x329 */ bool field_0x329; /* 0x32A */ bool field_0x32A; + /* 0x32B */ u8 _0x32B[0x334 - 0x32B]; + /* 0x334 */ u32 mMinigameResultPoints; /* 0x338 */ u32 mMinigameTime; + /* 0x33C */ u8 _0x33C[0x344 - 0x33C]; /* 0x344 */ s32 field_0x344; }; diff --git a/include/d/d_textunk.h b/include/d/d_textunk.h index bc820fd7..90e2a4d4 100644 --- a/include/d/d_textunk.h +++ b/include/d/d_textunk.h @@ -133,10 +133,26 @@ public: return field_0x7B4; } + void *getField_0x74C() const { + return field_0x74C; + } + + void *getField_0x750() const { + return field_0x750; + } + + bool getField_0x7B6() const { + return field_0x7B6; + } + MsbtInfo *getMsbtInfo(s32 index) const { return field_buf2[index]; } + MsbfInfo *getMsbfInfo(s32 index) const { + return field_buf3[index]; + } + const char *getStr1() const { return field_0x004; } @@ -161,11 +177,12 @@ public: field_0x104 = s; } + void *allocUnk(size_t size, int align); + void destroyUnk(void *thing); + private: static UnkTextThing *sInstance; - void *allocUnk(size_t size, int align); - void destroyUnk(void *thing); void destroyFlow(MsbfInfo *flow); void destroyMsg(MsbtInfo *msg); diff --git a/include/libms/flowfile.h b/include/libms/flowfile.h index 9bc47790..edd1710f 100644 --- a/include/libms/flowfile.h +++ b/include/libms/flowfile.h @@ -12,7 +12,7 @@ struct MsbfInfo; struct MsbFlowInfo { /* 0x00 */ char type; /* 0x01 */ char subType; - /* 0x04 */ short params1n2; + /* 0x04 */ int params1n2; /* 0x08 */ short next; /* 0x0A */ short param3; /* 0x0C */ short param4; -- cgit v1.2.3 From fe32ad126e812a2745b615918aa4ba6aba7e9a09 Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 7 Apr 2025 00:00:36 +0200 Subject: Some cleanup --- include/d/d_textunk.h | 61 +++++++++++------------ include/d/lyt/msg_window/d_lyt_msg_window_link.h | 2 +- include/d/lyt/msg_window/d_lyt_msg_window_sword.h | 5 +- include/d/lyt/msg_window/d_lyt_msg_window_talk.h | 2 +- 4 files changed, 32 insertions(+), 38 deletions(-) (limited to 'include') diff --git a/include/d/d_textunk.h b/include/d/d_textunk.h index 90e2a4d4..a76d5c99 100644 --- a/include/d/d_textunk.h +++ b/include/d/d_textunk.h @@ -7,6 +7,13 @@ #include "nw4r/ut/ut_Color.h" #include "sized_string.h" +/** + * This class appears to be the remnant of a sort of "hot-reloading" + * mechanism for the game's user interface. Many of the functions + * affect text formatting, UI layouting, and it also has mechanisms + * for overriding the text and flow files being accessed. The actual + * implementation appears to have been stripped out though. + */ class UnkTextThing { public: UnkTextThing(); @@ -113,44 +120,32 @@ public: return sInstance; } - void reset0(const char *str) { - field_0x004 = str; + s16 getMsgWindowWaitDelay() const { + return mMsgWindowWaitDelay; } - void reset1(const char *str) { - field_0x084 = str; + bool getShouldOverrideData() const { + return mShouldOverrideData; } - void reset2(const char *str) { - field_0x104 = str; + void *getOverrideZev0() const { + return mOverrideZev0; } - s16 getField_0x7AE() const { - return field_0x7AE; + void *getOverrideStageZev() const { + return mOverrideStageZev; } - bool getField_0x7B4() const { - return field_0x7B4; + bool getShouldHookAllocations() const { + return mShouldHookAllocations; } - void *getField_0x74C() const { - return field_0x74C; + MsbtInfo *getOverrideMsbtInfo(s32 index) const { + return mMsbts[index]; } - void *getField_0x750() const { - return field_0x750; - } - - bool getField_0x7B6() const { - return field_0x7B6; - } - - MsbtInfo *getMsbtInfo(s32 index) const { - return field_buf2[index]; - } - - MsbfInfo *getMsbfInfo(s32 index) const { - return field_buf3[index]; + MsbfInfo *getOverrideMsbfInfo(s32 index) const { + return mMsbfs[index]; } const char *getStr1() const { @@ -204,11 +199,11 @@ private: /* 0x184 */ void *field_buf0[82]; /* 0x2CC */ void *field_buf4[23]; /* 0x328 */ void *field_buf1[80]; - /* 0x468 */ MsbtInfo *field_buf2[82]; + /* 0x468 */ MsbtInfo *mMsbts[82]; /* 0x5B0 */ MsbtInfo *field_buf5[23]; - /* 0x60C */ MsbfInfo *field_buf3[80]; - /* 0x74C */ void *field_0x74C; - /* 0x750 */ void *field_0x750; + /* 0x60C */ MsbfInfo *mMsbfs[80]; + /* 0x74C */ void *mOverrideZev0; + /* 0x750 */ void *mOverrideStageZev; /* 0x754 */ f32 field_0x754; /* 0x758 */ f32 field_0x758; /* 0x75C */ f32 field_0x75C; @@ -235,13 +230,13 @@ private: /* 0x7A8 */ s16 field_0x7A8; /* 0x7AA */ s16 field_0x7AA; /* 0x7AC */ s16 field_0x7AC; - /* 0x7AE */ s16 field_0x7AE; + /* 0x7AE */ s16 mMsgWindowWaitDelay; /* 0x7B0 */ s16 field_0x7B0; /* 0x7B2 */ bool field_0x7B2; /* 0x7B3 */ bool field_0x7B3; - /* 0x7B4 */ bool field_0x7B4; + /* 0x7B4 */ bool mShouldOverrideData; /* 0x7B5 */ bool field_0x7B5; - /* 0x7B6 */ bool field_0x7B6; + /* 0x7B6 */ bool mShouldHookAllocations; /* 0x7B6 */ bool field_0x7B7; /* 0x7B8 */ nw4r::ut::Color field_0x7B8; /* 0x7BC */ nw4r::ut::Color field_0x7BC; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_link.h b/include/d/lyt/msg_window/d_lyt_msg_window_link.h index ffb99c91..f392c417 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_link.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_link.h @@ -63,7 +63,7 @@ private: /* 0x05AC */ mVec2_c mOffset; /* 0x05B4 */ dAcObjBase_c *mpActor; /* 0x05B8 */ s32 mParam; - /* 0x05BC */ s32 field_0x05BC; + /* 0x05BC */ s32 mWaitDelay; /* 0x05C0 */ dLytCommonABtn_c mBtn; /* 0x0770 */ dLytTextLight mText; /* 0x084C */ MsgWindowBlurRelated mBlurRelated; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_sword.h b/include/d/lyt/msg_window/d_lyt_msg_window_sword.h index 268a5bf5..ae9a40b8 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_sword.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_sword.h @@ -67,13 +67,12 @@ private: /* 0x05CC */ mVec3_c mTranslationTo; /* 0x05D8 */ mVec3_c mTranslationFrom; - /* 0x05E4 */ f32 field_0x05E4; - /* 0x05E8 */ f32 field_0x05E8; + /* 0x05E4 */ mVec2_c mOffset; /* 0x05EC */ dAcObjBase_c *mpActor; /* 0x05F0 */ s32 mParam; - /* 0x05F4 */ s32 field_0x5F4; + /* 0x05F4 */ s32 mWaitDelay; /* 0x05F8 */ dLytCommonABtn_c mBtn; diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_talk.h b/include/d/lyt/msg_window/d_lyt_msg_window_talk.h index f7770bfa..3cbed7e2 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_talk.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_talk.h @@ -64,7 +64,7 @@ private: /* 0x05AC */ mVec2_c mOffset; /* 0x05B4 */ dAcObjBase_c *mpActor; /* 0x05B8 */ s32 mParam; - /* 0x05BC */ s32 field_0x05BC; + /* 0x05BC */ s32 mWaitDelay; /* 0x05C0 */ dLytCommonABtn_c mBtn; /* 0x0770 */ dLytTextLight mText; /* 0x084C */ MsgWindowBlurRelated mBlurRelated; -- cgit v1.2.3 From 6feb6a95c6e1b523a31fb1616207c02d63b10cbe Mon Sep 17 00:00:00 2001 From: robojumper Date: Mon, 7 Apr 2025 22:23:06 +0200 Subject: Fix wrong offset comment --- include/d/lyt/msg_window/d_lyt_msg_window_common.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/d/lyt/msg_window/d_lyt_msg_window_common.h b/include/d/lyt/msg_window/d_lyt_msg_window_common.h index 70548d3c..0180bdd3 100644 --- a/include/d/lyt/msg_window/d_lyt_msg_window_common.h +++ b/include/d/lyt/msg_window/d_lyt_msg_window_common.h @@ -59,7 +59,7 @@ public: private: /* 0x04 */ d2d::LytBase_c mLyt; - /* 0x90 */ d2d::AnmGroup_c mAnm; + /* 0x94 */ d2d::AnmGroup_c mAnm; /* 0xD4 */ dTextBox_c *mpTexts[3]; /* 0xE0 */ nw4r::lyt::Pane *mpPane; /* 0xE4 */ ESwordType mType; @@ -83,7 +83,6 @@ public: private: /* 0x04 */ d2d::LytBase_c mLyt; - // ??? /* 0x94 */ d2d::AnmGroup_c mAnm; /* 0xD4 */ nw4r::lyt::Pane *mpPane; /* 0xD8 */ ETextType mType; -- cgit v1.2.3