d_lyt_meter_plus_btn OK

This commit is contained in:
robojumper
2025-04-11 22:54:51 +02:00
parent f250e6fa8f
commit 95ef1d3193
15 changed files with 457 additions and 111 deletions
+4
View File
@@ -382,7 +382,11 @@ d/lyt/meter/d_lyt_meter_item_select.cpp:
d/lyt/meter/d_lyt_meter_plus_btn.cpp:
.text start:0x800F35B0 end:0x800F4768
.ctors start:0x804DB704 end:0x804DB708
.rodata start:0x804E5F28 end:0x804E61A0
.data start:0x80516A28 end:0x80516C90
.sdata start:0x80572400 end:0x80572418
.sdata2 start:0x80579BF8 end:0x80579C08
.bss start:0x805AB650 end:0x805AB750
d/lyt/meter/d_lyt_meter_minus_btn.cpp:
.text start:0x800F4770 end:0x800F8D98
+41 -41
View File
@@ -5931,29 +5931,29 @@ isSameName__39sFStateID_c<24dLytMeterItemSelectBtn_c>CFPCc = .text:0x800F3370; /
isSameName__40sFStateID_c<25dLytMeterItemSelectText_c>CFPCc = .text:0x800F3400; // type:function size:0x88
isSameName__41sFStateID_c<26dLytMeterItemSelectBlink_c>CFPCc = .text:0x800F3490; // type:function size:0x88
isSameName__40sFStateID_c<25dLytMeterItemSelectIcon_c>CFPCc = .text:0x800F3520; // type:function size:0x88
fn_800F35B0 = .text:0x800F35B0; // type:function size:0x4
fn_800F35C0 = .text:0x800F35C0; // type:function size:0x34
fn_800F3600 = .text:0x800F3600; // type:function size:0x4
fn_800F3610 = .text:0x800F3610; // type:function size:0x60
fn_800F3670 = .text:0x800F3670; // type:function size:0x70
fn_800F36E0 = .text:0x800F36E0; // type:function size:0xC
fn_800F36F0 = .text:0x800F36F0; // type:function size:0x60
fn_800F3750 = .text:0x800F3750; // type:function size:0x70
fn_800F37C0 = .text:0x800F37C0; // type:function size:0xC
fn_800F37D0 = .text:0x800F37D0; // type:function size:0x4
fn_800F37E0 = .text:0x800F37E0; // type:function size:0x54
fn_800F3840 = .text:0x800F3840; // type:function size:0x4
fn_800F3850 = .text:0x800F3850; // type:function size:0x1F0
fn_800F3A40 = .text:0x800F3A40; // type:function size:0x58
fn_800F3AA0 = .text:0x800F3AA0; // type:function size:0x3B4
fn_800F3E60 = .text:0x800F3E60; // type:function size:0x84
fn_800F3EF0 = .text:0x800F3EF0; // type:function size:0x28
fn_800F3F20 = .text:0x800F3F20; // type:function size:0x250
fn_800F4170 = .text:0x800F4170; // type:function size:0x18
fn_800F4190 = .text:0x800F4190; // type:function size:0x174
fn_800F4310 = .text:0x800F4310; // type:function size:0x8
fn_800F4320 = .text:0x800F4320; // type:function size:0x8
fn_800F4330 = .text:0x800F4330; // type:function size:0x8
initializeState_Wait__18dLytMeterPlusBtn_cFv = .text:0x800F35B0; // type:function size:0x4
executeState_Wait__18dLytMeterPlusBtn_cFv = .text:0x800F35C0; // type:function size:0x34
finalizeState_Wait__18dLytMeterPlusBtn_cFv = .text:0x800F3600; // type:function size:0x4
initializeState_ToUse__18dLytMeterPlusBtn_cFv = .text:0x800F3610; // type:function size:0x60
executeState_ToUse__18dLytMeterPlusBtn_cFv = .text:0x800F3670; // type:function size:0x70
finalizeState_ToUse__18dLytMeterPlusBtn_cFv = .text:0x800F36E0; // type:function size:0xC
initializeState_ToUnuse__18dLytMeterPlusBtn_cFv = .text:0x800F36F0; // type:function size:0x60
executeState_ToUnuse__18dLytMeterPlusBtn_cFv = .text:0x800F3750; // type:function size:0x70
finalizeState_ToUnuse__18dLytMeterPlusBtn_cFv = .text:0x800F37C0; // type:function size:0xC
initializeState_Unuse__18dLytMeterPlusBtn_cFv = .text:0x800F37D0; // type:function size:0x4
executeState_Unuse__18dLytMeterPlusBtn_cFv = .text:0x800F37E0; // type:function size:0x54
finalizeState_Unuse__18dLytMeterPlusBtn_cFv = .text:0x800F3840; // type:function size:0x4
build__18dLytMeterPlusBtn_cFPQ23d2d10ResAccIf_c = .text:0x800F3850; // type:function size:0x1F0
remove__18dLytMeterPlusBtn_cFv = .text:0x800F3A40; // type:function size:0x58
execute__18dLytMeterPlusBtn_cFv = .text:0x800F3AA0; // type:function size:0x3B4
isCalling__18dLytMeterPlusBtn_cCFv = .text:0x800F3E60; // type:function size:0x84
setCall__18dLytMeterPlusBtn_cFb = .text:0x800F3EF0; // type:function size:0x28
hasSpecificMapMark__18dLytMeterPlusBtn_cFv = .text:0x800F3F20; // type:function size:0x250
isMapOpen__18dLytMeterPlusBtn_cCFv = .text:0x800F4170; // type:function size:0x18
setMessage__18dLytMeterPlusBtn_cFl = .text:0x800F4190; // type:function size:0x174
getName__18dLytMeterPlusBtn_cCFv = .text:0x800F4310; // type:function size:0x8
getLyt__18dLytMeterPlusBtn_cFv = .text:0x800F4320; // type:function size:0x8
getPane__18dLytMeterPlusBtn_cFv = .text:0x800F4330; // type:function size:0x8
__sinit_\d_lyt_meter_plus_btn_cpp = .text:0x800F4340; // type:function size:0x338 scope:local
__dt__33sFStateID_c<18dLytMeterPlusBtn_c>Fv = .text:0x800F4680; // type:function size:0x58
isSameName__33sFStateID_c<18dLytMeterPlusBtn_c>CFPCc = .text:0x800F46E0; // type:function size:0x88
@@ -31493,20 +31493,20 @@ __vt__39sFStateID_c<24dLytMeterItemSelectBtn_c> = .data:0x80516958; // type:obje
__vt__40sFStateID_c<25dLytMeterItemSelectText_c> = .data:0x8051698C; // type:object size:0x34
__vt__41sFStateID_c<26dLytMeterItemSelectBlink_c> = .data:0x805169C0; // type:object size:0x34
__vt__40sFStateID_c<25dLytMeterItemSelectIcon_c> = .data:0x805169F4; // type:object size:0x34
lbl_80516A28 = .data:0x80516A28; // type:object size:0x1C
lbl_80516A44 = .data:0x80516A44; // type:object size:0xC
lbl_80516A50 = .data:0x80516A50; // type:object size:0x1C
lbl_80516A6C = .data:0x80516A6C; // type:object size:0xC
lbl_80516A78 = .data:0x80516A78; // type:object size:0x1C
lbl_80516A94 = .data:0x80516A94; // type:object size:0xC
lbl_80516AA0 = .data:0x80516AA0; // type:object size:0xC
lbl_80516A28 = .data:0x80516A28; // type:object size:0x1A data:string
lbl_80516A44 = .data:0x80516A44; // type:object size:0xB data:string
lbl_80516A50 = .data:0x80516A50; // type:object size:0x19 data:string
lbl_80516A6C = .data:0x80516A6C; // type:object size:0xA data:string
lbl_80516A78 = .data:0x80516A78; // type:object size:0x19 data:string
lbl_80516A94 = .data:0x80516A94; // type:object size:0xA data:string
lbl_80516AA0 = .data:0x80516AA0; // type:object size:0x9 data:string
lbl_80516AAC = .data:0x80516AAC; // type:object size:0xC data:string
lbl_80516AB8 = .data:0x80516AB8; // type:object size:0x10
lbl_80516AC8 = .data:0x80516AC8; // type:object size:0xC
lbl_80516AB8 = .data:0x80516AB8; // type:object size:0xD data:string
lbl_80516AC8 = .data:0x80516AC8; // type:object size:0x9 data:string
lbl_80516AD4 = .data:0x80516AD4; // type:object size:0x14 data:string
lbl_80516AE8 = .data:0x80516AE8; // type:object size:0x10
lbl_80516AF8 = .data:0x80516AF8; // type:object size:0x10
__vt__18dLytMeterPlusBtn_c = .data:0x80516B08; // type:object size:0x154
lbl_80516AE8 = .data:0x80516AE8; // type:object size:0xE data:string
lbl_80516AF8 = .data:0x80516AF8; // type:object size:0xD data:string
__vt__18dLytMeterPlusBtn_c = .data:0x80516B08; // type:object size:0x34
__vt__33sFStateID_c<18dLytMeterPlusBtn_c> = .data:0x80516C5C; // type:object size:0x34
lbl_80516C90 = .data:0x80516C90; // type:object size:0x10
lbl_80516CA0 = .data:0x80516CA0; // type:object size:0x10
@@ -38143,9 +38143,9 @@ lbl_805723E8 = .sdata:0x805723E8; // type:object size:0x4 data:4byte
lbl_805723F0 = .sdata:0x805723F0; // type:object size:0x4 data:4byte
lbl_805723F4 = .sdata:0x805723F4; // type:object size:0x6 data:wstring
lbl_805723FC = .sdata:0x805723FC; // type:object size:0x2
lbl_80572400 = .sdata:0x80572400; // type:object size:0x8 data:4byte
lbl_80572400 = .sdata:0x80572400; // type:object size:0x4 data:4byte
lbl_80572408 = .sdata:0x80572408; // type:object size:0x8 data:4byte
lbl_80572410 = .sdata:0x80572410; // type:object size:0x8 data:4byte
lbl_80572410 = .sdata:0x80572410; // type:object size:0x4 data:4byte
lbl_80572418 = .sdata:0x80572418; // type:object size:0x4 data:4byte
lbl_8057241C = .sdata:0x8057241C; // type:object size:0x8
lbl_80572424 = .sdata:0x80572424; // type:object size:0x8
@@ -48705,10 +48705,10 @@ LytMeterItemSelect__STATE_DEMO_OUT_0 = .bss:0x805AB520; // type:object size:0x30
LytMeterItemSelect__STATE_DEMO_OUT_1 = .bss:0x805AB560; // type:object size:0x30 data:4byte
LytMeterItemSelect__STATE_FRAME_OFF_MOVE = .bss:0x805AB5E0; // type:object size:0x30 data:4byte
LytMeterItemSelect__STATE_FRAME_OFF_OUT = .bss:0x805AB620; // type:object size:0x30 data:4byte
lbl_805AB650 = .bss:0x805AB650; // type:object size:0x10
LytMeterPlusBtn__STATE_WAIT = .bss:0x805AB660; // type:object size:0x40 data:4byte
LytMeterPlusBtn__STATE_TO_USE = .bss:0x805AB6A0; // type:object size:0x40 data:4byte
LytMeterPlusBtn__STATE_TO_UNUSE = .bss:0x805AB6E0; // type:object size:0x40 data:4byte
lbl_805AB650 = .bss:0x805AB650; // type:object size:0xC
LytMeterPlusBtn__STATE_WAIT = .bss:0x805AB660; // type:object size:0x30 data:4byte
LytMeterPlusBtn__STATE_TO_USE = .bss:0x805AB6A0; // type:object size:0x30 data:4byte
LytMeterPlusBtn__STATE_TO_UNUSE = .bss:0x805AB6E0; // type:object size:0x30 data:4byte
LytMeterPlusBtn__STATE_UNUSE = .bss:0x805AB720; // type:object size:0x30 data:4byte
lbl_805AB750 = .bss:0x805AB750; // type:object size:0x10
LytMeterMinusBtnMenuIcon__STATE_WAIT = .bss:0x805AB760; // type:object size:0x40 data:4byte
+1 -1
View File
@@ -394,7 +394,7 @@ config.libs = [
Object(NonMatching, "d/lyt/meter/d_lyt_meter_nunchaku_bg.cpp"),
Object(Matching, "d/lyt/meter/d_lyt_meter_nun_stk.cpp"),
Object(Matching, "d/lyt/meter/d_lyt_meter_item_select.cpp"),
Object(NonMatching, "d/lyt/meter/d_lyt_meter_plus_btn.cpp"),
Object(Matching, "d/lyt/meter/d_lyt_meter_plus_btn.cpp"),
Object(NonMatching, "d/lyt/meter/d_lyt_meter_minus_btn.cpp"),
Object(NonMatching, "d/lyt/meter/d_lyt_meter_cross_btn.cpp"),
Object(NonMatching, "d/lyt/meter/d_lyt_meter_dowsing.cpp"),
+10
View File
@@ -121,6 +121,10 @@ public:
return &mFader;
}
bool isInLastBoss() const {
return mIsInLastBoss;
}
private:
static void lastExecuteCallback();
@@ -165,6 +169,12 @@ private:
/* 0x88A0 */ u32 field_0x88A0;
/* 0x88A4 */ SizedString<16> mDemoName;
/* 0x88B4 */ u8 _0x88B4[0x88BC - 0x88B4];
/* 0x88BC */ bool field_0x88BC;
/* 0x88BD */ u8 field_0x88BD;
/* 0x88BE */ u8 field_0x88BE;
/* 0x88BF */ u8 field_0x88BF;
/* 0x88C0 */ u8 field_0x88C0;
/* 0x88C1 */ bool mIsInLastBoss;
};
#endif
+2
View File
@@ -35,6 +35,8 @@ public:
DO_BUTTON_NUN_STK = 4,
DO_BUTTON_REMOCON_BG = 5,
DO_BUTTON_NUN_BG = 6,
DO_BUTTON_PLUS = 11,
};
static void set(DoButton_e button, Action_e value) {
+1 -1
View File
@@ -47,7 +47,7 @@ private:
/* 0x170 */ s32 field_0x170;
/* 0x174 */ s32 field_0x174;
/* 0x178 */ BOOL field_0x178;
/* 0x17C */ s32 field_0x17C;
/* 0x17C */ s32 mDisplayedAction;
/* 0x180 */ s32 mOnDelay;
/* 0x184 */ bool field_0x184;
/* 0x185 */ u8 field_0x185;
+33 -6
View File
@@ -2,8 +2,9 @@
#define D_LYT_METER_PLUS_BTN_H
#include "d/lyt/d2d.h"
#include "d/lyt/d_textbox.h"
#include "nw4r/lyt/lyt_pane.h"
#include "s/s_State.hpp"
#include "s/s_StateMgr.hpp"
class dLytMeterPlusBtn_c : public d2d::dSubPane {
public:
@@ -11,12 +12,26 @@ public:
virtual bool build(d2d::ResAccIf_c *resAcc) override;
virtual bool remove() override;
virtual bool execute() override;
virtual nw4r::lyt::Pane *getPane() override;
virtual d2d::LytBase_c *getLyt() override;
virtual const char *getName() const override;
virtual nw4r::lyt::Pane *getPane() override {
return mLyt.getLayout()->GetRootPane();
}
virtual d2d::LytBase_c *getLyt() override {
return &mLyt;
}
virtual const char *getName() const override {
return mLyt.getName();
}
virtual ~dLytMeterPlusBtn_c() {}
bool isCalling() const;
void setCall(bool shouldCall);
private:
void setMessage(s32 id);
bool isMapOpen() const;
static bool hasSpecificMapMark();
STATE_FUNC_DECLARE(dLytMeterPlusBtn_c, Wait);
STATE_FUNC_DECLARE(dLytMeterPlusBtn_c, ToUse);
STATE_FUNC_DECLARE(dLytMeterPlusBtn_c, ToUnuse);
@@ -24,8 +39,20 @@ private:
/* 0x004 */ UI_STATE_MGR_DECLARE(dLytMeterPlusBtn_c);
/* 0x040 */ d2d::dLytSub mLyt;
/* 0x0D8 */ d2d::AnmGroup_c mAnmGroups[3];
/* 0x??? */ u8 padding[0x7A64 - 0x7A38];
/* 0x0D8 */ d2d::AnmGroup_c mAnm[3];
/* 0x198 */ nw4r::lyt::Pane *mpPane[1];
/* 0x19C */ nw4r::lyt::Pane *mpOwnerPane;
/* 0x1A0 */ dTextBox_c *mpTextBoxes[2];
/* 0x1A8 */ dWindow_c *mpWindow[1];
/* 0x1AC */ dTextBox_c *mpSizeBox[1];
/* 0x1B0 */ s32 field_0x1B0;
/* 0x1B4 */ s32 field_0x1B4;
/* 0x1B8 */ s32 mCallCount;
/* 0x1BC */ s32 field_0x1BC;
/* 0x1C0 */ bool field_0x1C0;
/* 0x1C1 */ bool field_0x1C1;
/* 0x1C2 */ bool mShouldCall;
/* 0x1C3 */ bool field_0x1C3;
};
#endif
+16 -3
View File
@@ -1,14 +1,27 @@
#ifndef D_T_MAP_MARK_H
#define D_T_MAP_MARK_H
#include "d/a/d_a_base.h"
#include "d/t/d_tg.h"
class dTgMapMark_c : public dAcBase_c {
class dTgMapMark_c : public dTg_c {
public:
dTgMapMark_c() {}
virtual ~dTgMapMark_c() {}
private:
/* 0x0FC */ u16 mTriggerStoryFlag;
/* 0x0FE */ u16 rotz_shift8_0xff;
/* 0x100 */ u8 shift4_0x8;
/* 0x101 */ u8 shift23_0x8;
/* 0x102 */ u8 shift0_0x3;
/* 0x103 */ u8 shift2_0x3;
/* 0x104 */ u8 shift4_0x3f;
/* 0x105 */ u8 rotz_shift0_0xff;
/* 0x108 */ s32 rotz_shift0_0xf;
/* 0x10C */ bool field_0x10C;
/* 0x10D */ bool field_0x10D;
/* 0x10E */ bool field_0x10E;
/* 0x10F */ u8 rotz_shift10_0x3;
/* 0x110 */ u8 rotz_shift12_0x3;
};
#endif
+1 -11
View File
@@ -297,17 +297,7 @@ bool dLytMeterABtn_c::execute() {
return true;
}
// TODO
static const s32 sActIds[] = {
0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13,
0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C,
0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, -1, 0x1,
0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13, 0x14,
0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x0, 0x0, 0x0, 0x0, 0x0
};
#include "d/lyt/meter/d_lyt_meter_action_table.inc"
void dLytMeterABtn_c::setMessage(s32 id) {
char buf[11];
@@ -0,0 +1,10 @@
static const s32 sActIds[] = {
0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13,
0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C,
0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, -1, 0x1,
0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13, 0x14,
0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x0, 0x0, 0x0, 0x0, 0x0
};
+1 -11
View File
@@ -2578,17 +2578,7 @@ void dLytMeterItemSelect_c::fn_800F0310() {
}
}
// TODO
static const s32 sActIds[] = {
0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13,
0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C,
0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, -1, 0x1,
0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13, 0x14,
0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x0, 0x0, 0x0, 0x0, 0x0
};
#include "d/lyt/meter/d_lyt_meter_action_table.inc"
void dLytMeterItemSelect_c::setBtnText(s32 unkId) {
SizedString<16> id;
+5 -15
View File
@@ -72,8 +72,8 @@ void dLytMeterNunStk_c::executeState_Active() {
mAnm[NUN_STK_ANIM_INPUT].setForwardOnce();
mAnm[NUN_STK_ANIM_INPUT].setFrame(0.0f);
mAnm[NUN_STK_ANIM_INPUT].setAnimEnable(true);
if (field_0x170 != field_0x17C) {
field_0x174 = field_0x17C;
if (field_0x170 != mDisplayedAction) {
field_0x174 = mDisplayedAction;
}
mStateMgr.changeState(StateID_Off);
} else {
@@ -127,7 +127,7 @@ bool dLytMeterNunStk_c::build(d2d::ResAccIf_c *resAcc) {
mpSizeBox[i] = mLyt.getSizeBoxInWindow(sWindows[i]);
}
field_0x17C = LytDoButtonRelated::DO_NONE;
mDisplayedAction = LytDoButtonRelated::DO_NONE;
field_0x170 = LytDoButtonRelated::DO_NONE;
field_0x174 = LytDoButtonRelated::DO_NONE;
field_0x184 = true;
@@ -194,17 +194,7 @@ bool dLytMeterNunStk_c::execute() {
return true;
}
// TODO
static const s32 sActIds[] = {
0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13,
0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C,
0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, -1, 0x1,
0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13, 0x14,
0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x0, 0x0, 0x0, 0x0, 0x0
};
#include "d/lyt/meter/d_lyt_meter_action_table.inc"
void dLytMeterNunStk_c::setMessage(s32 id) {
char buf[11];
@@ -226,7 +216,7 @@ void dLytMeterNunStk_c::setMessage(s32 id) {
mpWindow[0]->SetVisible(true);
mpWindow[0]->UpdateSize(mpSizeBox[0], 32.0f);
field_0x17C = id;
mDisplayedAction = id;
} else {
wchar_t b2[2];
b2[0] = b2[1] = 0;
+1 -11
View File
@@ -216,17 +216,7 @@ bool dLytMeterNunchakuBg_c::execute() {
return true;
}
// TODO
static const s32 sActIds[] = {
0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13,
0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C,
0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, -1, 0x1,
0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13, 0x14,
0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x0, 0x0, 0x0, 0x0, 0x0
};
#include "d/lyt/meter/d_lyt_meter_action_table.inc"
void dLytMeterNunchakuBg_c::setMessage(s32 id) {
char buf[11];
+330
View File
@@ -1,6 +1,336 @@
#include "d/lyt/meter/d_lyt_meter_plus_btn.h"
#include "common.h"
#include "d/d_stage_mgr.h"
#include "d/flag/dungeonflag_manager.h"
#include "d/flag/sceneflag_manager.h"
#include "d/flag/storyflag_manager.h"
#include "d/lyt/d_lyt_control_game.h"
#include "d/lyt/d_lyt_unknowns.h"
#include "d/lyt/d_window.h"
#include "d/lyt/meter/d_lyt_meter.h"
#include "d/t/d_t_map_mark.h"
#include "f/f_base.h"
#include "f/f_manager.h"
#include "f/f_profile_name.h"
#include "toBeSorted/small_sound_mgr.h"
STATE_DEFINE(dLytMeterPlusBtn_c, Wait);
STATE_DEFINE(dLytMeterPlusBtn_c, ToUse);
STATE_DEFINE(dLytMeterPlusBtn_c, ToUnuse);
STATE_DEFINE(dLytMeterPlusBtn_c, Unuse);
static const d2d::LytBrlanMapping brlanMap[] = {
{"remoConBtn_02_input.brlan", "G_input_00"},
{ "remoConBtn_02_call.brlan", "G_call_00"},
{ "remoConBtn_02_loop.brlan", "G_loop_00"},
};
#define PLUS_BTN_ANIM_INPUT 0
#define PLUS_BTN_ANIM_CALL 1
#define PLUS_BTN_ANIM_LOOP 2
#define PLUS_BTN_NUM_ANIMS 3
void dLytMeterPlusBtn_c::initializeState_Wait() {}
void dLytMeterPlusBtn_c::executeState_Wait() {
if (!dLytMeterContainer_c::GetInstance()->checkAllFlags(0x20)) {
mStateMgr.changeState(StateID_ToUnuse);
}
}
void dLytMeterPlusBtn_c::finalizeState_Wait() {}
void dLytMeterPlusBtn_c::initializeState_ToUse() {
mAnm[PLUS_BTN_ANIM_INPUT].setBackwardsOnce();
mAnm[PLUS_BTN_ANIM_INPUT].setToStart();
mAnm[PLUS_BTN_ANIM_INPUT].setAnimEnable(true);
}
void dLytMeterPlusBtn_c::executeState_ToUse() {
if (mAnm[PLUS_BTN_ANIM_INPUT].isStop2()) {
mStateMgr.changeState(StateID_Wait);
}
if (mAnm[PLUS_BTN_ANIM_INPUT].isEnabled()) {
mAnm[PLUS_BTN_ANIM_INPUT].play();
}
}
void dLytMeterPlusBtn_c::finalizeState_ToUse() {
mAnm[PLUS_BTN_ANIM_INPUT].setAnimEnable(false);
}
void dLytMeterPlusBtn_c::initializeState_ToUnuse() {
mAnm[PLUS_BTN_ANIM_INPUT].setForwardOnce();
mAnm[PLUS_BTN_ANIM_INPUT].setToStart();
mAnm[PLUS_BTN_ANIM_INPUT].setAnimEnable(true);
}
void dLytMeterPlusBtn_c::executeState_ToUnuse() {
if (mAnm[PLUS_BTN_ANIM_INPUT].isStop2()) {
mStateMgr.changeState(StateID_Unuse);
}
if (mAnm[PLUS_BTN_ANIM_INPUT].isEnabled()) {
mAnm[PLUS_BTN_ANIM_INPUT].play();
}
}
void dLytMeterPlusBtn_c::finalizeState_ToUnuse() {
mAnm[PLUS_BTN_ANIM_INPUT].setAnimEnable(false);
}
void dLytMeterPlusBtn_c::initializeState_Unuse() {}
void dLytMeterPlusBtn_c::executeState_Unuse() {
if (dLytMeterContainer_c::GetInstance()->checkAllFlags(0x20)) {
if (field_0x1BC <= 0) {
mStateMgr.changeState(StateID_ToUse);
} else {
field_0x1BC--;
}
} else {
field_0x1BC = 15;
}
}
void dLytMeterPlusBtn_c::finalizeState_Unuse() {}
static const char *sPane[] = {"N_all_00"};
static const char *sTextBoxes[] = {
"T_mapBtn_02",
"T_mapBtnS_00",
};
static const char *sWindows[] = {"W_bgP_00"};
bool dLytMeterPlusBtn_c::build(d2d::ResAccIf_c *resAcc) {
mLyt.setResAcc(resAcc);
mLyt.build("remoConBtn_02.brlyt", nullptr);
for (int i = 0; i < PLUS_BTN_NUM_ANIMS; i++) {
mAnm[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName);
mAnm[i].bind(false);
mAnm[i].setAnimEnable(false);
}
for (int i = 0; i < 1; i++) {
mpPane[i] = mLyt.findPane(sPane[i]);
}
for (int i = 0; i < 2; i++) {
mpTextBoxes[i] = mLyt.getTextBox(sTextBoxes[i]);
}
for (int i = 0; i < 1; i++) {
mpWindow[i] = mLyt.getWindow(sWindows[i]);
mpSizeBox[i] = mLyt.getSizeBoxInWindow(sWindows[i]);
mpWindow[i]->UpdateSize(mpSizeBox[i], 32.0f);
}
field_0x1B0 = LytDoButtonRelated::DO_NONE;
field_0x1B4 = LytDoButtonRelated::DO_NONE;
setMessage(LytDoButtonRelated::DO_NONE);
field_0x1C0 = 0;
field_0x1C1 = StoryflagManager::sInstance->getCounterOrFlag(212);
mCallCount = 0;
mpOwnerPane = nullptr;
mShouldCall = false;
field_0x1C3 = false;
field_0x1BC = 15;
mAnm[PLUS_BTN_ANIM_LOOP].setAnimEnable(true);
mAnm[PLUS_BTN_ANIM_INPUT].setAnimEnable(true);
mAnm[PLUS_BTN_ANIM_INPUT].setFrame(0.0f);
mLyt.calc();
mAnm[PLUS_BTN_ANIM_INPUT].setAnimEnable(false);
mStateMgr.changeState(StateID_Wait);
return true;
}
bool dLytMeterPlusBtn_c::remove() {
for (int i = 0; i < PLUS_BTN_NUM_ANIMS; i++) {
mAnm[i].unbind();
mAnm[i].remove();
}
return true;
}
bool dLytMeterPlusBtn_c::execute() {
if (mpOwnerPane == nullptr) {
return true;
}
if (!mpOwnerPane->IsVisible()) {
if (*mStateMgr.getStateID() == StateID_Wait && dStageMgr_c::GetInstance()->isInLastBoss()) {
mAnm[PLUS_BTN_ANIM_INPUT].setAnimEnable(true);
mAnm[PLUS_BTN_ANIM_INPUT].setToEnd();
mLyt.calc();
mAnm[PLUS_BTN_ANIM_INPUT].setAnimEnable(false);
mStateMgr.changeState(StateID_Unuse);
}
return true;
}
// Better double check if the map is open!
if (hasSpecificMapMark() && DungeonflagManager::sInstance->getCounterOrFlag(2, 8) && !isMapOpen() &&
dLytMeterContainer_c::GetInstance()->checkAllFlags(0x20) && !isMapOpen()) {
mShouldCall = true;
} else {
if (dLytControlGame_c::getInstance()->isStateNormal()) {
if (StoryflagManager::sInstance->getCounterOrFlag(567)) {
mShouldCall = true;
} else {
mShouldCall = false;
}
} else {
mShouldCall = false;
}
}
if (mShouldCall && dLytMeterContainer_c::GetInstance()->checkAllFlags(0x20)) {
if (!field_0x1C3) {
mAnm[PLUS_BTN_ANIM_CALL].setToEnd();
mAnm[PLUS_BTN_ANIM_CALL].setAnimEnable(true);
field_0x1C3 = true;
}
if (mAnm[PLUS_BTN_ANIM_CALL].isEnabled()) {
mAnm[PLUS_BTN_ANIM_CALL].play();
if (dLytMeterContainer_c::GetInstance()->checkAllFlags(0x20) &&
mAnm[PLUS_BTN_ANIM_CALL].getFrame() == 1.0f && mCallCount < 3) {
SmallSoundManager::GetInstance()->playSound(SE_S_PLUS_BUTTON_BLINK);
mCallCount++;
}
}
} else if (field_0x1C3 == true) {
mAnm[PLUS_BTN_ANIM_CALL].setToEnd();
} else if (mAnm[PLUS_BTN_ANIM_CALL].isEnabled()) {
mAnm[PLUS_BTN_ANIM_CALL].setAnimEnable(false);
}
if (!mShouldCall) {
field_0x1C3 = mShouldCall;
}
mShouldCall = false;
field_0x1B0 = LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_PLUS);
if (field_0x1B0 != field_0x1B4) {
setMessage(field_0x1B0);
}
mStateMgr.executeState();
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_PLUS, LytDoButtonRelated::DO_NONE);
if (mAnm[PLUS_BTN_ANIM_LOOP].isEnabled()) {
mAnm[PLUS_BTN_ANIM_LOOP].play();
}
return true;
}
bool dLytMeterPlusBtn_c::isCalling() const {
if (dLytControlGame_c::getInstance()->isStateNormal() && StoryflagManager::sInstance->getCounterOrFlag(567)) {
return true;
}
return false;
}
void dLytMeterPlusBtn_c::setCall(bool shouldCall) {
field_0x1C0 = shouldCall;
if (shouldCall) {
StoryflagManager::sInstance->setFlag(212);
}
}
bool dLytMeterPlusBtn_c::hasSpecificMapMark() {
dTgMapMark_c *mark = nullptr;
while ((mark = static_cast<dTgMapMark_c *>(fManager_c::searchBaseByGroupType(fBase_c::STAGE, mark))) != nullptr) {
if (mark->checkActorProperty(0x100) || mark->profile_name != fProfile::T_MAP_MARK ||
mark->rotz_shift0_0xf == 1) {
continue;
}
switch (mark->shift0_0x3) {
case 0: {
mark->field_0x10D = mark->shift4_0x8 < 0xFF &&
SceneflagManager::sInstance->checkBoolFlag(mark->roomid, mark->shift4_0x8);
break;
}
case 1: {
mark->field_0x10D = mark->shift4_0x8 < 0xFF &&
!SceneflagManager::sInstance->checkBoolFlag(mark->roomid, mark->shift4_0x8);
break;
}
case 3: {
mark->field_0x10D = true;
break;
}
}
switch (mark->shift2_0x3) {
case 0: {
mark->field_0x10C = StoryflagManager::sInstance->getCounterOrFlag(mark->mTriggerStoryFlag) != 0;
break;
}
case 1: {
mark->field_0x10C = StoryflagManager::sInstance->getCounterOrFlag(mark->mTriggerStoryFlag) == 0;
break;
}
case 3: {
mark->field_0x10C = true;
break;
}
}
mark->field_0x10E = mark->field_0x10C && mark->field_0x10D;
if (mark->shift23_0x8 < 0xFF && SceneflagManager::sInstance->checkBoolFlag(mark->roomid, mark->shift23_0x8)) {
mark->field_0x10E = !mark->field_0x10E;
if (mark->rotz_shift12_0x3 != 0) {
mark->field_0x10E = false;
}
}
if (mark->field_0x10E && mark->rotz_shift10_0x3 != 0) {
return true;
}
}
return false;
}
bool dLytMeterPlusBtn_c::isMapOpen() const {
if (dLytControlGame_c::getInstance() != nullptr) {
return dLytControlGame_c::getInstance()->isInSomeMapState();
}
return false;
}
#include "d/lyt/meter/d_lyt_meter_action_table.inc"
void dLytMeterPlusBtn_c::setMessage(s32 id) {
char buf[11];
for (int i = 0; i < 11; i++) {
buf[i] = 0;
}
if (id < LytDoButtonRelated::DO_NONE) {
if (id < 0x5D) {
sprintf(buf, "ACT_INFO_%03d", sActIds[id]);
} else {
s32 id2 = id - 0x5E;
sprintf(buf, "ACT_ETC_%03d", sActIds[id2]);
}
for (int i = 0; i < 2; i++) {
mpTextBoxes[i]->SetVisible(true);
mpTextBoxes[i]->setMessageWithGlobalTextProcessor2(buf, nullptr);
}
mpWindow[0]->SetVisible(true);
mpWindow[0]->UpdateSize(mpSizeBox[0], 32.0f);
} else {
mpTextBoxes[0]->SetVisible(false);
mpTextBoxes[1]->SetVisible(false);
mpWindow[0]->SetVisible(false);
}
field_0x1B4 = id;
}
+1 -11
View File
@@ -242,17 +242,7 @@ bool dLytMeterZBtn_c::execute() {
return true;
}
// TODO
static const s32 sActIds[] = {
0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13,
0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26,
0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C,
0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, -1, 0x1,
0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF, 0x10, 0x11, 0x12, 0x13, 0x14,
0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x0, 0x0, 0x0, 0x0, 0x0
};
#include "d/lyt/meter/d_lyt_meter_action_table.inc"
void dLytMeterZBtn_c::setMessage(s32 id) {
char buf[11];