mirror of
https://github.com/zeldaret/ss
synced 2026-05-28 00:15:59 -04:00
Merge pull request #228 from robojumper/lyt-pause-components
More pause menu UI components
This commit is contained in:
@@ -1002,7 +1002,7 @@ d/lyt/d_lyt_deposit_stock.cpp:
|
||||
|
||||
d/lyt/d_lyt_deposit_box.cpp:
|
||||
.text start:0x801578B0 end:0x80158288 align:16
|
||||
.rodata start:0x804E8218 end:0x804E8258
|
||||
.rodata start:0x804E8218 end:0x804E8228
|
||||
.data start:0x80524BC8 end:0x80524CD0
|
||||
.sdata start:0x80572990 end:0x80572998
|
||||
.sdata2 start:0x8057A060 end:0x8057A078
|
||||
@@ -1010,6 +1010,7 @@ d/lyt/d_lyt_deposit_box.cpp:
|
||||
d/lyt/d_lyt_boss_gauge.cpp:
|
||||
.text start:0x80158290 end:0x80158E78 align:16
|
||||
.ctors start:0x804DB790 end:0x804DB794
|
||||
.rodata start:0x804E8228 end:0x804E8248
|
||||
.data start:0x80524CD0 end:0x80524ED0
|
||||
.sdata start:0x80572998 end:0x805729A0
|
||||
.sbss start:0x805754F0 end:0x805754F8
|
||||
@@ -1019,6 +1020,7 @@ d/lyt/d_lyt_boss_gauge.cpp:
|
||||
d/lyt/d_lyt_pause_back.cpp:
|
||||
.text start:0x80158E80 end:0x80159E78 align:16
|
||||
.ctors start:0x804DB794 end:0x804DB798
|
||||
.rodata start:0x804E8248 end:0x804E8258
|
||||
.data start:0x80524ED0 end:0x80525138
|
||||
.sdata2 start:0x8057A090 end:0x8057A098
|
||||
.bss start:0x805B1570 end:0x805B1670
|
||||
@@ -1044,7 +1046,7 @@ d/lyt/d_lyt_pause_disp_01.cpp:
|
||||
d/lyt/d_lyt_pause_info.cpp:
|
||||
.text start:0x80161FA0 end:0x80163568 align:16
|
||||
.ctors start:0x804DB7A0 end:0x804DB7A4
|
||||
.rodata start:0x804E8B30 end:0x804E8B60
|
||||
.rodata start:0x804E8B30 end:0x804E8B48
|
||||
.data start:0x80526610 end:0x80526880
|
||||
.sdata2 start:0x8057A0F8 end:0x8057A100
|
||||
.bss start:0x805B19B0 end:0x805B1AB0
|
||||
@@ -1052,6 +1054,7 @@ d/lyt/d_lyt_pause_info.cpp:
|
||||
d/lyt/d_lyt_pause_text.cpp:
|
||||
.text start:0x80163570 end:0x80164F88 align:16
|
||||
.ctors start:0x804DB7A4 end:0x804DB7A8
|
||||
.rodata start:0x804E8B48 end:0x804E8B60
|
||||
.data start:0x80526880 end:0x80526D10
|
||||
.sdata start:0x805729C0 end:0x805729C8
|
||||
.sdata2 start:0x8057A100 end:0x8057A108
|
||||
@@ -1535,6 +1538,7 @@ d/lyt/d_lyt_pause.cpp:
|
||||
.text start:0x8027E9E0 end:0x80282678 align:16
|
||||
.ctors start:0x804DB85C end:0x804DB860
|
||||
.data start:0x80537310 end:0x80537970
|
||||
.sdata start:0x80573B48 end:0x80573B58
|
||||
.sbss start:0x80575938 end:0x80575948
|
||||
.bss start:0x805B5940 end:0x805B5D40
|
||||
|
||||
|
||||
+1008
-761
File diff suppressed because it is too large
Load Diff
+6
-6
@@ -545,15 +545,15 @@ config.libs = [
|
||||
Object(NonMatching, "d/lyt/d_lyt_deposit_stock.cpp"),
|
||||
Object(NonMatching, "d/lyt/d_lyt_deposit_box.cpp"),
|
||||
Object(NonMatching, "d/lyt/d_lyt_boss_gauge.cpp"),
|
||||
Object(NonMatching, "d/lyt/d_lyt_pause_back.cpp"),
|
||||
Object(Matching, "d/lyt/d_lyt_pause_back.cpp"),
|
||||
Object(NonMatching, "d/lyt/d_lyt_pause_disp_00.cpp"),
|
||||
Object(NonMatching, "d/lyt/d_lyt_pause_disp_01.cpp"),
|
||||
Object(NonMatching, "d/lyt/d_lyt_pause_info.cpp"),
|
||||
Object(NonMatching, "d/lyt/d_lyt_pause_text.cpp"),
|
||||
Object(Matching, "d/lyt/d_lyt_pause_disp_01.cpp"),
|
||||
Object(Matching, "d/lyt/d_lyt_pause_info.cpp"),
|
||||
Object(Matching, "d/lyt/d_lyt_pause_text.cpp"),
|
||||
Object(Matching, "d/lyt/d_lyt_save_msg_window.cpp"),
|
||||
Object(NonMatching, "d/lyt/d_lyt_util_items.cpp"),
|
||||
Object(Matching, "d/lyt/d_lyt_common_arrow.cpp"),
|
||||
Object(NonMatching, "d/lyt/d_lyt_common_title.cpp"),
|
||||
Object(Matching, "d/lyt/d_lyt_common_title.cpp"),
|
||||
Object(Matching, "d/lyt/d_lyt_cursor_stick.cpp"),
|
||||
Object(Matching, "toBeSorted/fi_context.cpp"),
|
||||
Object(NonMatching, "toBeSorted/item_mdl_name.cpp"),
|
||||
@@ -624,7 +624,7 @@ config.libs = [
|
||||
Object(NonMatching, "toBeSorted/d_a_npc_inv.cpp"),
|
||||
Object(NonMatching, "toBeSorted/d_a_npc_tke.cpp"),
|
||||
Object(NonMatching, "toBeSorted/d_a_npc_str.cpp"),
|
||||
Object(NonMatching, "d/lyt/d_lyt_pause.cpp"),
|
||||
Object(Matching, "d/lyt/d_lyt_pause.cpp"),
|
||||
Object(NonMatching, "d/lyt/d_lyt_game_over.cpp"),
|
||||
Object(NonMatching, "d/lyt/d_lyt_save_mgr.cpp"),
|
||||
Object(NonMatching, "d/lyt/d_lyt_drop_line.cpp"),
|
||||
|
||||
@@ -68,6 +68,10 @@ public:
|
||||
|
||||
static s32 getRupeeCounter();
|
||||
static u32 getCurrentWalletCapacity();
|
||||
static u32 getExtraWalletCount();
|
||||
|
||||
static u32 getHeartContainerHealthCount();
|
||||
static u32 getGratitudeCrystalCount();
|
||||
|
||||
static u32 getKeyPieceCount();
|
||||
static u32 getSmallKeyCount();
|
||||
@@ -94,7 +98,13 @@ public:
|
||||
|
||||
static void healLink(u32 amount, bool); // move to dAcPy_c
|
||||
|
||||
static bool isPerformingInitialCollection() {
|
||||
return sIsPerformingInitialCollection;
|
||||
}
|
||||
|
||||
private:
|
||||
static bool sIsPerformingInitialCollection;
|
||||
|
||||
/* 0x334 */ UNKTYPE *mpMdl; // Model has its own handling system
|
||||
/* 0x338 */ dShadowCircle_c mShdw;
|
||||
/* 0x340 */ mVec3_c mField_0x340;
|
||||
|
||||
@@ -148,7 +148,7 @@ enum ITEM_ID {
|
||||
/* 0x08C */ ITEM_BIG_BUG_NET = 140,
|
||||
/* 0x08D */ ITEM_FARON_GRASSHOPPER = 141,
|
||||
/* 0x08E */ ITEM_WOODLAND_RHINO_BEETLE = 142,
|
||||
/* 0x08F */ ITEM_DEKU_HORNET_ = 143,
|
||||
/* 0x08F */ ITEM_DEKU_HORNET = 143,
|
||||
/* 0x090 */ ITEM_SKYLOFT_MANTIS = 144,
|
||||
/* 0x091 */ ITEM_VOLCANIC_LADYBUG = 145,
|
||||
/* 0x092 */ ITEM_BLESSED_BUTTERFLY = 146,
|
||||
|
||||
@@ -58,6 +58,9 @@ public:
|
||||
void setBeetleBackAnim();
|
||||
s32 getBeetleWarningTimeLeft();
|
||||
|
||||
// Item select/equip/use functions [0x801E3160 - 0x801E7AD0] ?
|
||||
static s32 calcItemWheelSelection(bool reset, s32 numOptions);
|
||||
|
||||
public:
|
||||
f32 getField_0x4564() const {
|
||||
return field_0x4564;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "m/m2d.h"
|
||||
#include "m/m_angle.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "nw4r/lyt/lyt_pane.h"
|
||||
|
||||
class dCsBase_c : public dCs_c {
|
||||
public:
|
||||
@@ -39,6 +40,10 @@ public:
|
||||
return mCursorIf.getHit();
|
||||
}
|
||||
|
||||
dCursorInterface_c *getCursorIf() {
|
||||
return &mCursorIf;
|
||||
}
|
||||
|
||||
static dCsBase_c *GetInstance() {
|
||||
return sInstance;
|
||||
}
|
||||
@@ -47,6 +52,10 @@ public:
|
||||
mCursorStick.setShouldBeOn(visible);
|
||||
}
|
||||
|
||||
void setCursorStickTargetPane(const nw4r::lyt::Pane *target) {
|
||||
mCursorStick.setTargetPane(target);
|
||||
}
|
||||
|
||||
private:
|
||||
static dCsBase_c *sInstance;
|
||||
void setCurrentLyt(int lyt);
|
||||
|
||||
+11
-1
@@ -317,10 +317,14 @@ public:
|
||||
mCursorActive = val;
|
||||
}
|
||||
|
||||
// TODO - maybe a system for overriding cursor type
|
||||
void setNextCursorType(CursorType_e cs) {
|
||||
mNextCursor = 1;
|
||||
mNextCursor = true;
|
||||
mNextCursorType = cs;
|
||||
}
|
||||
void offNextCursor() {
|
||||
mNextCursor = false;
|
||||
}
|
||||
|
||||
void changeState(const sFStateID_c<lytItemCursor_c> &newState);
|
||||
|
||||
@@ -361,6 +365,12 @@ public:
|
||||
};
|
||||
|
||||
void setNextCursorType(lytItemCursor_c::CursorType_e);
|
||||
void setCursorTypeNoneMaybe();
|
||||
void setCursorTypePointer();
|
||||
|
||||
void offNextCursor() {
|
||||
mCursor.offNextCursor();
|
||||
}
|
||||
|
||||
static dCsGame_c *sInstance;
|
||||
|
||||
|
||||
+21
-1
@@ -38,13 +38,33 @@ inline bool isPointerVisible() {
|
||||
return sIsPointerVisible;
|
||||
}
|
||||
|
||||
inline bool isPrevPointerVisible() {
|
||||
return sPrevIsPointerVisible;
|
||||
}
|
||||
|
||||
inline bool isCursorStickVisible() {
|
||||
return sIsCursorStickVisible;
|
||||
}
|
||||
|
||||
inline s32 getFSStickNavDirection() {
|
||||
return sFSStickNavDirection;
|
||||
}
|
||||
|
||||
inline bool isMplsNavLeftGesture() {
|
||||
return sIsMplsNavLeftGesture;
|
||||
}
|
||||
|
||||
inline bool isMplsNavRightGesture() {
|
||||
return sIsMplsNavRightGesture;
|
||||
}
|
||||
|
||||
inline bool isMplsNavGesture() {
|
||||
return isMplsNavLeftGesture() || isMplsNavRightGesture();
|
||||
}
|
||||
|
||||
void init();
|
||||
void calc();
|
||||
void setNavEnabled(bool navEnabled, bool autoReturnToPointerNav);
|
||||
void setNavEnabled(bool navEnabled, bool disableAutoReturnToPointerNav);
|
||||
|
||||
// I really wish these returned enums but the codegen requires not-enums
|
||||
s32 getFSStickDirection();
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "d/d_bzs_types.h"
|
||||
#include "d/d_dylink.h"
|
||||
#include "d/d_fader.h"
|
||||
#include "egg/gfx/eggCpuTexture.h"
|
||||
#include "egg/gfx/eggScreen.h"
|
||||
#include "m/m_allocator.h"
|
||||
#include "m/m_dvd.h"
|
||||
@@ -78,6 +79,10 @@ public:
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
EGG::CpuTexture *getField_0x8898() {
|
||||
return field_0x8898;
|
||||
}
|
||||
|
||||
bool checkFlag0x88A0(u32 flag) const {
|
||||
return (field_0x88A0 & flag) != 0;
|
||||
}
|
||||
@@ -190,7 +195,10 @@ private:
|
||||
/* 0x8694 */ dTimeAreaMgr_c mTimeAreaMgr;
|
||||
|
||||
// ...
|
||||
u8 ___[446];
|
||||
u8 ___[438];
|
||||
/* 0x8898 */ EGG::CpuTexture *field_0x8898;
|
||||
|
||||
u8 _0x889C[4];
|
||||
|
||||
/* 0x88A0 */ u32 field_0x88A0;
|
||||
/* 0x88A4 */ SizedString<16> mDemoName;
|
||||
|
||||
+21
-7
@@ -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;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef D_LYT_BASE_H
|
||||
#define D_LYT_BASE_H
|
||||
|
||||
#include "common.h"
|
||||
#include "d/d_base.h"
|
||||
#include "m/m_allocator.h"
|
||||
|
||||
class dLytBase_c : public dBase_c {
|
||||
public:
|
||||
dLytBase_c();
|
||||
virtual ~dLytBase_c();
|
||||
|
||||
/* 0x4C */ virtual bool build();
|
||||
|
||||
protected:
|
||||
bool allocateLytWork1Heap(const char *name, bool exp);
|
||||
void removeLyt();
|
||||
|
||||
private:
|
||||
/* 0x68 */ mHeapAllocator_c mAllocator;
|
||||
/* 0x84 */ UNKWORD field_0x84;
|
||||
/* 0x88 */ u8 field_0x88;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -14,6 +14,12 @@ public:
|
||||
dLytCommonArrow_c();
|
||||
virtual ~dLytCommonArrow_c() {}
|
||||
|
||||
enum Arrow_e {
|
||||
ARROW_LEFT = 0,
|
||||
ARROW_RIGHT = 1,
|
||||
ARROW_NONE = 2,
|
||||
};
|
||||
|
||||
bool build();
|
||||
|
||||
STATE_FUNC_DECLARE(dLytCommonArrow_c, None);
|
||||
@@ -29,31 +35,51 @@ public:
|
||||
bool requestIn();
|
||||
bool requestOut();
|
||||
|
||||
void unk() {
|
||||
field_0x6B8 = mPointedAtArrow;
|
||||
}
|
||||
|
||||
s32 getField_0x6B8() const {
|
||||
return field_0x6B8;
|
||||
}
|
||||
|
||||
nw4r::lyt::Bounding *getArrowBounding(s32 idx) const {
|
||||
return mpBoundings[idx];
|
||||
}
|
||||
|
||||
void setField_0x6B8(s32 v) {
|
||||
field_0x6B8 = v;
|
||||
}
|
||||
|
||||
void setBackwards(bool b) {
|
||||
mBackwards = b;
|
||||
}
|
||||
bool fn_80168760();
|
||||
|
||||
private:
|
||||
void setTranslate(const Vec *);
|
||||
bool fn_80168760();
|
||||
void displayElement(s32, f32);
|
||||
void unbindAt(s32);
|
||||
void tickDown(d2d::AnmGroup_c *);
|
||||
void fn_80168880();
|
||||
UI_STATE_MGR_DECLARE(dLytCommonArrow_c);
|
||||
void checkPointAtPane();
|
||||
|
||||
/* 0x04 */ UI_STATE_MGR_DECLARE(dLytCommonArrow_c);
|
||||
/* 0x40 */ d2d::LytBase_c mLytBase;
|
||||
d2d::ResAccIf_c mResAcc;
|
||||
d2d::AnmGroup_c mAnmGroups[0x9];
|
||||
d2d::AnmGroup_c mAnmGroups[9];
|
||||
dCursorHitCheckLyt_c mCsHitCheck;
|
||||
nw4r::lyt::Bounding *mBoundingL;
|
||||
nw4r::lyt::Bounding *mBoundingR;
|
||||
s32 mType;
|
||||
s32 field_0x6B4;
|
||||
s32 field_0x6B8;
|
||||
s32 field_0x6BC;
|
||||
s32 field_0x6C0;
|
||||
s32 mTimer;
|
||||
u8 mInRequested;
|
||||
u8 mOutRequested;
|
||||
u8 field_0x6CA;
|
||||
u8 field_0x6CB;
|
||||
u8 field_0x6CC;
|
||||
/* 0x6A8 */ nw4r::lyt::Bounding *mpBoundings[2];
|
||||
/* 0x6B0 */ s32 mType;
|
||||
/* 0x6B4 */ s32 mPointedAtArrow;
|
||||
/* 0x6B8 */ s32 field_0x6B8;
|
||||
/* 0x6BC */ s32 field_0x6BC;
|
||||
/* 0x6C0 */ s32 field_0x6C0;
|
||||
/* 0x6C4 */ s32 mTimer;
|
||||
/* 0x6C8 */ bool mInRequested;
|
||||
/* 0x6C9 */ bool mOutRequested;
|
||||
/* 0x6CA */ bool mIsChangingState;
|
||||
/* 0x6CB */ bool mVisible;
|
||||
/* 0x6CC */ bool mBackwards;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -15,6 +15,24 @@
|
||||
#define LYT_CMN_BugLanayruAnt (10) // [10] tr_bugIcon_10.tpl
|
||||
#define LYT_CMN_BugEldinRoller (11) // [11] tr_bugIcon_11.tpl
|
||||
|
||||
// Treasure
|
||||
#define LYT_CMN_HORNET_LARVAE (0) // [ 1] uk_soaHachisu_00.tpl
|
||||
#define LYT_CMN_BIRD_FEATHER (1) // [ 2] uk_sobHaneA_00.tpl
|
||||
#define LYT_CMN_TUMBLEWEED (2) // [ 3] uk_socTumble_00.tpl
|
||||
#define LYT_CMN_LIZALFOS_TAIL (3) // [ 0] tr_sozaiIcon_03.tpl
|
||||
#define LYT_CMN_ELDIN_ORE (4) // [ 4] uk_soeKoseki_00.tpl
|
||||
#define LYT_CMN_ANCIENT_FLOWER (5) // [ 5] uk_sofHana_00.tpl
|
||||
#define LYT_CMN_AMBER_RELIC (6) // [ 6] uk_sogMagatamaA_00.tpl
|
||||
#define LYT_CMN_DUSK_RELOC (7) // [ 7] uk_sohMagatamaB_00.tpl
|
||||
#define LYT_CMN_JELLY_BLOB (8) // [ 8] uk_soiPuyo_00.tpl
|
||||
#define LYT_CMN_MONSTER_CLAW (9) // [ 9] uk_sojClaw_00.tpl
|
||||
#define LYT_CMN_MONSTER_HORN (10) // [11] uk_solHorn_00.tpl
|
||||
#define LYT_CMN_ORNAMENTAL_SKULL (11) // [10] uk_sokDokuroA_00.tpl
|
||||
#define LYT_CMN_EVIL_CRYSTAL (12) // [12] uk_somEvil_00.tpl
|
||||
#define LYT_CMN_BLUE_BIRD_FEATHER (13) // [13] uk_sonHaneB_00.tpl
|
||||
#define LYT_CMN_GOLDEN_SKULL (14) // [14] uk_sooDokuroB_00.tpl
|
||||
#define LYT_CMN_GODDESS_PLUME (15) // [15] uk_sopGoddess_00.tpl
|
||||
|
||||
// Items
|
||||
#define LYT_CMN_ItemBombBag (0) // [ 8] uc_bomb_00.tpl
|
||||
#define LYT_CMN_ItemBow (1) // [ 9] uc_bowA_00.tpl
|
||||
@@ -34,7 +52,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_ItemInvalid (18) // -------------------------
|
||||
#define LYT_CMN_ItemInvalid (18) // -------------------------
|
||||
|
||||
// Pouch Items
|
||||
#define LYT_CMN_PouchPotionHealyh (0) // [12] uc_bottleKusuriA_00.tpl
|
||||
@@ -113,6 +131,6 @@
|
||||
#define LYT_CMN_DowsingZelda (19) // [13] tr_dauzTarget_19.tpl
|
||||
#define LYT_CMN_DowsingTrialGate (20) // [14] tr_dauzTarget_20.tpl
|
||||
#define LYT_CMN_DowsingNewPlantSpecies (21) // [15] tr_dauzTarget_21.tpl
|
||||
#define LYT_CMN_DowsingInvalid (22) // -------------------------
|
||||
#define LYT_CMN_DowsingInvalid (22) // -------------------------
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,26 +8,18 @@
|
||||
#include "nw4r/lyt/lyt_bounding.h"
|
||||
#include "s/s_State.hpp"
|
||||
|
||||
class dLytCommonIconMaterialPartBase_c {
|
||||
public:
|
||||
virtual ~dLytCommonIconMaterialPartBase_c() {}
|
||||
virtual nw4r::lyt::Pane *getPane() = 0;
|
||||
virtual d2d::LytBase_c *getLyt() = 0;
|
||||
virtual const char *getName() const = 0;
|
||||
};
|
||||
|
||||
/** Material - Bug */
|
||||
class dLytCommonIconMaterialPart1_c : public dLytCommonIconMaterialPartBase_c {
|
||||
class dLytCommonIconMaterialPart1_c {
|
||||
public:
|
||||
dLytCommonIconMaterialPart1_c() {}
|
||||
virtual ~dLytCommonIconMaterialPart1_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();
|
||||
}
|
||||
|
||||
@@ -78,17 +70,17 @@ private:
|
||||
};
|
||||
|
||||
/** Material - Treasure */
|
||||
class dLytCommonIconMaterialPart2_c : public dLytCommonIconMaterialPartBase_c {
|
||||
class dLytCommonIconMaterialPart2_c {
|
||||
public:
|
||||
dLytCommonIconMaterialPart2_c() {}
|
||||
virtual ~dLytCommonIconMaterialPart2_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();
|
||||
}
|
||||
|
||||
@@ -185,6 +177,9 @@ public:
|
||||
|
||||
const nw4r::lyt::Bounding *getBounding() const;
|
||||
|
||||
STATE_MGR_DEFINE_UTIL_CHANGESTATE(dLytCommonIconMaterial_c);
|
||||
STATE_MGR_DEFINE_UTIL_ISSTATE(dLytCommonIconMaterial_c);
|
||||
|
||||
private:
|
||||
STATE_FUNC_DECLARE(dLytCommonIconMaterial_c, None);
|
||||
STATE_FUNC_DECLARE(dLytCommonIconMaterial_c, In);
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
#ifndef D_LYT_COMMON_TITLE_H
|
||||
#define D_LYT_COMMON_TITLE_H
|
||||
|
||||
#include "common.h"
|
||||
#include "d/lyt/d2d.h"
|
||||
#include "s/s_State.hpp"
|
||||
#include "sized_string.h"
|
||||
|
||||
/**
|
||||
* 2D UI - Common - Title
|
||||
*
|
||||
* Used on title screen and pause menu.
|
||||
*/
|
||||
class dLytCommonTitle_c {
|
||||
public:
|
||||
dLytCommonTitle_c();
|
||||
virtual ~dLytCommonTitle_c() {}
|
||||
|
||||
bool build();
|
||||
bool remove();
|
||||
bool execute();
|
||||
bool draw();
|
||||
|
||||
enum SetMode_e {
|
||||
SET_00 = 0,
|
||||
SET_01 = 1,
|
||||
SET_CAPTION_IMMEDIATELY = 2,
|
||||
SET_OUT = 3,
|
||||
};
|
||||
|
||||
bool set(s32 arg, const char *title, const char *caption);
|
||||
const char *setSubTitle(s32 msgIdx);
|
||||
const char *setSysTitle(s32 msgIdx);
|
||||
const char *setSysCaption(s32 msgIdx);
|
||||
|
||||
void setField_0x680(UNKWORD val) {
|
||||
field_0x680 = val;
|
||||
}
|
||||
|
||||
void setInputInOut(bool inOut) {
|
||||
mInputInOut = inOut;
|
||||
}
|
||||
|
||||
private:
|
||||
void gotoStateNone();
|
||||
void startAnim(int idx);
|
||||
void stopAnim(int idx);
|
||||
void playBackwards(d2d::AnmGroup_c &anm);
|
||||
|
||||
void applyText();
|
||||
void applyTextChange(s32 arg);
|
||||
|
||||
void applyTitle(s32 arg);
|
||||
void applyCaption(s32 arg);
|
||||
|
||||
d2d::AnmGroup_c &getAnm(int idx) {
|
||||
return mAnm[idx];
|
||||
}
|
||||
|
||||
STATE_FUNC_DECLARE(dLytCommonTitle_c, None);
|
||||
STATE_FUNC_DECLARE(dLytCommonTitle_c, In);
|
||||
STATE_FUNC_DECLARE(dLytCommonTitle_c, Wait);
|
||||
STATE_FUNC_DECLARE(dLytCommonTitle_c, Out);
|
||||
STATE_FUNC_DECLARE(dLytCommonTitle_c, Change);
|
||||
|
||||
/* 0x004 */ UI_STATE_MGR_DECLARE(dLytCommonTitle_c);
|
||||
/* 0x040 */ d2d::LytBase_c mLyt;
|
||||
/* 0x0D0 */ d2d::ResAccIf_c mResAcc;
|
||||
/* 0x440 */ d2d::AnmGroup_c mAnm[8];
|
||||
/* 0x640 */ SizedString<0x20> mTitle;
|
||||
/* 0x660 */ SizedString<0x20> mCaption;
|
||||
|
||||
/* 0x680 */ UNKWORD field_0x680;
|
||||
/* 0x680 */ UNKWORD mSetMode;
|
||||
/* 0x688 */ s32 mStep;
|
||||
/* 0x68C */ bool mChangeRequest;
|
||||
/* 0x68D */ bool field_0x68D;
|
||||
/* 0x68E */ bool mVisible;
|
||||
/* 0x68F */ bool field_0x68F;
|
||||
/* 0x690 */ bool mInputInOut;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -16,11 +16,44 @@ public:
|
||||
void somehowRelatedToEnteringLightPillars(s32, s32, s32);
|
||||
|
||||
void fn_802CCD40(bool);
|
||||
void fn_802D04F0();
|
||||
|
||||
static dLytControlGame_c *getInstance() {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
s32 getCurrentPauseDisp() const {
|
||||
return mCurrentPauseDisp;
|
||||
}
|
||||
|
||||
void setCurrentPauseDisp(s32 value) {
|
||||
mCurrentPauseDisp = value;
|
||||
}
|
||||
|
||||
void setPauseDisp00Tab(s32 tab) {
|
||||
mPauseDisp00Tab = tab;
|
||||
}
|
||||
|
||||
s32 getPauseDisp00Tab() const {
|
||||
return mPauseDisp00Tab;
|
||||
}
|
||||
|
||||
u16 getItemForPauseDemo() const {
|
||||
return mItemForPauseDemo;
|
||||
}
|
||||
|
||||
u16 getItemCountForPauseDemo() const {
|
||||
return mItemCountForPauseDemo;
|
||||
}
|
||||
|
||||
bool isPauseDemo() const {
|
||||
return mIsPauseDemo;
|
||||
}
|
||||
|
||||
u8 getPauseDemoDisp() const {
|
||||
return mPauseDemoDisp;
|
||||
}
|
||||
|
||||
STATE_FUNC_DECLARE(dLytControlGame_c, Normal);
|
||||
STATE_FUNC_DECLARE(dLytControlGame_c, Pause_SetRes);
|
||||
STATE_FUNC_DECLARE(dLytControlGame_c, Pause_SyncRes);
|
||||
@@ -37,7 +70,21 @@ public:
|
||||
|
||||
private:
|
||||
/* 0x00068 */ UI_STATE_MGR_DECLARE(dLytControlGame_c);
|
||||
|
||||
/* 0x000A4 */ u8 _0x000A4[0x15C2C - 0x000A4];
|
||||
|
||||
/* 0x15C2C */ s32 mCurrentPauseDisp;
|
||||
/* 0x15C30 */ s32 mPauseDisp00Tab;
|
||||
|
||||
/* 0x15C34 */ u8 _0x15C34[0x15C60 - 0x15C34];
|
||||
|
||||
/* 0x15C60 */ u16 mItemForPauseDemo;
|
||||
|
||||
/* 0x15C62 */ u8 _0x15C62[0x15C64 - 0x15C62];
|
||||
|
||||
/* 0x15C64 */ u16 mItemCountForPauseDemo;
|
||||
/* 0x15C66 */ u8 field_0x15C66;
|
||||
/* 0x15C67 */ bool mIsPauseDemo;
|
||||
/* 0x15C68 */ u8 mPauseDemoDisp;
|
||||
|
||||
static dLytControlGame_c *sInstance;
|
||||
};
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
static bool drawDirectly();
|
||||
|
||||
void setPriority(u8 priority);
|
||||
void setTargetPane(nw4r::lyt::Pane *pane);
|
||||
void setTargetPane(const nw4r::lyt::Pane *pane);
|
||||
|
||||
void setShouldBeOn(bool value) {
|
||||
mShouldBeOn = value;
|
||||
@@ -47,7 +47,7 @@ private:
|
||||
/* 0x3AC */ d2d::dLytSub mLyt;
|
||||
/* 0x440 */ d2d::AnmGroup_c mAnm[1];
|
||||
/* 0x480 */ nw4r::lyt::Pane *mpPanes[5];
|
||||
/* 0x494 */ nw4r::lyt::Pane *mpTargetPane;
|
||||
/* 0x494 */ const nw4r::lyt::Pane *mpTargetPane;
|
||||
/* 0x498 */ bool mShouldBeOn;
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,273 @@
|
||||
#ifndef D_LYT_PAUSE_H
|
||||
#define D_LYT_PAUSE_H
|
||||
|
||||
#include "common.h"
|
||||
#include "d/lyt/d2d.h"
|
||||
#include "d/lyt/d_lyt_base.h"
|
||||
#include "egg/gfx/eggCpuTexture.h"
|
||||
#include "egg/gfx/eggTextureBuffer.h"
|
||||
#include "nw4r/lyt/lyt_bounding.h"
|
||||
#include "s/s_State.hpp"
|
||||
|
||||
class dLytPauseBack_c;
|
||||
class dLytPauseInfo_c;
|
||||
class dLytPauseText_c;
|
||||
class dLytCommonArrow_c;
|
||||
class dLytPauseDisp00_c;
|
||||
class dLytPauseDisp01_c;
|
||||
|
||||
class dLytPauseMain_c {
|
||||
public:
|
||||
dLytPauseMain_c();
|
||||
virtual ~dLytPauseMain_c() {}
|
||||
|
||||
bool build();
|
||||
bool remove();
|
||||
bool execute();
|
||||
bool draw();
|
||||
void drawDirectly();
|
||||
|
||||
void loadBgTextureUnused();
|
||||
void loadBgTexture();
|
||||
|
||||
void requestIn();
|
||||
void requestOut();
|
||||
void requestChange();
|
||||
void requestSelect();
|
||||
void requestRingToggle();
|
||||
|
||||
bool hasSelection() const;
|
||||
void updateTitle();
|
||||
|
||||
bool isChangingState() const {
|
||||
return mIsChangingState;
|
||||
}
|
||||
|
||||
dLytCommonArrow_c *getArrow() const {
|
||||
return mpArrow;
|
||||
}
|
||||
|
||||
private:
|
||||
STATE_FUNC_DECLARE(dLytPauseMain_c, None);
|
||||
STATE_FUNC_DECLARE(dLytPauseMain_c, In);
|
||||
STATE_FUNC_DECLARE(dLytPauseMain_c, Wait);
|
||||
STATE_FUNC_DECLARE(dLytPauseMain_c, Change);
|
||||
STATE_FUNC_DECLARE(dLytPauseMain_c, Select);
|
||||
STATE_FUNC_DECLARE(dLytPauseMain_c, Ring);
|
||||
STATE_FUNC_DECLARE(dLytPauseMain_c, GetDemo);
|
||||
STATE_FUNC_DECLARE(dLytPauseMain_c, Out);
|
||||
|
||||
/* 0x04 */ UI_STATE_MGR_DECLARE(dLytPauseMain_c);
|
||||
/* 0x40 */ dLytPauseBack_c *mpPauseBack;
|
||||
/* 0x44 */ dLytPauseDisp00_c *mpDisp00;
|
||||
/* 0x48 */ dLytPauseDisp01_c *mpDisp01;
|
||||
/* 0x4C */ dLytPauseInfo_c *mpPauseInfo;
|
||||
/* 0x50 */ dLytPauseText_c *mpPauseText;
|
||||
/* 0x54 */ dLytCommonArrow_c *mpArrow;
|
||||
/* 0x58 */ s32 mTimer;
|
||||
/* 0x5C */ s32 mStep;
|
||||
/* 0x60 */ u8 mPartStateChangeFlags;
|
||||
/* 0x61 */ bool mInRequest;
|
||||
/* 0x62 */ bool mOutRequest;
|
||||
/* 0x63 */ bool mIsChangingState;
|
||||
/* 0x64 */ bool mChangeRequest;
|
||||
/* 0x65 */ bool mSelectRequest;
|
||||
/* 0x66 */ bool mRingToggleRequest;
|
||||
};
|
||||
|
||||
class dLytPauseMgr_c : public dLytBase_c {
|
||||
public:
|
||||
dLytPauseMgr_c();
|
||||
~dLytPauseMgr_c();
|
||||
|
||||
enum Disp_e {
|
||||
DISP_00_INVENTORY = 0,
|
||||
DISP_01_COLLECTION = 1,
|
||||
|
||||
DISP_MAX,
|
||||
};
|
||||
|
||||
enum Tab_e {
|
||||
TAB_ITEM = 0,
|
||||
TAB_POUCH = 1,
|
||||
TAB_DOWSING = 2,
|
||||
|
||||
TAB_MAX = 3,
|
||||
};
|
||||
|
||||
/* 0x08 */ virtual int create() override;
|
||||
/* 0x14 */ virtual int doDelete() override;
|
||||
/* 0x20 */ virtual int execute() override;
|
||||
/* 0x2C */ virtual int draw() override;
|
||||
/* 0x4C */ virtual bool build() override;
|
||||
|
||||
static dLytPauseMgr_c *GetInstance() {
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
d2d::ResAccIf_c *getResAcc1() {
|
||||
return &mResAcc1;
|
||||
}
|
||||
|
||||
d2d::ResAccIf_c *getResAcc2() {
|
||||
return &mResAcc2;
|
||||
}
|
||||
|
||||
EGG::CpuTexture *getBgTexture() {
|
||||
return mpBgTexture;
|
||||
}
|
||||
|
||||
bool isNavLeft() const {
|
||||
return mIsNavLeft;
|
||||
}
|
||||
|
||||
bool getField_0x0832() const {
|
||||
return field_0x0832;
|
||||
}
|
||||
|
||||
void setField_0x0837(bool b) {
|
||||
field_0x0837 = b;
|
||||
}
|
||||
|
||||
bool getField_0x0838() const {
|
||||
return field_0x0838;
|
||||
}
|
||||
|
||||
bool getField_0x083B() const {
|
||||
return field_0x083B;
|
||||
}
|
||||
|
||||
bool getField_0x083C() const {
|
||||
return field_0x083C;
|
||||
}
|
||||
|
||||
void setField_0x083C(bool b) {
|
||||
field_0x083C = b;
|
||||
}
|
||||
|
||||
bool getField_0x083D() const {
|
||||
return field_0x083D;
|
||||
}
|
||||
|
||||
void setField_0x083D(bool b) {
|
||||
field_0x083D = b;
|
||||
}
|
||||
|
||||
bool getField_0x083E() const {
|
||||
return field_0x083E;
|
||||
}
|
||||
|
||||
void setField_0x083E(bool b) {
|
||||
field_0x083E = b;
|
||||
}
|
||||
|
||||
bool getField_0x0840() const {
|
||||
return field_0x0840;
|
||||
}
|
||||
|
||||
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,
|
||||
SELECT_ITEM = 6,
|
||||
SELECT_CATEGORY = 7,
|
||||
SELECT_FIRE = 8,
|
||||
SELECT_RING = 9,
|
||||
SELECT_NONE = 10,
|
||||
};
|
||||
|
||||
void setSelection(SelectionType_e type, u16 id, bool restricted);
|
||||
|
||||
bool isCurrentSelectionRestricted() const {
|
||||
return mCurrentSelectionIsRestricted;
|
||||
}
|
||||
SelectionType_e getCurrentSelectionType() const {
|
||||
return mCurrentSelectionType;
|
||||
}
|
||||
|
||||
s32 getCurrentSelectionId() const {
|
||||
return mCurrentSelectionId;
|
||||
}
|
||||
|
||||
u8 getCurrentSelectionTab() const {
|
||||
return mCurrentSelectionTab;
|
||||
}
|
||||
|
||||
void setCurrentSelectionTab(u8 tab) {
|
||||
mCurrentSelectionTab = tab;
|
||||
}
|
||||
|
||||
nw4r::lyt::Bounding *getArrowBounding(int idx) const;
|
||||
void setSelectedArrowBounding(int idx);
|
||||
|
||||
static void setSelectHand(f32 rotation, f32 length);
|
||||
|
||||
void preDrawStage();
|
||||
void postDrawStage();
|
||||
|
||||
void inRequest();
|
||||
|
||||
static f32 sDisp00ArrowRotation;
|
||||
static f32 sDisp00ArrowLength;
|
||||
|
||||
private:
|
||||
bool checkSelectRing();
|
||||
bool checkChangeDisp();
|
||||
bool checkRing();
|
||||
void changeSavedDisp();
|
||||
void saveTabFlag();
|
||||
|
||||
STATE_FUNC_DECLARE(dLytPauseMgr_c, None);
|
||||
STATE_FUNC_DECLARE(dLytPauseMgr_c, In);
|
||||
STATE_FUNC_DECLARE(dLytPauseMgr_c, Wait);
|
||||
STATE_FUNC_DECLARE(dLytPauseMgr_c, Change);
|
||||
STATE_FUNC_DECLARE(dLytPauseMgr_c, Select);
|
||||
STATE_FUNC_DECLARE(dLytPauseMgr_c, Ring);
|
||||
STATE_FUNC_DECLARE(dLytPauseMgr_c, GetDemo);
|
||||
STATE_FUNC_DECLARE(dLytPauseMgr_c, Out);
|
||||
|
||||
static dLytPauseMgr_c *sInstance;
|
||||
|
||||
/* 0x008C */ UI_STATE_MGR_DECLARE(dLytPauseMgr_c);
|
||||
/* 0x00C8 */ d2d::ResAccIf_c mResAcc1;
|
||||
/* 0x0438 */ d2d::ResAccIf_c mResAcc2;
|
||||
/* 0x07A8 */ dLytPauseMain_c mMain;
|
||||
|
||||
/* 0x0810 */ EGG::TextureBuffer *mpTexture0x0810;
|
||||
/* 0x0814 */ EGG::TextureBuffer *mpBgTexture;
|
||||
/* 0x0818 */ SelectionType_e mCurrentSelectionType;
|
||||
/* 0x081C */ SelectionType_e mPrevSelectionType;
|
||||
/* 0x0820 */ s32 mCurrentDisp00Tab;
|
||||
/* 0x0824 */ s32 mCurrentDisp00HeldRing;
|
||||
/* 0x0828 */ s32 mSavedPauseDisp;
|
||||
/* 0x082C */ u16 mCurrentSelectionId;
|
||||
/* 0x082E */ u16 mPrevSelectionId;
|
||||
/* 0x0830 */ bool mInRequest;
|
||||
/* 0x0831 */ bool mIsNavLeft;
|
||||
/* 0x0832 */ bool field_0x0832;
|
||||
/* 0x0833 */ u8 mCurrentSelectionTab;
|
||||
/* 0x0834 */ u8 mTimer;
|
||||
/* 0x0835 */ u8 field_0x0835;
|
||||
/* 0x0836 */ bool field_0x0836;
|
||||
/* 0x0837 */ bool field_0x0837;
|
||||
/* 0x0838 */ bool field_0x0838;
|
||||
/* 0x0839 */ bool field_0x0839;
|
||||
/* 0x083A */ bool field_0x083A;
|
||||
/* 0x083B */ bool field_0x083B;
|
||||
/* 0x083C */ bool field_0x083C;
|
||||
/* 0x083D */ bool field_0x083D;
|
||||
/* 0x083E */ bool field_0x083E;
|
||||
/* 0x083F */ bool field_0x083F;
|
||||
/* 0x0840 */ bool field_0x0840;
|
||||
/* 0x0841 */ bool mCurrentSelectionIsRestricted;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,46 @@
|
||||
#ifndef D_LYT_PAUSE_BACK_H
|
||||
#define D_LYT_PAUSE_BACK_H
|
||||
|
||||
#include "d/lyt/d2d.h"
|
||||
#include "s/s_State.hpp"
|
||||
|
||||
/** 2D UI - Pause menu - Background */
|
||||
class dLytPauseBack_c {
|
||||
public:
|
||||
dLytPauseBack_c();
|
||||
virtual ~dLytPauseBack_c() {}
|
||||
|
||||
bool build();
|
||||
bool remove();
|
||||
bool execute();
|
||||
bool draw();
|
||||
|
||||
void loadBgTexture();
|
||||
void requestIn();
|
||||
void requestOut();
|
||||
|
||||
bool isChangingState() const {
|
||||
return mIsChangingState;
|
||||
}
|
||||
|
||||
private:
|
||||
void startAnim(int idx);
|
||||
void stopAnim(int idx);
|
||||
|
||||
STATE_FUNC_DECLARE(dLytPauseBack_c, None);
|
||||
STATE_FUNC_DECLARE(dLytPauseBack_c, In);
|
||||
STATE_FUNC_DECLARE(dLytPauseBack_c, Wait);
|
||||
STATE_FUNC_DECLARE(dLytPauseBack_c, Out);
|
||||
|
||||
/* 0x004 */ UI_STATE_MGR_DECLARE(dLytPauseBack_c);
|
||||
/* 0x040 */ d2d::LytBase_c mLyt;
|
||||
/* 0x0D0 */ d2d::AnmGroup_c mAnm[2];
|
||||
|
||||
/* 0x150 */ s32 mOutStep;
|
||||
/* 0x154 */ bool mInRequest;
|
||||
/* 0x155 */ bool mOutRequest;
|
||||
/* 0x156 */ bool mIsChangingState;
|
||||
/* 0x157 */ bool mVisible;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -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,20 @@ public:
|
||||
dLytPauseDisp00_c();
|
||||
virtual ~dLytPauseDisp00_c() {}
|
||||
|
||||
void init();
|
||||
bool build();
|
||||
bool remove();
|
||||
bool execute();
|
||||
bool draw();
|
||||
|
||||
void drawDirectly();
|
||||
void requestIn(bool scroll);
|
||||
void requestOut(bool scroll);
|
||||
void requestSelect();
|
||||
void requestRingToggle();
|
||||
void requestUnselect();
|
||||
|
||||
bool requestSelectGuide();
|
||||
bool requestSelectMpls();
|
||||
|
||||
STATE_FUNC_DECLARE(dLytPauseDisp00_c, None);
|
||||
STATE_FUNC_DECLARE(dLytPauseDisp00_c, In);
|
||||
@@ -21,16 +35,79 @@ public:
|
||||
STATE_FUNC_DECLARE(dLytPauseDisp00_c, GetDemo);
|
||||
STATE_FUNC_DECLARE(dLytPauseDisp00_c, Out);
|
||||
|
||||
private:
|
||||
void displayElement(int idx, float value);
|
||||
bool isChangingState() const {
|
||||
return mIsChangingState;
|
||||
}
|
||||
|
||||
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;
|
||||
bool hasSelection() const {
|
||||
return mHasSelection;
|
||||
}
|
||||
|
||||
private:
|
||||
void setAnm(int idx, f32 value);
|
||||
void stopAnm(int idx);
|
||||
void playBackwards(d2d::AnmGroup_c &anm);
|
||||
|
||||
// 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;
|
||||
bool isPointingAtRingIcon();
|
||||
|
||||
void hideItemIcons();
|
||||
u16 getPointedItemSpecial(s32 paneIdx, bool *pLocked);
|
||||
|
||||
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 mIsChangingState;
|
||||
/* 0xE36F */ bool mIsVisible;
|
||||
/* 0xE370 */ bool mDoScrollAnim;
|
||||
/* 0xE371 */ bool mHasSelection;
|
||||
/* 0xE372 */ bool mSelectToggleRequest;
|
||||
/* 0xE373 */ bool mSelectGuideRequest;
|
||||
/* 0xE374 */ bool mStopCallRequest;
|
||||
/* 0xE375 */ bool mSelectMplsRequest;
|
||||
/* 0xE376 */ bool mReverseTabChangeAnim;
|
||||
/* 0xE377 */ bool mRingToggleRequest;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#ifndef LYT_PAUSE_DISP_01_H
|
||||
#define LYT_PAUSE_DISP_01_H
|
||||
|
||||
#include "common.h"
|
||||
#include "d/d_cursor_hit_check.h"
|
||||
#include "d/lyt/d2d.h"
|
||||
#include "d/lyt/d_lyt_common_icon_material.h"
|
||||
#include "nw4r/lyt/lyt_pane.h"
|
||||
#include "s/s_State.hpp"
|
||||
|
||||
class dLytPauseDisp01_c {
|
||||
@@ -11,7 +13,16 @@ public:
|
||||
dLytPauseDisp01_c();
|
||||
virtual ~dLytPauseDisp01_c() {}
|
||||
|
||||
void init();
|
||||
bool build();
|
||||
bool remove();
|
||||
bool execute();
|
||||
bool draw();
|
||||
|
||||
void drawDirectly();
|
||||
void requestIn(bool scroll);
|
||||
void requestOut(bool scroll);
|
||||
void requestSelect();
|
||||
void requestUnselect();
|
||||
|
||||
STATE_FUNC_DECLARE(dLytPauseDisp01_c, None);
|
||||
STATE_FUNC_DECLARE(dLytPauseDisp01_c, In);
|
||||
@@ -20,16 +31,58 @@ public:
|
||||
STATE_FUNC_DECLARE(dLytPauseDisp01_c, GetDemo);
|
||||
STATE_FUNC_DECLARE(dLytPauseDisp01_c, Out);
|
||||
|
||||
private:
|
||||
void displayElement(int idx, float value);
|
||||
bool isChangingState() const {
|
||||
return mIsChangingState;
|
||||
}
|
||||
|
||||
/* 0x0004 */ STATE_MGR_DECLARE(dLytPauseDisp01_c);
|
||||
/* 0x0040 */ d2d::LytBase_c mLytBase;
|
||||
/* 0x00D0 */ d2d::AnmGroup_c field_0x00D0[15];
|
||||
/* 0x0490 */ dLytCommonIconMaterial_c field_0x2050[28];
|
||||
/* 0x96B0 */ d2d::SubPaneList mSubpanes;
|
||||
/* 0x96BC */ d2d::SubPaneListNode field_0xE11C[28];
|
||||
/* 0x987C */ dCursorHitCheckLyt_c field_0xE29C;
|
||||
bool hasSelection() const {
|
||||
return mHasSelection;
|
||||
}
|
||||
|
||||
private:
|
||||
void setAnm(int idx, f32 value);
|
||||
void stopAnm(int idx);
|
||||
|
||||
void setupDisp();
|
||||
void setupInsects();
|
||||
void setupMaterials();
|
||||
|
||||
void showInsectsAndMaterials();
|
||||
s32 updateSelection();
|
||||
s32 getPointerPane() const;
|
||||
void hideInsectsAndMaterials();
|
||||
|
||||
bool shouldInsectBeDisplayed(s32 insectIdx) const;
|
||||
u16 getInsectItemId(s32 insectIdx) const;
|
||||
s32 getInsectIcon(s32 insectIdx) const;
|
||||
s32 getInsectCountByIndex(s32 insectIdx) const;
|
||||
|
||||
u16 getQuestItemId(s32 questItemIndex) const;
|
||||
|
||||
bool shouldMaterialBeDisplayed(s32 materialIdx) const;
|
||||
u16 getMaterialItemId(s32 materialIdx) const;
|
||||
s32 getMaterialIcon(s32 materialIdx) const;
|
||||
s32 getMaterialCountByIndex(s32 materialIdx) const;
|
||||
|
||||
/* 0x0004 */ UI_STATE_MGR_DECLARE(dLytPauseDisp01_c);
|
||||
/* 0x0040 */ d2d::LytBase_c mLyt;
|
||||
/* 0x00D0 */ d2d::AnmGroup_c mAnm[15];
|
||||
/* 0x0490 */ dLytCommonIconMaterial_c mIcons[28];
|
||||
/* 0x96B0 */ d2d::SubPaneList mSubpaneList;
|
||||
/* 0x96BC */ d2d::SubPaneListNode mSubpanes[28];
|
||||
/* 0x987C */ dCursorHitCheckLyt_c mCsHitCheck;
|
||||
/* 0x98A4 */ nw4r::lyt::Pane *mpPanes[6];
|
||||
/* 0x98BC */ s32 mStep;
|
||||
/* 0x98C0 */ s32 mPrevNavTarget;
|
||||
/* 0x98C4 */ s32 mCurrentNavTarget;
|
||||
/* 0x98C8 */ s32 mGetDemoTimer;
|
||||
/* 0x98CC */ bool mInRequest;
|
||||
/* 0x98CD */ bool mOutRequest;
|
||||
/* 0x98CE */ bool mIsChangingState;
|
||||
/* 0x98CF */ bool mIsVisible;
|
||||
/* 0x98D0 */ bool mDoScrollAnim;
|
||||
/* 0x98D1 */ bool mHasSelection;
|
||||
/* 0x98D2 */ bool mSelectToggle;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
#ifndef D_LYT_PAUSE_INFO_H
|
||||
#define D_LYT_PAUSE_INFO_H
|
||||
|
||||
#include "d/lyt/d2d.h"
|
||||
#include "s/s_State.hpp"
|
||||
|
||||
class dLytCommonTitle_c;
|
||||
|
||||
/** 2D UI - Pause menu - title and button help */
|
||||
class dLytPauseInfo_c {
|
||||
public:
|
||||
dLytPauseInfo_c();
|
||||
virtual ~dLytPauseInfo_c() {}
|
||||
|
||||
bool build();
|
||||
bool remove();
|
||||
bool execute();
|
||||
bool draw();
|
||||
|
||||
void requestIn();
|
||||
void requestOut();
|
||||
void updateTitle();
|
||||
|
||||
void setInputInOut(bool inOut);
|
||||
|
||||
bool isChangingState() const {
|
||||
return mIsChangingState;
|
||||
}
|
||||
|
||||
private:
|
||||
void updateCaption();
|
||||
void startAnim(int idx);
|
||||
void stopAnim(int idx);
|
||||
void playBackwards(d2d::AnmGroup_c &anm);
|
||||
|
||||
STATE_FUNC_DECLARE(dLytPauseInfo_c, None);
|
||||
STATE_FUNC_DECLARE(dLytPauseInfo_c, In);
|
||||
STATE_FUNC_DECLARE(dLytPauseInfo_c, Wait);
|
||||
STATE_FUNC_DECLARE(dLytPauseInfo_c, Out);
|
||||
|
||||
/* 0x004 */ UI_STATE_MGR_DECLARE(dLytPauseInfo_c);
|
||||
/* 0x040 */ dLytCommonTitle_c *mpTitle;
|
||||
/* 0x044 */ d2d::LytBase_c mLyt;
|
||||
/* 0x0D4 */ d2d::AnmGroup_c mAnm[3];
|
||||
/* 0x194 */ s32 mStep;
|
||||
/* 0x198 */ bool mInRequest;
|
||||
/* 0x199 */ bool mOutRequest;
|
||||
/* 0x19A */ bool mIsChangingState;
|
||||
/* 0x19B */ bool field_0x19B;
|
||||
/* 0x19C */ bool mInputInOut;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,61 @@
|
||||
#ifndef D_LYT_PAUSE_TEXT_H
|
||||
#define D_LYT_PAUSE_TEXT_H
|
||||
|
||||
#include "common.h"
|
||||
#include "d/lyt/d2d.h"
|
||||
#include "d/lyt/d_lyt_common_a_btn.h"
|
||||
#include "s/s_State.hpp"
|
||||
#include "sized_string.h"
|
||||
|
||||
/** 2D UI - Pause menu - item info popup */
|
||||
class dLytPauseText_c {
|
||||
public:
|
||||
static const char *getCurrentPauseLabel(SizedString<32> &buf);
|
||||
static const wchar_t *getCurrentPausePopupName();
|
||||
static const wchar_t *getCurrentPausePopupCaption();
|
||||
|
||||
dLytPauseText_c();
|
||||
virtual ~dLytPauseText_c() {}
|
||||
|
||||
bool build();
|
||||
bool remove();
|
||||
bool execute();
|
||||
bool draw();
|
||||
|
||||
void requestIn();
|
||||
void requestOut();
|
||||
|
||||
bool isChangingState() const {
|
||||
return mIsChangingState;
|
||||
}
|
||||
|
||||
private:
|
||||
void startAnim(int idx);
|
||||
void stopAnim(int idx);
|
||||
void updateText();
|
||||
|
||||
bool isCurrentItemWallet() const;
|
||||
void calcTextLines(dTextBox_c *textBox, const wchar_t *text);
|
||||
|
||||
STATE_FUNC_DECLARE(dLytPauseText_c, None);
|
||||
STATE_FUNC_DECLARE(dLytPauseText_c, In);
|
||||
STATE_FUNC_DECLARE(dLytPauseText_c, Wait);
|
||||
STATE_FUNC_DECLARE(dLytPauseText_c, Out);
|
||||
|
||||
/* 0x004 */ UI_STATE_MGR_DECLARE(dLytPauseText_c);
|
||||
/* 0x040 */ d2d::LytBase_c mLyt;
|
||||
/* 0x0D0 */ d2d::AnmGroup_c mAnm[3];
|
||||
/* 0x190 */ d2d::ResAccIf_c mResAcc;
|
||||
/* 0x500 */ dLytCommonABtn_c mABtn;
|
||||
/* 0x6B0 */ d2d::SubPaneList mSubpaneList;
|
||||
/* 0x6BC */ d2d::SubPaneListNode mSubpanes[1];
|
||||
/* 0x6CC */ s32 mStep;
|
||||
/* 0x6D0 */ f32 mLineSpace;
|
||||
/* 0x6D4 */ u8 mNumTextLines;
|
||||
/* 0x6D5 */ bool mInRequest;
|
||||
/* 0x6D6 */ bool mOutRequest;
|
||||
/* 0x6D7 */ bool mIsChangingState;
|
||||
/* 0x6D8 */ bool field_0x6D8;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -2,19 +2,96 @@
|
||||
#define D_LYT_UTIL_ITEMS_H
|
||||
|
||||
#include "common.h"
|
||||
#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();
|
||||
u16 getCurrentSwordItemId();
|
||||
bool isSwordRestrictedBokoBase();
|
||||
|
||||
u16 getCurrentGoddessHarpItemId();
|
||||
bool isHarpRestrictedBokoBase();
|
||||
|
||||
u16 getCurrentEarringsItemId();
|
||||
|
||||
u16 getTabletItemIdForIndex(s32 index);
|
||||
|
||||
u16 getTriforceItemIdForIndex(s32 index);
|
||||
|
||||
u16 getSongItemIdForIndex(s32 index);
|
||||
|
||||
bool hasGoddessHarp();
|
||||
|
||||
bool hasSong(s32 index);
|
||||
|
||||
bool hasWaterDragonScale();
|
||||
u16 getCurrentWaterDragonScaleItemId();
|
||||
bool isWaterDragonScaleRestricted();
|
||||
|
||||
bool hasSailcloth();
|
||||
|
||||
s32 getCurrentMittsLevel();
|
||||
u16 getCurrentMittsItemId();
|
||||
bool isMittsRestricted();
|
||||
|
||||
u16 getCurrentSailclothItemId();
|
||||
|
||||
u16 getCurrentWalletItemId();
|
||||
|
||||
u16 getCurrentHeartPieceItemId();
|
||||
|
||||
void getItemLabel(s32 itemId, SizedString<32> &buf);
|
||||
void getCaptionItemLabel(s32 itemId, SizedString<32> &buf);
|
||||
void getDowsingLabel(s32 itemId, SizedString<32> &buf);
|
||||
void getPauseCategoryLabel(s32 itemId, SizedString<32> &buf);
|
||||
|
||||
const wchar_t *getItemText(s32 itemId);
|
||||
const wchar_t *getCaptionItemText(s32 itemId);
|
||||
const wchar_t *getDowsingText(s32 itemId);
|
||||
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
|
||||
|
||||
@@ -264,6 +264,10 @@ public:
|
||||
return mMain.field_0x13750;
|
||||
}
|
||||
|
||||
void setMeterField_0x13750(s32 value) {
|
||||
mMain.field_0x13750 = value;
|
||||
}
|
||||
|
||||
u8 getMeterField_0x13770() const {
|
||||
return mMain.field_0x13770;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -315,6 +315,10 @@ public:
|
||||
mVec2_c operator-(const mVec2_c &v) const {
|
||||
return mVec2_c(x - v.x, y - v.y);
|
||||
}
|
||||
|
||||
f32 squareDistanceTo(const mVec2_c &other) const {
|
||||
return (*this - other).squaredLength();
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -37,6 +37,10 @@ struct SizedString {
|
||||
return mChars;
|
||||
}
|
||||
|
||||
void empty() {
|
||||
mChars[0] = '\0';
|
||||
}
|
||||
|
||||
void operator=(const char *src) {
|
||||
if (src != mChars) {
|
||||
mChars[0] = '\0';
|
||||
@@ -100,7 +104,7 @@ struct SizedString {
|
||||
template <size_t Size>
|
||||
struct SizedWString {
|
||||
SizedWString() {
|
||||
mChars[0] = '\0';
|
||||
mChars[0] = L'\0';
|
||||
}
|
||||
|
||||
wchar_t mChars[Size];
|
||||
@@ -113,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);
|
||||
|
||||
@@ -327,9 +327,9 @@ void dScBoot_c::drawCallback() {
|
||||
dScBoot_c::strap_c::strap_c() {
|
||||
SizedString<8> str;
|
||||
u8 langNum = getUsedLanguageNTSCNum();
|
||||
mArcName.mChars[0] = '\0';
|
||||
mLytFileName.mChars[0] = '\0';
|
||||
mAnimFileName.mChars[0] = '\0';
|
||||
mArcName.empty();
|
||||
mLytFileName.empty();
|
||||
mAnimFileName.empty();
|
||||
if (langNum == 3) {
|
||||
str = "F";
|
||||
} else if (langNum == 4) {
|
||||
|
||||
+23
-23
@@ -500,23 +500,23 @@ void LytBase_c::setProperties(nw4r::lyt::Pane *pane, f32 posX, f32 posY, f32 sca
|
||||
|
||||
textBox->SetCharSpace(textBox->GetCharSpace() + dLyt_HIO_c::getFn800B2020() + f6);
|
||||
textBox->SetLineSpace(textBox->GetLineSpace() + dLyt_HIO_c::getFn800B2000() + f4);
|
||||
fn_800AB930(textBox);
|
||||
loadText(textBox);
|
||||
}
|
||||
|
||||
bool LytBase_c::fn_800AB930(dTextBox_c *box) {
|
||||
return fn_800AB9A0(box, -1);
|
||||
bool LytBase_c::loadText(dTextBox_c *box) {
|
||||
return loadTextVariant(box, -1);
|
||||
}
|
||||
|
||||
bool LytBase_c::fn_800AB940(const char *name, int arg) {
|
||||
bool LytBase_c::loadTextVariant(const char *name, int arg) {
|
||||
dTextBox_c *box = getTextBox(name);
|
||||
if (box == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return fn_800AB9A0(box, arg);
|
||||
return loadTextVariant(box, arg);
|
||||
}
|
||||
|
||||
bool LytBase_c::fn_800AB9A0(dTextBox_c *textbox, int arg) {
|
||||
bool LytBase_c::loadTextVariant(dTextBox_c *textbox, int arg) {
|
||||
if (getMsbtInfo() == nullptr) {
|
||||
return false;
|
||||
}
|
||||
@@ -551,21 +551,21 @@ bool LytBase_c::fn_800AB9A0(dTextBox_c *textbox, int arg) {
|
||||
if (ty == 1) {
|
||||
dTextBox_c *otherBox = getTextBox(list->GetString());
|
||||
if (otherBox != nullptr) {
|
||||
return fn_800ABB80(textbox, otherBox, arg);
|
||||
return loadTextVariantCopy(textbox, otherBox, arg);
|
||||
}
|
||||
} else {
|
||||
return fn_800ABCE0(list, textbox, textbox, arg);
|
||||
return setText(list, textbox, textbox, arg);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LytBase_c::fn_800ABB80(dTextBox_c *textbox1, dTextBox_c *textbox2, int arg) {
|
||||
u16 num = textbox2->GetExtUserDataNum();
|
||||
bool LytBase_c::loadTextVariantCopy(dTextBox_c *targetTextBox, dTextBox_c *sourceTextBox, int arg) {
|
||||
u16 num = sourceTextBox->GetExtUserDataNum();
|
||||
if (num == 0) {
|
||||
return false;
|
||||
}
|
||||
u32 found = 0;
|
||||
const nw4r::lyt::res::ExtUserData *list = textbox2->GetExtUserData();
|
||||
const nw4r::lyt::res::ExtUserData *list = sourceTextBox->GetExtUserData();
|
||||
for (int i = 0; i < num; i++) {
|
||||
SizedString<0x40> userDatName;
|
||||
userDatName = list->GetName();
|
||||
@@ -579,17 +579,17 @@ bool LytBase_c::fn_800ABB80(dTextBox_c *textbox1, dTextBox_c *textbox2, int arg)
|
||||
if (found != 1) {
|
||||
return false;
|
||||
}
|
||||
return fn_800ABCE0(list, textbox1, textbox2, arg);
|
||||
return setText(list, targetTextBox, sourceTextBox, arg);
|
||||
}
|
||||
|
||||
bool LytBase_c::fn_800ABCE0(
|
||||
const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *textbox1, dTextBox_c *textbox2, int arg
|
||||
bool LytBase_c::setText(
|
||||
const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *targetTextBox, dTextBox_c *sourceTextBox, int arg
|
||||
) {
|
||||
s32 userDatInt = userDatum->GetInt();
|
||||
SizedString<0x40> str1;
|
||||
SizedString<0x40> str2;
|
||||
|
||||
str1 = textbox2->GetName();
|
||||
str1 = sourceTextBox->GetName();
|
||||
if (userDatInt != 0) {
|
||||
userDatInt = 0;
|
||||
if (arg != -1) {
|
||||
@@ -605,7 +605,7 @@ bool LytBase_c::fn_800ABCE0(
|
||||
return false;
|
||||
}
|
||||
|
||||
textbox1->setTextWithGlobalTextProcessor(dMessage_c::formatText(text));
|
||||
targetTextBox->setTextWithGlobalTextProcessor(dMessage_c::formatText(text));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -652,13 +652,13 @@ bool LytBase_c::fn_800ABE50(dTextBox_c *textbox, wchar_t *destBuf, u32 maxLen) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LytBase_c::fn_800AC040(dTextBox_c *textbox1, dTextBox_c *textbox2, wchar_t *destBuf, u32 maxLen) {
|
||||
u16 num = textbox2->GetExtUserDataNum();
|
||||
bool LytBase_c::fn_800AC040(dTextBox_c *targetTextBox, dTextBox_c *sourceTextBox, wchar_t *destBuf, u32 maxLen) {
|
||||
u16 num = sourceTextBox->GetExtUserDataNum();
|
||||
if (num == 0) {
|
||||
return false;
|
||||
}
|
||||
u32 found = 0;
|
||||
const nw4r::lyt::res::ExtUserData *list = textbox2->GetExtUserData();
|
||||
const nw4r::lyt::res::ExtUserData *list = sourceTextBox->GetExtUserData();
|
||||
for (int i = 0; i < num; i++) {
|
||||
SizedString<0x40> userDatName;
|
||||
userDatName = list->GetName();
|
||||
@@ -672,24 +672,24 @@ bool LytBase_c::fn_800AC040(dTextBox_c *textbox1, dTextBox_c *textbox2, wchar_t
|
||||
if (found != 1) {
|
||||
return false;
|
||||
}
|
||||
return fn_800AC1AC(list, textbox1, textbox2, destBuf, maxLen);
|
||||
return fn_800AC1AC(list, targetTextBox, sourceTextBox, destBuf, maxLen);
|
||||
}
|
||||
|
||||
bool LytBase_c::fn_800AC1AC(
|
||||
const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *textbox1, dTextBox_c *textbox2, wchar_t *destBuf, u32 maxLen
|
||||
const nw4r::lyt::res::ExtUserData *userDatum, dTextBox_c *targetTextBox, dTextBox_c *sourceTextBox, wchar_t *destBuf, u32 maxLen
|
||||
) {
|
||||
s32 userDatInt = userDatum->GetInt();
|
||||
SizedString<0x40> str1;
|
||||
SizedString<0x40> str2;
|
||||
|
||||
str1 = textbox2->GetName();
|
||||
str1 = sourceTextBox->GetName();
|
||||
if (userDatInt != 0) {
|
||||
SizedString<0x40> &fmt = str2;
|
||||
fmt.sprintf(":%02d", 0);
|
||||
str1.append(fmt);
|
||||
}
|
||||
|
||||
textbox1->setMessageWithGlobalTextProcessorAndMsbtInfo(getMsbtInfo(), str1, destBuf, maxLen);
|
||||
targetTextBox->setMessageWithGlobalTextProcessorAndMsbtInfo(getMsbtInfo(), str1, destBuf, maxLen);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ static const d2d::LytBrlanMapping brlanMap[] = {
|
||||
#define ANIM_INPUT 7
|
||||
#define ANIM_OUT 8
|
||||
|
||||
#define NUM_ANIMS 9
|
||||
|
||||
dLytCommonArrow_c::dLytCommonArrow_c() : mStateMgr(*this, sStateID::null) {}
|
||||
|
||||
bool dLytCommonArrow_c::build() {
|
||||
@@ -45,13 +47,13 @@ bool dLytCommonArrow_c::build() {
|
||||
mLytBase.build("commonArrow_00.brlyt", &mResAcc);
|
||||
mLytBase.setPriority(0x86);
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
for (int i = 0; i < NUM_ANIMS; i++) {
|
||||
mAnmGroups[i].init(brlanMap[i].mFile, &mResAcc, mLytBase.getLayout(), brlanMap[i].mName);
|
||||
}
|
||||
mCsHitCheck.init(mLytBase.getLayout()->GetRootPane(), 1, 0, 0);
|
||||
dCsMgr_c::GetInstance()->registCursorTarget(&mCsHitCheck);
|
||||
mBoundingL = mLytBase.findBounding("B_arrowL_00");
|
||||
mBoundingR = mLytBase.findBounding("B_arrowR_00");
|
||||
mpBoundings[ARROW_LEFT] = mLytBase.findBounding("B_arrowL_00");
|
||||
mpBoundings[ARROW_RIGHT] = mLytBase.findBounding("B_arrowR_00");
|
||||
mStateMgr.changeState(StateID_None);
|
||||
setState(0);
|
||||
return true;
|
||||
@@ -60,7 +62,7 @@ bool dLytCommonArrow_c::build() {
|
||||
bool dLytCommonArrow_c::remove() {
|
||||
dCsMgr_c::GetInstance()->unregistCursorTarget(&mCsHitCheck);
|
||||
mLytBase.unbindAnims();
|
||||
for (int i = 0; i < 9; i++) {
|
||||
for (int i = 0; i < NUM_ANIMS; i++) {
|
||||
mAnmGroups[i].remove();
|
||||
}
|
||||
return true;
|
||||
@@ -79,7 +81,7 @@ bool dLytCommonArrow_c::execute() {
|
||||
}
|
||||
|
||||
bool dLytCommonArrow_c::draw() {
|
||||
if (field_0x6CB == 1) {
|
||||
if (mVisible == true) {
|
||||
mLytBase.addToDrawList();
|
||||
}
|
||||
return true;
|
||||
@@ -104,7 +106,7 @@ bool dLytCommonArrow_c::requestIn() {
|
||||
if (!mStateMgr.getStateID()->isEqual(StateID_None)) {
|
||||
return false;
|
||||
}
|
||||
mInRequested = 1;
|
||||
mInRequested = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -117,7 +119,7 @@ bool dLytCommonArrow_c::requestOut() {
|
||||
}
|
||||
|
||||
bool dLytCommonArrow_c::fn_80168760() {
|
||||
if (field_0x6C0 == 2 && field_0x6B8 != 2) {
|
||||
if (field_0x6C0 == ARROW_NONE && field_0x6B8 != ARROW_NONE) {
|
||||
field_0x6C0 = field_0x6B8;
|
||||
return true;
|
||||
}
|
||||
@@ -145,56 +147,56 @@ void dLytCommonArrow_c::tickDown(d2d::AnmGroup_c *ctrl) {
|
||||
}
|
||||
}
|
||||
|
||||
void dLytCommonArrow_c::fn_80168880() {
|
||||
void dLytCommonArrow_c::checkPointAtPane() {
|
||||
int i = -1;
|
||||
if (!dPadNav::isPointerVisible()) {
|
||||
field_0x6B4 = 2;
|
||||
mPointedAtArrow = ARROW_NONE;
|
||||
return;
|
||||
}
|
||||
|
||||
dCursorHitCheck_c *d = dCsBase_c::GetInstance()->getHitCheck();
|
||||
if (d != nullptr && d->getType() == 'lyt ') {
|
||||
if (static_cast<dCursorHitCheckLyt_c *>(d)->getHitPane() == mBoundingL) {
|
||||
i = 0;
|
||||
} else if (static_cast<dCursorHitCheckLyt_c *>(d)->getHitPane() == mBoundingR) {
|
||||
i = 1;
|
||||
if (static_cast<dCursorHitCheckLyt_c *>(d)->getHitPane() == mpBoundings[ARROW_LEFT]) {
|
||||
i = ARROW_LEFT;
|
||||
} else if (static_cast<dCursorHitCheckLyt_c *>(d)->getHitPane() == mpBoundings[ARROW_RIGHT]) {
|
||||
i = ARROW_RIGHT;
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= 0) {
|
||||
field_0x6B4 = i;
|
||||
mPointedAtArrow = i;
|
||||
} else {
|
||||
field_0x6B4 = 2;
|
||||
mPointedAtArrow = ARROW_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
void dLytCommonArrow_c::initializeState_None() {
|
||||
mLytBase.unbindAnims();
|
||||
mInRequested = 0;
|
||||
mOutRequested = 0;
|
||||
field_0x6CA = 0;
|
||||
field_0x6CB = 0;
|
||||
field_0x6B4 = 2;
|
||||
field_0x6B8 = 2;
|
||||
field_0x6BC = 2;
|
||||
field_0x6C0 = 2;
|
||||
mInRequested = false;
|
||||
mOutRequested = false;
|
||||
mIsChangingState = false;
|
||||
mVisible = false;
|
||||
mPointedAtArrow = ARROW_NONE;
|
||||
field_0x6B8 = ARROW_NONE;
|
||||
field_0x6BC = ARROW_NONE;
|
||||
field_0x6C0 = ARROW_NONE;
|
||||
mTimer = 0;
|
||||
displayElement(ANIM_IN, 0.0f);
|
||||
field_0x6CC = 1;
|
||||
mBackwards = true;
|
||||
}
|
||||
void dLytCommonArrow_c::executeState_None() {
|
||||
if (mInRequested == 1) {
|
||||
if (mInRequested == true) {
|
||||
mStateMgr.changeState(StateID_In);
|
||||
}
|
||||
}
|
||||
void dLytCommonArrow_c::finalizeState_None() {
|
||||
mInRequested = 0;
|
||||
mInRequested = false;
|
||||
displayElement(ANIM_LOOP, 0.0f);
|
||||
}
|
||||
|
||||
void dLytCommonArrow_c::initializeState_In() {
|
||||
mTimer = 0;
|
||||
field_0x6CB = 1;
|
||||
mVisible = true;
|
||||
f32 anmType = 0.0f;
|
||||
if (mType == 1) {
|
||||
anmType = 1.0f;
|
||||
@@ -208,15 +210,15 @@ void dLytCommonArrow_c::executeState_In() {
|
||||
switch (mTimer) {
|
||||
case 0: {
|
||||
d2d::AnmGroup_c *s = &mAnmGroups[ANIM_IN];
|
||||
if (s->isEndReached() == 1) {
|
||||
if (s->isEndReached() == true) {
|
||||
mTimer += 1;
|
||||
field_0x6CA = 1;
|
||||
mIsChangingState = true;
|
||||
} else {
|
||||
s->play();
|
||||
}
|
||||
} break;
|
||||
case 1:
|
||||
field_0x6CA = 0;
|
||||
mIsChangingState = false;
|
||||
mStateMgr.changeState(StateID_Wait);
|
||||
break;
|
||||
}
|
||||
@@ -230,17 +232,17 @@ void dLytCommonArrow_c::initializeState_Wait() {
|
||||
}
|
||||
|
||||
void dLytCommonArrow_c::executeState_Wait() {
|
||||
if (mOutRequested == 1) {
|
||||
if (mOutRequested == true) {
|
||||
mStateMgr.changeState(StateID_Out);
|
||||
return;
|
||||
}
|
||||
|
||||
fn_80168880();
|
||||
if (field_0x6B8 == 0) {
|
||||
checkPointAtPane();
|
||||
if (field_0x6B8 == ARROW_LEFT) {
|
||||
d2d::AnmGroup_c &g = mAnmGroups[ANIM_ONOFF_L];
|
||||
g.play();
|
||||
tickDown(&mAnmGroups[ANIM_ONOFF_R]);
|
||||
} else if (field_0x6B8 == 1) {
|
||||
} else if (field_0x6B8 == ARROW_RIGHT) {
|
||||
d2d::AnmGroup_c &g = mAnmGroups[ANIM_ONOFF_R];
|
||||
g.play();
|
||||
tickDown(&mAnmGroups[ANIM_ONOFF_L]);
|
||||
@@ -250,7 +252,7 @@ void dLytCommonArrow_c::executeState_Wait() {
|
||||
}
|
||||
|
||||
d2d::AnmGroup_c &g2 = mAnmGroups[ANIM_INPUT];
|
||||
if (field_0x6CC != 0) {
|
||||
if (mBackwards) {
|
||||
tickDown(&g2);
|
||||
} else {
|
||||
g2.play();
|
||||
@@ -258,7 +260,7 @@ void dLytCommonArrow_c::executeState_Wait() {
|
||||
|
||||
switch (mTimer) {
|
||||
case 0:
|
||||
if (field_0x6C0 != 2) {
|
||||
if (field_0x6C0 != ARROW_NONE) {
|
||||
displayElement(field_0x6C0 + ANIM_DECIDE_OFFSET, 0.0f);
|
||||
if (field_0x6C0 == 0) {
|
||||
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_MENU_SELECT_TURN_PAGE_LEFT);
|
||||
@@ -272,20 +274,20 @@ void dLytCommonArrow_c::executeState_Wait() {
|
||||
d2d::AnmGroup_c &g = mAnmGroups[field_0x6C0 + ANIM_DECIDE_OFFSET];
|
||||
if (g.isEndReached() == true) {
|
||||
mTimer++;
|
||||
field_0x6CA = 1;
|
||||
mIsChangingState = true;
|
||||
}
|
||||
g.play();
|
||||
} break;
|
||||
case 2:
|
||||
unbindAt(field_0x6C0 + ANIM_DECIDE_OFFSET);
|
||||
mTimer = 0;
|
||||
field_0x6CA = 0;
|
||||
field_0x6C0 = 2;
|
||||
mIsChangingState = false;
|
||||
field_0x6C0 = ARROW_NONE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (field_0x6BC != field_0x6B8 && field_0x6B8 != 2) {
|
||||
if (field_0x6B8 == 0) {
|
||||
if (field_0x6BC != field_0x6B8 && field_0x6B8 != ARROW_NONE) {
|
||||
if (field_0x6B8 == ARROW_LEFT) {
|
||||
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_MENU_POINT_TURN_PAGE_LEFT);
|
||||
} else {
|
||||
dSndSmallEffectMgr_c::GetInstance()->playSound(SE_S_MENU_POINT_TURN_PAGE_RIGHT);
|
||||
@@ -297,15 +299,15 @@ void dLytCommonArrow_c::finalizeState_Wait() {}
|
||||
void dLytCommonArrow_c::initializeState_Out() {
|
||||
mTimer = 0;
|
||||
displayElement(ANIM_OUT, 0.0f);
|
||||
mOutRequested = 0;
|
||||
mOutRequested = false;
|
||||
}
|
||||
void dLytCommonArrow_c::executeState_Out() {
|
||||
switch (mTimer) {
|
||||
case 0: {
|
||||
d2d::AnmGroup_c *s = &mAnmGroups[ANIM_OUT];
|
||||
if (s->isEndReached() == 1) {
|
||||
if (s->isEndReached() == true) {
|
||||
mTimer = 1;
|
||||
field_0x6CA = 1;
|
||||
mIsChangingState = 1;
|
||||
}
|
||||
s->play();
|
||||
} break;
|
||||
|
||||
@@ -0,0 +1,525 @@
|
||||
#include "d/lyt/d_lyt_common_title.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "d/d_message.h"
|
||||
#include "d/lyt/d2d.h"
|
||||
#include "d/lyt/d_lyt_control_game.h"
|
||||
#include "d/lyt/d_textbox.h"
|
||||
#include "d/lyt/d_window.h"
|
||||
#include "toBeSorted/arc_managers/layout_arc_manager.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
STATE_DEFINE(dLytCommonTitle_c, None);
|
||||
STATE_DEFINE(dLytCommonTitle_c, In);
|
||||
STATE_DEFINE(dLytCommonTitle_c, Wait);
|
||||
STATE_DEFINE(dLytCommonTitle_c, Out);
|
||||
STATE_DEFINE(dLytCommonTitle_c, Change);
|
||||
|
||||
static const d2d::LytBrlanMapping brlanMap[] = {
|
||||
{ "commonTitle_00_in.brlan", "G_inOut_00"},
|
||||
{ "commonTitle_00_out.brlan", "G_inOut_00"},
|
||||
{ "commonTitle_00_loop.brlan", "G_loop_00"},
|
||||
{"commonTitle_00_titleChange.brlan", "G_titleInOut_00"},
|
||||
{ "commonTitle_00_textIn.brlan", "G_textInOut_00"},
|
||||
{ "commonTitle_00_textOut.brlan", "G_textInOut_00"},
|
||||
{ "commonTitle_00_textChange.brlan", "G_textInOut_00"},
|
||||
{ "commonTitle_00_input.brlan", "G_input_00"},
|
||||
};
|
||||
|
||||
#define COMMON_TITLE_ANIM_IN 0
|
||||
#define COMMON_TITLE_ANIM_OUT 1
|
||||
#define COMMON_TITLE_ANIM_LOOP 2
|
||||
#define COMMON_TITLE_ANIM_TITLE_CHANGE 3
|
||||
#define COMMON_TITLE_ANIM_TEXT_IN 4
|
||||
#define COMMON_TITLE_ANIM_TEXT_OUT 5
|
||||
#define COMMON_TITLE_ANIM_TEXT_CHANGE 6
|
||||
#define COMMON_TITLE_ANIM_INPUT 7
|
||||
|
||||
#define COMMON_TITLE_NUM_ANIMS 8
|
||||
|
||||
dLytCommonTitle_c::dLytCommonTitle_c() : mStateMgr(*this) {}
|
||||
|
||||
bool dLytCommonTitle_c::build() {
|
||||
void *data = LayoutArcManager::GetInstance()->getLoadedData("DoButton");
|
||||
mResAcc.attach(data, "");
|
||||
mLyt.build("commonTitle_00.brlyt", &mResAcc);
|
||||
mLyt.setPriority(0x86);
|
||||
|
||||
for (int i = 0; i < COMMON_TITLE_NUM_ANIMS; i++) {
|
||||
mAnm[i].init(brlanMap[i].mFile, &mResAcc, mLyt.getLayout(), brlanMap[i].mName);
|
||||
}
|
||||
|
||||
mStateMgr.changeState(StateID_None);
|
||||
field_0x680 = 0;
|
||||
mInputInOut = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytCommonTitle_c::remove() {
|
||||
mLyt.unbindAnims();
|
||||
for (int i = 0; i < COMMON_TITLE_NUM_ANIMS; i++) {
|
||||
mAnm[i].remove();
|
||||
}
|
||||
mResAcc.detach();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytCommonTitle_c::execute() {
|
||||
mStateMgr.executeState();
|
||||
if (!(mStateMgr.getStateID()->isEqual(StateID_None))) {
|
||||
mAnm[COMMON_TITLE_ANIM_LOOP].play();
|
||||
if (mInputInOut == true) {
|
||||
playBackwards(mAnm[COMMON_TITLE_ANIM_INPUT]);
|
||||
} else {
|
||||
mAnm[COMMON_TITLE_ANIM_INPUT].play();
|
||||
}
|
||||
}
|
||||
mLyt.calc();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytCommonTitle_c::draw() {
|
||||
if (mVisible == true) {
|
||||
mLyt.addToDrawList();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytCommonTitle_c::set(s32 arg, const char *title, const char *caption) {
|
||||
if (!(mStateMgr.getStateID()->isEqual(StateID_Wait)) && !(mStateMgr.getStateID()->isEqual(StateID_None))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
mSetMode = arg;
|
||||
|
||||
if (title != nullptr) {
|
||||
mTitle = title;
|
||||
} else {
|
||||
mTitle.empty();
|
||||
}
|
||||
|
||||
if (caption != nullptr) {
|
||||
mCaption = caption;
|
||||
} else {
|
||||
mCaption.empty();
|
||||
}
|
||||
|
||||
mChangeRequest = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
const char *dLytCommonTitle_c::setSubTitle(s32 msgIdx) {
|
||||
const char *ret = nullptr;
|
||||
mCaption.empty();
|
||||
if (msgIdx != 0 && msgIdx <= 2) {
|
||||
// "Gear", "Collection"
|
||||
mCaption.sprintf("SUB_TITLE_%02d", msgIdx);
|
||||
ret = mCaption;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
const char *dLytCommonTitle_c::setSysTitle(s32 msgIdx) {
|
||||
const char *ret = nullptr;
|
||||
mTitle.empty();
|
||||
if (msgIdx != 0 && msgIdx <= 2) {
|
||||
// "Quest Logs", "Your Name"
|
||||
mTitle.sprintf("SYS_TITLE_%02d", msgIdx);
|
||||
ret = mTitle;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
const char *dLytCommonTitle_c::setSysCaption(s32 msgIdx) {
|
||||
const char *ret = nullptr;
|
||||
mCaption.empty();
|
||||
if (msgIdx != 0 && msgIdx <= 5) {
|
||||
// "Select a file.", ...
|
||||
mCaption.sprintf("SYS_CAPTION_%02d", msgIdx);
|
||||
ret = mCaption;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void dLytCommonTitle_c::gotoStateNone() {
|
||||
mStateMgr.changeState(StateID_None);
|
||||
}
|
||||
|
||||
void dLytCommonTitle_c::initializeState_None() {
|
||||
mLyt.unbindAnims();
|
||||
mChangeRequest = false;
|
||||
field_0x68D = false;
|
||||
mVisible = false;
|
||||
mSetMode = SET_00;
|
||||
mStep = 0;
|
||||
mTitle.empty();
|
||||
mCaption.empty();
|
||||
field_0x68F = 0;
|
||||
if (dLytControlGame_c::getInstance()->isPauseDemo()) {
|
||||
mLyt.findPane("N_next_01")->SetVisible(false);
|
||||
} else {
|
||||
mLyt.findPane("N_next_01")->SetVisible(true);
|
||||
}
|
||||
}
|
||||
void dLytCommonTitle_c::executeState_None() {
|
||||
if (mChangeRequest == true) {
|
||||
mStateMgr.changeState(StateID_In);
|
||||
}
|
||||
}
|
||||
void dLytCommonTitle_c::finalizeState_None() {
|
||||
mChangeRequest = false;
|
||||
startAnim(COMMON_TITLE_ANIM_LOOP);
|
||||
startAnim(COMMON_TITLE_ANIM_INPUT);
|
||||
}
|
||||
|
||||
void dLytCommonTitle_c::initializeState_In() {
|
||||
mStep = 0;
|
||||
startAnim(COMMON_TITLE_ANIM_IN);
|
||||
startAnim(COMMON_TITLE_ANIM_TITLE_CHANGE);
|
||||
if (field_0x680 == 0) {
|
||||
mLyt.setPriority(0x80);
|
||||
startAnim(COMMON_TITLE_ANIM_TEXT_IN);
|
||||
} else {
|
||||
startAnim(COMMON_TITLE_ANIM_TEXT_CHANGE);
|
||||
getAnm(COMMON_TITLE_ANIM_TEXT_CHANGE).setToEnd();
|
||||
startAnim(COMMON_TITLE_ANIM_TEXT_OUT);
|
||||
getAnm(COMMON_TITLE_ANIM_TEXT_OUT).setToEnd();
|
||||
}
|
||||
mVisible = true;
|
||||
applyText();
|
||||
}
|
||||
void dLytCommonTitle_c::executeState_In() {
|
||||
switch (mStep) {
|
||||
case 0: {
|
||||
d2d::AnmGroup_c &anm = mAnm[COMMON_TITLE_ANIM_IN];
|
||||
if (anm.isEndReached() == true) {
|
||||
if (field_0x680 == 0) {
|
||||
mStep = 1;
|
||||
} else {
|
||||
mStep = 10;
|
||||
field_0x68D = true;
|
||||
}
|
||||
} else {
|
||||
anm.play();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
d2d::AnmGroup_c &anm = mAnm[COMMON_TITLE_ANIM_TEXT_IN];
|
||||
if (anm.isEndReached() == true) {
|
||||
mStep = 10;
|
||||
field_0x68D = true;
|
||||
}
|
||||
anm.play();
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
field_0x68D = false;
|
||||
mStateMgr.changeState(StateID_Wait);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void dLytCommonTitle_c::finalizeState_In() {
|
||||
stopAnim(COMMON_TITLE_ANIM_TITLE_CHANGE);
|
||||
stopAnim(COMMON_TITLE_ANIM_IN);
|
||||
if (field_0x680 == 0) {
|
||||
stopAnim(COMMON_TITLE_ANIM_TEXT_IN);
|
||||
} else {
|
||||
stopAnim(COMMON_TITLE_ANIM_TEXT_CHANGE);
|
||||
}
|
||||
}
|
||||
|
||||
void dLytCommonTitle_c::initializeState_Wait() {
|
||||
mStep = 0;
|
||||
field_0x68F = false;
|
||||
}
|
||||
void dLytCommonTitle_c::executeState_Wait() {
|
||||
if (field_0x680 == 1) {
|
||||
if (mCaption.len() != 0) {
|
||||
field_0x68F = true;
|
||||
mAnm[COMMON_TITLE_ANIM_TEXT_OUT].setFrame(0.0f);
|
||||
} else {
|
||||
mAnm[COMMON_TITLE_ANIM_TEXT_OUT].play();
|
||||
if (field_0x68F == true && mAnm[COMMON_TITLE_ANIM_TEXT_OUT].isEndReached() == true) {
|
||||
applyCaption(0);
|
||||
field_0x68F = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mChangeRequest == true) {
|
||||
if (mSetMode == SET_OUT) {
|
||||
mStateMgr.changeState(StateID_Out);
|
||||
} else if (field_0x680 == 0) {
|
||||
mStateMgr.changeState(StateID_Change);
|
||||
} else if (mSetMode == SET_01) {
|
||||
mStateMgr.changeState(StateID_Change);
|
||||
} else {
|
||||
mChangeRequest = false;
|
||||
if (mCaption.len() != 0) {
|
||||
applyCaption(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void dLytCommonTitle_c::finalizeState_Wait() {
|
||||
mChangeRequest = false;
|
||||
}
|
||||
|
||||
void dLytCommonTitle_c::initializeState_Out() {
|
||||
mStep = 0;
|
||||
startAnim(COMMON_TITLE_ANIM_OUT);
|
||||
}
|
||||
void dLytCommonTitle_c::executeState_Out() {
|
||||
d2d::AnmGroup_c &anm = mAnm[COMMON_TITLE_ANIM_OUT];
|
||||
switch (mStep) {
|
||||
case 0: {
|
||||
if (anm.isEndReached() == true) {
|
||||
mStep = 1;
|
||||
field_0x68D = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
mStateMgr.changeState(StateID_None);
|
||||
return;
|
||||
}
|
||||
}
|
||||
anm.play();
|
||||
}
|
||||
void dLytCommonTitle_c::finalizeState_Out() {}
|
||||
|
||||
void dLytCommonTitle_c::initializeState_Change() {
|
||||
applyTextChange(0);
|
||||
if (mSetMode == SET_01) {
|
||||
startAnim(COMMON_TITLE_ANIM_TITLE_CHANGE);
|
||||
}
|
||||
|
||||
if (field_0x680 == 0) {
|
||||
mStep = 0;
|
||||
startAnim(COMMON_TITLE_ANIM_TEXT_CHANGE);
|
||||
} else {
|
||||
mStep = 10;
|
||||
}
|
||||
}
|
||||
void dLytCommonTitle_c::executeState_Change() {
|
||||
switch (mStep) {
|
||||
case 0: {
|
||||
d2d::AnmGroup_c &anm = mAnm[COMMON_TITLE_ANIM_TEXT_CHANGE];
|
||||
if (anm.isEndReached() == true) {
|
||||
mStep++;
|
||||
}
|
||||
anm.play();
|
||||
if (mSetMode == SET_01) {
|
||||
getAnm(COMMON_TITLE_ANIM_TITLE_CHANGE).play();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
applyTextChange(1);
|
||||
getAnm(COMMON_TITLE_ANIM_TEXT_CHANGE).setFrame(0.0f);
|
||||
if (mSetMode == SET_01) {
|
||||
getAnm(COMMON_TITLE_ANIM_TITLE_CHANGE).setFrame(0.0f);
|
||||
}
|
||||
field_0x68D = true;
|
||||
mStep++;
|
||||
// fall-through
|
||||
}
|
||||
case 2: {
|
||||
mStateMgr.changeState(StateID_Wait);
|
||||
break;
|
||||
}
|
||||
case 10: {
|
||||
d2d::AnmGroup_c &anm = mAnm[COMMON_TITLE_ANIM_TITLE_CHANGE];
|
||||
if (anm.isEndReached() == true) {
|
||||
mStep++;
|
||||
}
|
||||
anm.play();
|
||||
break;
|
||||
}
|
||||
case 11: {
|
||||
applyTextChange(1);
|
||||
mAnm[COMMON_TITLE_ANIM_TITLE_CHANGE].setFrame(0.0f);
|
||||
mAnm[COMMON_TITLE_ANIM_TEXT_OUT].setToEnd();
|
||||
mStep = 2;
|
||||
field_0x68D = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void dLytCommonTitle_c::finalizeState_Change() {
|
||||
stopAnim(COMMON_TITLE_ANIM_TEXT_CHANGE);
|
||||
if (mSetMode == SET_01) {
|
||||
stopAnim(COMMON_TITLE_ANIM_TITLE_CHANGE);
|
||||
}
|
||||
}
|
||||
|
||||
void dLytCommonTitle_c::startAnim(int idx) {
|
||||
d2d::AnmGroup_c &anm = mAnm[idx];
|
||||
anm.bind(false);
|
||||
anm.setFrame(0.0f);
|
||||
}
|
||||
|
||||
void dLytCommonTitle_c::stopAnim(int idx) {
|
||||
d2d::AnmGroup_c &anm = mAnm[idx];
|
||||
anm.unbind();
|
||||
}
|
||||
|
||||
void dLytCommonTitle_c::playBackwards(d2d::AnmGroup_c &anm) {
|
||||
f32 frame = anm.getFrame();
|
||||
if (frame) {
|
||||
frame -= 1.0f;
|
||||
if (frame <= 0.0f) {
|
||||
frame = 0.0f;
|
||||
}
|
||||
anm.setFrame(frame);
|
||||
}
|
||||
}
|
||||
|
||||
void dLytCommonTitle_c::applyText() {
|
||||
if (mSetMode == SET_CAPTION_IMMEDIATELY) {
|
||||
applyCaption(0);
|
||||
} else {
|
||||
applyTitle(0);
|
||||
applyCaption(0);
|
||||
}
|
||||
}
|
||||
|
||||
void dLytCommonTitle_c::applyTextChange(s32 arg) {
|
||||
switch (arg) {
|
||||
case 0: {
|
||||
if (mSetMode == SET_CAPTION_IMMEDIATELY) {
|
||||
applyCaption(1);
|
||||
} else {
|
||||
applyTitle(1);
|
||||
applyCaption(1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
if (mSetMode == SET_CAPTION_IMMEDIATELY) {
|
||||
applyCaption(2);
|
||||
} else {
|
||||
applyTitle(2);
|
||||
applyCaption(2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dLytCommonTitle_c::applyTitle(s32 arg) {
|
||||
dTextBox_c *mainTitle0 = mLyt.getTextBox("T_mainTitle_00");
|
||||
dTextBox_c *mainTitleS0 = mLyt.getTextBox("T_mainTitleS_00");
|
||||
dTextBox_c *mainTitle1 = mLyt.getTextBox("T_mainTitle_01");
|
||||
dTextBox_c *mainTitleS1 = mLyt.getTextBox("T_mainTitleS_01");
|
||||
|
||||
switch (arg) {
|
||||
case 0: {
|
||||
if (mTitle.len() != 0) {
|
||||
const wchar_t *text = dMessage_c::getTextMessageByLabel(mTitle, true, nullptr, 0);
|
||||
mainTitle0->setTextWithGlobalTextProcessor(text);
|
||||
mainTitleS0->setTextWithGlobalTextProcessor(text);
|
||||
mainTitle1->setTextWithGlobalTextProcessor(text);
|
||||
mainTitleS1->setTextWithGlobalTextProcessor(text);
|
||||
} else {
|
||||
mainTitle0->setTextWithGlobalTextProcessor(L"");
|
||||
mainTitleS0->setTextWithGlobalTextProcessor(L"");
|
||||
mainTitle1->setTextWithGlobalTextProcessor(L"");
|
||||
mainTitleS1->setTextWithGlobalTextProcessor(L"");
|
||||
}
|
||||
// @bug missing break, ends up doing duplicate work
|
||||
// break;
|
||||
}
|
||||
case 1: {
|
||||
if (mTitle.len() != 0) {
|
||||
const wchar_t *text = dMessage_c::getTextMessageByLabel(mTitle, true, nullptr, 0);
|
||||
mainTitle0->setTextWithGlobalTextProcessor(text);
|
||||
mainTitleS0->setTextWithGlobalTextProcessor(text);
|
||||
} else {
|
||||
mainTitle0->setTextWithGlobalTextProcessor(L"");
|
||||
mainTitleS0->setTextWithGlobalTextProcessor(L"");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
if (mTitle.len() != 0) {
|
||||
const wchar_t *text = dMessage_c::getTextMessageByLabel(mTitle, true, nullptr, 0);
|
||||
mainTitle1->setTextWithGlobalTextProcessor(text);
|
||||
mainTitleS1->setTextWithGlobalTextProcessor(text);
|
||||
} else {
|
||||
mainTitle1->setTextWithGlobalTextProcessor(L"");
|
||||
mainTitleS1->setTextWithGlobalTextProcessor(L"");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dLytCommonTitle_c::applyCaption(s32 arg) {
|
||||
dTextBox_c *mainTitle0 = mLyt.getTextBox("T_changeText_00");
|
||||
dTextBox_c *mainTitleS0 = mLyt.getTextBox("T_changeTextS_00");
|
||||
dTextBox_c *mainTitle1 = mLyt.getTextBox("T_changeText_01");
|
||||
dTextBox_c *mainTitleS1 = mLyt.getTextBox("T_changeTextS_01");
|
||||
dWindow_c *window0 = mLyt.getWindow("W_bgP_00");
|
||||
dWindow_c *window1 = mLyt.getWindow("W_bgP_01");
|
||||
|
||||
switch (arg) {
|
||||
case 0: {
|
||||
if (mCaption.len() != 0) {
|
||||
const wchar_t *text = dMessage_c::getTextMessageByLabel(mCaption, true, nullptr, 0);
|
||||
mainTitle0->setTextWithGlobalTextProcessor(text);
|
||||
mainTitleS0->setTextWithGlobalTextProcessor(text);
|
||||
mainTitle1->setTextWithGlobalTextProcessor(text);
|
||||
mainTitleS1->setTextWithGlobalTextProcessor(text);
|
||||
if (field_0x680 == 0) {
|
||||
window0->SetVisible(false);
|
||||
window1->SetVisible(true);
|
||||
} else {
|
||||
window0->SetVisible(true);
|
||||
window1->SetVisible(false);
|
||||
}
|
||||
} else {
|
||||
mainTitle0->setTextWithGlobalTextProcessor(L"");
|
||||
mainTitleS0->setTextWithGlobalTextProcessor(L"");
|
||||
mainTitle1->setTextWithGlobalTextProcessor(L"");
|
||||
mainTitleS1->setTextWithGlobalTextProcessor(L"");
|
||||
window0->SetVisible(false);
|
||||
window1->SetVisible(false);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
if (mCaption.len() != 0) {
|
||||
const wchar_t *text = dMessage_c::getTextMessageByLabel(mCaption, true, nullptr, 0);
|
||||
mainTitle1->setTextWithGlobalTextProcessor(text);
|
||||
mainTitleS1->setTextWithGlobalTextProcessor(text);
|
||||
window0->SetVisible(true);
|
||||
} else {
|
||||
mainTitle1->setTextWithGlobalTextProcessor(L"");
|
||||
mainTitleS1->setTextWithGlobalTextProcessor(L"");
|
||||
window0->SetVisible(false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
if (std::strlen(mCaption) != 0) {
|
||||
window1->SetVisible(true);
|
||||
const wchar_t *text = dMessage_c::getTextMessageByLabel(mCaption, true, nullptr, 0);
|
||||
mainTitle0->setTextWithGlobalTextProcessor(text);
|
||||
mainTitleS0->setTextWithGlobalTextProcessor(text);
|
||||
} else {
|
||||
window1->SetVisible(false);
|
||||
mainTitle0->setTextWithGlobalTextProcessor(L"");
|
||||
mainTitleS0->setTextWithGlobalTextProcessor(L"");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
window0->UpdateSize(mLyt.getSizeBoxInWindow("W_bgP_00"), 32.0f);
|
||||
window1->UpdateSize(mLyt.getSizeBoxInWindow("W_bgP_01"), 32.0f);
|
||||
}
|
||||
@@ -150,7 +150,7 @@ void dLytCursorStick_c::executeState_On() {
|
||||
}
|
||||
void dLytCursorStick_c::finalizeState_On() {}
|
||||
|
||||
void dLytCursorStick_c::setTargetPane(nw4r::lyt::Pane *pane) {
|
||||
void dLytCursorStick_c::setTargetPane(const nw4r::lyt::Pane *pane) {
|
||||
mpTargetPane = pane;
|
||||
positionToTarget();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,159 @@
|
||||
#include "d/lyt/d_lyt_pause_back.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "d/d_stage_mgr.h"
|
||||
#include "d/lyt/d2d.h"
|
||||
#include "d/lyt/d_lyt_pause.h"
|
||||
#include "rvl/GX/GXTexture.h"
|
||||
|
||||
STATE_DEFINE(dLytPauseBack_c, None);
|
||||
STATE_DEFINE(dLytPauseBack_c, In);
|
||||
STATE_DEFINE(dLytPauseBack_c, Wait);
|
||||
STATE_DEFINE(dLytPauseBack_c, Out);
|
||||
|
||||
static const d2d::LytBrlanMapping brlanMap[] = {
|
||||
{ "pauseBace_00_in.brlan", "G_inOut_00"},
|
||||
{"pauseBace_00_out.brlan", "G_inOut_00"},
|
||||
};
|
||||
|
||||
#define PAUSE_BACK_ANIM_IN 0
|
||||
#define PAUSE_BACK_ANIM_OUT 1
|
||||
|
||||
#define PAUSE_BACK_NUM_ANIMS 2
|
||||
|
||||
dLytPauseBack_c::dLytPauseBack_c() : mStateMgr(*this) {}
|
||||
|
||||
bool dLytPauseBack_c::build() {
|
||||
d2d::ResAccIf_c *resAcc = dLytPauseMgr_c::GetInstance()->getResAcc1();
|
||||
mLyt.setResAcc(resAcc);
|
||||
mLyt.build("pauseBace_00.brlyt", nullptr);
|
||||
mLyt.setPriority(0x86);
|
||||
|
||||
for (int i = 0; i < PAUSE_BACK_NUM_ANIMS; i++) {
|
||||
mAnm[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName);
|
||||
}
|
||||
|
||||
mStateMgr.changeState(StateID_None);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytPauseBack_c::remove() {
|
||||
mLyt.unbindAnims();
|
||||
for (int i = 0; i < PAUSE_BACK_NUM_ANIMS; i++) {
|
||||
mAnm[i].remove();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytPauseBack_c::execute() {
|
||||
mStateMgr.executeState();
|
||||
mLyt.calc();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytPauseBack_c::draw() {
|
||||
if (mVisible == true) {
|
||||
mLyt.addToDrawList();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void dLytPauseBack_c::requestIn() {
|
||||
mInRequest = true;
|
||||
}
|
||||
|
||||
void dLytPauseBack_c::requestOut() {
|
||||
mOutRequest = true;
|
||||
}
|
||||
|
||||
void dLytPauseBack_c::initializeState_None() {
|
||||
mLyt.unbindAnims();
|
||||
mIsChangingState = false;
|
||||
mInRequest = false;
|
||||
mOutRequest = false;
|
||||
mVisible = false;
|
||||
mOutStep = 0;
|
||||
}
|
||||
void dLytPauseBack_c::executeState_None() {
|
||||
if (mInRequest == true) {
|
||||
mInRequest = false;
|
||||
mStateMgr.changeState(StateID_In);
|
||||
}
|
||||
}
|
||||
void dLytPauseBack_c::finalizeState_None() {}
|
||||
|
||||
void dLytPauseBack_c::initializeState_In() {
|
||||
startAnim(PAUSE_BACK_ANIM_IN);
|
||||
mVisible = true;
|
||||
if (dStageMgr_c::GetInstance()->getField_0x8898() != nullptr) {
|
||||
GXTexObj texObj;
|
||||
dStageMgr_c::GetInstance()->getField_0x8898()->getTexObj(&texObj);
|
||||
mLyt.findPicture("P_capture_00")->GetMaterial()->GetTexMapAry()->ReplaceImage(texObj);
|
||||
mLyt.findPicture("P_capture_01")->GetMaterial()->GetTexMapAry()->ReplaceImage(texObj);
|
||||
}
|
||||
}
|
||||
void dLytPauseBack_c::executeState_In() {
|
||||
d2d::AnmGroup_c &anm = mAnm[PAUSE_BACK_ANIM_IN];
|
||||
if (anm.isEndReached() == true) {
|
||||
mStateMgr.changeState(StateID_Wait);
|
||||
} else {
|
||||
anm.play();
|
||||
}
|
||||
}
|
||||
void dLytPauseBack_c::finalizeState_In() {}
|
||||
|
||||
void dLytPauseBack_c::initializeState_Wait() {
|
||||
mIsChangingState = true;
|
||||
}
|
||||
void dLytPauseBack_c::executeState_Wait() {
|
||||
mIsChangingState = false;
|
||||
if (mOutRequest == true) {
|
||||
mOutRequest = false;
|
||||
mStateMgr.changeState(StateID_Out);
|
||||
}
|
||||
}
|
||||
void dLytPauseBack_c::finalizeState_Wait() {}
|
||||
|
||||
void dLytPauseBack_c::initializeState_Out() {
|
||||
stopAnim(PAUSE_BACK_ANIM_IN);
|
||||
startAnim(PAUSE_BACK_ANIM_OUT);
|
||||
mOutStep = 0;
|
||||
}
|
||||
void dLytPauseBack_c::executeState_Out() {
|
||||
d2d::AnmGroup_c &anm = mAnm[PAUSE_BACK_ANIM_OUT];
|
||||
switch (mOutStep) {
|
||||
case 0: {
|
||||
if (anm.isEndReached() == true) {
|
||||
mOutStep = 1;
|
||||
mIsChangingState = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
mStateMgr.changeState(StateID_None);
|
||||
return;
|
||||
}
|
||||
}
|
||||
anm.play();
|
||||
}
|
||||
void dLytPauseBack_c::finalizeState_Out() {}
|
||||
|
||||
void dLytPauseBack_c::startAnim(int idx) {
|
||||
d2d::AnmGroup_c &anm = mAnm[idx];
|
||||
anm.bind(false);
|
||||
anm.setFrame(0.0f);
|
||||
}
|
||||
|
||||
void dLytPauseBack_c::stopAnim(int idx) {
|
||||
d2d::AnmGroup_c &anm = mAnm[idx];
|
||||
anm.unbind();
|
||||
}
|
||||
|
||||
void dLytPauseBack_c::loadBgTexture() {
|
||||
if (dLytPauseMgr_c::GetInstance()->getBgTexture() != nullptr) {
|
||||
GXTexObj texObj;
|
||||
dLytPauseMgr_c::GetInstance()->getBgTexture()->getTexObj(&texObj);
|
||||
mLyt.findPicture("P_capture_00")->GetMaterial()->GetTexMapAry()->ReplaceImage(texObj);
|
||||
mLyt.findPicture("P_capture_01")->GetMaterial()->GetTexMapAry()->ReplaceImage(texObj);
|
||||
}
|
||||
}
|
||||
+2136
-26
File diff suppressed because it is too large
Load Diff
+1006
-14
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,243 @@
|
||||
#include "d/lyt/d_lyt_pause_info.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "d/a/d_a_itembase.h"
|
||||
#include "d/lyt/d2d.h"
|
||||
#include "d/lyt/d_lyt_common_title.h"
|
||||
#include "d/lyt/d_lyt_control_game.h"
|
||||
#include "d/lyt/d_lyt_pause.h"
|
||||
#include "d/lyt/d_lyt_pause_text.h"
|
||||
#include "d/lyt/d_lyt_util_items.h"
|
||||
#include "sized_string.h"
|
||||
|
||||
STATE_DEFINE(dLytPauseInfo_c, None);
|
||||
STATE_DEFINE(dLytPauseInfo_c, In);
|
||||
STATE_DEFINE(dLytPauseInfo_c, Wait);
|
||||
STATE_DEFINE(dLytPauseInfo_c, Out);
|
||||
|
||||
static const d2d::LytBrlanMapping brlanMap[] = {
|
||||
{ "pauseInfo_00_in.brlan", "G_inOut_00"},
|
||||
{ "pauseInfo_00_out.brlan", "G_inOut_00"},
|
||||
{"pauseInfo_00_input.brlan", "G_input_00"},
|
||||
};
|
||||
|
||||
#define PAUSE_INFO_ANIM_IN 0
|
||||
#define PAUSE_INFO_ANIM_OUT 1
|
||||
#define PAUSE_INFO_ANIM_INPUT 2
|
||||
|
||||
#define PAUSE_INFO_NUM_ANIMS 3
|
||||
|
||||
dLytPauseInfo_c::dLytPauseInfo_c() : mStateMgr(*this) {
|
||||
mpTitle = nullptr;
|
||||
}
|
||||
|
||||
bool dLytPauseInfo_c::build() {
|
||||
d2d::ResAccIf_c *resAcc = dLytPauseMgr_c::GetInstance()->getResAcc1();
|
||||
mLyt.setResAcc(resAcc);
|
||||
mLyt.build("pauseInfo_00.brlyt", nullptr);
|
||||
mLyt.setPriority(0x86);
|
||||
|
||||
for (int i = 0; i < PAUSE_INFO_NUM_ANIMS; i++) {
|
||||
mAnm[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName);
|
||||
}
|
||||
|
||||
mStateMgr.changeState(StateID_None);
|
||||
|
||||
mpTitle = new dLytCommonTitle_c();
|
||||
mpTitle->build();
|
||||
mpTitle->setField_0x680(1);
|
||||
mInputInOut = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytPauseInfo_c::remove() {
|
||||
if (mpTitle != nullptr) {
|
||||
mpTitle->remove();
|
||||
delete mpTitle;
|
||||
mpTitle = nullptr;
|
||||
}
|
||||
mLyt.unbindAnims();
|
||||
for (int i = 0; i < PAUSE_INFO_NUM_ANIMS; i++) {
|
||||
mAnm[i].remove();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytPauseInfo_c::execute() {
|
||||
mStateMgr.executeState();
|
||||
if (!mStateMgr.getStateID()->isEqual(StateID_None)) {
|
||||
if (mInputInOut == true) {
|
||||
playBackwards(mAnm[PAUSE_INFO_ANIM_INPUT]);
|
||||
} else {
|
||||
mAnm[PAUSE_INFO_ANIM_INPUT].play();
|
||||
}
|
||||
}
|
||||
mLyt.calc();
|
||||
if (mpTitle != nullptr) {
|
||||
mpTitle->execute();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytPauseInfo_c::draw() {
|
||||
if (field_0x19B == true) {
|
||||
if (mpTitle != nullptr) {
|
||||
mpTitle->draw();
|
||||
}
|
||||
if (!dLytControlGame_c::getInstance()->isPauseDemo()) {
|
||||
mLyt.addToDrawList();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void dLytPauseInfo_c::requestIn() {
|
||||
mInRequest = true;
|
||||
}
|
||||
|
||||
void dLytPauseInfo_c::requestOut() {
|
||||
mOutRequest = true;
|
||||
}
|
||||
|
||||
void dLytPauseInfo_c::updateTitle() {
|
||||
// Change the title before the transition is finished, so the logic here is correctly inverted
|
||||
if (dLytControlGame_c::getInstance()->getCurrentPauseDisp() != dLytPauseMgr_c::DISP_00_INVENTORY) {
|
||||
// "Gear"
|
||||
mpTitle->set(dLytCommonTitle_c::SET_01, mpTitle->setSubTitle(1), nullptr);
|
||||
} else {
|
||||
// "Collection"
|
||||
mpTitle->set(dLytCommonTitle_c::SET_01, mpTitle->setSubTitle(2), nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void dLytPauseInfo_c::setInputInOut(bool inOut) {
|
||||
if (mpTitle == nullptr) {
|
||||
return;
|
||||
}
|
||||
mpTitle->setInputInOut(inOut);
|
||||
mInputInOut = inOut;
|
||||
}
|
||||
|
||||
void dLytPauseInfo_c::initializeState_None() {
|
||||
mLyt.unbindAnims();
|
||||
mIsChangingState = false;
|
||||
mInRequest = false;
|
||||
mOutRequest = false;
|
||||
field_0x19B = false;
|
||||
mStep = 0;
|
||||
}
|
||||
void dLytPauseInfo_c::executeState_None() {
|
||||
if (mInRequest == true) {
|
||||
mInRequest = false;
|
||||
mStateMgr.changeState(StateID_In);
|
||||
}
|
||||
}
|
||||
void dLytPauseInfo_c::finalizeState_None() {}
|
||||
|
||||
void dLytPauseInfo_c::initializeState_In() {
|
||||
startAnim(PAUSE_INFO_ANIM_IN);
|
||||
startAnim(PAUSE_INFO_ANIM_INPUT);
|
||||
field_0x19B = true;
|
||||
|
||||
s32 msgIdx = 1; // "Gear"
|
||||
if (dLytControlGame_c::getInstance()->getCurrentPauseDisp() != dLytPauseMgr_c::DISP_00_INVENTORY) {
|
||||
msgIdx = 2; // "Collection"
|
||||
}
|
||||
if (dLytControlGame_c::getInstance()->isPauseDemo()) {
|
||||
SizedString<32> label;
|
||||
if (dLytControlGame_c::getInstance()->getItemForPauseDemo() == ITEM_5_CRYSTALS) {
|
||||
getItemLabel(ITEM_1_CRYSTAL, label);
|
||||
} else {
|
||||
getItemLabel(dLytControlGame_c::getInstance()->getItemForPauseDemo(), label);
|
||||
}
|
||||
|
||||
if (label.len() != 0) {
|
||||
const char *msgLabel = mpTitle->setSubTitle(msgIdx);
|
||||
mpTitle->set(dLytCommonTitle_c::SET_00, msgLabel, label);
|
||||
} else {
|
||||
const char *msgLabel = mpTitle->setSubTitle(msgIdx);
|
||||
mpTitle->set(dLytCommonTitle_c::SET_00, msgLabel, nullptr);
|
||||
}
|
||||
} else {
|
||||
const char *msgLabel = mpTitle->setSubTitle(msgIdx);
|
||||
mpTitle->set(dLytCommonTitle_c::SET_00, msgLabel, nullptr);
|
||||
}
|
||||
}
|
||||
void dLytPauseInfo_c::executeState_In() {
|
||||
d2d::AnmGroup_c &anm = mAnm[PAUSE_INFO_ANIM_IN];
|
||||
if (anm.isEndReached() == true) {
|
||||
mStateMgr.changeState(StateID_Wait);
|
||||
} else {
|
||||
anm.play();
|
||||
}
|
||||
}
|
||||
void dLytPauseInfo_c::finalizeState_In() {}
|
||||
|
||||
void dLytPauseInfo_c::initializeState_Wait() {
|
||||
mIsChangingState = true;
|
||||
}
|
||||
void dLytPauseInfo_c::executeState_Wait() {
|
||||
updateCaption();
|
||||
mIsChangingState = false;
|
||||
if (mOutRequest == true) {
|
||||
mOutRequest = false;
|
||||
mStateMgr.changeState(StateID_Out);
|
||||
}
|
||||
}
|
||||
void dLytPauseInfo_c::finalizeState_Wait() {}
|
||||
|
||||
void dLytPauseInfo_c::initializeState_Out() {
|
||||
stopAnim(PAUSE_INFO_ANIM_IN);
|
||||
startAnim(PAUSE_INFO_ANIM_OUT);
|
||||
mpTitle->set(dLytCommonTitle_c::SET_OUT, nullptr, nullptr);
|
||||
mStep = 0;
|
||||
}
|
||||
void dLytPauseInfo_c::executeState_Out() {
|
||||
d2d::AnmGroup_c &anm = mAnm[PAUSE_INFO_ANIM_OUT];
|
||||
switch (mStep) {
|
||||
case 0: {
|
||||
if (anm.isEndReached() == true) {
|
||||
mStep = 1;
|
||||
mIsChangingState = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
mStateMgr.changeState(StateID_None);
|
||||
return;
|
||||
}
|
||||
}
|
||||
anm.play();
|
||||
}
|
||||
void dLytPauseInfo_c::finalizeState_Out() {}
|
||||
|
||||
void dLytPauseInfo_c::startAnim(int idx) {
|
||||
d2d::AnmGroup_c &anm = mAnm[idx];
|
||||
anm.bind(false);
|
||||
anm.setFrame(0.0f);
|
||||
}
|
||||
|
||||
void dLytPauseInfo_c::stopAnim(int idx) {
|
||||
d2d::AnmGroup_c &anm = mAnm[idx];
|
||||
anm.unbind();
|
||||
}
|
||||
|
||||
void dLytPauseInfo_c::playBackwards(d2d::AnmGroup_c &anm) {
|
||||
f32 frame = anm.getFrame();
|
||||
if (frame) {
|
||||
frame -= 1.0f;
|
||||
if (frame <= 0.0f) {
|
||||
frame = 0.0f;
|
||||
}
|
||||
anm.setFrame(frame);
|
||||
}
|
||||
}
|
||||
|
||||
void dLytPauseInfo_c::updateCaption() {
|
||||
if (dLytControlGame_c::getInstance()->isPauseDemo() != true &&
|
||||
dLytPauseMgr_c::GetInstance()->getField_0x083B() == true) {
|
||||
SizedString<32> buf;
|
||||
const char *label = dLytPauseText_c::getCurrentPauseLabel(buf);
|
||||
mpTitle->set(dLytCommonTitle_c::SET_CAPTION_IMMEDIATELY, nullptr, label);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,454 @@
|
||||
#include "d/lyt/d_lyt_pause_text.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "d/a/d_a_item.h"
|
||||
#include "d/a/d_a_itembase.h"
|
||||
#include "d/d_message.h"
|
||||
#include "d/flag/itemflag_manager.h"
|
||||
#include "d/flag/storyflag_manager.h"
|
||||
#include "d/lyt/d2d.h"
|
||||
#include "d/lyt/d_lyt_pause.h"
|
||||
#include "d/lyt/d_lyt_util_items.h"
|
||||
#include "d/lyt/d_textbox.h"
|
||||
#include "nw4r/lyt/lyt_group.h"
|
||||
#include "sized_string.h"
|
||||
#include "toBeSorted/arc_managers/layout_arc_manager.h"
|
||||
|
||||
STATE_DEFINE(dLytPauseText_c, None);
|
||||
STATE_DEFINE(dLytPauseText_c, In);
|
||||
STATE_DEFINE(dLytPauseText_c, Wait);
|
||||
STATE_DEFINE(dLytPauseText_c, Out);
|
||||
|
||||
static const d2d::LytBrlanMapping brlanMap[] = {
|
||||
{ "iconText_00_in.brlan", "G_inOut_00"},
|
||||
{"iconText_00_loop.brlan", "G_loop_00"},
|
||||
{ "iconText_00_out.brlan", "G_inOut_00"},
|
||||
};
|
||||
|
||||
#define PAUSE_TEXT_ANIM_IN 0
|
||||
#define PAUSE_TEXT_ANIM_LOOP 1
|
||||
#define PAUSE_TEXT_ANIM_OUT 2
|
||||
|
||||
#define PAUSE_TEXT_NUM_ANIMS 3
|
||||
|
||||
static const char *sGroupName = "G_ref_00";
|
||||
|
||||
dLytPauseText_c::dLytPauseText_c() : mStateMgr(*this) {}
|
||||
|
||||
bool dLytPauseText_c::build() {
|
||||
d2d::ResAccIf_c *resAcc = dLytPauseMgr_c::GetInstance()->getResAcc1();
|
||||
mLyt.setResAcc(resAcc);
|
||||
mLyt.build("iconText_00.brlyt", nullptr);
|
||||
mLyt.setPriority(0x86);
|
||||
|
||||
for (int i = 0; i < PAUSE_TEXT_NUM_ANIMS; i++) {
|
||||
mAnm[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName);
|
||||
}
|
||||
|
||||
void *data = LayoutArcManager::GetInstance()->getLoadedData("System2D");
|
||||
mResAcc.attach(data, "");
|
||||
|
||||
mSubpanes[0].mpLytPane = &mABtn;
|
||||
for (int i = 0; i < 1; i++) {
|
||||
mSubpanes[i].mpLytPane->build(&mResAcc);
|
||||
mSubpaneList.PushBack(&mSubpanes[i]);
|
||||
}
|
||||
|
||||
if (mLyt.getLayout()->GetGroupContainer() != nullptr) {
|
||||
nw4r::lyt::Group *g = mLyt.getLayout()->GetGroupContainer()->FindGroupByName(sGroupName);
|
||||
if (g != nullptr) {
|
||||
d2d::dSubPane::linkMeters(g, &mSubpaneList);
|
||||
}
|
||||
}
|
||||
|
||||
mLineSpace = mLyt.getTextBox("T_text_00")->GetLineSpace();
|
||||
mStateMgr.changeState(StateID_None);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytPauseText_c::remove() {
|
||||
mLyt.unbindAnims();
|
||||
|
||||
for (d2d::SubPaneList::Iterator it = mSubpaneList.GetBeginIter(); it != mSubpaneList.GetEndIter(); ++it) {
|
||||
d2d::dSubPane *subPane = it->mpLytPane;
|
||||
if (subPane != nullptr) {
|
||||
nw4r::lyt::Pane *parent = subPane->getPane()->GetParent();
|
||||
parent->RemoveChild(subPane->getPane());
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 1; i++) {
|
||||
mSubpanes[i].mpLytPane->remove();
|
||||
}
|
||||
for (int i = 0; i < PAUSE_TEXT_NUM_ANIMS; i++) {
|
||||
mAnm[i].remove();
|
||||
}
|
||||
|
||||
mResAcc.detach();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytPauseText_c::execute() {
|
||||
mStateMgr.executeState();
|
||||
for (int i = 0; i < 1; i++) {
|
||||
mSubpanes[i].mpLytPane->execute();
|
||||
}
|
||||
mLyt.calc();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytPauseText_c::draw() {
|
||||
if (field_0x6D8 == true) {
|
||||
mLyt.addToDrawList();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void dLytPauseText_c::requestIn() {
|
||||
mInRequest = true;
|
||||
}
|
||||
|
||||
void dLytPauseText_c::requestOut() {
|
||||
mOutRequest = true;
|
||||
}
|
||||
|
||||
void dLytPauseText_c::initializeState_None() {
|
||||
mLyt.unbindAnims();
|
||||
mIsChangingState = false;
|
||||
mInRequest = false;
|
||||
mOutRequest = false;
|
||||
field_0x6D8 = false;
|
||||
mStep = 0;
|
||||
mABtn.resetToInvisble();
|
||||
updateText();
|
||||
}
|
||||
void dLytPauseText_c::executeState_None() {
|
||||
if (mInRequest == true) {
|
||||
mInRequest = false;
|
||||
mStateMgr.changeState(StateID_In);
|
||||
}
|
||||
}
|
||||
void dLytPauseText_c::finalizeState_None() {}
|
||||
|
||||
void dLytPauseText_c::initializeState_In() {
|
||||
updateText();
|
||||
startAnim(PAUSE_TEXT_ANIM_IN);
|
||||
startAnim(PAUSE_TEXT_ANIM_LOOP);
|
||||
mABtn.requestIn();
|
||||
field_0x6D8 = true;
|
||||
}
|
||||
void dLytPauseText_c::executeState_In() {
|
||||
d2d::AnmGroup_c &anm = mAnm[PAUSE_TEXT_ANIM_IN];
|
||||
if (anm.isEndReached() == true) {
|
||||
mStateMgr.changeState(StateID_Wait);
|
||||
mAnm[PAUSE_TEXT_ANIM_LOOP].play();
|
||||
} else {
|
||||
anm.play();
|
||||
mAnm[PAUSE_TEXT_ANIM_LOOP].play();
|
||||
}
|
||||
}
|
||||
void dLytPauseText_c::finalizeState_In() {}
|
||||
|
||||
void dLytPauseText_c::initializeState_Wait() {
|
||||
mIsChangingState = true;
|
||||
}
|
||||
void dLytPauseText_c::executeState_Wait() {
|
||||
mAnm[PAUSE_TEXT_ANIM_LOOP].play();
|
||||
mIsChangingState = false;
|
||||
if (mOutRequest == true && mABtn.requestOut(false)) {
|
||||
mOutRequest = false;
|
||||
mStateMgr.changeState(StateID_Out);
|
||||
}
|
||||
}
|
||||
void dLytPauseText_c::finalizeState_Wait() {}
|
||||
|
||||
void dLytPauseText_c::initializeState_Out() {
|
||||
stopAnim(PAUSE_TEXT_ANIM_IN);
|
||||
startAnim(PAUSE_TEXT_ANIM_OUT);
|
||||
mStep = 0;
|
||||
}
|
||||
void dLytPauseText_c::executeState_Out() {
|
||||
d2d::AnmGroup_c &anm = mAnm[PAUSE_TEXT_ANIM_OUT];
|
||||
switch (mStep) {
|
||||
case 0: {
|
||||
if (mABtn.isDoneOut()) {
|
||||
mStep = 1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
case 1: {
|
||||
if (anm.isEndReached() == true) {
|
||||
mStep = 2;
|
||||
mIsChangingState = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
mStateMgr.changeState(StateID_None);
|
||||
return;
|
||||
}
|
||||
}
|
||||
anm.play();
|
||||
mAnm[PAUSE_TEXT_ANIM_LOOP].play();
|
||||
}
|
||||
void dLytPauseText_c::finalizeState_Out() {}
|
||||
|
||||
void dLytPauseText_c::startAnim(int idx) {
|
||||
d2d::AnmGroup_c &anm = mAnm[idx];
|
||||
anm.bind(false);
|
||||
anm.setFrame(0.0f);
|
||||
}
|
||||
|
||||
void dLytPauseText_c::stopAnim(int idx) {
|
||||
d2d::AnmGroup_c &anm = mAnm[idx];
|
||||
anm.unbind();
|
||||
}
|
||||
|
||||
void dLytPauseText_c::updateText() {
|
||||
// "planned implementation"
|
||||
#define TODO_TEXT (L"実装予定")
|
||||
dTextBox_c *text0 = mLyt.getTextBox("T_text_00");
|
||||
dTextBox_c *text0S = mLyt.getTextBox("T_textS_00");
|
||||
dTextBox_c *name0 = mLyt.getTextBox("T_name_00");
|
||||
dTextBox_c *name0S = mLyt.getTextBox("T_nameS_00");
|
||||
|
||||
const wchar_t *text = getCurrentPausePopupName();
|
||||
if (text != nullptr) {
|
||||
name0->setTextWithGlobalTextProcessor(text);
|
||||
name0S->setTextWithGlobalTextProcessor(text);
|
||||
} else {
|
||||
name0->setTextWithGlobalTextProcessor(TODO_TEXT);
|
||||
name0S->setTextWithGlobalTextProcessor(TODO_TEXT);
|
||||
}
|
||||
|
||||
if (isCurrentItemWallet() && dMessage_c::getGlobalTagProcessor() != nullptr) {
|
||||
dMessage_c::getGlobalTagProcessor()->setNumericArg0(dAcItem_c::getCurrentWalletCapacity());
|
||||
}
|
||||
|
||||
text = getCurrentPausePopupCaption();
|
||||
calcTextLines(text0, text);
|
||||
if (text != nullptr) {
|
||||
if (mNumTextLines == 1) {
|
||||
text0->SetLineSpace(0.0f);
|
||||
text0S->SetLineSpace(0.0f);
|
||||
} else {
|
||||
text0->SetLineSpace(mLineSpace);
|
||||
text0S->SetLineSpace(mLineSpace);
|
||||
}
|
||||
text0->setTextWithGlobalTextProcessor(text);
|
||||
text0S->setTextWithGlobalTextProcessor(text);
|
||||
} else {
|
||||
text0->setTextWithGlobalTextProcessor(TODO_TEXT);
|
||||
text0S->setTextWithGlobalTextProcessor(TODO_TEXT);
|
||||
}
|
||||
|
||||
#undef TODO_TEXT
|
||||
}
|
||||
|
||||
const char *dLytPauseText_c::getCurrentPauseLabel(SizedString<32> &buf) {
|
||||
// This is for the title - it's used by a different component (dLytPauseInfo_c)
|
||||
const char *result = nullptr;
|
||||
dLytPauseMgr_c::SelectionType_e selectionType = dLytPauseMgr_c::GetInstance()->getCurrentSelectionType();
|
||||
s32 id = dLytPauseMgr_c::GetInstance()->getCurrentSelectionId();
|
||||
|
||||
switch (selectionType) {
|
||||
case dLytPauseMgr_c::SELECT_DOWSING: {
|
||||
getDowsingLabel(id, buf);
|
||||
if (buf.len() != 0) {
|
||||
result = buf;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case dLytPauseMgr_c::SELECT_CATEGORY: {
|
||||
getPauseCategoryLabel(id, buf);
|
||||
if (buf.len() != 0) {
|
||||
result = buf;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case dLytPauseMgr_c::SELECT_ITEM: {
|
||||
switch (id) {
|
||||
case ITEM_TRI_COURAGE:
|
||||
case ITEM_TRI_POWER:
|
||||
case ITEM_TRI_WISDOM: id = ITEM_COMPLETE_TRIFORCE; break;
|
||||
}
|
||||
getItemLabel(id, buf);
|
||||
if (buf.len() != 0) {
|
||||
result = buf;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case dLytPauseMgr_c::SELECT_FIRE: {
|
||||
buf.empty();
|
||||
buf.sprintf("NAME_FIRE_%03d", id);
|
||||
result = buf;
|
||||
break;
|
||||
}
|
||||
case dLytPauseMgr_c::SELECT_RING: {
|
||||
buf.empty();
|
||||
buf.sprintf("SUB_RING_%02d", id);
|
||||
result = buf;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
getItemLabel(id, buf);
|
||||
if (buf.len() != 0) {
|
||||
result = buf;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
const wchar_t *dLytPauseText_c::getCurrentPausePopupName() {
|
||||
dLytPauseMgr_c::SelectionType_e selectionType = dLytPauseMgr_c::GetInstance()->getCurrentSelectionType();
|
||||
s32 id = dLytPauseMgr_c::GetInstance()->getCurrentSelectionId();
|
||||
|
||||
switch (selectionType) {
|
||||
case dLytPauseMgr_c::SELECT_DOWSING: return getDowsingText(id);
|
||||
case dLytPauseMgr_c::SELECT_ITEM:
|
||||
switch (id) {
|
||||
case ITEM_TRI_COURAGE:
|
||||
case ITEM_TRI_POWER:
|
||||
case ITEM_TRI_WISDOM: return dMessage_c::getTextMessageByLabel("NAME_ITEM_005", true, nullptr, 0);
|
||||
default: return getItemText(id);
|
||||
}
|
||||
case dLytPauseMgr_c::SELECT_CATEGORY: return getPauseCategoryText(id);
|
||||
case dLytPauseMgr_c::SELECT_FIRE: {
|
||||
SizedString<32> buf;
|
||||
buf.sprintf("NAME_FIRE_%03d", id);
|
||||
return dMessage_c::getTextMessageByLabel(buf, true, nullptr, 0);
|
||||
}
|
||||
default: return getItemText(id);
|
||||
}
|
||||
}
|
||||
|
||||
const wchar_t *dLytPauseText_c::getCurrentPausePopupCaption() {
|
||||
// TODO - bunch of unresolved IDs here
|
||||
dLytPauseMgr_c::SelectionType_e selectionType = dLytPauseMgr_c::GetInstance()->getCurrentSelectionType();
|
||||
|
||||
if (dLytPauseMgr_c::GetInstance()->isCurrentSelectionRestricted()) {
|
||||
// "It has been stolen by monsters! You've got to get it back."
|
||||
return dMessage_c::getTextMessageByLabel("CAPTION_ITEM_STOLEN", true, nullptr, 0);
|
||||
}
|
||||
|
||||
s32 id = dLytPauseMgr_c::GetInstance()->getCurrentSelectionId();
|
||||
|
||||
switch (selectionType) {
|
||||
case dLytPauseMgr_c::SELECT_DOWSING: {
|
||||
if (id == 12) {
|
||||
if (ItemflagManager::sInstance->getFlagDirect(502) == 80) {
|
||||
// "You've collected all the Gratitude Crystals. There are none left for your sword to react to."
|
||||
return dMessage_c::getTextMessageByLabel("CAPTION_DOWSING_012_02", true, nullptr, 0);
|
||||
} else {
|
||||
// "Use your dowsing ability to detect the Gratitude Crystals that the demon Batreaux wants to see."
|
||||
return dMessage_c::getTextMessageByLabel("CAPTION_DOWSING_012", true, nullptr, 0);
|
||||
}
|
||||
} else if (id == 14) {
|
||||
if (StoryflagManager::sInstance->getCounterOrFlag(1087) == 27) {
|
||||
// "You've activated all of the Goddess Cubes. There are none left for your sword to react to."
|
||||
return dMessage_c::getTextMessageByLabel("CAPTION_DOWSING_014_02", true, nullptr, 0);
|
||||
} else {
|
||||
// "Use your dowsing ability to detect Goddess Cubes and their corresponding treasure chests in the
|
||||
// sky above."
|
||||
return dMessage_c::getTextMessageByLabel("CAPTION_DOWSING_014", true, nullptr, 0);
|
||||
}
|
||||
} else {
|
||||
SizedString<32> buf;
|
||||
buf.sprintf("CAPTION_DOWSING_%03d", id);
|
||||
return dMessage_c::getTextMessageByLabel(buf, true, nullptr, 0);
|
||||
}
|
||||
}
|
||||
case dLytPauseMgr_c::SELECT_ITEM: {
|
||||
if (id == ITEM_TRI_COURAGE || id == ITEM_TRI_POWER || id == ITEM_TRI_WISDOM) {
|
||||
if (id == ITEM_TRI_COURAGE) {
|
||||
return dMessage_c::getTextMessageByLabel("CAPTION_ITEM_005", true, nullptr, 0);
|
||||
} else if (id == ITEM_TRI_POWER) {
|
||||
return dMessage_c::getTextMessageByLabel("CAPTION_ITEM_005_02", true, nullptr, 0);
|
||||
} else {
|
||||
return dMessage_c::getTextMessageByLabel("CAPTION_ITEM_005_03", true, nullptr, 0);
|
||||
}
|
||||
} else if (id == ITEM_HEART_PIECE) {
|
||||
if (dAcItem_c::getHeartContainerHealthCount() == 24) {
|
||||
// "You've collected all the Pieces of Heart."
|
||||
return dMessage_c::getTextMessageByLabel("CAPTION_ITEM_094_02", true, nullptr, 0);
|
||||
} else {
|
||||
return getCaptionItemText(id);
|
||||
}
|
||||
} else {
|
||||
return getCaptionItemText(id);
|
||||
}
|
||||
}
|
||||
case dLytPauseMgr_c::SELECT_FIRE: {
|
||||
SizedString<32> buf;
|
||||
buf.sprintf("CAPTION_FIRE_%03d", id);
|
||||
return dMessage_c::getTextMessageByLabel(buf, true, nullptr, 0);
|
||||
}
|
||||
default: {
|
||||
if (id == ITEM_CAWLIN_LETTER) {
|
||||
if (StoryflagManager::sInstance->getFlag(552) || StoryflagManager::sInstance->getFlag(555)) {
|
||||
// "A heartfelt letter from Cawlin that you were able to somewhat successfully deliver..."
|
||||
return dMessage_c::getTextMessageByLabel("CAPTION_ITEM_158_02", true, nullptr, 0);
|
||||
} else {
|
||||
return getCaptionItemText(id);
|
||||
}
|
||||
} else if (id == ITEM_BEEDLE_INSECT_CAGE) {
|
||||
if (StoryflagManager::sInstance->getFlag(477)) {
|
||||
// "Formerly contained Beedle's beloved insect. You successfully returned it to its owner."
|
||||
return dMessage_c::getTextMessageByLabel("CAPTION_ITEM_159_02", true, nullptr, 0);
|
||||
} else {
|
||||
return getCaptionItemText(id);
|
||||
}
|
||||
} else if (id == ITEM_RATTLE) {
|
||||
if (StoryflagManager::sInstance->getFlag(387)) {
|
||||
// "This toy belongs to the baby of Bertie, who runs the Potion Shop. You've successfully returned it to its owner."
|
||||
return dMessage_c::getTextMessageByLabel("CAPTION_ITEM_160_02", true, nullptr, 0);
|
||||
} else {
|
||||
return getCaptionItemText(id);
|
||||
}
|
||||
} else if (id == ITEM_1_CRYSTAL) {
|
||||
if (StoryflagManager::sInstance->getFlag(360)) {
|
||||
// "Crystallized gratitude from the people of the land. This power of thankfulness turned Batreaux into a human."
|
||||
return dMessage_c::getTextMessageByLabel("CAPTION_ITEM_048_02", true, nullptr, 0);
|
||||
} else {
|
||||
return getCaptionItemText(id);
|
||||
}
|
||||
} else {
|
||||
return getCaptionItemText(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void dLytPauseText_c::calcTextLines(dTextBox_c *textBox, const wchar_t *text) {
|
||||
if (text != nullptr) {
|
||||
mNumTextLines = textBox->calcTextLines(text, dMessage_c::getGlobalTagProcessor());
|
||||
} else {
|
||||
mNumTextLines = 2;
|
||||
}
|
||||
}
|
||||
|
||||
bool dLytPauseText_c::isCurrentItemWallet() const {
|
||||
dLytPauseMgr_c::SelectionType_e selectionType = dLytPauseMgr_c::GetInstance()->getCurrentSelectionType();
|
||||
if (dLytPauseMgr_c::GetInstance()->isCurrentSelectionRestricted()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
s32 id = dLytPauseMgr_c::GetInstance()->getCurrentSelectionId();
|
||||
|
||||
if (selectionType != dLytPauseMgr_c::SELECT_ITEM) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (id) {
|
||||
case ITEM_UNK_107:
|
||||
case ITEM_MEDIUM_WALLET:
|
||||
case ITEM_BIG_WALLET:
|
||||
case ITEM_GIANT_WALLET:
|
||||
case ITEM_TYCOON_WALLET: return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
@@ -146,8 +146,9 @@ bool dLytMeter1Button_c::build(d2d::ResAccIf_c *resAcc) {
|
||||
mAnm[i].setAnimEnable(false);
|
||||
}
|
||||
|
||||
mLyt.fn_800AB9A0(mLyt.getTextBox("T_sabBtnS_00"), 0);
|
||||
mLyt.fn_800AB9A0(mLyt.getTextBox("T_sabBtn_00"), 0);
|
||||
// "Gear"
|
||||
mLyt.loadTextVariant(mLyt.getTextBox("T_sabBtnS_00"), 0);
|
||||
mLyt.loadTextVariant(mLyt.getTextBox("T_sabBtn_00"), 0);
|
||||
for (int i = 0; i < 1; i++) {
|
||||
mpWindow[i] = mLyt.getWindow(sWindowName1[i]);
|
||||
mpSizeBox[i] = mLyt.getSizeBoxInWindow(sWindowName1[i]);
|
||||
|
||||
@@ -25,11 +25,13 @@ void dLytMeterEventSkip_c::executeState_Invisible() {
|
||||
if (shouldPromptForSkip() || dLytMeter_c::GetInstance()->isHelpOpen()) {
|
||||
if (dLytMeter_c::GetInstance()->isHelpOpen()) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mLyt.fn_800AB9A0(mpTextBoxes[i], 1);
|
||||
// "Close"
|
||||
mLyt.loadTextVariant(mpTextBoxes[i], 1);
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mLyt.fn_800AB9A0(mpTextBoxes[i], 0);
|
||||
// "Skip"
|
||||
mLyt.loadTextVariant(mpTextBoxes[i], 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "d/lyt/d_lyt_control_game.h"
|
||||
#include "d/lyt/d_lyt_do_button.h"
|
||||
#include "d/lyt/d_lyt_unknowns.h"
|
||||
#include "d/lyt/d_lyt_util_items.h"
|
||||
#include "d/lyt/meter/d_lyt_meter.h"
|
||||
#include "d/snd/d_snd_small_effect_mgr.h"
|
||||
#include "m/m_vec.h"
|
||||
@@ -719,9 +720,9 @@ void dLytMeterItemSelect_c::initializeState_SelectIn() {
|
||||
mAnm[ITEM_SELECT_ANIM_DECIDE].setFrame(0.0f);
|
||||
|
||||
for (int i = 0; i < ITEM_SELECT_NUM_ITEMS; i++) {
|
||||
if (fn_800F01B0(i)) {
|
||||
if (hasBWheelItem(i)) {
|
||||
mAnm[i + ITEM_SELECT_ANIM_HAVE_OFFSET].setFrame(0.0f);
|
||||
if (fn_800F01E0(i)) {
|
||||
if (isBocoburinLocked(i)) {
|
||||
mIsBocoburinLocked[i] = true;
|
||||
}
|
||||
} else {
|
||||
@@ -1345,7 +1346,7 @@ void dLytMeterItemSelect_c::initializeState_DemoMove() {
|
||||
} else {
|
||||
field_0x57A3[i] = true;
|
||||
}
|
||||
} else if ((i == 0 || i == 2 || i == 3) && fn_800F01B0(i)) {
|
||||
} else if ((i == 0 || i == 2 || i == 3) && hasBWheelItem(i)) {
|
||||
field_0x57A3[i] = false;
|
||||
field_0x575C++;
|
||||
} else {
|
||||
@@ -1355,8 +1356,8 @@ void dLytMeterItemSelect_c::initializeState_DemoMove() {
|
||||
}
|
||||
|
||||
for (int i = 0; i < ITEM_SELECT_NUM_ITEMS; i++) {
|
||||
if (fn_800F01B0(i)) {
|
||||
if (fn_800F01E0(i) || field_0x57A3[i] == 0) {
|
||||
if (hasBWheelItem(i)) {
|
||||
if (isBocoburinLocked(i) || field_0x57A3[i] == 0) {
|
||||
if (isSlotBocoburinLocked(i)) {
|
||||
mIsBocoburinLocked[i] = true;
|
||||
mAnm[i + ITEM_SELECT_ANIM_HAVE_OFFSET].setFrame(0.0f);
|
||||
@@ -1399,7 +1400,7 @@ void dLytMeterItemSelect_c::executeState_DemoMove() {
|
||||
mDemoMoveTimer++;
|
||||
if (mDemoMoveTimer == 15) {
|
||||
for (int i = 0; i < ITEM_SELECT_NUM_ITEMS; i++) {
|
||||
if (fn_800F01B0(i) && !field_0x57A3[i]) {
|
||||
if (hasBWheelItem(i) && !field_0x57A3[i]) {
|
||||
mAnm[i + ITEM_SELECT_ANIM_HAVE_OFFSET].setFrame(0.0f);
|
||||
field_0x57A3[i] = true;
|
||||
|
||||
@@ -2514,16 +2515,12 @@ u8 dLytMeterItemSelect_c::getInternalBaseItemForSlot(s32 slot) const {
|
||||
return sSlotToInternalItem[slot];
|
||||
}
|
||||
|
||||
extern "C" s32 fn_801673B0(s32);
|
||||
|
||||
bool dLytMeterItemSelect_c::fn_800F01B0(s32 arg) const {
|
||||
return fn_801673B0(arg) != 0;
|
||||
bool dLytMeterItemSelect_c::hasBWheelItem(s32 arg) const {
|
||||
return getItemLevelForBWheelIndex(arg) != 0;
|
||||
}
|
||||
|
||||
extern "C" bool fn_80167780(s32, bool);
|
||||
|
||||
bool dLytMeterItemSelect_c::fn_800F01E0(s32 arg) const {
|
||||
return fn_80167780(arg, true);
|
||||
bool dLytMeterItemSelect_c::isBocoburinLocked(s32 arg) const {
|
||||
return isBWheelIndexBocoburinLocked(arg, true);
|
||||
}
|
||||
|
||||
bool dLytMeterItemSelect_c::isSlotBocoburinLocked(s32 slot) {
|
||||
|
||||
@@ -217,7 +217,8 @@ void dLytMsgWindowSelectBtn_c::initializeState_In() {
|
||||
field_0x9A4 = 1;
|
||||
field_0x9B4 = -1;
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mLyt.fn_800AB9A0(mpDecideTextBoxes[i], 1);
|
||||
// "Select"
|
||||
mLyt.loadTextVariant(mpDecideTextBoxes[i], 1);
|
||||
}
|
||||
|
||||
mpWindow->UpdateSize(mpSizeBox, 32.0f);
|
||||
@@ -317,7 +318,8 @@ void dLytMsgWindowSelectBtn_c::executeState_WaitSelect() {
|
||||
f32 f = mBtnHelper.fn_8011D690(mBtnHelper.field_0x50);
|
||||
// TODO
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mLyt.fn_800AB9A0(mpDecideTextBoxes[i], 0);
|
||||
// "Confirm"
|
||||
mLyt.loadTextVariant(mpDecideTextBoxes[i], 0);
|
||||
}
|
||||
|
||||
mpWindow->UpdateSize(mpSizeBox, 32.0f);
|
||||
|
||||
Reference in New Issue
Block a user