A bit of select_btn

This commit is contained in:
robojumper
2025-04-03 19:09:11 +02:00
parent e7e08fa546
commit 832f6a6744
6 changed files with 761 additions and 61 deletions
+4 -1
View File
@@ -439,10 +439,13 @@ d/lyt/d_lyt_common_icon_item.cpp:
d/lyt/msg_window/d_lyt_msg_window.cpp:
.text start:0x801148F0 end:0x8011C8C8
.ctors start:0x804DB738 end:0x804DB73C
.data start:0x8051B6E8 end:0x8051C300
d/lyt/msg_window/d_lyt_msg_window_select_btn.cpp:
.text start:0x8011C8D0 end:0x80120988
.text start:0x8011C8D0 end:0x80120A18
.ctors start:0x804DB73C end:0x804DB740
.data start:0x8051C300 end:0x8051CB10
.bss start:0x805AE670 end:0x805AE930
d/lyt/msg_window/d_lyt_msg_window_base.cpp:
.text start:0x80120A20 end:0x80121068
+58 -58
View File
@@ -7043,8 +7043,8 @@ initializeState__32sFStateID_c<17dLytAutoCaption_c>CFR17dLytAutoCaption_c = .tex
LytMsgWindow__initStates = .text:0x8011B980; // type:function size:0xE58
LytMsgWindow__dtor = .text:0x8011C7E0; // type:function size:0x58
fn_8011C840 = .text:0x8011C840; // type:function size:0x88
fn_8011C8D0 = .text:0x8011C8D0; // type:function size:0x60
fn_8011C930 = .text:0x8011C930; // type:function size:0x40
__ct__15SelectBtnHelperFv = .text:0x8011C8D0; // type:function size:0x60
__dt__15SelectBtnHelperFv = .text:0x8011C930; // type:function size:0x40
fn_8011C970 = .text:0x8011C970; // type:function size:0x6C
fn_8011C9E0 = .text:0x8011C9E0; // type:function size:0x4
fn_8011C9F0 = .text:0x8011C9F0; // type:function size:0xCC
@@ -7056,65 +7056,65 @@ fn_8011D760 = .text:0x8011D760; // type:function size:0x37C
fn_8011DAE0 = .text:0x8011DAE0; // type:function size:0x5E0
fn_8011E0C0 = .text:0x8011E0C0; // type:function size:0x50
fn_8011E110 = .text:0x8011E110; // type:function size:0x38
fn_8011E150 = .text:0x8011E150; // type:function size:0x4
fn_8011E160 = .text:0x8011E160; // type:function size:0xA4
fn_8011E210 = .text:0x8011E210; // type:function size:0x10
fn_8011E220 = .text:0x8011E220; // type:function size:0x4
fn_8011E230 = .text:0x8011E230; // type:function size:0x4
fn_8011E240 = .text:0x8011E240; // type:function size:0xF4
fn_8011E340 = .text:0x8011E340; // type:function size:0x4
fn_8011E350 = .text:0x8011E350; // type:function size:0x4
fn_8011E360 = .text:0x8011E360; // type:function size:0xA8
fn_8011E410 = .text:0x8011E410; // type:function size:0x4
fn_8011E420 = .text:0x8011E420; // type:function size:0x4
fn_8011E430 = .text:0x8011E430; // type:function size:0xC8
fn_8011E500 = .text:0x8011E500; // type:function size:0x4
fn_8011E510 = .text:0x8011E510; // type:function size:0x54
fn_8011E570 = .text:0x8011E570; // type:function size:0x4C
fn_8011E5C0 = .text:0x8011E5C0; // type:function size:0x10
initializeState_Wait__29dLytMsgWindowSelectBtnParts_cFv = .text:0x8011E150; // type:function size:0x4
executeState_Wait__29dLytMsgWindowSelectBtnParts_cFv = .text:0x8011E160; // type:function size:0xA4
changeState__98sStateMgr_c<29dLytMsgWindowSelectBtnParts_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x8011E210; // type:function size:0x10
finalizeState_Wait__29dLytMsgWindowSelectBtnParts_cFv = .text:0x8011E220; // type:function size:0x4
initializeState_On__29dLytMsgWindowSelectBtnParts_cFv = .text:0x8011E230; // type:function size:0x4
executeState_On__29dLytMsgWindowSelectBtnParts_cFv = .text:0x8011E240; // type:function size:0xF4
finalizeState_On__29dLytMsgWindowSelectBtnParts_cFv = .text:0x8011E340; // type:function size:0x4
initializeState_Select__29dLytMsgWindowSelectBtnParts_cFv = .text:0x8011E350; // type:function size:0x4
executeState_Select__29dLytMsgWindowSelectBtnParts_cFv = .text:0x8011E360; // type:function size:0xA8
finalizeState_Select__29dLytMsgWindowSelectBtnParts_cFv = .text:0x8011E410; // type:function size:0x4
initializeState_Off__29dLytMsgWindowSelectBtnParts_cFv = .text:0x8011E420; // type:function size:0x4
executeState_Off__29dLytMsgWindowSelectBtnParts_cFv = .text:0x8011E430; // type:function size:0xC8
finalizeState_Off__29dLytMsgWindowSelectBtnParts_cFv = .text:0x8011E500; // type:function size:0x4
init__29dLytMsgWindowSelectBtnParts_cFv = .text:0x8011E510; // type:function size:0x54
execute__29dLytMsgWindowSelectBtnParts_cFv = .text:0x8011E570; // type:function size:0x4C
executeState__98sStateMgr_c<29dLytMsgWindowSelectBtnParts_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x8011E5C0; // type:function size:0x10
fn_8011E5D0 = .text:0x8011E5D0; // type:function size:0x138
fn_8011E710 = .text:0x8011E710; // type:function size:0x10
fn_8011E720 = .text:0x8011E720; // type:function size:0x2C
fn_8011E750 = .text:0x8011E750; // type:function size:0x4
fn_8011E760 = .text:0x8011E760; // type:function size:0x4
fn_8011E770 = .text:0x8011E770; // type:function size:0x3C0
fn_8011EB30 = .text:0x8011EB30; // type:function size:0x7C
fn_8011EBB0 = .text:0x8011EBB0; // type:function size:0xC
fn_8011EBC0 = .text:0x8011EBC0; // type:function size:0x58
fn_8011EC20 = .text:0x8011EC20; // type:function size:0x288
fn_8011EEB0 = .text:0x8011EEB0; // type:function size:0x5C
fn_8011EF10 = .text:0x8011EF10; // type:function size:0x21C
fn_8011F130 = .text:0x8011F130; // type:function size:0x7C
fn_8011F1B0 = .text:0x8011F1B0; // type:function size:0x4
fn_8011F1C0 = .text:0x8011F1C0; // type:function size:0x7C
fn_8011F240 = .text:0x8011F240; // type:function size:0xD0
fn_8011F310 = .text:0x8011F310; // type:function size:0x4
fn_8011F320 = .text:0x8011F320; // type:function size:0x94
fn_8011F3C0 = .text:0x8011F3C0; // type:function size:0x38
fn_8011F400 = .text:0x8011F400; // type:function size:0x4
fn_8011F410 = .text:0x8011F410; // type:function size:0x5C
fn_8011F470 = .text:0x8011F470; // type:function size:0xA4
fn_8011F520 = .text:0x8011F520; // type:function size:0xC
fn_8011F530 = .text:0x8011F530; // type:function size:0x3E4
fn_8011F920 = .text:0x8011F920; // type:function size:0x84
fn_8011F9B0 = .text:0x8011F9B0; // type:function size:0x444
fn_8011FE00 = .text:0x8011FE00; // type:function size:0x10
drawChoices = .text:0x8011FE10; // type:function size:0x34
initializeState_Wait__24dLytMsgWindowSelectBtn_cFv = .text:0x8011E720; // type:function size:0x2C
executeState_Wait__24dLytMsgWindowSelectBtn_cFv = .text:0x8011E750; // type:function size:0x4
finalizeState_Wait__24dLytMsgWindowSelectBtn_cFv = .text:0x8011E760; // type:function size:0x4
initializeState_In__24dLytMsgWindowSelectBtn_cFv = .text:0x8011E770; // type:function size:0x3C0
executeState_In__24dLytMsgWindowSelectBtn_cFv = .text:0x8011EB30; // type:function size:0x7C
finalizeState_In__24dLytMsgWindowSelectBtn_cFv = .text:0x8011EBB0; // type:function size:0xC
initializeState_WaitSelect__24dLytMsgWindowSelectBtn_cFv = .text:0x8011EBC0; // type:function size:0x58
executeState_WaitSelect__24dLytMsgWindowSelectBtn_cFv = .text:0x8011EC20; // type:function size:0x288
finalizeState_WaitSelect__24dLytMsgWindowSelectBtn_cFv = .text:0x8011EEB0; // type:function size:0x5C
initializeState_CursorInOut__24dLytMsgWindowSelectBtn_cFv = .text:0x8011EF10; // type:function size:0x21C
executeState_CursorInOut__24dLytMsgWindowSelectBtn_cFv = .text:0x8011F130; // type:function size:0x7C
finalizeState_CursorInOut__24dLytMsgWindowSelectBtn_cFv = .text:0x8011F1B0; // type:function size:0x4
initializeState_WaitDecide__24dLytMsgWindowSelectBtn_cFv = .text:0x8011F1C0; // type:function size:0x7C
executeState_WaitDecide__24dLytMsgWindowSelectBtn_cFv = .text:0x8011F240; // type:function size:0xD0
finalizeState_WaitDecide__24dLytMsgWindowSelectBtn_cFv = .text:0x8011F310; // type:function size:0x4
initializeState_WaitCancel__24dLytMsgWindowSelectBtn_cFv = .text:0x8011F320; // type:function size:0x94
executeState_WaitCancel__24dLytMsgWindowSelectBtn_cFv = .text:0x8011F3C0; // type:function size:0x38
finalizeState_WaitCancel__24dLytMsgWindowSelectBtn_cFv = .text:0x8011F400; // type:function size:0x4
initializeState_Out__24dLytMsgWindowSelectBtn_cFv = .text:0x8011F410; // type:function size:0x5C
executeState_Out__24dLytMsgWindowSelectBtn_cFv = .text:0x8011F470; // type:function size:0xA4
finalizeState_Out__24dLytMsgWindowSelectBtn_cFv = .text:0x8011F520; // type:function size:0xC
build__24dLytMsgWindowSelectBtn_cFPQ23d2d10ResAccIf_c = .text:0x8011F530; // type:function size:0x3E4
remove__24dLytMsgWindowSelectBtn_cFv = .text:0x8011F920; // type:function size:0x84
execute__24dLytMsgWindowSelectBtn_cFv = .text:0x8011F9B0; // type:function size:0x444
executeState__93sStateMgr_c<24dLytMsgWindowSelectBtn_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x8011FE00; // type:function size:0x10
draw__24dLytMsgWindowSelectBtn_cFv = .text:0x8011FE10; // type:function size:0x34
fn_8011FE50 = .text:0x8011FE50; // type:function size:0x24
fn_8011FE80 = .text:0x8011FE80; // type:function size:0x8
fn_8011FE90 = .text:0x8011FE90; // type:function size:0x8
fn_8011FEA0 = .text:0x8011FEA0; // type:function size:0x8
fn_8011FEB0 = .text:0x8011FEB0; // type:function size:0x30
fn_8011FEE0 = .text:0x8011FEE0; // type:function size:0x30
fn_8011FF10 = .text:0x8011FF10; // type:function size:0x30
fn_8011FF40 = .text:0x8011FF40; // type:function size:0x30
fn_8011FF70 = .text:0x8011FF70; // type:function size:0x30
fn_8011FFA0 = .text:0x8011FFA0; // type:function size:0x30
LytMsgWindowSelectBtn__initStates = .text:0x8011FFD0; // type:function size:0x868
LytMsgWindowSelectBtn__LytMsgWindowSelectBtnParts__dtor = .text:0x80120840; // type:function size:0x58
LytMsgWindowSelectBtn__dtor = .text:0x801208A0; // type:function size:0x58
fn_80120900 = .text:0x80120900; // type:function size:0x88
fn_80120990 = .text:0x80120990; // type:function size:0x88
getName__24dLytMsgWindowSelectBtn_cCFv = .text:0x8011FE80; // type:function size:0x8
getLyt__24dLytMsgWindowSelectBtn_cFv = .text:0x8011FE90; // type:function size:0x8
getPane__24dLytMsgWindowSelectBtn_cFv = .text:0x8011FEA0; // type:function size:0x8
finalizeState__44sFStateID_c<29dLytMsgWindowSelectBtnParts_c>CFR29dLytMsgWindowSelectBtnParts_c = .text:0x8011FEB0; // type:function size:0x30
executeState__44sFStateID_c<29dLytMsgWindowSelectBtnParts_c>CFR29dLytMsgWindowSelectBtnParts_c = .text:0x8011FEE0; // type:function size:0x30
initializeState__44sFStateID_c<29dLytMsgWindowSelectBtnParts_c>CFR29dLytMsgWindowSelectBtnParts_c = .text:0x8011FF10; // type:function size:0x30
finalizeState__39sFStateID_c<24dLytMsgWindowSelectBtn_c>CFR24dLytMsgWindowSelectBtn_c = .text:0x8011FF40; // type:function size:0x30
executeState__39sFStateID_c<24dLytMsgWindowSelectBtn_c>CFR24dLytMsgWindowSelectBtn_c = .text:0x8011FF70; // type:function size:0x30
initializeState__39sFStateID_c<24dLytMsgWindowSelectBtn_c>CFR24dLytMsgWindowSelectBtn_c = .text:0x8011FFA0; // type:function size:0x30
__sinit_\d_lyt_msg_window_select_btn_cpp = .text:0x8011FFD0; // type:function size:0x868
__dt__44sFStateID_c<29dLytMsgWindowSelectBtnParts_c>Fv = .text:0x80120840; // type:function size:0x58
__dt__39sFStateID_c<24dLytMsgWindowSelectBtn_c>Fv = .text:0x801208A0; // type:function size:0x58
isSameName__39sFStateID_c<24dLytMsgWindowSelectBtn_c>CFPCc = .text:0x80120900; // type:function size:0x88
isSameName__44sFStateID_c<29dLytMsgWindowSelectBtnParts_c>CFPCc = .text:0x80120990; // type:function size:0x88
fn_80120A20 = .text:0x80120A20; // type:function size:0x8
fn_80120A30 = .text:0x80120A30; // type:function size:0x8
fn_80120A40 = .text:0x80120A40; // type:function size:0x8
@@ -0,0 +1,117 @@
#ifndef D_LYT_MSG_WINDOW_SELECT_BTN_H
#define D_LYT_MSG_WINDOW_SELECT_BTN_H
#include "d/lyt/d2d.h"
#include "d/lyt/d_window.h"
#include "nw4r/lyt/lyt_pane.h"
#include "s/s_State.hpp"
// Size 0x54?
struct SelectBtnHelper {
SelectBtnHelper();
~SelectBtnHelper();
/* 0x00 */ nw4r::lyt::Pane *panes[9];
/* 0x24 */ u8 _0x24[0x34 - 0x24];
/* 0x34 */ f32 field_0x34;
/* 0x38 */ f32 field_0x38;
/* 0x3C */ f32 field_0x3C;
/* 0x40 */ f32 field_0x40;
/* 0x44 */ s32 field_0x44;
/* 0x48 */ s32 field_0x48;
/* 0x4C */ s32 field_0x4C;
/* 0x50 */ s8 field_0x50;
/* 0x51 */ s8 field_0x51;
/* 0x52 */ s8 field_0x52;
f32 fn_8011D690(s32);
void fn_8011C970();
u8 fn_8011CAC0();
};
class dLytMsgWindowSelectBtnParts_c {
friend class dLytMsgWindowSelectBtn_c;
public:
dLytMsgWindowSelectBtnParts_c() : mStateMgr(*this) {}
void init();
void execute();
private:
STATE_FUNC_DECLARE(dLytMsgWindowSelectBtnParts_c, Wait);
STATE_FUNC_DECLARE(dLytMsgWindowSelectBtnParts_c, On);
STATE_FUNC_DECLARE(dLytMsgWindowSelectBtnParts_c, Select);
STATE_FUNC_DECLARE(dLytMsgWindowSelectBtnParts_c, Off);
/* 0x00 */ UI_STATE_MGR_DECLARE(dLytMsgWindowSelectBtnParts_c);
/* 0x3C */ d2d::AnmGroup_c *mpAnms[3];
/* 0x48 */ u32 field_0x48;
/* 0x4C */ u32 field_0x4C;
/* 0x50 */ u8 field_0x50;
};
class dLytMsgWindowSelectBtn_c : public d2d::dSubPane {
public:
dLytMsgWindowSelectBtn_c() : mStateMgr(*this) {}
virtual bool build(d2d::ResAccIf_c *resAcc) override;
virtual bool remove() override;
virtual bool execute() 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 ~dLytMsgWindowSelectBtn_c() {}
bool draw();
private:
s32 fn_8011FE50();
STATE_FUNC_DECLARE(dLytMsgWindowSelectBtn_c, Wait);
STATE_FUNC_DECLARE(dLytMsgWindowSelectBtn_c, In);
STATE_FUNC_DECLARE(dLytMsgWindowSelectBtn_c, WaitSelect);
STATE_FUNC_DECLARE(dLytMsgWindowSelectBtn_c, CursorInOut);
STATE_FUNC_DECLARE(dLytMsgWindowSelectBtn_c, WaitDecide);
STATE_FUNC_DECLARE(dLytMsgWindowSelectBtn_c, WaitCancel);
STATE_FUNC_DECLARE(dLytMsgWindowSelectBtn_c, Out);
/* 0x008 */ UI_STATE_MGR_DECLARE(dLytMsgWindowSelectBtn_c);
/* 0x044 */ d2d::dLytSub mLyt;
/* 0x0D8 */ d2d::AnmGroup_c mAnm[27];
/* 0x798 */ nw4r::lyt::Pane *mpSelectPanes[7];
/* 0x7B4 */ dTextBox_c *mpSelectTextBoxes[4][2];
/* 0x7D4 */ dTextBox_c *mpDecideTextBoxes[2];
/* 0x7DC */ nw4r::lyt::Pane *mpBoundings[4];
/* 0x7EC */ dWindow_c *mpWindow;
/* 0x7F0 */ dTextBox_c *mpSizeBox;
/* 0x7F4 */ dLytMsgWindowSelectBtnParts_c mParts[4];
/* 0x944 */ SelectBtnHelper mBtnHelper;
/* 0x998 */ void *field_0x998;
/* 0x99C */ s32 field_0x99C;
/* 0x9A0 */ s32 field_0x9A0;
/* 0x9A4 */ u8 field_0x9A4;
/* 0x9A8 */ s32 field_0x9A8;
/* 0x9AC */ void *field_0x9AC;
/* 0x9B0 */ s32 field_0x9B0;
/* 0x9B0 */ s32 field_0x9B4;
/* 0x9B8 */ s32 field_0x9B8;
/* 0x9BC */ s32 field_0x9BC;
/* 0x9C0 */ s32 field_0x9C0;
/* 0x9C4 */ void *field_0x9C4;
/* 0x9C8 */ s32 field_0x9C8;
/* 0x9CC */ s8 field_0x9CC;
/* 0x9CD */ u8 field_0x9CD;
/* 0x9CE */ u8 field_0x9CE;
/* 0x9CF */ u8 field_0x9CF;
/* 0x9D0 */ u8 field_0x9D0;
/* 0x9D1 */ u8 field_0x9D1;
};
#endif
+2
View File
@@ -5,7 +5,9 @@
extern "C" void *BGM_MGR;
extern "C" void fn_8035E000();
extern "C" void fn_8035E860(void *);
extern "C" void fn_8035E310(void *);
extern "C" void fn_8035E880(void *);
extern "C" void *ENEMY_SOUND_MGR;
extern "C" void fn_80362150(void *, u16);
+2 -2
View File
@@ -106,8 +106,8 @@ bool dLytMeter1Button_c::build(d2d::ResAccIf_c *resAcc) {
mAnmGroups[i].setAnimEnable(false);
}
// TODO
mLyt.fn_800AB9A0(mLyt.getTextBox("T_sabBtnS_00"), nullptr);
mLyt.fn_800AB9A0(mLyt.getTextBox("T_sabBtn_00"), nullptr);
mLyt.fn_800AB9A0(mLyt.getTextBox("T_sabBtnS_00"), 0);
mLyt.fn_800AB9A0(mLyt.getTextBox("T_sabBtn_00"), 0);
mpWindow = mLyt.getWindow(sWindowName1);
mpTextbox = mLyt.getSizeBoxInWindow(sWindowName1);
mpWindow->UpdateSize(mpTextbox, 32.0f);
@@ -0,0 +1,578 @@
#include "d/lyt/msg_window/d_lyt_msg_window_select_btn.h"
#include "common.h"
#include "d/lyt/d2d.h"
#include "toBeSorted/music_mgrs.h"
#include "toBeSorted/small_sound_mgr.h"
STATE_DEFINE(dLytMsgWindowSelectBtnParts_c, Wait);
STATE_DEFINE(dLytMsgWindowSelectBtnParts_c, On);
STATE_DEFINE(dLytMsgWindowSelectBtnParts_c, Select);
STATE_DEFINE(dLytMsgWindowSelectBtnParts_c, Off);
STATE_DEFINE(dLytMsgWindowSelectBtn_c, Wait);
STATE_DEFINE(dLytMsgWindowSelectBtn_c, In);
STATE_DEFINE(dLytMsgWindowSelectBtn_c, WaitSelect);
STATE_DEFINE(dLytMsgWindowSelectBtn_c, CursorInOut);
STATE_DEFINE(dLytMsgWindowSelectBtn_c, WaitDecide);
STATE_DEFINE(dLytMsgWindowSelectBtn_c, WaitCancel);
STATE_DEFINE(dLytMsgWindowSelectBtn_c, Out);
SelectBtnHelper::SelectBtnHelper() {
field_0x4C = -1;
field_0x50 = -1;
field_0x44 = field_0x48 = 0;
field_0x34 = field_0x3C = 0.0f;
field_0x38 = field_0x40 = 0.0f;
field_0x52 = 0;
field_0x51 = 1;
panes[0] = 0;
panes[1] = 0;
panes[2] = 0;
panes[3] = 0;
panes[4] = 0;
panes[5] = 0;
panes[6] = 0;
panes[7] = 0;
panes[8] = 0;
}
SelectBtnHelper::~SelectBtnHelper() {}
// STATE_DEFINE\(([A-Za-z_0-9]+), ([A-Za-z_0-9]+)\);
// void $1::initializeState_$2() {}\nvoid $1::executeState_$2() {}\nvoid $1::finalizeState_$2() {}\n
void dLytMsgWindowSelectBtnParts_c::initializeState_Wait() {}
void dLytMsgWindowSelectBtnParts_c::executeState_Wait() {
if (field_0x48 != 0) {
for (int i = 0; i <= 1; i++) {
mpAnms[i]->setForwardOnce();
mpAnms[i]->setFrame(0.0f);
mpAnms[i]->setAnimEnable(true);
}
mStateMgr.changeState(StateID_On);
}
}
void dLytMsgWindowSelectBtnParts_c::finalizeState_Wait() {}
void dLytMsgWindowSelectBtnParts_c::initializeState_On() {}
void dLytMsgWindowSelectBtnParts_c::executeState_On() {
if (mpAnms[0]->isEndReached() && mpAnms[1]->isEndReached()) {
mpAnms[0]->setAnimEnable(false);
mpAnms[1]->setAnimEnable(false);
mStateMgr.changeState(StateID_Select);
}
for (int i = 0; i <= 1; i++) {
if (mpAnms[i]->isEnabled()) {
mpAnms[i]->play();
}
}
}
void dLytMsgWindowSelectBtnParts_c::finalizeState_On() {}
void dLytMsgWindowSelectBtnParts_c::initializeState_Select() {}
void dLytMsgWindowSelectBtnParts_c::executeState_Select() {
if (field_0x48 == 0) {
for (int i = 0; i <= 1; i++) {
mpAnms[i]->setBackwardsOnce();
mpAnms[i]->setToStart();
mpAnms[i]->setAnimEnable(true);
}
mStateMgr.changeState(StateID_Off);
}
}
void dLytMsgWindowSelectBtnParts_c::finalizeState_Select() {}
void dLytMsgWindowSelectBtnParts_c::initializeState_Off() {}
void dLytMsgWindowSelectBtnParts_c::executeState_Off() {
if (mpAnms[0]->isStop2() && mpAnms[1]->isStop2()) {
mpAnms[0]->setAnimEnable(false);
mpAnms[1]->setAnimEnable(false);
mStateMgr.changeState(StateID_Wait);
}
for (int i = 0; i <= 1; i++) {
if (mpAnms[i]->isEnabled()) {
mpAnms[i]->play();
}
}
}
void dLytMsgWindowSelectBtnParts_c::finalizeState_Off() {}
void dLytMsgWindowSelectBtnParts_c::init() {
mStateMgr.changeState(StateID_Wait);
field_0x48 = 0;
field_0x50 = 0;
field_0x4C = 3;
}
void dLytMsgWindowSelectBtnParts_c::execute() {
mStateMgr.executeState();
mpAnms[2]->play();
}
#define SELECT_BTN_ANIM_IN 0
#define SELECT_BTN_ANIM_LOOP_REMOCON 1
#define SELECT_BTN_ANIM_INOUT_CURSOR 2
#define SELECT_BTN_ANIM_MESSAGE_BTN 3
#define SELECT_BTN_ANIM_ITEM_ARROW_0 4
#define SELECT_BTN_ANIM_ITEM_ARROW_1 5
#define SELECT_BTN_ANIM_MESSAGE_BTN_LOOP_0 6
#define SELECT_BTN_ANIM_MESSAGE_BTN_LOOP_1 7
#define SELECT_BTN_ANIM_MESSAGE_BTN_LOOP_2 8
#define SELECT_BTN_ANIM_MESSAGE_BTN_LOOP_3 9
#define SELECT_BTN_ANIM_MESSAGE_BTN_CANCEL_0 10
#define SELECT_BTN_ANIM_MESSAGE_BTN_CANCEL_1 11
#define SELECT_BTN_ANIM_MESSAGE_BTN_CANCEL_2 12
#define SELECT_BTN_ANIM_MESSAGE_BTN_CANCEL_3 13
#define SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_B_0 14
#define SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_B_1 15
#define SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_B_2 16
#define SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_B_3 17
#define SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_A_0 18
#define SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_A_1 19
#define SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_A_2 20
#define SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_A_3 21
#define SELECT_BTN_ANIM_MESSAGE_BTN_DECIDE_0 22
#define SELECT_BTN_ANIM_MESSAGE_BTN_DECIDE_1 23
#define SELECT_BTN_ANIM_MESSAGE_BTN_DECIDE_2 24
#define SELECT_BTN_ANIM_MESSAGE_BTN_DECIDE_3 25
#define SELECT_BTN_ANIM_OUT 26
#define SELECT_BTN_NUM_ANIMS 27
#define SELECT_BTN_NUM_BTNS 4
#define SELECT_BTN_ANIM_MESSAGE_BTN_LOOP_OFFSET SELECT_BTN_ANIM_MESSAGE_BTN_LOOP_0
#define SELECT_BTN_ANIM_MESSAGE_BTN_CANCEL_OFFSET SELECT_BTN_ANIM_MESSAGE_BTN_CANCEL_0
#define SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_B_OFFSET SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_B_0
#define SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_A_OFFSET SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_A_0
#define SELECT_BTN_ANIM_MESSAGE_BTN_DECIDE_OFFSET SELECT_BTN_ANIM_MESSAGE_BTN_DECIDE_0
static const d2d::LytBrlanMapping brlanMap[] = {
{ "messageBtn_00_in.brlan", "G_inOut_00"},
{"messageBtn_00_loopRemocon.brlan", "G_loopRemocon_00"},
{"messageBtn_00_inOutCursor.brlan", "G_inOutAlpha_00"},
{ "messageBtn_00_messageBtn.brlan", "G_messageBtn_00"},
{ "messageBtn_00_itemArrow.brlan", "G_itemArrow_00"},
{ "messageBtn_00_itemArrow.brlan", "G_itemArrow_01"},
{ "messageBtn_00_loop.brlan", "G_btn_00"},
{ "messageBtn_00_loop.brlan", "G_btn_01"},
{ "messageBtn_00_loop.brlan", "G_btn_02"},
{ "messageBtn_00_loop.brlan", "G_btn_03"},
{ "messageBtn_00_cancel.brlan", "G_cancel_00"},
{ "messageBtn_00_cancel.brlan", "G_cancel_01"},
{ "messageBtn_00_cancel.brlan", "G_cancel_02"},
{ "messageBtn_00_cancel.brlan", "G_cancel_03"},
{ "messageBtn_00_onOffB.brlan", "G_onOffB_00"},
{ "messageBtn_00_onOffB.brlan", "G_onOffB_01"},
{ "messageBtn_00_onOffB.brlan", "G_onOffB_02"},
{ "messageBtn_00_onOffB.brlan", "G_onOffB_03"},
{ "messageBtn_00_onOffA.brlan", "G_btn_00"},
{ "messageBtn_00_onOffA.brlan", "G_btn_01"},
{ "messageBtn_00_onOffA.brlan", "G_btn_02"},
{ "messageBtn_00_onOffA.brlan", "G_btn_03"},
{ "messageBtn_00_decide.brlan", "G_btn_00"},
{ "messageBtn_00_decide.brlan", "G_btn_01"},
{ "messageBtn_00_decide.brlan", "G_btn_02"},
{ "messageBtn_00_decide.brlan", "G_btn_03"},
{ "messageBtn_00_out.brlan", "G_inOut_00"}
};
static const char *sSelectTextBoxes[SELECT_BTN_NUM_BTNS][2] = {
{"T_selectS_00", "T_select_00"},
{"T_selectS_01", "T_select_01"},
{"T_selectS_02", "T_select_02"},
{"T_selectS_03", "T_select_03"},
};
static const char *sDecideTextBoxes[2] = {
"T_decide_00",
"T_decideS_00",
};
static const char *sWindowName = "W_bgP_01";
static const char *sBoundings[SELECT_BTN_NUM_BTNS] = {
"B_btn_00",
"B_btn_01",
"B_btn_02",
"B_btn_03",
};
static const char *sSelectPanes[7] = {
"N_itemArrow_00", "N_arrowHand_00", "N_aBtn_00", "N_messageBtn_00",
"N_messageBtn_01", "N_messageBtn_02", "N_messageBtn_03",
};
void dLytMsgWindowSelectBtn_c::initializeState_Wait() {
field_0x9A4 = 0;
field_0x9B8 = -1;
field_0x9BC = -1;
field_0x9CC = 0xFF;
field_0x9C0 = 10;
field_0x9CD = 1;
}
void dLytMsgWindowSelectBtn_c::executeState_Wait() {}
void dLytMsgWindowSelectBtn_c::finalizeState_Wait() {}
void dLytMsgWindowSelectBtn_c::initializeState_In() {
field_0x9A4 = 1;
field_0x9B4 = -1;
for (int i = 0; i < 2; i++) {
mLyt.fn_800AB9A0(mpDecideTextBoxes[i], 1);
}
mpWindow->UpdateSize(mpSizeBox, 32.0f);
for (int i = SELECT_BTN_ANIM_MESSAGE_BTN_CANCEL_0; i <= SELECT_BTN_ANIM_MESSAGE_BTN_CANCEL_3; i++) {
if (field_0x9BC == i - SELECT_BTN_ANIM_MESSAGE_BTN_CANCEL_0) {
mAnm[i].setFrame(1.0f);
} else {
mAnm[i].setFrame(0.0f);
}
}
mBtnHelper.field_0x50 = -1;
mBtnHelper.field_0x51 = 1;
// ??????
f32 v = mBtnHelper.fn_8011D690(mBtnHelper.field_0x50);
mLyt.findPane("N_allBtn_00")->SetVisible(true);
mLyt.findPane("N_arrowIn_00")->SetVisible(true);
mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].setForwardOnce();
mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].setToStart();
mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].setAnimEnable(true);
mAnm[SELECT_BTN_ANIM_ITEM_ARROW_0].setAnimEnable(true);
mAnm[SELECT_BTN_ANIM_ITEM_ARROW_0].setFrame(0.0f);
mAnm[SELECT_BTN_ANIM_ITEM_ARROW_1].setAnimEnable(true);
mAnm[SELECT_BTN_ANIM_ITEM_ARROW_1].setFrame(0.0f);
for (int i = 0; i < SELECT_BTN_NUM_BTNS; i++) {
mParts[i].init();
mAnm[i + SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_A_OFFSET].setAnimEnable(true);
mAnm[i + SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_A_OFFSET].setFrame(0.0f);
mAnm[i + SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_B_OFFSET].setAnimEnable(true);
mAnm[i + SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_B_OFFSET].setFrame(0.0f);
}
mLyt.calc();
for (int i = 0; i < SELECT_BTN_NUM_BTNS; i++) {
mAnm[i + SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_A_OFFSET].setAnimEnable(false);
mAnm[i + SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_B_OFFSET].setAnimEnable(false);
}
mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].setAnimEnable(false);
mAnm[SELECT_BTN_ANIM_ITEM_ARROW_0].setAnimEnable(false);
mAnm[SELECT_BTN_ANIM_ITEM_ARROW_1].setAnimEnable(false);
mLyt.findPane("N_allBtn_00")->SetVisible(false);
mLyt.findPane("N_arrowIn_00")->SetVisible(false);
mAnm[SELECT_BTN_ANIM_IN].setAnimEnable(true);
mAnm[SELECT_BTN_ANIM_IN].setForwardOnce();
if (field_0x9D1 != 0) {
mAnm[SELECT_BTN_ANIM_IN].setToEnd();
field_0x9D1 = false;
} else {
if (field_0x9CF != 0) {
if (field_0x9A0 == 1) {
SmallSoundManager::GetInstance()->playSound(SE_S_CHOICE_START);
} else if (field_0x9A0 == 2) {
SmallSoundManager::GetInstance()->playSound(SE_S_CHOICE_START_GAMEOVER);
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_TALK_CHOICE_START);
}
}
mAnm[SELECT_BTN_ANIM_IN].setFrame(0.0f);
}
}
void dLytMsgWindowSelectBtn_c::executeState_In() {
mAnm[SELECT_BTN_ANIM_IN].play();
if (mAnm[SELECT_BTN_ANIM_IN].isEndReached()) {
mStateMgr.changeState(StateID_WaitSelect);
}
}
void dLytMsgWindowSelectBtn_c::finalizeState_In() {
mAnm[SELECT_BTN_ANIM_IN].setAnimEnable(false);
}
void dLytMsgWindowSelectBtn_c::initializeState_WaitSelect() {
if (field_0x9D0 == 0) {
field_0x9D0 = true;
fn_8035E860(BGM_MGR);
}
mBtnHelper.fn_8011C970();
mBtnHelper.field_0x48 = fn_8011FE50();
}
extern "C" bool checkButtonAPressed();
extern "C" bool checkButtonBPressed();
void dLytMsgWindowSelectBtn_c::executeState_WaitSelect() {
u8 v = mBtnHelper.fn_8011CAC0();
if (v == 1) {
mStateMgr.changeState(StateID_CursorInOut);
return;
} else if (v == 2) {
f32 f = mBtnHelper.fn_8011D690(mBtnHelper.field_0x50);
// TODO
for (int i = 0; i < 2; i++) {
mLyt.fn_800AB9A0(mpDecideTextBoxes[i], 0);
}
mpWindow->UpdateSize(mpSizeBox, 32.0f);
} else if (v == 3) {
field_0x9D1 = 1;
SmallSoundManager::GetInstance()->playSound(SE_S_POINTER_RESET);
mStateMgr.changeState(StateID_In);
return;
}
if (mBtnHelper.field_0x50 >= 0 && checkButtonAPressed()) {
field_0x9D0 = 0;
field_0x9B0 = mBtnHelper.field_0x50;
mStateMgr.changeState(StateID_WaitDecide);
// TODO
if (field_0x998 != nullptr) {
SmallSoundManager::GetInstance()->playSound(SE_S_TALK_CURSOR_CANCEL);
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_TALK_CURSOR_OK);
}
fn_8035E880(BGM_MGR);
} else if (checkButtonBPressed()) {
f32 f = mBtnHelper.fn_8011D690(field_0x9BC);
// TODO
field_0x9CC = field_0x9BC;
field_0x9D0 = 0;
mStateMgr.changeState(StateID_WaitCancel);
// TODO
if (field_0x998 != nullptr) {
SmallSoundManager::GetInstance()->playSound(SE_S_TALK_CURSOR_CANCEL);
} else {
SmallSoundManager::GetInstance()->playSound(SE_S_TALK_CURSOR_OK);
}
fn_8035E880(BGM_MGR);
}
}
void dLytMsgWindowSelectBtn_c::finalizeState_WaitSelect() {}
void dLytMsgWindowSelectBtn_c::initializeState_CursorInOut() {}
void dLytMsgWindowSelectBtn_c::executeState_CursorInOut() {
if (mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].isStop2()) {
mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].setAnimEnable(false);
mStateMgr.changeState(StateID_WaitSelect);
}
if (mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].isEnabled()) {
mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].play();
}
}
void dLytMsgWindowSelectBtn_c::finalizeState_CursorInOut() {}
void dLytMsgWindowSelectBtn_c::initializeState_WaitDecide() {
s32 decideAnm = field_0x9B0 + SELECT_BTN_ANIM_MESSAGE_BTN_DECIDE_OFFSET;
mAnm[decideAnm].setAnimEnable(true);
mAnm[decideAnm].setFrame(0.0f);
mAnm[decideAnm].setForwardOnce();
}
void dLytMsgWindowSelectBtn_c::executeState_WaitDecide() {
s32 decideAnm = field_0x9B0 + SELECT_BTN_ANIM_MESSAGE_BTN_DECIDE_OFFSET;
mAnm[decideAnm].play();
if (mAnm[decideAnm].isStop2()) {
mAnm[decideAnm].setAnimEnable(false);
field_0x9B4 = field_0x9B0;
if (field_0x99C == 1) {
mStateMgr.changeState(StateID_Wait);
} else {
mStateMgr.changeState(StateID_Out);
}
}
}
void dLytMsgWindowSelectBtn_c::finalizeState_WaitDecide() {}
void dLytMsgWindowSelectBtn_c::initializeState_WaitCancel() {
field_0x9C0 = 10;
mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].setForwardOnce();
mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].setToEnd2();
mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].setAnimEnable(true);
mLyt.calc();
mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].setAnimEnable(false);
mpSelectPanes[0]->SetAlpha(0xFF);
}
void dLytMsgWindowSelectBtn_c::executeState_WaitCancel() {
if (--field_0x9C0 <= 0) {
field_0x9B0 = field_0x9CC;
mStateMgr.changeState(StateID_WaitDecide);
}
}
void dLytMsgWindowSelectBtn_c::finalizeState_WaitCancel() {}
void dLytMsgWindowSelectBtn_c::initializeState_Out() {
mAnm[SELECT_BTN_ANIM_OUT].setAnimEnable(true);
mAnm[SELECT_BTN_ANIM_OUT].setFrame(0.0f);
mAnm[SELECT_BTN_ANIM_OUT].setForwardOnce();
field_0x9C8 = 0;
}
void dLytMsgWindowSelectBtn_c::executeState_Out() {
switch (field_0x9C8) {
case 0:
mAnm[SELECT_BTN_ANIM_OUT].play();
if (mAnm[SELECT_BTN_ANIM_OUT].isStop2()) {
field_0x9A4 = 0;
field_0x9C8 = 1;
}
break;
case 1:
mAnm[SELECT_BTN_ANIM_OUT].setAnimEnable(false);
field_0x9B4 = field_0x9B0;
mStateMgr.changeState(StateID_Wait);
break;
}
}
void dLytMsgWindowSelectBtn_c::finalizeState_Out() {}
bool dLytMsgWindowSelectBtn_c::build(d2d::ResAccIf_c *resAcc) {
mLyt.setResAcc(resAcc);
mLyt.build("messageBtn_00.brlyt", nullptr);
mLyt.setPriority(0x8A);
for (int i = 0; i < SELECT_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 = SELECT_BTN_ANIM_MESSAGE_BTN_CANCEL_0; i <= SELECT_BTN_ANIM_MESSAGE_BTN_CANCEL_3; i++) {
mAnm[i].setAnimEnable(true);
}
mAnm[SELECT_BTN_ANIM_LOOP_REMOCON].setAnimEnable(true);
for (int i = 0; i < SELECT_BTN_NUM_BTNS; i++) {
mParts[i].mpAnms[0] = &mAnm[SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_A_OFFSET + i];
mParts[i].mpAnms[1] = &mAnm[SELECT_BTN_ANIM_MESSAGE_BTN_ONOFF_B_OFFSET + i];
mParts[i].mpAnms[2] = &mAnm[SELECT_BTN_ANIM_MESSAGE_BTN_LOOP_OFFSET + i];
mParts[i].init();
mAnm[SELECT_BTN_ANIM_MESSAGE_BTN_LOOP_OFFSET + i].setAnimEnable(true);
}
for (int i = 0; i < SELECT_BTN_NUM_BTNS; i++) {
for (int j = 0; j < 2; j++) {
mpSelectTextBoxes[i][j] = mLyt.getTextBox(sSelectTextBoxes[i][j]);
}
}
for (int i = 0; i < 2; i++) {
mpDecideTextBoxes[i] = mLyt.getTextBox(sDecideTextBoxes[i]);
}
mpWindow = mLyt.getWindow(sWindowName);
mpSizeBox = mLyt.getSizeBoxInWindow(sWindowName);
mpWindow->UpdateSize(mpSizeBox, 32.0f);
for (int i = 0; i < SELECT_BTN_NUM_BTNS; i++) {
mpBoundings[i] = mLyt.findPane(sBoundings[i]);
}
field_0x998 = nullptr;
for (int i = 0; i < 7; i++) {
mpSelectPanes[i] = mLyt.findPane(sSelectPanes[i]);
}
mBtnHelper.panes[0] = mpSelectPanes[0];
mBtnHelper.panes[1] = mpSelectPanes[3];
mBtnHelper.panes[2] = mpSelectPanes[4];
mBtnHelper.panes[3] = mpSelectPanes[5];
mBtnHelper.panes[4] = mpSelectPanes[6];
mBtnHelper.panes[5] = mpBoundings[0];
mBtnHelper.panes[6] = mpBoundings[1];
mBtnHelper.panes[7] = mpBoundings[2];
mBtnHelper.panes[8] = mpBoundings[3];
field_0x9C4 = nullptr;
mLyt.findPane("N_arrowIn_00")->SetVisible(true);
mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].setForwardOnce();
mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].setToStart();
mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].setAnimEnable(true);
mAnm[SELECT_BTN_ANIM_ITEM_ARROW_0].setAnimEnable(true);
mAnm[SELECT_BTN_ANIM_ITEM_ARROW_0].setFrame(0.0f);
mAnm[SELECT_BTN_ANIM_ITEM_ARROW_1].setAnimEnable(true);
mAnm[SELECT_BTN_ANIM_ITEM_ARROW_1].setFrame(0.0f);
mLyt.calc();
mAnm[SELECT_BTN_ANIM_INOUT_CURSOR].setAnimEnable(false);
mAnm[SELECT_BTN_ANIM_ITEM_ARROW_0].setAnimEnable(false);
mAnm[SELECT_BTN_ANIM_ITEM_ARROW_1].setAnimEnable(false);
mLyt.findPane("N_arrowIn_00")->SetVisible(false);
mStateMgr.changeState(StateID_Wait);
field_0x9A8 = -1;
field_0x9B0 = -1;
field_0x9D0 = 0;
field_0x9D1 = 0;
field_0x99C = 0;
field_0x9A0 = 0;
field_0x9CE = 0;
field_0x9CF = 1;
return true;
}
extern "C" void fn_801942F0(int, int);
bool dLytMsgWindowSelectBtn_c::remove() {
for (int i = 0; i < SELECT_BTN_NUM_ANIMS; i++) {
mAnm[i].unbind();
mAnm[i].remove();
}
if (mBtnHelper.field_0x52 != 0) {
mBtnHelper.field_0x52 = 0;
fn_801942F0(0, 0);
}
return true;
}
bool dLytMsgWindowSelectBtn_c::execute() {
if (*mStateMgr.getStateID() != StateID_Wait) {
// TODO
}
mStateMgr.executeState();
for (int i = 0; i < SELECT_BTN_NUM_BTNS; i++) {
mParts[i].execute();
}
if (mAnm[SELECT_BTN_ANIM_ITEM_ARROW_0].isEnabled()) {
mAnm[SELECT_BTN_ANIM_ITEM_ARROW_0].play();
}
if (mAnm[SELECT_BTN_ANIM_ITEM_ARROW_1].isEnabled()) {
mAnm[SELECT_BTN_ANIM_ITEM_ARROW_1].play();
}
if (mAnm[SELECT_BTN_ANIM_LOOP_REMOCON].isEnabled()) {
mAnm[SELECT_BTN_ANIM_LOOP_REMOCON].play();
}
mLyt.calc();
return true;
}
bool dLytMsgWindowSelectBtn_c::draw() {
if (field_0x9A4 != 0) {
mLyt.addToDrawList();
}
return true;
}