This commit is contained in:
robojumper
2025-08-09 01:18:43 +02:00
parent 2dd4f06992
commit e7495a950e
18 changed files with 1954 additions and 190 deletions
+1
View File
@@ -68,6 +68,7 @@ public:
static s32 getRupeeCounter();
static u32 getCurrentWalletCapacity();
static u32 getExtraWalletCount();
static u32 getHeartContainerHealthCount();
static u32 getGratitudeCrystalCount();
+3
View File
@@ -58,6 +58,9 @@ public:
void setBeetleBackAnim();
s32 getBeetleWarningTimeLeft();
// Item Selection functions
static s32 calcItemWheelSelection(bool reset, s32 numOptions);
public:
f32 getField_0x4564() const {
return field_0x4564;
+21 -7
View File
@@ -79,6 +79,20 @@ protected:
u32 mFlags;
};
/**
* A layout with some utility functions, and a system
* for integrating LibMS text into NW4R's LYT.
*
* * If a TextBox has an integer userdatum "embed", this sets the text identified by the
* LibMS label of the same name as the text box (e.g. `T_back_00`)
* * If the integer is non-zero (it always seems to be for Skyward Sword!),
* `:00` is appended to the label name (e.g. `T_back_00:00`).
* * Game code can call a function to reload this text with a custom integer to select
* a specific variant. E.g. `T_newFile_00:00` -> "New Adventure", `T_newFile_00:01` -> "Hero Mode"
* * If a TextBox has a string userdatum "copy", the value identifies another textbox
* whose name is used instead. This is often used for text shadow, where a separate
* textbox is used for the shadow.
*/
class LytBase_c : public Multi_c {
public:
LytBase_c();
@@ -93,8 +107,8 @@ public:
dWindow_c *getWindow(const char *name);
nw4r::lyt::Group *findGroupByName(const char *name);
bool fn_800AB940(const char *name, int arg);
bool fn_800AB9A0(dTextBox_c *textbox, int arg);
bool loadTextVariant(const char *name, int arg);
bool loadTextVariant(dTextBox_c *textbox, int arg);
bool fn_800ABE50(dTextBox_c *textbox, wchar_t *destBuf, u32 maxLen);
@@ -102,16 +116,16 @@ private:
void setPropertiesRecursive(nw4r::lyt::Pane *pane, f32, f32, f32, f32, f32);
void setProperties(nw4r::lyt::Pane *pane, f32, f32, f32, f32, f32);
dTextBox_c *getTextBoxViaUserData(nw4r::lyt::Pane *pane, const char *name);
bool fn_800ABB80(dTextBox_c *textbox1, dTextBox_c *textbox2, int arg);
bool fn_800ABCE0(const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *textbox1, dTextBox_c *textbox2, int arg);
bool loadTextVariantCopy(dTextBox_c *targetTextBox, dTextBox_c *sourceTextBox, int arg);
bool setText(const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *targetTextBox, dTextBox_c *sourceTextBox, int arg);
bool fn_800AC040(dTextBox_c *textbox1, dTextBox_c *textbox2, wchar_t *destBuf, u32 maxLen);
bool fn_800AC040(dTextBox_c *targetTextBox, dTextBox_c *sourceTextBox, wchar_t *destBuf, u32 maxLen);
bool fn_800AC1AC(
const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *textbox1, dTextBox_c *textbox2, wchar_t *destBuf,
const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *targetTextBox, dTextBox_c *sourceTextBox, wchar_t *destBuf,
u32 maxLen
);
MsbtInfo *getMsbtInfo() const;
bool fn_800AB930(dTextBox_c *box);
bool loadText(dTextBox_c *box);
/* 0x8C */ MsbtInfo *mpMsbtInfo;
};
+6 -1
View File
@@ -25,6 +25,10 @@ public:
return field_0x15C2C;
}
s32 getPauseDisp00Tab() const {
return mPauseDisp00Tab;
}
u16 getItemForPauseDemo() const {
return mItemForPauseDemo;
}
@@ -56,8 +60,9 @@ private:
/* 0x000A4 */ u8 _0x000A4[0x15C2C - 0x000A4];
/* 0x15C2C */ s32 field_0x15C2C;
/* 0x15C30 */ s32 mPauseDisp00Tab;
/* 0x15C30 */ u8 _0x15C23[0x15C60 - 0x15C30];
/* 0x15C34 */ u8 _0x15C34[0x15C60 - 0x15C34];
/* 0x15C60 */ u16 mItemForPauseDemo;
+33 -5
View File
@@ -3,7 +3,7 @@
#include "d/lyt/d2d.h"
#include "egg/gfx/eggCpuTexture.h"
#include "nw4r/lyt/lyt_pane.h"
#include "nw4r/lyt/lyt_bounding.h"
class dLytPauseMgr_c {
public:
@@ -31,6 +31,10 @@ public:
return field_0x0832;
}
bool getField_0x0838() const {
return field_0x0838;
}
bool getField_0x083B() const {
return field_0x083B;
}
@@ -45,7 +49,13 @@ public:
bool isStateWait() const;
s32 getCurrentDisp00Tab() const {
return mCurrentDisp00Tab;
}
enum SelectionType_e {
SELECT_BWHEEL = 0,
SELECT_POUCH = 1,
SELECT_DOWSING = 2,
SELECT_INSECT = 4,
SELECT_QUEST_MATERIAL = 5,
@@ -69,8 +79,19 @@ public:
return mCurrentSelectionId;
}
nw4r::lyt::Pane *getArrowBounding(int idx) const;
nw4r::lyt::Pane *setSelectedArrowBounding(int idx) const;
u8 getCurrentSelectionTab() const {
return mCurrentSelectionTab;
}
void setCurrentSelectionTab(u8 tab) {
mCurrentSelectionTab = tab;
}
nw4r::lyt::Bounding *getArrowBounding(int idx) const;
void setSelectedArrowBounding(int idx) const;
static f32 sDisp00ArrowRotation;
static f32 sDisp00ArrowLength;
private:
static dLytPauseMgr_c *sInstance;
@@ -85,7 +106,9 @@ private:
/* 0x0814 */ EGG::CpuTexture *mpBgTexture;
/* 0x0818 */ SelectionType_e mCurrentSelectionType;
/* 0x081C */ u8 _0x081C[0x082C - 0x081C];
/* 0x081C */ u8 _0x081C[0x0820 - 0x081C];
/* 0x0820 */ s32 mCurrentDisp00Tab;
/* 0x0824 */ u8 _0x0824[0x082C - 0x0824];
/* 0x082C */ u16 mCurrentSelectionId;
@@ -93,9 +116,14 @@ private:
/* 0x0831 */ bool field_0x0831;
/* 0x0832 */ bool field_0x0832;
/* 0x0833 */ u8 mCurrentSelectionTab;
/* 0x0832 */ u8 _0x0832[0x083B - 0x0833];
/* 0x0834 */ u8 _0x0834[0x0838 - 0x0834];
/* 0x0838 */ bool field_0x0838;
/* 0x0839 */ u8 _0x0839[0x083B - 0x0839];
/* 0x083B */ bool field_0x083B;
/* 0x083C */ u8 _0x083C[0x083E - 0x083C];
+66 -9
View File
@@ -4,6 +4,7 @@
#include "d/d_cursor_hit_check.h"
#include "d/lyt/d2d.h"
#include "d/lyt/d_lyt_common_icon_item.h"
#include "nw4r/lyt/lyt_bounding.h"
#include "s/s_State.hpp"
class dLytPauseDisp00_c {
@@ -11,7 +12,10 @@ public:
dLytPauseDisp00_c();
virtual ~dLytPauseDisp00_c() {}
void init();
bool build();
bool remove();
bool execute();
bool draw();
STATE_FUNC_DECLARE(dLytPauseDisp00_c, None);
STATE_FUNC_DECLARE(dLytPauseDisp00_c, In);
@@ -22,15 +26,68 @@ public:
STATE_FUNC_DECLARE(dLytPauseDisp00_c, Out);
private:
void displayElement(int idx, float value);
void setAnm(int idx, f32 value);
void stopAnm(int idx);
void playBackwards(d2d::AnmGroup_c &anm);
STATE_MGR_DECLARE(dLytPauseDisp00_c);
d2d::LytBase_c mLytBase;
d2d::AnmGroup_c field_0x00D0[0x7E];
dLytCommonIconItem_c field_0x2050[0x18];
/* 0xE110 */ d2d::SubPaneList mSubpanes;
d2d::SubPaneListNode field_0xE11C[0x18];
dCursorHitCheckLyt_c field_0xE29C;
// Initial setup
void setupDisp();
void setupInventoryWheel();
void setupHeartPieces();
void setupWallets();
void setupMitts();
void setupSailcloth();
void setupWaterDragonScale();
void setupFireshieldEarrings();
void setupSongsAndLifeTree();
void setupTabletTriforce();
void setupSword();
void setupStoneOfTrials();
// Dynamic setup
void setupRingIcons(s32 tab);
s32 updateSelection();
s32 getPointerPane() const;
void hideItemIcons();
enum LoadRingTextCmd_e {
RING_TEXT_RELEASE_TO_CONFIRM = 0,
RING_TEXT_INITIAL_TAB = 1,
RING_TEXT_CURRENT_TAB = 2,
};
void executeCall();
void playOnOffTabAnim();
void loadRingText(u32 cmd);
/* 0x0004 */ STATE_MGR_DECLARE(dLytPauseDisp00_c);
/* 0x0040 */ d2d::LytBase_c mLyt;
/* 0x00D0 */ d2d::AnmGroup_c mAnm[126];
/* 0x2050 */ dLytCommonIconItem_c mIcons[24];
/* 0xE110 */ d2d::SubPaneList mSubpaneList;
/* 0xE11C */ d2d::SubPaneListNode mSubpanes[24];
/* 0xE29C */ dCursorHitCheckLyt_c mCsHitCheck;
/* 0xE2C4 */ nw4r::lyt::Bounding *mpBoundings[37];
/* 0xE358 */ s32 mStep;
/* 0xE35C */ s32 mPrevNavTarget;
/* 0xE360 */ s32 mCurrentNavTarget;
/* 0xE364 */ s32 mCallTimerMaybe;
/* 0xE368 */ s32 mGetDemoTimer;
/* 0xE36C */ bool mInRequest;
/* 0xE36D */ bool mOutRequest;
/* 0xE36E */ bool field_0xE36E;
/* 0xE36F */ bool mIsVisible;
/* 0xE370 */ bool mDoScrollAnim;
/* 0xE371 */ bool field_0xE371;
/* 0xE372 */ bool mSelectToggleRequest;
/* 0xE373 */ bool mSelectGuideRequest;
/* 0xE374 */ bool mStopCallRequest;
/* 0xE375 */ bool mSelectMplsRequest;
/* 0xE376 */ bool field_0xE376;
/* 0xE377 */ bool mRingToggleRequest;
};
#endif
+1 -1
View File
@@ -67,7 +67,7 @@ private:
/* 0x98BC */ s32 mStep;
/* 0x98C0 */ s32 mPrevNavTarget;
/* 0x98C4 */ s32 mCurrentNavTarget;
/* 0x98C8 */ s32 mTimer;
/* 0x98C8 */ s32 mGetDemoTimer;
/* 0x98CC */ bool mInRequest;
/* 0x98CD */ bool mOutRequest;
/* 0x98CE */ bool field_0x98CE;
+51 -1
View File
@@ -5,6 +5,41 @@
#include "sized_string.h"
#include "toBeSorted/dowsing_target.h"
enum LytItemNumberColor_e {
LYT_ITEM_COLOR_GOLD = 0,
LYT_ITEM_COLOR_RED = 1,
LYT_ITEM_COLOR_GREEN = 2,
LYT_ITEM_COLOR_NONE = 3,
};
enum SongLifeTreeSeedStatus_e {
SONG_LIFETREE_NONE = 0,
SONG_LIFETREE_HAS_SOTH_PARTS_OR_SEED = 1,
SONG_LIFETREE_HAS_SOTH = 2,
};
u8 getSongLifeTreeStatus();
/** 0: no sword, 6: TMS */
s32 getCurrentSwordLevel();
bool isSwordRestrictedBokoBase();
u16 getTabletItemIdForIndex(s32 index);
u16 getTriforceItemIdForIndex(s32 index);
bool hasGoddessHarp();
bool hasSong(s32 index);
bool hasWaterDragonScale();
bool isWaterDragonScaleRestricted();
bool hasSailcloth();
s32 getCurrentMittsLevel();
bool isMittsRestricted();
void getItemLabel(s32 itemId, SizedString<32> &buf);
void getCaptionItemLabel(s32 itemId, SizedString<32> &buf);
void getDowsingLabel(s32 itemId, SizedString<32> &buf);
@@ -17,15 +52,30 @@ const wchar_t *getPauseCategoryText(s32 itemId);
bool isPouchBocoburinLocked();
// TODO - these return types may require some work
u8 getPouchItemForSlot(s32 slot, bool unk);
bool hasPouchSlot(s32 slot, bool unk);
s32 getPouchItemAmount(s32 slot, bool unk);
u8 getPouchItemNumberColor(s32 slot, bool unk);
f32 getShieldDurability(s32 slot, bool unk);
u32 getPouchItemIdForIndex(s32 slot, bool unk);
// TODO - rename and make sense of these
DowsingTarget::DowsingSlot dowsingSlotForIndex(s32 index);
s32 getLytIndexForDowsingIndex(s32 index);
u8 getLytIndexForDowsingIndex(s32 index);
u16 getDowsingItemIdForIndex(s32 index);
bool hasDowsingInIndex(s32 index);
// B-Wheel
s32 getBWheelSlotForIndex(s32 index);
bool isBWheelIndexWithNumber(s32 index);
s32 getNumberForBWheelIndex(s32 index);
s32 getItemLevelForBWheelIndex(s32 index);
u8 getLytItemIdForBWheelIndex(s32 index);
bool isBWheelIndexBocoburinLocked(s32 index, bool unk);
u8 getNumberColorForBWheelIndex(s32 index);
u16 getBWheelItemIdForIndex(s32 index);
/**
* FR: -1, 0, 1 singular, else plural
@@ -213,8 +213,8 @@ private:
void fn_800EF8C0(bool);
bool isWheelBlockedByCurrentAction();
void setBtnText(s32);
bool fn_800F01B0(s32) const;
bool fn_800F01E0(s32) const;
bool hasBWheelItem(s32) const;
bool isBocoburinLocked(s32) const;
bool isSlotBocoburinLocked(s32);
void fn_800F0310();
bool fn_800F0030() const;
+5 -1
View File
@@ -104,7 +104,7 @@ struct SizedString {
template <size_t Size>
struct SizedWString {
SizedWString() {
mChars[0] = '\0';
mChars[0] = L'\0';
}
wchar_t mChars[Size];
@@ -117,6 +117,10 @@ struct SizedWString {
return mChars;
}
void empty() {
mChars[0] = L'\0';
}
int sprintf(const wchar_t *fmt, ...) {
va_list args;
va_start(args, fmt);