auto_caption, auto_explain largely matching

This commit is contained in:
robojumper
2025-04-02 13:36:11 +02:00
parent 5e2343afb7
commit 4e88b4aec7
16 changed files with 584 additions and 122 deletions
+7 -3
View File
@@ -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;
+45
View File
@@ -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
+45
View File
@@ -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
+1 -1
View File
@@ -24,7 +24,7 @@ public:
return mLyt.getName();
}
u8 isDoneOut() const {
bool isDoneOut() const {
return mIsDoneOut;
}
+1
View File
@@ -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, ...);
@@ -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;
};
@@ -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;
};
@@ -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;
};
+4
View File
@@ -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