summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-11-22 22:27:54 +0100
committerGitHub <noreply@github.com>2025-11-22 22:27:54 +0100
commit71713b520bf0179cbfd962928c326de5ec697db6 (patch)
treeaf53729245320a6452ee443596070d448cbb31dd /include
parentcd78f5b78b5233474375ff7898e848fb000d4b54 (diff)
parentab83c7628f2f1bb1d8842cfee839338a8ccc86d9 (diff)
Merge pull request #269 from robojumper/d_lyt_simple_window
d_lyt_simple_window OK
Diffstat (limited to 'include')
-rw-r--r--include/d/d_tag_processor.h10
-rw-r--r--include/d/d_textwindow_unk.h8
-rw-r--r--include/d/lyt/d_lyt_control_game.h23
-rw-r--r--include/d/lyt/d_lyt_map.h8
-rw-r--r--include/d/lyt/d_lyt_wipe.h3
-rw-r--r--include/d/lyt/msg_window/d_lyt_msg_window.h9
-rw-r--r--include/d/lyt/msg_window/d_lyt_msg_window_sword.h4
-rw-r--r--include/d/lyt/msg_window/d_lyt_simple_window.h200
8 files changed, 245 insertions, 20 deletions
diff --git a/include/d/d_tag_processor.h b/include/d/d_tag_processor.h
index e7a63110..c643e3f3 100644
--- a/include/d/d_tag_processor.h
+++ b/include/d/d_tag_processor.h
@@ -196,6 +196,16 @@ public:
return mOptionSound[idx];
}
+ void resetSomeThings() {
+ // TODO clean this up - are these arrays or not???
+ for (int i = 0; i < 11; i++) {
+ mNumericArgsCopy[i] = 0;
+ }
+ for (int i = 0; i < 11; i++) {
+ (&field_0xEE5)[i] = 0;
+ }
+ }
+
private:
enum Cmd_e {
TAG_CMD_SCALE = 0x2,
diff --git a/include/d/d_textwindow_unk.h b/include/d/d_textwindow_unk.h
index a599b2d0..f98aec26 100644
--- a/include/d/d_textwindow_unk.h
+++ b/include/d/d_textwindow_unk.h
@@ -30,6 +30,8 @@ struct dLytMsgWindowCharData {
// one by one in the text boxes
class TextWindowUnk {
public:
+ static const int BUF_SIZE = 1023;
+
TextWindowUnk(dTagProcessor_c *tagProcessor);
virtual ~TextWindowUnk() {}
@@ -55,8 +57,8 @@ public:
private:
/* 0x0004 */ dTagProcessor_c *mpTagProcessor;
- /* 0x0008 */ wchar_t mRawTextBuffer[1023];
- /* 0x0806 */ wchar_t mProcessedTextBuffer[1023];
+ /* 0x0008 */ wchar_t mRawTextBuffer[BUF_SIZE];
+ /* 0x0806 */ wchar_t mProcessedTextBuffer[BUF_SIZE];
/* 0x1004 */ wchar_t mUnkBuffer[511]; // ???
/* 0x1402 */ SizedString<64> field_0x1402;
/* 0x1442 */ u8 _0x1442[0x144C - 0x1442];
@@ -90,7 +92,7 @@ public:
}
private:
- dLytMsgWindowCharData mData[1023];
+ dLytMsgWindowCharData mData[TextWindowUnk::BUF_SIZE];
};
#endif
diff --git a/include/d/lyt/d_lyt_control_game.h b/include/d/lyt/d_lyt_control_game.h
index 110e0c03..c36b2ee0 100644
--- a/include/d/lyt/d_lyt_control_game.h
+++ b/include/d/lyt/d_lyt_control_game.h
@@ -3,7 +3,13 @@
#include "d/d_base.h"
#include "d/lyt/d_lyt_map.h"
+#include "d/lyt/d_lyt_wipe.h"
+#include "d/lyt/meter/d_lyt_meter.h"
+#include "d/lyt/msg_window/d_lyt_msg_window.h"
+#include "d/lyt/msg_window/d_lyt_simple_window.h"
#include "s/s_State.hpp"
+#include "toBeSorted/arc_managers/layout_arc_manager.h"
+#include "toBeSorted/raii_ptr.h"
class dLytControlGame_c : public dBase_c {
public:
@@ -75,16 +81,25 @@ public:
private:
/* 0x00068 */ UI_STATE_MGR_DECLARE(dLytControlGame_c);
- /* 0x000A4 */ u8 _0x000A4[0x15850 - 0x000A4];
-
+ /* 0x000A4 */ RaiiPtr<void*> field_0x000A4;
+ /* 0x000A8 */ dLytMeter_c mMeter;
+ /* 0x13C10 */ dLytMsgWindow_c mMsgWindow;
+ /* 0x14E34 */ dLytSimpleWindow_c mSimpleWindow;
+ /* 0x152A0 */ dLytWipe_c mWipe;
+ /* 0x15848 */ u8 _0x15848[0x15850 - 0x15848];
/* 0x15850 */ dMapFootPrintsMgr_c mFootprintsMgr;
- /* 0x15C24 */ u8 _0x15C24[0x15C2C - 0x15C24];
+ /* 0x15C24 */ UNKWORD field_0x15C24;
+ /* 0x15C28 */ UNKWORD field_0x15C28;
/* 0x15C2C */ s32 mCurrentPauseDisp;
/* 0x15C30 */ s32 mPauseDisp00Tab;
- /* 0x15C34 */ u8 _0x15C34[0x15C60 - 0x15C34];
+ /* 0x15C34 */ u8 _0x15C34[0x15C40 - 0x15C34];
+
+ /* 0x15C40 */ LayoutArcControl mLytArcControl;
+
+ /* 0x15C4C */ u8 _0x15C4C[0x15C60 - 0x15C4C];
/* 0x15C60 */ u16 mItemForPauseDemo;
diff --git a/include/d/lyt/d_lyt_map.h b/include/d/lyt/d_lyt_map.h
index fedd5d13..54df7cf9 100644
--- a/include/d/lyt/d_lyt_map.h
+++ b/include/d/lyt/d_lyt_map.h
@@ -60,6 +60,9 @@ struct dMapFootPrintEntry {
/** Generic footprints queue */
class dMapFootPrintsQueue_c {
public:
+ dMapFootPrintsQueue_c() {
+ init();
+ }
void init();
void addStep(const mVec3_c &pos, const mAng &rot);
dMapFootPrintEntry *getFirst() const;
@@ -79,9 +82,7 @@ private:
/** Records Link's footsteps */
class dMapFootPrintsMgr_c {
public:
- dMapFootPrintsMgr_c() {
- mQueue.init();
- }
+ dMapFootPrintsMgr_c() : mMinStepDistanceSq(0.0f) {}
virtual ~dMapFootPrintsMgr_c() {}
void execute();
@@ -141,7 +142,6 @@ struct LytMap0x80520B5C {
bool field_0x05;
};
-
/** 2D UI - Map - beacon preview icon following the cursor */
class dLytMapPutIcon_c {
public:
diff --git a/include/d/lyt/d_lyt_wipe.h b/include/d/lyt/d_lyt_wipe.h
index ec9b5677..58558856 100644
--- a/include/d/lyt/d_lyt_wipe.h
+++ b/include/d/lyt/d_lyt_wipe.h
@@ -4,6 +4,7 @@
#include "common.h"
#include "d/lyt/d2d.h"
#include "s/s_State.hpp"
+#include "toBeSorted/d_flow_mgr.h"
class dLytWipeMain_c {
public:
@@ -61,7 +62,7 @@ private:
/* 0x03C */ d2d::ResAccIf_c mResAcc;
/* 0x3AC */ dLytWipeMain_c mMain;
- /* 0x4E0 */ u8 _0x4E0[0x59C - 0x4E0];
+ /* 0x4E0 */ dFlowMgr_c mFlowMgr;
/* 0x59C */ bool mWantsIn;
/* 0x59D */ bool mWantsOut;
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 74e34487..e0e0e2e1 100644
--- a/include/d/lyt/msg_window/d_lyt_msg_window.h
+++ b/include/d/lyt/msg_window/d_lyt_msg_window.h
@@ -1,6 +1,7 @@
#ifndef D_LYT_MSG_WINDOW_H
#define D_LYT_MSG_WINDOW_H
+#include "common.h"
#include "d/d_tag_processor.h"
#include "d/d_textwindow_unk.h"
#include "d/lyt/d2d.h"
@@ -53,8 +54,12 @@ public:
MSG_WINDOW_36 = 36,
};
- dLytMsgWindow_c() : mStateMgr(*this) {}
- virtual ~dLytMsgWindow_c() {}
+ dLytMsgWindow_c() : mStateMgr(*this) {
+ sInstance = this;
+ }
+ virtual ~dLytMsgWindow_c() {
+ sInstance = nullptr;
+ }
bool build();
bool remove();
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 ae9a40b8..82e649f5 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
@@ -76,8 +76,8 @@ private:
/* 0x05F8 */ dLytCommonABtn_c mBtn;
- /* 0x07A8 */ dLytMsgWindowCharData mCharacterData[1023];
- /* 0x5794 */ wchar_t mTextBuf[1023];
+ /* 0x07A8 */ dLytMsgWindowCharData mCharacterData[TextWindowUnk::BUF_SIZE];
+ /* 0x5794 */ wchar_t mTextBuf[TextWindowUnk::BUF_SIZE];
/* 0x5F94 */ dLytTextSword mSwordText;
/* 0x607C */ dLytTextSword::ESwordType mSwordType;
diff --git a/include/d/lyt/msg_window/d_lyt_simple_window.h b/include/d/lyt/msg_window/d_lyt_simple_window.h
index 2356fd83..83f8e8b1 100644
--- a/include/d/lyt/msg_window/d_lyt_simple_window.h
+++ b/include/d/lyt/msg_window/d_lyt_simple_window.h
@@ -1,18 +1,210 @@
#ifndef D_LYT_SIMPLE_WINDOW_H
#define D_LYT_SIMPLE_WINDOW_H
-class dLytSimpleWindow_c {
+#include "common.h"
+#include "d/d_tag_processor.h"
+#include "d/d_textwindow_unk.h"
+#include "d/lyt/d2d.h"
+#include "d/lyt/d_textbox.h"
+#include "d/lyt/msg_window/d_lyt_msg_window_common.h"
+#include "m/m2d.h"
+#include "m/m_vec.h"
+#include "nw4r/lyt/lyt_pane.h"
+#include "s/s_State.hpp"
+#include "sized_string.h"
+
+class dLytSimpleWindowSubtype {
public:
- dLytSimpleWindow_c() {}
- virtual ~dLytSimpleWindow_c() {}
+ /* 0x08 */ virtual ~dLytSimpleWindowSubtype() {}
+ /* 0x0C */ virtual bool build(d2d::ResAccIf_c *, dTagProcessor_c *);
+ /* 0x10 */ virtual bool remove() {
+ return true;
+ }
+ /* 0x14 */ virtual bool execute() {
+ return true;
+ }
+ /* 0x18 */ virtual bool draw() {
+ return true;
+ }
+ /* 0x1C */ virtual void initializeIn(s32 pos);
+ /* 0x20 */ virtual bool isIn() {
+ return true;
+ }
+ /* 0x24 */ virtual void initializeOutputText() {}
+ /* 0x28 */ virtual void initializeOut() {}
+ /* 0x2C */ virtual bool isOut() {
+ return true;
+ }
+ /* 0x30 */ virtual bool setText(const wchar_t *text);
+ /* 0x34 */ virtual dTextBox_c *getTextBox() {
+ return nullptr;
+ }
+ /* 0x38 */ virtual dLytMsgWindowCharData *getCharData() {
+ return nullptr;
+ }
+
+private:
+};
+
+class dLytSimpleWindowTalk_c : public dLytSimpleWindowSubtype {
+public:
+ /* 0x0C */ virtual bool build(d2d::ResAccIf_c *, dTagProcessor_c *) override;
+ /* 0x10 */ virtual bool remove() override;
+ /* 0x14 */ virtual bool execute() override;
+ /* 0x18 */ virtual bool draw() override;
+ /* 0x1C */ virtual void initializeIn(s32 pos) override;
+ /* 0x20 */ virtual bool isIn() override;
+ /* 0x24 */ virtual void initializeOutputText() override;
+ /* 0x28 */ virtual void initializeOut() override;
+ /* 0x2C */ virtual bool isOut() override;
+ /* 0x30 */ virtual bool setText(const wchar_t *text) override;
+
+ /* 0x34 */ virtual dTextBox_c *getTextBox() override {
+ return mpTextboxes[0];
+ }
+ /* 0x38 */ virtual dLytMsgWindowCharData *getCharData() override {
+ return mBlurRelated.getCharData();
+ }
+
+private:
+ /* 0x0004 */ d2d::ResAccIf_c *mpResAcc;
+ /* 0x0008 */ d2d::LytBase_c mLyt;
+ /* 0x0098 */ d2d::AnmGroup_c mAnm[4];
+ /* 0x0198 */ dTextBox_c *mpTextboxes[2];
+ /* 0x01A0 */ nw4r::lyt::Pane *mpPanes[5];
+ /* 0x01B4 */ dTagProcessor_c *mpTagProcessor;
+ /* 0x01B8 */ dLytTextLight mLightText;
+ /* 0x0294 */ MsgWindowBlurRelated mBlurRelated;
+ /* 0x5284 */ mVec3_c mOrigPosition;
+ /* 0x5290 */ mVec3_c mPosition;
+ /* 0x529C */ mVec2_c mOffset;
+};
+
+class dLytSimpleWindowSword_c : public dLytSimpleWindowSubtype {
+public:
+ /* 0x0C */ virtual bool build(d2d::ResAccIf_c *, dTagProcessor_c *) override;
+ /* 0x10 */ virtual bool remove() override;
+ /* 0x14 */ virtual bool execute() override;
+ /* 0x18 */ virtual bool draw() override;
+ /* 0x1C */ virtual void initializeIn(s32 pos) override;
+ /* 0x20 */ virtual bool isIn() override;
+ /* 0x24 */ virtual void initializeOutputText() override;
+ /* 0x28 */ virtual void initializeOut() override;
+ /* 0x2C */ virtual bool isOut() override;
+ /* 0x30 */ virtual bool setText(const wchar_t *text) override;
+
+ /* 0x34 */ virtual dTextBox_c *getTextBox() override {
+ return mpTextboxes[0];
+ }
+ /* 0x38 */ virtual dLytMsgWindowCharData *getCharData() override {
+ return mCharData;
+ }
+ void setSwordType(s32 b) {
+ mSwordType = b;
+ }
+
+private:
+ /* 0x0004 */ d2d::ResAccIf_c *mpResAcc;
+ /* 0x0008 */ d2d::LytBase_c mLyt;
+ /* 0x0098 */ d2d::AnmGroup_c mAnm[5];
+ /* 0x01D8 */ dTextBox_c *mpTextboxes[2];
+ /* 0x01E0 */ nw4r::lyt::Pane *mpPanes[3];
+ /* 0x01F4 */ dTagProcessor_c *mpTagProcessor;
+ /* 0x01F8 */ dLytMsgWindowCharData mCharData[TextWindowUnk::BUF_SIZE];
+ /* 0x51DC */ wchar_t mTextBuf[TextWindowUnk::BUF_SIZE];
+ /* 0x59DC */ dLytTextSword mSwordText;
+ /* 0x5AC4 */ s32 mSwordType;
+ /* 0x5AC8 */ u8 field_0x5AC8;
+ /* 0x5ACC */ mVec3_c mOrigPosition;
+ /* 0x5AD8 */ mVec3_c mPosition;
+ /* 0x5AE4 */ mVec2_c mOffset;
+};
+
+class dLytSimpleWindowLink_c : public dLytSimpleWindowSubtype {
+public:
+ /* 0x0C */ virtual bool build(d2d::ResAccIf_c *, dTagProcessor_c *) override;
+ /* 0x10 */ virtual bool remove() override;
+ /* 0x14 */ virtual bool execute() override;
+ /* 0x18 */ virtual bool draw() override;
+ /* 0x1C */ virtual void initializeIn(s32 pos) override;
+ /* 0x20 */ virtual bool isIn() override;
+ /* 0x24 */ virtual void initializeOutputText() override;
+ /* 0x28 */ virtual void initializeOut() override;
+ /* 0x2C */ virtual bool isOut() override;
+ /* 0x30 */ virtual bool setText(const wchar_t *text) override;
+
+ /* 0x34 */ virtual dTextBox_c *getTextBox() override {
+ return mpTextboxes[0];
+ }
+ /* 0x38 */ virtual dLytMsgWindowCharData *getCharData() override {
+ return mBlurRelated.getCharData();
+ }
+
+private:
+ /* 0x0004 */ d2d::ResAccIf_c *mpResAcc;
+ /* 0x0008 */ d2d::LytBase_c mLyt;
+ /* 0x0098 */ d2d::AnmGroup_c mAnm[4];
+ /* 0x0198 */ dTextBox_c *mpTextboxes[2];
+ /* 0x01A0 */ nw4r::lyt::Pane *mpPanes[5];
+ /* 0x01B4 */ dTagProcessor_c *mpTagProcessor;
+ /* 0x01B8 */ dLytTextLight mLightText;
+ /* 0x0294 */ MsgWindowBlurRelated mBlurRelated;
+ /* 0x5??? */ mVec3_c mOrigPosition;
+ /* 0x5??? */ mVec3_c mPosition;
+ /* 0x5??? */ mVec2_c mOffset;
+};
+
+/** 2D UI - Message window - Window without a confirm button, automatically closes (on timer or event) */
+class dLytSimpleWindow_c : public m2d::Base_c {
+public:
+ dLytSimpleWindow_c() : mStateMgr(*this) {
+ sInstance = this;
+ }
+ virtual ~dLytSimpleWindow_c() {
+ sInstance = nullptr;
+ }
+ virtual void draw() override;
+
+ bool build();
+ bool remove();
+ bool execute();
static dLytSimpleWindow_c *getInstance() {
return sInstance;
}
- bool fn_8012B000();
+ bool set(const char *label, s32 timer, bool global);
+
+ bool isVisible();
+ bool isOutputText();
+ bool isInEvent();
+
+ STATE_FUNC_DECLARE(dLytSimpleWindow_c, Invisible);
+ STATE_FUNC_DECLARE(dLytSimpleWindow_c, In);
+ STATE_FUNC_DECLARE(dLytSimpleWindow_c, OutputText);
+ STATE_FUNC_DECLARE(dLytSimpleWindow_c, Out);
private:
+ /* 0x010 */ UI_STATE_MGR_DECLARE(dLytSimpleWindow_c);
+ /* 0x04C */ d2d::ResAccIf_c mResAcc;
+
+ /* 0x3BC */ TextWindowUnk *mpUnk;
+ /* 0x3C0 */ dTagProcessor_c *mpTagProcessor;
+ /* 0x3C4 */ dLytSimpleWindowSubtype *mpCurrentWindow;
+ /* 0x3C8 */ dLytSimpleWindowTalk_c *mpWindowTalk;
+ /* 0x3CC */ dLytSimpleWindowSword_c *mpWindowSword;
+ /* 0x3D0 */ dLytSimpleWindowLink_c *mpWindowLink;
+ /* 0x3D4 */ UNKWORD field_0x3D4;
+ /* 0x3D8 */ UNKWORD field_0x3D8;
+ /* 0x3DC */ UNKWORD field_0x3DC;
+ /* 0x3E0 */ UNKWORD field_0x3E0;
+ /* 0x3E4 */ UNKWORD mTimer;
+ /* 0x3E8 */ u16 field_0x3E8;
+ /* 0x3EA */ SizedString<0x40> mLabel;
+ /* 0x42A */ SizedString<0x40> field_0x42A;
+ /* 0x46A */ bool mInRequest;
+ /* 0x46B */ bool mWaitForEvent;
+
static dLytSimpleWindow_c *sInstance;
};