summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-04-02 00:29:45 +0200
committerrobojumper <robojumper@gmail.com>2025-04-07 22:12:36 +0200
commita337ae752a4aa67b423baee3d28fb6ae9a28c5be (patch)
tree3074f09f979bb045909b79112027926a1b4be831
parenta4ff5b11f771e9375fc8fed3f5b492423a68529b (diff)
Fix variable ownership
-rw-r--r--include/d/lyt/d_lyt_common_a_btn.h18
-rw-r--r--include/d/lyt/msg_window/d_lyt_msg_window_common.h8
-rw-r--r--include/d/lyt/msg_window/d_lyt_msg_window_wood.h9
-rw-r--r--src/d/lyt/msg_window/d_lyt_msg_window_wood.cpp16
4 files changed, 19 insertions, 32 deletions
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
diff --git a/src/d/lyt/msg_window/d_lyt_msg_window_wood.cpp b/src/d/lyt/msg_window/d_lyt_msg_window_wood.cpp
index 2727e7cf..765a0e0b 100644
--- a/src/d/lyt/msg_window/d_lyt_msg_window_wood.cpp
+++ b/src/d/lyt/msg_window/d_lyt_msg_window_wood.cpp
@@ -110,7 +110,7 @@ void dLytMsgWindowWood_c::initializeState_Invisible() {
mCommon.resetToInvisble();
}
void dLytMsgWindowWood_c::executeState_Invisible() {
- if (mCommon.shouldBeOpen()) {
+ if (mShouldBeOpen) {
mStateMgr.changeState(StateID_In);
}
}
@@ -130,7 +130,7 @@ void dLytMsgWindowWood_c::finalizeState_In() {}
void dLytMsgWindowWood_c::initializeState_Visible() {}
void dLytMsgWindowWood_c::executeState_Visible() {
- if (!mCommon.shouldBeOpen()) {
+ if (!mShouldBeOpen) {
mStateMgr.changeState(StateID_Out);
}
}
@@ -166,19 +166,19 @@ void dLytMsgWindowWood_c::draw() {
mLyt.draw();
}
-void dLytMsgWindowWood_c::vt_0x1C() {
- mCommon.openMaybe();
+void dLytMsgWindowWood_c::open() {
+ mShouldBeOpen = true;
}
-bool dLytMsgWindowWood_c::vt_0x20() const {
+bool dLytMsgWindowWood_c::isOpening() const {
return !(*mStateMgr.getStateID() == StateID_In);
}
-void dLytMsgWindowWood_c::vt_0x24() {
- mCommon.closeMaybe();
+void dLytMsgWindowWood_c::close() {
+ mShouldBeOpen = false;
}
-bool dLytMsgWindowWood_c::vt_0x28() const {
+bool dLytMsgWindowWood_c::isClosing() const {
return !(*mStateMgr.getStateID() == StateID_Out);
}