Matching, I guess

This commit is contained in:
robojumper
2025-04-10 20:30:27 +02:00
parent 803541336d
commit d19adefd7a
26 changed files with 1609 additions and 337 deletions
+7 -3
View File
@@ -51,9 +51,13 @@ public:
void getItemFromBWheelItem();
bool isStateWait();
static int getTotalBombCount();
static int getTotalArrowCount();
static int getTotalSeedCount();
static s32 getTotalBombCount();
static s32 getTotalArrowCount();
static s32 getTotalSeedCount();
static s32 getTotalBombCapacity();
static s32 getTotalSeedCapacity();
static s32 getTotalArrowCapacity();
static bool isRupee(ITEM_ID item);
static bool isKeyPiece(ITEM_ID item);
+1 -1
View File
@@ -109,7 +109,7 @@ enum ITEM_ID {
/* 0x066 */ ITEM_TREASURE_MEDAL = 102,
/* 0x067 */ ITEM_POTION_MEDAL = 103,
/* 0x068 */ ITEM_CURSED_MEDAL = 104,
/* 0x069 */ ITEM_SCATTERSHOT = 105,
/* 0x069 */ ITEM_MIGHTY_SCATTERSHOT = 105,
/* 0x06A */ ITEM_UNK_106 = 106,
/* 0x06B */ ITEM_UNK_107 = 107,
/* 0x06C */ ITEM_MEDIUM_WALLET = 108,
+14
View File
@@ -3,6 +3,7 @@
#include "common.h"
#include "d/a/d_a_base.h"
#include "d/a/d_a_itembase.h"
#include "d/a/obj/d_a_obj_base.h"
#include "m/m_allocator.h"
#include "m/m_angle.h"
@@ -61,6 +62,7 @@ public:
void setPosYRot(const mVec3_c &pos, mAng rot, UNKWORD, UNKWORD, UNKWORD);
// argument is always false in existing code, true doesn't seem to make a difference
void bonk(bool unk = false);
bool fn_80202D90(bool);
/* vt 0x080 */ virtual UNKWORD IfCurrentActionToActor(dAcBase_c *ac, UNKWORD);
/* vt 0x084 */ virtual void vt_0x084(dAcBase_c *ac, UNKWORD);
@@ -288,7 +290,19 @@ public:
return LINK;
}
static dAcPy_c *GetLink2() {
return LINK2;
}
static dAcPy_c *LINK;
static dAcPy_c *LINK2;
static s32 getCurrentBowType();
static s32 getCurrentSlingshotType();
static s32 getCurrentBeetleType();
static s32 getCurrentBugNetType();
static bool isItemRestrictedByBokoBase(ITEM_ID item);
};
#endif
+12 -20
View File
@@ -8,27 +8,19 @@
#include "nw4r/lyt/lyt_bounding.h"
#include "s/s_State.hpp"
class dLytCommonIconItemPartBase_c {
public:
virtual ~dLytCommonIconItemPartBase_c() {}
virtual nw4r::lyt::Pane *getPane() = 0;
virtual d2d::LytBase_c *getLyt() = 0;
virtual const char *getName() const = 0;
};
/** B-Wheel item */
class dLytCommonIconItemPart1_c : public dLytCommonIconItemPartBase_c {
class dLytCommonIconItemPart1_c {
public:
dLytCommonIconItemPart1_c()
: mItem(0), mColor(0), field_0x2B4(false), mHasNumber(false), mSize(false), mBocoburinLocked(false) {}
virtual ~dLytCommonIconItemPart1_c() {}
virtual nw4r::lyt::Pane *getPane() override {
virtual nw4r::lyt::Pane *getPane() {
return mLyt.getLayout()->GetRootPane();
}
virtual d2d::LytBase_c *getLyt() override {
virtual d2d::LytBase_c *getLyt() {
return &mLyt;
}
virtual const char *getName() const override {
virtual const char *getName() const {
return mLyt.getName();
}
@@ -82,7 +74,7 @@ private:
};
/** Pouch item */
class dLytCommonIconItemPart2_c : public dLytCommonIconItemPartBase_c {
class dLytCommonIconItemPart2_c {
public:
dLytCommonIconItemPart2_c()
: mItem(0),
@@ -94,13 +86,13 @@ public:
mOnOff(true),
mDurability(0.0f) {}
virtual ~dLytCommonIconItemPart2_c() {}
virtual nw4r::lyt::Pane *getPane() override {
virtual nw4r::lyt::Pane *getPane() {
return mLyt.getLayout()->GetRootPane();
}
virtual d2d::LytBase_c *getLyt() override {
virtual d2d::LytBase_c *getLyt() {
return &mLyt;
}
virtual const char *getName() const override {
virtual const char *getName() const {
return mLyt.getName();
}
@@ -162,17 +154,17 @@ private:
};
/** Dowsing "item" */
class dLytCommonIconItemPart3_c : public dLytCommonIconItemPartBase_c {
class dLytCommonIconItemPart3_c {
public:
dLytCommonIconItemPart3_c() : mItem(0), mSize(false), mBocoburinLocked(false) {}
virtual ~dLytCommonIconItemPart3_c() {}
virtual nw4r::lyt::Pane *getPane() override {
virtual nw4r::lyt::Pane *getPane() {
return mLyt.getLayout()->GetRootPane();
}
virtual d2d::LytBase_c *getLyt() override {
virtual d2d::LytBase_c *getLyt() {
return &mLyt;
}
virtual const char *getName() const override {
virtual const char *getName() const {
return mLyt.getName();
}
@@ -34,6 +34,7 @@
#define LYT_CMN_ItemBigBugnet (15) // [14] uc_netB_00.tpl
#define LYT_CMN_ItemBoatCannon (16) // [ 7] uc_boatCannon_00.tpl
#define LYT_CMN_ItemHarp (17) // [ 0] tr_tategoto_00.tpl
#define LYT_CMN_ItemNone (18) // -------------------------
// Pouch Items
#define LYT_CMN_PouchPotionHealyh (0) // [12] uc_bottleKusuriA_00.tpl
+9 -3
View File
@@ -1,6 +1,7 @@
#ifndef D_LYT_TEXTBOX_H
#define D_LYT_TEXTBOX_H
#include "common.h"
#include "d/lyt/d2d.h"
#include "libms/msgfile.h"
#include "nw4r/lyt/lyt_drawInfo.h"
@@ -47,8 +48,11 @@ public:
return mMyScale;
}
void fn_800E0A60(const char *area, ...) {
// TODO
void setMessageWithGlobalTextProcessor2(const char *message, void *unk, ...) {
va_list l;
va_start(l, str);
setMessageWithGlobalTextProcessorV(message, nullptr, unk, l);
va_end(l);
}
void setTextWithGlobalTextProcessor(const wchar_t *str);
@@ -58,7 +62,9 @@ public:
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 setMessageWithGlobalTextProcessorAndMsbtInfo(
const MsbtInfo *info, const char *labelId, wchar_t *destBuf, u32 maxLen
);
void loadTextFormatVars();
void setupGX() const;
+20 -5
View File
@@ -49,6 +49,14 @@ public:
bool isSilentRealm();
u8 getField_0x13792() const {
return field_0x13792;
}
u8 getField_0x1377E() const {
return field_0x1377E;
}
/* 0x00004 */ d2d::ResAccIf_c mResAcc;
/* 0x00374 */ d2d::LytBase_c mLyt;
/* 0x00404 */ d2d::AnmGroup_c mAnmGroups[34];
@@ -91,7 +99,13 @@ public:
/* 0x1373C */ mVec3_c mPos2;
/* 0x13748 */ u8 field_0x13748[0x13750 - 0x13748];
/* 0x13750 */ s32 field_0x13750;
/* 0x13754 */ u8 field_0x13754[0x137B4 - 0x13754];
/* 0x13754 */ u8 field_0x13754[0x13770 - 0x13754];
/* 0x13770 */ u8 field_0x13770;
/* 0x13771 */ u8 field_0x13771[0x1377E - 0x13771];
/* 0x1377E */ u8 field_0x1377E;
/* 0x1377F */ u8 field_0x1375F[0x13792 - 0x1377F];
/* 0x13792 */ u8 field_0x13792;
/* 0x13793 */ u8 field_0x13793[0x137B4 - 0x13793];
/* 0x137B4 */ mVec3_c mPos3;
/* 0x137C0 */ u32 field_0x137C0;
};
@@ -110,6 +124,7 @@ STATIC_ASSERT(offsetof(dLytMeter_c, mRemoCon) == 0x12350);
STATIC_ASSERT(offsetof(dLytMeter_c, mNunBg) == 0x12440);
STATIC_ASSERT(offsetof(dLytMeter_c, mHeart) == 0x12608);
STATIC_ASSERT(offsetof(dLytMeter_c, mShield) == 0x12DA4);
STATIC_ASSERT(offsetof(dLytMeter_c, field_0x137C0) == 0x137C0);
// made up name
class dLytMeterContainer_c {
@@ -123,10 +138,6 @@ public:
bool remove();
bool draw();
bool checkFlag(u32 flag) {
return (mFlags & flag) == flag;
}
static dLytMeterContainer_c *GetInstance() {
return sInstance;
}
@@ -135,6 +146,10 @@ public:
return &sInstance->mMeter;
}
u8 getMeterField_0x13770() const {
return mMeter.field_0x13770;
}
bool checkAllFlags(u32 mask) const {
return (mFlags & mask) == mask;
}
+1 -1
View File
@@ -17,7 +17,7 @@ public:
virtual d2d::LytBase_c *getLyt() override {
return &mLyt;
}
virtual const char *getName() const {
virtual const char *getName() const override {
return mLyt.getName();
}
+71 -19
View File
@@ -1,6 +1,7 @@
#ifndef D_LYT_METER_ITEM_SELECT_H
#define D_LYT_METER_ITEM_SELECT_H
#include "d/a/d_a_itembase.h"
#include "d/lyt/d2d.h"
#include "d/lyt/d_lyt_common_icon_item.h"
#include "d/lyt/d_textbox.h"
@@ -49,6 +50,10 @@ public:
mpAnm = anim;
}
void setShouldBeSelect(u32 v) {
mShouldBeSelect = v;
}
private:
STATE_FUNC_DECLARE(dLytMeterItemSelectBlink_c, Wait);
STATE_FUNC_DECLARE(dLytMeterItemSelectBlink_c, On);
@@ -73,6 +78,10 @@ public:
mpAnm = anim;
}
void setShouldBeSelect(u32 v) {
mShouldBeSelect = v;
}
private:
STATE_FUNC_DECLARE(dLytMeterItemSelectText_c, Wait);
STATE_FUNC_DECLARE(dLytMeterItemSelectText_c, On);
@@ -95,7 +104,7 @@ public:
void setVisible(bool bVisible);
void setVisible2(bool bVisible);
void execute();
bool isSettled() const;
void setAnm(d2d::AnmGroup_c *anim) {
@@ -114,6 +123,14 @@ public:
return mShouldBeVisible;
}
bool getInstant() const {
return mInstant;
}
void setOwnerPane(nw4r::lyt::Pane *p) {
mpPane2 = p;
}
private:
STATE_FUNC_DECLARE(dLytMeterItemSelectBtn_c, Invisible);
STATE_FUNC_DECLARE(dLytMeterItemSelectBtn_c, On);
@@ -140,24 +157,59 @@ public:
virtual bool build(d2d::ResAccIf_c *resAcc) override;
virtual bool remove() override;
virtual bool execute() override;
virtual nw4r::lyt::Pane *getPane() override;
virtual d2d::LytBase_c *getLyt() override;
virtual const char *getName() const 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 ~dLytMeterItemSelect_c() {}
static bool isInSpiralChargeTutorialMinigame();
static bool isInRollercoasterMinigame();
void fn_800EF580();
void fn_800EF6B0(u8);
void setOwnerPane(nw4r::lyt::Pane *p);
void fn_800EF710(u8);
void fn_800EF720(s32);
void fn_800EF7A0(bool, s32);
bool fn_800EFDF0(bool b) const;
bool fn_800F02F0() const;
bool fn_800F0220(s32 arg);
private:
void fn_800F0680(u8);
s32 fn_800F0990(u8);
s32 fn_800F07D0(s32);
void fn_800EFAD0(s32, bool);
void fn_800EF7C0();
void fn_800EF8C0(u8);
bool fn_800F09E0();
void fn_800F0440(s32);
void fn_800F0700();
bool fn_800F01B0(s32);
bool fn_800F01E0(s32);
void setBtnItem(s32 unkId);
void realizeSelectedWheelItem();
void fn_800EF8C0(bool);
bool isWheelBlockedByCurrentAction();
void setBtnText(s32);
bool fn_800F01B0(s32) const;
bool fn_800F01E0(s32) const;
bool isSlotBocoburinLocked(s32);
void fn_800F0310();
bool fn_800F0030() const;
s32 fn_800F0170(s32) const;
u8 fn_800F0190(s32) const;
bool isWheelIndexLocked(s32 idx);
void realizeWheelItems();
void realizeWheelNumberForLytIndex(s32 iconIdx, s32 lytItemIdx);
void realizeBtnNumberForLytIndex(s32 iconIdx, bool);
void realizeWheelNumberVForLytIndex(s32 iconIdx, s32 lytItemIdx);
void setCurrentItemText(ITEM_ID item);
static ITEM_ID getBaseItemForBWheelSlot(s32 idx);
ITEM_ID baseItemIdToCurrentVariant(ITEM_ID baseItem) const;
s32 baseItemLytIndexToCurrentVariant(s32 lytIndex) const;
s32 getBaseItemLytIndexforUnkId(s32 idx) const;
STATE_FUNC_DECLARE(dLytMeterItemSelect_c, InitWait);
STATE_FUNC_DECLARE(dLytMeterItemSelect_c, Wait);
@@ -192,7 +244,7 @@ private:
/* 0x0DA4 */ nw4r::lyt::Pane *mpPanes[17];
/* 0x0DE8 */ nw4r::lyt::Pane *mpSomePane;
/* 0x0DE8 */ nw4r::lyt::Pane *mpOwnerPane;
/* 0x0DEC */ dTextBox_c *mpTextBoxes[10];
/* 0x0E14 */ dWindow_c *mpWindows[4];
/* 0x0E24 */ dTextBox_c *mpSizeBoxes[4];
@@ -206,7 +258,7 @@ private:
/* 0x5754 */ s32 field_0x5754;
/* 0x5758 */ s32 field_0x5758;
/* 0x575C */ s32 field_0x575C;
/* 0x5760 */ s32 field_0x5760;
/* 0x5760 */ s32 mDemoMoveTimer;
/* 0x5764 */ s32 field_0x5764;
/* 0x5768 */ s32 field_0x5768;
/* 0x576C */ s32 field_0x576C;
@@ -234,8 +286,8 @@ private:
/* 0x57A0 */ u8 field_0x57A0;
/* 0x57A1 */ u8 field_0x57A1;
/* 0x57A2 */ u8 field_0x57A2;
/* 0x57A3 */ u8 field_0x57A3[8];
/* 0x57AB */ u8 field_0x57AB[8];
/* 0x57A3 */ bool field_0x57A3[8];
/* 0x57AB */ bool mIsBocoburinLocked[8];
/* 0x57B3 */ u8 field_0x57B3;
/* 0x57B4 */ u8 field_0x57B4;
/* 0x57B5 */ u8 field_0x57B5;
@@ -8,9 +8,9 @@ public:
GoddessChestCounter() : Counter(0x43F) {}
virtual ~GoddessChestCounter() {};
virtual u16 getCommittedValue() override;
virtual u16 getMax() override;
virtual u16 getUncommittedValue() override;
virtual u16 getCommittedValue() const override;
virtual u16 getMax() const override;
virtual u16 getUncommittedValue() const override;
virtual void setValue(u16 num) override;
static GoddessChestCounter sInstance;
+6
View File
@@ -28,8 +28,14 @@ public:
void fn_80029980(u16 effect, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, void *, void *);
void fn_800299F0(u16 effect, mMtx_c *mtx, void *, void *);
void fn_80029A10(u16 effect, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, void *, void *);
void fn_80029A70(u16 effect, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, void *, void *);
void setMtx(const mMtx_c &);
static void fn_800298C0(u16 effect, mVec3_c *pos, void*, void*, void*, void*);
void fn_80026ED0();
void fn_80026F10();
bool checkField0x00() const {
return field_0x00 != 0;
}