More demo

This commit is contained in:
robojumper
2025-04-05 00:11:00 +02:00
parent af4a1cfdb0
commit f2bcb0da52
10 changed files with 380 additions and 111 deletions
+33 -3
View File
@@ -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
+11 -2
View File
@@ -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;
@@ -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
@@ -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
@@ -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;
+1 -1
View File
@@ -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();
+14
View File
@@ -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