mirror of
https://github.com/zeldaret/ss
synced 2026-07-26 14:31:49 -04:00
Merge pull request #166 from robojumper/lyt_do_button_cleanup
dLytDoButton_c OK
This commit is contained in:
+27
-19
@@ -5,6 +5,7 @@
|
||||
#include "d/d_message.h"
|
||||
#include "d/d_textunk.h"
|
||||
#include "d/d_textwindow_unk.h"
|
||||
#include "d/lyt/msg_window/d_lyt_msg_window.h"
|
||||
#include "nw4r/lyt/lyt_types.h"
|
||||
#include "nw4r/ut/ut_CharWriter.h"
|
||||
#include "nw4r/ut/ut_Color.h"
|
||||
@@ -206,7 +207,7 @@ dTagProcessor_c::dTagProcessor_c() {
|
||||
field_0xEE3 = 0;
|
||||
field_0xEE4 = 0;
|
||||
field_0x004 = nullptr;
|
||||
mMsgWindowSubtype = 0x24;
|
||||
mMsgWindowSubtype = dLytMsgWindow_c::MSG_WINDOW_36;
|
||||
field_0x90D = 4;
|
||||
field_0xEF0 = 0;
|
||||
field_0xEF1 = 0;
|
||||
@@ -497,7 +498,9 @@ beginning:
|
||||
if (lineNum / getMaxNumLines(mMsgWindowSubtype) == unkArg) {
|
||||
nw4r::lyt::Size fontSize = field_0x004->GetFontSize();
|
||||
posX = fn_800B8560(lineNum);
|
||||
if ((mMsgWindowSubtype < 6 || mMsgWindowSubtype >= 10) && mMsgWindowSubtype != 30) {
|
||||
if ((mMsgWindowSubtype < dLytMsgWindow_c::MSG_WINDOW_WOOD ||
|
||||
mMsgWindowSubtype >= dLytMsgWindow_c::MSG_WINDOW_10) &&
|
||||
mMsgWindowSubtype != dLytMsgWindow_c::MSG_WINDOW_DEMO) {
|
||||
posX = 0.0f;
|
||||
}
|
||||
|
||||
@@ -513,7 +516,7 @@ beginning:
|
||||
if (textBox != nullptr) {
|
||||
currScale *= textBox->getMyScale();
|
||||
}
|
||||
if (mMsgWindowSubtype == 30) {
|
||||
if (mMsgWindowSubtype == dLytMsgWindow_c::MSG_WINDOW_DEMO) {
|
||||
tmp3 = -2.0f;
|
||||
} else {
|
||||
tmp3 = 3.0f;
|
||||
@@ -804,12 +807,14 @@ nw4r::ut::Operation dTagProcessor_c::ProcessTags(nw4r::ut::Rect *rect, u16 ch, n
|
||||
}
|
||||
|
||||
void dTagProcessor_c::fn_800B4FF0(nw4r::ut::Rect *rect, nw4r::ut::PrintContext<wchar_t> *ctx, u8 cmdLen, wchar_t *ptr) {
|
||||
if (mMsgWindowSubtype != 22 && mMsgWindowSubtype != 30 && field_0xEE0 != 0) {
|
||||
if (mMsgWindowSubtype != dLytMsgWindow_c::MSG_WINDOW_22 && mMsgWindowSubtype != dLytMsgWindow_c::MSG_WINDOW_DEMO &&
|
||||
field_0xEE0 != 0) {
|
||||
int arg = ptr[0];
|
||||
nw4r::lyt::Size textBoxSize = field_0x004->GetSize();
|
||||
nw4r::lyt::Size fontSize = field_0x004->GetFontSize();
|
||||
int i1 = getMaxNumLines(mMsgWindowSubtype);
|
||||
if (arg % i1 == 0 && mMsgWindowSubtype != 31 && mMsgWindowSubtype != 8) {
|
||||
if (arg % i1 == 0 && mMsgWindowSubtype != dLytMsgWindow_c::MSG_WINDOW_31 &&
|
||||
mMsgWindowSubtype != dLytMsgWindow_c::MSG_WINDOW_8) {
|
||||
int u = 0;
|
||||
int v = 0;
|
||||
for (int i = arg; i < arg + getMaxNumLines(mMsgWindowSubtype) && i < 0x32; i++) {
|
||||
@@ -854,7 +859,9 @@ void dTagProcessor_c::fn_800B4FF0(nw4r::ut::Rect *rect, nw4r::ut::PrintContext<w
|
||||
|
||||
f32 lineWidth = getLineWidth(arg);
|
||||
f32 margin = (textBoxSize.width - lineWidth) * 0.5f;
|
||||
if ((mMsgWindowSubtype < 6 || mMsgWindowSubtype >= 9) && mMsgWindowSubtype != 30) {
|
||||
if ((mMsgWindowSubtype < dLytMsgWindow_c::MSG_WINDOW_WOOD ||
|
||||
mMsgWindowSubtype >= dLytMsgWindow_c::MSG_WINDOW_LINK) &&
|
||||
mMsgWindowSubtype != 30) {
|
||||
margin = 0.0f;
|
||||
}
|
||||
if (margin > 0.0f) {
|
||||
@@ -872,14 +879,14 @@ void dTagProcessor_c::setColor(nw4r::ut::Rect *rect, nw4r::ut::PrintContext<wcha
|
||||
nw4r::ut::Color c1 = FontColors1[cmd & 0xFFFF];
|
||||
nw4r::ut::Color c2 = FontColors2[cmd & 0xFFFF];
|
||||
if (cmd == 0) {
|
||||
if (mMsgWindowSubtype == 2) {
|
||||
if (mMsgWindowSubtype == dLytMsgWindow_c::MSG_WINDOW_SWORD_FI) {
|
||||
c1.r = 0xFF;
|
||||
c1.g = 0x6E;
|
||||
c1.b = 0x64;
|
||||
c2.r = 0xFF;
|
||||
c2.g = 0x6E;
|
||||
c2.b = 0x64;
|
||||
} else if (mMsgWindowSubtype == 7) {
|
||||
} else if (mMsgWindowSubtype == dLytMsgWindow_c::MSG_WINDOW_STONE) {
|
||||
c1.r = 0xE6;
|
||||
c1.g = 0x4B;
|
||||
c1.b = 0x32;
|
||||
@@ -888,14 +895,14 @@ void dTagProcessor_c::setColor(nw4r::ut::Rect *rect, nw4r::ut::PrintContext<wcha
|
||||
c2.b = 0x32;
|
||||
}
|
||||
} else if (cmd == 1) {
|
||||
if (mMsgWindowSubtype == 2) {
|
||||
if (mMsgWindowSubtype == dLytMsgWindow_c::MSG_WINDOW_SWORD_FI) {
|
||||
c1.r = 0xF5;
|
||||
c1.g = 0x64;
|
||||
c1.b = 0x5A;
|
||||
c2.r = 0xC8;
|
||||
c2.g = 0x64;
|
||||
c2.b = 0x5A;
|
||||
} else if (mMsgWindowSubtype == 7) {
|
||||
} else if (mMsgWindowSubtype == dLytMsgWindow_c::MSG_WINDOW_STONE) {
|
||||
c1.r = 0xB4;
|
||||
c1.g = 0x50;
|
||||
c1.b = 0x50;
|
||||
@@ -903,7 +910,8 @@ void dTagProcessor_c::setColor(nw4r::ut::Rect *rect, nw4r::ut::PrintContext<wcha
|
||||
c2.g = 0x40;
|
||||
c2.b = 0x40;
|
||||
}
|
||||
} else if (cmd == 3 && mMsgWindowSubtype >= 2 && mMsgWindowSubtype < 5) {
|
||||
} else if (cmd == 3 && mMsgWindowSubtype >= dLytMsgWindow_c::MSG_WINDOW_SWORD_FI &&
|
||||
mMsgWindowSubtype < dLytMsgWindow_c::MSG_WINDOW_SWORD_FI + 3) {
|
||||
c1.r = 0x50;
|
||||
c1.g = 0xE6;
|
||||
c1.b = 0xFA;
|
||||
@@ -1261,23 +1269,23 @@ void dTagProcessor_c::setStringArg(const wchar_t *arg, s32 index) {
|
||||
f32 dTagProcessor_c::fn_800B8040(s8 factor, u32 windowType) {
|
||||
// Fun little recursion here
|
||||
f32 f1 = UnkTextThing::getFn800B1F70();
|
||||
if (windowType == 6) {
|
||||
if (windowType == dLytMsgWindow_c::MSG_WINDOW_WOOD) {
|
||||
f32 f2 = fn_800B8040(0, 0);
|
||||
f32 f3 = fn_800B8040(factor, 0);
|
||||
return f1 * ((f3 / f2) * 0.93f);
|
||||
} else if (windowType == 7) {
|
||||
} else if (windowType == dLytMsgWindow_c::MSG_WINDOW_STONE) {
|
||||
f32 f2 = fn_800B8040(0, 0);
|
||||
f32 f3 = fn_800B8040(factor, 0);
|
||||
return f1 * ((f3 / f2) * 0.9f);
|
||||
} else if (windowType == 9) {
|
||||
} else if (windowType == dLytMsgWindow_c::MSG_WINDOW_LINK) {
|
||||
f32 f2 = fn_800B8040(0, 0);
|
||||
f32 f3 = fn_800B8040(factor, 0);
|
||||
return f1 * ((f3 / f2) * 0.68f);
|
||||
} else if (windowType == 30) {
|
||||
} else if (windowType == dLytMsgWindow_c::MSG_WINDOW_DEMO) {
|
||||
f32 f2 = fn_800B8040(0, 0);
|
||||
f32 f3 = fn_800B8040(factor, 0);
|
||||
return f1 * ((f3 / f2) * 0.9f);
|
||||
} else if (windowType == 34) {
|
||||
} else if (windowType == dLytMsgWindow_c::MSG_WINDOW_34) {
|
||||
f32 f2 = fn_800B8040(0, 0);
|
||||
f32 f3 = fn_800B8040(factor, 0);
|
||||
return f1 * ((f3 / f2) * 0.86f);
|
||||
@@ -1296,11 +1304,11 @@ f32 dTagProcessor_c::fn_800B8040(s8 factor, u32 windowType) {
|
||||
}
|
||||
|
||||
s32 dTagProcessor_c::getMaxNumLines(s32 arg) {
|
||||
if (arg >= 6 && arg < 8) {
|
||||
if (arg >= dLytMsgWindow_c::MSG_WINDOW_WOOD && arg < dLytMsgWindow_c::MSG_WINDOW_WOOD + 2) {
|
||||
return 4;
|
||||
} else if (arg == 9) {
|
||||
} else if (arg == dLytMsgWindow_c::MSG_WINDOW_LINK) {
|
||||
return 2;
|
||||
} else if (arg == 30) {
|
||||
} else if (arg == dLytMsgWindow_c::MSG_WINDOW_DEMO) {
|
||||
return 2;
|
||||
}
|
||||
return 4;
|
||||
|
||||
@@ -42,7 +42,7 @@ bool dLytCommonArrow_c::build() {
|
||||
void *data = LayoutArcManager::GetInstance()->getLoadedData("CommonArrow");
|
||||
mResAcc.attach(data, "");
|
||||
mLytBase.build("commonArrow_00.brlyt", &mResAcc);
|
||||
mLytBase.mPriority = 0x86;
|
||||
mLytBase.setPriority(0x86);
|
||||
|
||||
for (int i = 0; i < 9; i++) {
|
||||
mAnmGroups[i].init(brlanMap[i].mFile, &mResAcc, mLytBase.getLayout(), brlanMap[i].mName);
|
||||
@@ -87,9 +87,9 @@ bool dLytCommonArrow_c::draw() {
|
||||
void dLytCommonArrow_c::setState(s32 state) {
|
||||
mType = state;
|
||||
if (state == 0) {
|
||||
mLytBase.mPriority = 0x86;
|
||||
mLytBase.setPriority(0x86);
|
||||
} else {
|
||||
mLytBase.mPriority = 0x80;
|
||||
mLytBase.setPriority(0x80);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+641
-13
@@ -1,5 +1,15 @@
|
||||
#include "d/lyt/d_lyt_do_button.h"
|
||||
|
||||
#include "common.h"
|
||||
#include "d/a/d_a_player.h"
|
||||
#include "d/lyt/meter/d_lyt_meter.h"
|
||||
#include "nw4r/lyt/lyt_pane.h"
|
||||
#include "nw4r/lyt/lyt_types.h"
|
||||
#include "nw4r/math/math_types.h"
|
||||
#include "sized_string.h"
|
||||
#include "toBeSorted/event_manager.h"
|
||||
#include "toBeSorted/small_sound_mgr.h"
|
||||
|
||||
struct DoButtonClass {
|
||||
DoButtonClass();
|
||||
virtual ~DoButtonClass();
|
||||
@@ -32,6 +42,8 @@ DoButtonClass::DoButtonClass() {
|
||||
}
|
||||
DoButtonClass::~DoButtonClass() {}
|
||||
|
||||
dLytDobutton_c *dLytDobutton_c::sInstance;
|
||||
|
||||
STATE_DEFINE(dLytDobutton_c, InvisibleWait);
|
||||
STATE_DEFINE(dLytDobutton_c, InvisibleTimeCnt);
|
||||
STATE_DEFINE(dLytDobutton_c, In);
|
||||
@@ -39,7 +51,7 @@ STATE_DEFINE(dLytDobutton_c, Wait);
|
||||
STATE_DEFINE(dLytDobutton_c, Out);
|
||||
|
||||
#define DO_BUTTON_ANIM_IN 0
|
||||
#define DO_BUTTON_ANIM 1
|
||||
#define DO_BUTTON_ANIM_BASIC_INFO 1
|
||||
#define DO_BUTTON_ANIM_LOOP_BTN 2
|
||||
#define DO_BUTTON_ANIM_LOOP_BTN_Z 3
|
||||
#define DO_BUTTON_ANIM_LOOP_NUN 4
|
||||
@@ -51,6 +63,8 @@ STATE_DEFINE(dLytDobutton_c, Out);
|
||||
#define DO_BUTTON_ANIM_MOVE_OUT 10
|
||||
#define DO_BUTTON_ANIM_LOOP_BG 11
|
||||
|
||||
#define DO_BUTTON_NUM_ANIMS 12
|
||||
|
||||
static const d2d::LytBrlanMapping brlanMap[] = {
|
||||
{ "basicInfo_00_in.brlan", "G_inOut_00"},
|
||||
{ "basicInfo_00_basicInfo.brlan", "G_basicInfo_00"},
|
||||
@@ -66,6 +80,63 @@ static const d2d::LytBrlanMapping brlanMap[] = {
|
||||
{ "basicInfo_00_loopBg.brlan", "G_loopBg_00"},
|
||||
};
|
||||
|
||||
static const char *sPaneNames[] = {
|
||||
"N_infoAll_00", "N_infoAll_01", "N_bg_00", "W_bgP_00", "W_bgP_01", "N_infoText_00", "N_aBtn_00",
|
||||
"N_aBtn_01", "N_bBtn_00", "N_cBtn_00", "N_cBtn_01", "N_nunchaku_01", "N_nunchaku_02", "N_nunchaku_03",
|
||||
"N_upSwing_00", "N_downSwing_00", "N_swing_00", "N_rotate_00", "N_nunRimo_00", "N_nunDrag_00", "N_aBtnDown_00",
|
||||
"N_aBtnDown_01", "N_draw_00", "N_play_00", "N_swing_01", "N_swing_03", "N_upset_00", "N_stab_00",
|
||||
"N_pullOut_01", "N_bBtn_01", "N_twist_00", "N_zBtn_00", "N_zBtn_01", "N_crossBtn_00", "N_plusAll_00",
|
||||
"N_upSwing_01", "N_aBtnDown_02",
|
||||
};
|
||||
|
||||
#define DO_BUTTON_PANE_INFOALL_00 0
|
||||
#define DO_BUTTON_PANE_INFOALL_01 1
|
||||
#define DO_BUTTON_PANE_BG_00 2
|
||||
#define DO_BUTTON_PANE_W_BGP_00 3
|
||||
#define DO_BUTTON_PANE_W_BGP_01 4
|
||||
#define DO_BUTTON_PANE_INFOTEXT_00 5
|
||||
#define DO_BUTTON_PANE_A_BTN_00 6
|
||||
#define DO_BUTTON_PANE_A_BTN_01 7
|
||||
#define DO_BUTTON_PANE_B_BTN_00 8
|
||||
#define DO_BUTTON_PANE_C_BTN_00 9
|
||||
#define DO_BUTTON_PANE_C_BTN_01 10
|
||||
#define DO_BUTTON_PANE_NUNCHAKU_01 11
|
||||
#define DO_BUTTON_PANE_NUNCHAKU_02 12
|
||||
#define DO_BUTTON_PANE_NUNCHAKU_03 13
|
||||
#define DO_BUTTON_PANE_UP_SWING_00 14
|
||||
#define DO_BUTTON_PANE_DOWN_SWING_00 15
|
||||
#define DO_BUTTON_PANE_SWING_00 16
|
||||
#define DO_BUTTON_PANE_ROTATE_00 17
|
||||
#define DO_BUTTON_PANE_NUN_RIMO_00 18
|
||||
#define DO_BUTTON_PANE_NUN_DRAG_00 19
|
||||
#define DO_BUTTON_PANE_A_BTN_DOWN_00 20
|
||||
#define DO_BUTTON_PANE_A_BTN_DOWN_01 21
|
||||
#define DO_BUTTON_PANE_DRAW_00 22
|
||||
#define DO_BUTTON_PANE_PLAY_00 23
|
||||
#define DO_BUTTON_PANE_SWING_01 24
|
||||
#define DO_BUTTON_PANE_SWING_03 25
|
||||
#define DO_BUTTON_PANE_UPSET_00 26
|
||||
#define DO_BUTTON_PANE_STAB_00 27
|
||||
#define DO_BUTTON_PANE_PULL_OUT_01 28
|
||||
#define DO_BUTTON_PANE_B_BTN_01 29
|
||||
#define DO_BUTTON_PANE_TWIST_00 30
|
||||
#define DO_BUTTON_PANE_ZBTN_00 31
|
||||
#define DO_BUTTON_PANE_ZBTN_01 32
|
||||
#define DO_BUTTON_PANE_CROSS_BTN_00 33
|
||||
#define DO_BUTTON_PANE_PLUS_ALL_00 34
|
||||
#define DO_BUTTON_PANE_UP_SWING_01 35
|
||||
#define DO_BUTTON_PANE_A_BTN_DOWN_02 36
|
||||
|
||||
#define DO_BUTTON_PANE_NONE 37
|
||||
#define DO_BUTTON_NUM_PANES 37
|
||||
|
||||
static const char *sTextBoxNames[] = {
|
||||
"T_infoText_00",
|
||||
"T_infoTextS_00",
|
||||
};
|
||||
|
||||
#define DO_BUTTON_NUM_TEXT_BOXES 2
|
||||
|
||||
void dLytDobutton_c::initializeState_InvisibleWait() {}
|
||||
void dLytDobutton_c::executeState_InvisibleWait() {
|
||||
if (field_0x488 == field_0x474 && mNextDoActionToShow == mDoActionToShow) {
|
||||
@@ -75,11 +146,11 @@ void dLytDobutton_c::executeState_InvisibleWait() {
|
||||
field_0x478 = field_0x474;
|
||||
field_0x474 = field_0x488;
|
||||
mDoActionToShow = mNextDoActionToShow;
|
||||
if (field_0x488 == 0x29) {
|
||||
if (field_0x488 == ICON_NONE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mNextDoActionToShow == 0x5E) {
|
||||
if (mNextDoActionToShow == ACT_DO_INVALID) {
|
||||
return;
|
||||
}
|
||||
mStateMgr.changeState(StateID_InvisibleTimeCnt);
|
||||
@@ -90,14 +161,12 @@ void dLytDobutton_c::initializeState_InvisibleTimeCnt() {
|
||||
field_0x48C = 0;
|
||||
}
|
||||
|
||||
extern "C" void fn_8010DF00(dLytDobutton_c *);
|
||||
|
||||
void dLytDobutton_c::executeState_InvisibleTimeCnt() {
|
||||
if (field_0x488 != field_0x474 || mNextDoActionToShow != mDoActionToShow) {
|
||||
field_0x478 = field_0x474;
|
||||
field_0x474 = field_0x488;
|
||||
mDoActionToShow = mNextDoActionToShow;
|
||||
if (field_0x488 == 0x29 || mNextDoActionToShow == 0x5E) {
|
||||
if (field_0x488 == ICON_NONE || mNextDoActionToShow == ACT_DO_INVALID) {
|
||||
mStateMgr.changeState(StateID_InvisibleWait);
|
||||
} else {
|
||||
field_0x48C = 0;
|
||||
@@ -106,7 +175,7 @@ void dLytDobutton_c::executeState_InvisibleTimeCnt() {
|
||||
if (field_0x48C < sDoButtonClass.field_0x15) {
|
||||
field_0x48C++;
|
||||
} else {
|
||||
fn_8010DF00(this);
|
||||
realize();
|
||||
mStateMgr.changeState(StateID_In);
|
||||
}
|
||||
}
|
||||
@@ -123,7 +192,7 @@ void dLytDobutton_c::initializeState_In() {
|
||||
mAnmGroups[DO_BUTTON_ANIM_IN].setFrame(0.0f);
|
||||
}
|
||||
void dLytDobutton_c::executeState_In() {
|
||||
if (field_0x488 == 0x29 || mNextDoActionToShow == 0x5E) {
|
||||
if (field_0x488 == ICON_NONE || mNextDoActionToShow == ACT_DO_INVALID) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_IN].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_OUT].setAnimEnable(true);
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_OUT].setToEnd();
|
||||
@@ -144,11 +213,11 @@ void dLytDobutton_c::executeState_Wait() {
|
||||
field_0x478 = field_0x474;
|
||||
field_0x474 = field_0x488;
|
||||
mDoActionToShow = mNextDoActionToShow;
|
||||
if (field_0x488 == 0x29 || mNextDoActionToShow == 0x5E) {
|
||||
if (field_0x488 == ICON_NONE || mNextDoActionToShow == ACT_DO_INVALID) {
|
||||
mStateMgr.changeState(StateID_Out);
|
||||
field_0x48C = 0;
|
||||
} else {
|
||||
fn_8010DF00(this);
|
||||
realize();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -167,11 +236,570 @@ void dLytDobutton_c::executeState_Out() {
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_MOVE_OUT].isEndReached()) {
|
||||
mLyt.calc();
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_OUT].setAnimEnable(false);
|
||||
mStateMgr.changeState(StateID_InvisibleTimeCnt);
|
||||
mStateMgr.changeState(StateID_InvisibleWait);
|
||||
}
|
||||
}
|
||||
void dLytDobutton_c::finalizeState_Out() {}
|
||||
|
||||
bool dLytDobutton_c::init(m2d::ResAccIf_c *resAcc) {
|
||||
return brlanMap[0].mFile[0] != '\0' && sDoButtonClass.field_0x04;
|
||||
bool dLytDobutton_c::build(m2d::ResAccIf_c *resAcc) {
|
||||
mLyt.setResAcc(resAcc);
|
||||
mLyt.build("basicInfo_00.brlyt", nullptr);
|
||||
mLyt.setPriority(0x8A);
|
||||
|
||||
for (int i = 0; i < DO_BUTTON_NUM_ANIMS; i++) {
|
||||
mAnmGroups[i].init(brlanMap[i].mFile, resAcc, mLyt.getLayout(), brlanMap[i].mName);
|
||||
mAnmGroups[i].bind(false);
|
||||
mAnmGroups[i].setAnimEnable(false);
|
||||
}
|
||||
|
||||
for (int i = 0; i < DO_BUTTON_NUM_PANES; i++) {
|
||||
mpPanes[i] = mLyt.findPane(sPaneNames[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < DO_BUTTON_NUM_TEXT_BOXES; i++) {
|
||||
mpTextBoxes[i] = mLyt.getTextBox(sTextBoxNames[i]);
|
||||
}
|
||||
|
||||
mDoActionToShow = ACT_DO_INVALID;
|
||||
field_0x474 = ICON_NONE;
|
||||
field_0x478 = ICON_NONE;
|
||||
mNextDoActionToShow = ACT_DO_INVALID;
|
||||
field_0x488 = ICON_NONE;
|
||||
field_0x490 = 0;
|
||||
field_0x47C = ACT_DO_INVALID;
|
||||
field_0x480 = ICON_NONE;
|
||||
field_0x491 = 0;
|
||||
mSavedIsInEvent = false;
|
||||
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_NUN].setAnimEnable(true);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_BG].setAnimEnable(true);
|
||||
mAnmGroups[DO_BUTTON_ANIM_IN].setAnimEnable(true);
|
||||
mAnmGroups[DO_BUTTON_ANIM_IN].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_OUT].setAnimEnable(false);
|
||||
mLyt.calc();
|
||||
mAnmGroups[DO_BUTTON_ANIM_IN].setAnimEnable(false);
|
||||
|
||||
mStateMgr.changeState(StateID_InvisibleWait);
|
||||
field_0x48C = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytDobutton_c::remove() {
|
||||
for (int i = 0; i < DO_BUTTON_NUM_ANIMS; i++) {
|
||||
mAnmGroups[i].remove();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytDobutton_c::execute() {
|
||||
bool isInEvent = EventManager::isInEvent();
|
||||
bool b1 = true;
|
||||
if (dAcPy_c::isInBambooCuttingMinigame()) {
|
||||
setActionTextStuff(ICON_12, ACT_DO_70, false);
|
||||
}
|
||||
if (field_0x490 == 0) {
|
||||
if (isInEvent != mSavedIsInEvent) {
|
||||
if (isInEvent && field_0x488 == field_0x480 && mNextDoActionToShow == field_0x47C) {
|
||||
setActionTextStuff(ICON_NONE, ACT_DO_INVALID, false);
|
||||
b1 = false;
|
||||
}
|
||||
mSavedIsInEvent = isInEvent;
|
||||
} else if (isInEvent && field_0x490 == 0 && field_0x488 == field_0x480 && mNextDoActionToShow == field_0x47C) {
|
||||
setActionTextStuff(ICON_NONE, ACT_DO_INVALID, false);
|
||||
b1 = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (b1) {
|
||||
set_0x47C_0x480(mNextDoActionToShow, field_0x488);
|
||||
}
|
||||
|
||||
if ((isInEvent && !field_0x490) || dLytMeter_c::getItemSelect0x75A2() != 0 ||
|
||||
dLytMeter_c::getMinusBtnFn800F7600()) {
|
||||
setActionTextStuffInternal(41, ACT_DO_INVALID, false);
|
||||
}
|
||||
|
||||
for (int i = 0; i < DO_BUTTON_NUM_ANIMS; i++) {
|
||||
if (i != DO_BUTTON_ANIM_BASIC_INFO && i != DO_BUTTON_ANIM_LOOP_MOVE_INFO && i != DO_BUTTON_ANIM_MOVE_ALPHA) {
|
||||
if (mAnmGroups[i].isEnabled()) {
|
||||
mAnmGroups[i].play();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].isEnabled() || mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].isEnabled()) {
|
||||
bool b2 = false;
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].isStop2()) {
|
||||
if (((field_0x478 == 26 && field_0x474 == 11) || (field_0x478 == 27 && field_0x474 == 11) ||
|
||||
(field_0x478 == 28 && field_0x474 == 11) || (field_0x478 == 29 && field_0x474 == 11) ||
|
||||
(field_0x478 == 30 && field_0x474 == 8) || (field_0x478 == 31 && field_0x474 == 11) ||
|
||||
(field_0x478 == 32 && field_0x474 == 36) || (field_0x478 == 33 && field_0x474 == 11) ||
|
||||
(field_0x478 == 34 && field_0x474 == 11) || (field_0x478 == 35 && field_0x474 == 11)) &&
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].getFrame() == 0.0f) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_BASIC_INFO].setAnimEnable(true);
|
||||
mAnmGroups[DO_BUTTON_ANIM_BASIC_INFO].setFrame(field_0x474);
|
||||
}
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].setAnimEnable(false);
|
||||
} else {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].play();
|
||||
b2 = true;
|
||||
}
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].isStop2()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].setAnimEnable(false);
|
||||
} else {
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].play();
|
||||
b2 = true;
|
||||
}
|
||||
|
||||
if (b2) {
|
||||
mLyt.calc();
|
||||
}
|
||||
fn_8010E3D0(mDoActionToShow != ACT_DO_NONE);
|
||||
}
|
||||
|
||||
mStateMgr.executeState();
|
||||
|
||||
if (((field_0x474 == 1 && mDoActionToShow == ACT_DO_27) ||
|
||||
(field_0x474 == 1 && mDoActionToShow == ACT_DO_BREAK_FREE)) &&
|
||||
field_0x491) {
|
||||
if (!mAnmGroups[DO_BUTTON_ANIM_LOOP_RECOVER].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_RECOVER].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_RECOVER].setRate(3.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_RECOVER].setAnimEnable(true);
|
||||
}
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].setRate(1.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].setAnimEnable(false);
|
||||
}
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].setRate(1.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].setAnimEnable(false);
|
||||
}
|
||||
} else if ((field_0x474 == 6 && field_0x491) || (field_0x478 == 6 && *mStateMgr.getStateID() == StateID_Out)) {
|
||||
// Same code as above, copypasted
|
||||
if (!mAnmGroups[DO_BUTTON_ANIM_LOOP_RECOVER].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_RECOVER].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_RECOVER].setRate(3.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_RECOVER].setAnimEnable(true);
|
||||
}
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].setRate(1.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].setAnimEnable(false);
|
||||
}
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].setRate(1.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].setAnimEnable(false);
|
||||
}
|
||||
} else {
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_RECOVER].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_RECOVER].setRate(1.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_RECOVER].setAnimEnable(false);
|
||||
}
|
||||
|
||||
if (field_0x474 == 4 || field_0x474 == 28 || field_0x474 == 29) {
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].setRate(1.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].setAnimEnable(false);
|
||||
}
|
||||
if (!mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].setRate(1.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].setAnimEnable(true);
|
||||
}
|
||||
} else if (field_0x474 == 12 && mDoActionToShow == ACT_DO_70) {
|
||||
if (!mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].setAnimEnable(true);
|
||||
}
|
||||
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].getRate() != 2.0f) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].setRate(2.0f);
|
||||
}
|
||||
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].setRate(1.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].setAnimEnable(false);
|
||||
}
|
||||
} else {
|
||||
if (!mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].setAnimEnable(true);
|
||||
}
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].getRate() != 1.0f) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].setRate(1.0f);
|
||||
}
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].setRate(1.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].setAnimEnable(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mLyt.calc();
|
||||
|
||||
if (field_0x474 >= 26 && field_0x474 < 36) {
|
||||
if (!mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].isEnabled()) {
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_BTN].isEnabled()) {
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_BTN].getFrame() == 0.0f) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_BTN].setAnimEnable(false);
|
||||
}
|
||||
}
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_BTN_Z].isEnabled()) {
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_BTN_Z].getFrame() == 0.0f) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_BTN_Z].setAnimEnable(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!mAnmGroups[DO_BUTTON_ANIM_LOOP_BTN].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_BTN].setAnimEnable(true);
|
||||
}
|
||||
|
||||
if (!mAnmGroups[DO_BUTTON_ANIM_LOOP_BTN_Z].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_BTN_Z].setAnimEnable(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_BASIC_INFO].isEnabled()) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_BASIC_INFO].setAnimEnable(false);
|
||||
}
|
||||
|
||||
setActionTextStuffInternal(41, ACT_DO_INVALID, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool dLytDobutton_c::draw() {
|
||||
mLyt.addToDrawList();
|
||||
return true;
|
||||
}
|
||||
|
||||
static const s32 sActDoIds[] = {
|
||||
1, // ACT_DO_CLIMB_UP
|
||||
2, // ACT_DO_JUMP
|
||||
3, // ACT_DO_DROP_DOWN
|
||||
4, // ACT_DO_LET_GO
|
||||
5, // ACT_DO_OPEN
|
||||
6, // ACT_DO_PUT_DOWN
|
||||
7, // ACT_DO_THROW
|
||||
8, // ACT_DO_BURROW
|
||||
9, // ACT_DO_ROLL
|
||||
10, // ACT_DO_9
|
||||
11, // ACT_DO_MOVE
|
||||
12, // ACT_DO_GRAB
|
||||
13, // ACT_DO_SHOOT
|
||||
14, // ACT_DO_13
|
||||
15, // ACT_DO_14
|
||||
16, // ACT_DO_15
|
||||
17, // ACT_DO_TALK
|
||||
18, // ACT_DO_EXAMINE
|
||||
19, // ACT_DO_DRAW
|
||||
20, // ACT_DO_19
|
||||
21, // ACT_DO_BLOW
|
||||
22, // ACT_DO_21
|
||||
23, // ACT_DO_22
|
||||
24, // ACT_DO_SWIM
|
||||
25, // ACT_DO_LEAP
|
||||
26, // ACT_DO_DASH
|
||||
27, // ACT_DO_GET_OUT
|
||||
28, // ACT_DO_27
|
||||
29, // ACT_DO_PICK_UP
|
||||
30, // ACT_DO_SIT
|
||||
31, // ACT_DO_STAND
|
||||
32, // ACT_DO_DIG
|
||||
33, // ACT_DO_32
|
||||
34, // ACT_DO_33
|
||||
35, // ACT_DO_BREAK_FREE
|
||||
36, // ACT_DO_35
|
||||
37, // ACT_DO_36
|
||||
38, // ACT_DO_PLANT
|
||||
39, // ACT_DO_CATCH
|
||||
40, // ACT_DO_SPEED_UP
|
||||
41, // ACT_DO_SAILCLOTH
|
||||
42, // ACT_DO_PUT_AWAY
|
||||
43, // ACT_DO_EMERGE
|
||||
44, // ACT_DO_INSERT
|
||||
45, // ACT_DO_44
|
||||
46, // ACT_DO_TURN
|
||||
47, // ACT_DO_PUSH_IN
|
||||
48, // ACT_DO_47
|
||||
49, // ACT_DO_DRAW_BOW
|
||||
50, // ACT_DO_49
|
||||
51, // ACT_DO_50
|
||||
52, // ACT_DO_51
|
||||
53, // ACT_DO_SWING
|
||||
54, // ACT_DO_BALANCE
|
||||
55, // ACT_DO_JOSTLE
|
||||
56, // ACT_DO_55
|
||||
57, // ACT_DO_SLEEP
|
||||
58, // ACT_DO_DROP
|
||||
59, // ACT_DO_LAUNCH
|
||||
60, // ACT_DO_READ
|
||||
61, // ACT_DO_WHIP
|
||||
62, // ACT_DO_PULL
|
||||
63, // ACT_DO_DRINK
|
||||
64, // ACT_DO_63
|
||||
65, // ACT_DO_GET_IN
|
||||
66, // ACT_DO_FIRE
|
||||
67, // ACT_DO_ATTACK
|
||||
68, // ACT_DO_FATAL_BLOW
|
||||
69, // ACT_DO_JUMP_DOWN
|
||||
70, // ACT_DO_STRUM
|
||||
71, // ACT_DO_70
|
||||
72, // ACT_DO_RELEASE
|
||||
73, // ACT_DO_GRAB_2
|
||||
74, // ACT_DO_READY_STANCE
|
||||
75, // ACT_DO_REMOVE
|
||||
76, // ACT_DO_READY_SWORD
|
||||
77, // ACT_DO_THRUST_SWORD
|
||||
78, // ACT_DO_USE
|
||||
79, // ACT_DO_SCOOP
|
||||
80, // ACT_DO_79
|
||||
81, // ACT_DO_80
|
||||
82, // ACT_DO_LOOK
|
||||
83, // ACT_DO_DOWSE
|
||||
84, // ACT_DO_PILOT
|
||||
85, // ACT_DO_LOOK_DOWN
|
||||
86, // ACT_DO_DIVE
|
||||
87, // ACT_DO_SELECT
|
||||
88, // ACT_DO_GRAB_3
|
||||
89, // ACT_DO_MOVE_2
|
||||
90, // ACT_DO_ACCELERATE
|
||||
91, // ACT_DO_CHARGE
|
||||
92, // ACT_DO_LEAN
|
||||
93, // ACT_DO_PRESS
|
||||
-1,
|
||||
};
|
||||
|
||||
void dLytDobutton_c::realize() {
|
||||
// TODO: what?
|
||||
s32 i1 = field_0x478;
|
||||
s32 i2 = field_0x474;
|
||||
if ((i1 == 11 && i2 == 26) || (i1 == 11 && i2 == 27) || (i1 == 11 && i2 == 28) || (i1 == 11 && i2 == 29) ||
|
||||
(i1 == 8 && i2 == 30) || (i1 == 8 && i2 == 31) || (i1 == 36 && i2 == 32) || (i1 == 11 && i2 == 33) ||
|
||||
(i1 == 11 && i2 == 34) || (i1 == 11 && i2 == 35)) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_BTN].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_BTN_Z].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_NUN].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_RECOVER].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].setForwardOnce();
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].setAnimEnable(true);
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].setForwardOnce();
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].setAnimEnable(true);
|
||||
} else if ((i1 == 26 && i2 == 11) || (i1 == 27 && i2 == 11) || (i1 == 28 && i2 == 11) || (i1 == 29 && i2 == 11) ||
|
||||
(i1 == 30 && i2 == 8) || (i1 == 31 && i2 == /* this one is changed 8 -> 11 */ 11) ||
|
||||
(i1 == 32 && i2 == 36) || (i1 == 33 && i2 == 11) || (i1 == 34 && i2 == 11) || (i1 == 35 && i2 == 11)) {
|
||||
// Same conditions as above, but inverted (with one exception. Is that exception a bug?)
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].setBackwardsOnce();
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].setAnimEnable(true);
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].setBackwardsOnce();
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].setAnimEnable(true);
|
||||
i2 = field_0x478;
|
||||
} else if (i2 >= 26 && i2 < 36) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_BTN].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_BTN_Z].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_NUN].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_REMO_CON].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_RECOVER].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_ROTATE].setFrame(0.0f);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].setForwardOnce();
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].setAnimEnable(true);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].setToEnd2();
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].setForwardOnce();
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].setAnimEnable(true);
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].setToEnd2();
|
||||
} else {
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].setBackwardsOnce();
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].setAnimEnable(true);
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].setToEnd2();
|
||||
if (field_0x474 == 11 || field_0x474 == 8) {
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].setBackwardsOnce();
|
||||
} else {
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].setForwardOnce();
|
||||
}
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].setAnimEnable(true);
|
||||
mAnmGroups[DO_BUTTON_ANIM_MOVE_ALPHA].setToEnd2();
|
||||
}
|
||||
|
||||
mAnmGroups[DO_BUTTON_ANIM_BASIC_INFO].setAnimEnable(true);
|
||||
mAnmGroups[DO_BUTTON_ANIM_BASIC_INFO].setFrame(i2);
|
||||
if (mDoActionToShow != ACT_DO_NONE) {
|
||||
SizedString<16> buf;
|
||||
buf.sprintf("ACT_DO_%03d", sActDoIds[mDoActionToShow]);
|
||||
mpTextBoxes[0]->setMessageWithGlobalTextProcessor2(buf, nullptr);
|
||||
mpTextBoxes[1]->setMessageWithGlobalTextProcessor2(buf, nullptr);
|
||||
fn_8010E3D0(true);
|
||||
} else {
|
||||
wchar_t buf1[2];
|
||||
buf1[0] = buf1[1] = 0;
|
||||
mpTextBoxes[0]->setTextWithGlobalTextProcessor(buf1, nullptr);
|
||||
mpTextBoxes[1]->setTextWithGlobalTextProcessor(buf1, nullptr);
|
||||
fn_8010E3D0(false);
|
||||
}
|
||||
|
||||
if (mDoActionToShow == ACT_DO_CATCH) {
|
||||
SmallSoundManager::GetInstance()->playSound(SE_S_CALL_BIRD_CATCH);
|
||||
}
|
||||
}
|
||||
|
||||
static const s32 sPaneIdxes1[] = {
|
||||
DO_BUTTON_PANE_A_BTN_00, // ICON_0
|
||||
DO_BUTTON_PANE_SWING_00, // ICON_1
|
||||
DO_BUTTON_PANE_UP_SWING_00, // ICON_2
|
||||
DO_BUTTON_PANE_DOWN_SWING_00, // ICON_3
|
||||
DO_BUTTON_PANE_ROTATE_00, // ICON_4
|
||||
DO_BUTTON_PANE_NONE, // ICON_5
|
||||
DO_BUTTON_PANE_NUN_RIMO_00, // ICON_6
|
||||
DO_BUTTON_PANE_A_BTN_00, // ICON_7
|
||||
DO_BUTTON_PANE_C_BTN_00, // ICON_8
|
||||
DO_BUTTON_PANE_NUN_DRAG_00, // ICON_9
|
||||
DO_BUTTON_PANE_C_BTN_01, // ICON_10
|
||||
DO_BUTTON_PANE_A_BTN_DOWN_00, // ICON_11
|
||||
DO_BUTTON_PANE_SWING_01, // ICON_12
|
||||
DO_BUTTON_PANE_DRAW_00, // ICON_13
|
||||
DO_BUTTON_PANE_PLAY_00, // ICON_14
|
||||
DO_BUTTON_PANE_NONE, // ICON_15
|
||||
DO_BUTTON_PANE_NUNCHAKU_01, // ICON_16
|
||||
DO_BUTTON_PANE_UPSET_00, // ICON_17
|
||||
DO_BUTTON_PANE_STAB_00, // ICON_18
|
||||
DO_BUTTON_PANE_NONE, // ICON_19
|
||||
DO_BUTTON_PANE_PULL_OUT_01, // ICON_20
|
||||
DO_BUTTON_PANE_A_BTN_01, // ICON_21
|
||||
DO_BUTTON_PANE_SWING_03, // ICON_22
|
||||
DO_BUTTON_PANE_B_BTN_00, // ICON_23
|
||||
DO_BUTTON_PANE_B_BTN_01, // ICON_24
|
||||
DO_BUTTON_PANE_TWIST_00, // ICON_25
|
||||
DO_BUTTON_PANE_A_BTN_DOWN_00, // ICON_26
|
||||
DO_BUTTON_PANE_A_BTN_DOWN_00, // ICON_27
|
||||
DO_BUTTON_PANE_A_BTN_DOWN_01, // ICON_28
|
||||
DO_BUTTON_PANE_A_BTN_DOWN_01, // ICON_29
|
||||
DO_BUTTON_PANE_C_BTN_00, // ICON_30
|
||||
DO_BUTTON_PANE_ZBTN_00, // ICON_31
|
||||
DO_BUTTON_PANE_ZBTN_01, // ICON_32
|
||||
DO_BUTTON_PANE_A_BTN_DOWN_01, // ICON_33
|
||||
DO_BUTTON_PANE_A_BTN_DOWN_00, // ICON_34
|
||||
DO_BUTTON_PANE_A_BTN_DOWN_00, // ICON_35
|
||||
DO_BUTTON_PANE_ZBTN_00, // ICON_36
|
||||
DO_BUTTON_PANE_CROSS_BTN_00, // ICON_37
|
||||
DO_BUTTON_PANE_UP_SWING_01, // ICON_38
|
||||
DO_BUTTON_PANE_A_BTN_DOWN_02, // ICON_39
|
||||
DO_BUTTON_PANE_A_BTN_DOWN_02, // ICON_40
|
||||
|
||||
};
|
||||
|
||||
static const s32 sPaneIdxes2[] = {
|
||||
DO_BUTTON_PANE_NONE, // ICON_0
|
||||
DO_BUTTON_PANE_NONE, // ICON_1
|
||||
DO_BUTTON_PANE_NONE, // ICON_2
|
||||
DO_BUTTON_PANE_NONE, // ICON_3
|
||||
DO_BUTTON_PANE_NONE, // ICON_4
|
||||
DO_BUTTON_PANE_NONE, // ICON_5
|
||||
DO_BUTTON_PANE_NONE, // ICON_6
|
||||
DO_BUTTON_PANE_NONE, // ICON_7
|
||||
DO_BUTTON_PANE_NONE, // ICON_8
|
||||
DO_BUTTON_PANE_NONE, // ICON_9
|
||||
DO_BUTTON_PANE_NONE, // ICON_10
|
||||
DO_BUTTON_PANE_NONE, // ICON_11
|
||||
DO_BUTTON_PANE_NONE, // ICON_12
|
||||
DO_BUTTON_PANE_NONE, // ICON_13
|
||||
DO_BUTTON_PANE_NONE, // ICON_14
|
||||
DO_BUTTON_PANE_NONE, // ICON_15
|
||||
DO_BUTTON_PANE_NONE, // ICON_16
|
||||
DO_BUTTON_PANE_NONE, // ICON_17
|
||||
DO_BUTTON_PANE_NONE, // ICON_18
|
||||
DO_BUTTON_PANE_NONE, // ICON_19
|
||||
DO_BUTTON_PANE_NONE, // ICON_20
|
||||
DO_BUTTON_PANE_NONE, // ICON_21
|
||||
DO_BUTTON_PANE_NONE, // ICON_22
|
||||
DO_BUTTON_PANE_NONE, // ICON_23
|
||||
DO_BUTTON_PANE_NONE, // ICON_24
|
||||
DO_BUTTON_PANE_NONE, // ICON_25
|
||||
DO_BUTTON_PANE_NUNCHAKU_02, // ICON_26
|
||||
DO_BUTTON_PANE_NUNCHAKU_03, // ICON_27
|
||||
DO_BUTTON_PANE_ROTATE_00, // ICON_28
|
||||
DO_BUTTON_PANE_ROTATE_00, // ICON_29
|
||||
DO_BUTTON_PANE_NUN_DRAG_00, // ICON_30
|
||||
DO_BUTTON_PANE_A_BTN_00, // ICON_31
|
||||
DO_BUTTON_PANE_UP_SWING_00, // ICON_32
|
||||
DO_BUTTON_PANE_PLAY_00, // ICON_33
|
||||
DO_BUTTON_PANE_PULL_OUT_01, // ICON_34
|
||||
DO_BUTTON_PANE_STAB_00, // ICON_35
|
||||
DO_BUTTON_PANE_NONE, // ICON_36
|
||||
DO_BUTTON_PANE_NONE, // ICON_37
|
||||
DO_BUTTON_PANE_NONE, // ICON_38
|
||||
DO_BUTTON_PANE_STAB_00, // ICON_39
|
||||
DO_BUTTON_PANE_PULL_OUT_01, // ICON_40
|
||||
|
||||
};
|
||||
|
||||
void dLytDobutton_c::fn_8010E3D0(bool b) {
|
||||
s32 i1 = field_0x474;
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].isEnabled()) {
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].isPlayingForwardsOnce()) {
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].getFrame() <
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].getAnimDuration() * 0.5f) {
|
||||
i1 = field_0x478;
|
||||
}
|
||||
} else {
|
||||
if (mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].getFrame() >
|
||||
mAnmGroups[DO_BUTTON_ANIM_LOOP_MOVE_INFO].getAnimDuration() * 0.5f) {
|
||||
i1 = field_0x478;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
s32 idx1 = sPaneIdxes1[i1];
|
||||
f32 w1 = mpPanes[idx1]->GetSize().width;
|
||||
f32 x1 = mpPanes[idx1]->GetTranslate().x;
|
||||
f32 left = x1 - w1 / 2.0f;
|
||||
f32 right = x1 + w1 / 2.0f;
|
||||
f32 xBase = mpPanes[5]->GetTranslate().x;
|
||||
|
||||
s32 idx2 = sPaneIdxes2[i1];
|
||||
if (idx2 != 37) {
|
||||
f32 x2 = mpPanes[idx2]->GetTranslate().x;
|
||||
f32 w2 = mpPanes[idx2]->GetSize().width;
|
||||
f32 left2 = x2 - w2 / 2.0f;
|
||||
f32 right2 = x2 + w2 / 2.0f;
|
||||
if (left > left2) {
|
||||
left = left2;
|
||||
}
|
||||
if (right < right2) {
|
||||
right = right2;
|
||||
}
|
||||
w1 = right - left;
|
||||
}
|
||||
|
||||
nw4r::lyt::Size sz3 = mpPanes[3]->GetSize();
|
||||
nw4r::lyt::Size sz4 = mpPanes[4]->GetSize();
|
||||
if (b) {
|
||||
f32 tmp = (xBase - left);
|
||||
w1 = mpTextBoxes[0]->GetLineWidth(nullptr) + tmp;
|
||||
}
|
||||
f32 w = w1 + sDoButtonClass.field_0x10;
|
||||
sz3.width = w;
|
||||
sz4.width = w;
|
||||
mpPanes[3]->SetSize(sz3);
|
||||
mpPanes[4]->SetSize(sz4);
|
||||
nw4r::math::VEC3 v = mpPanes[1]->GetTranslate();
|
||||
v.x = -left - w1 / 2.0f;
|
||||
mpPanes[1]->SetTranslate(v);
|
||||
}
|
||||
|
||||
void dLytDobutton_c::setActionTextStuffInternal(s32 a1, Act_Do_e a2, bool b) {
|
||||
field_0x488 = a1;
|
||||
mNextDoActionToShow = (Act_Do_e)a2;
|
||||
field_0x490 = b;
|
||||
}
|
||||
|
||||
dLytDobutton_c::Act_Do_e dLytDobutton_c::getActionInternal() const {
|
||||
return mDoActionToShow;
|
||||
}
|
||||
|
||||
s32 dLytDobutton_c::fn_8010E5E0() const {
|
||||
if (mDoActionToShow != ACT_DO_INVALID) {
|
||||
return field_0x474;
|
||||
}
|
||||
return ICON_NONE;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,31 @@
|
||||
#include "common.h"
|
||||
#include "d/lyt/d2d.h"
|
||||
#include "d/lyt/d_lyt_do_button.h"
|
||||
#include "d/lyt/d_lyt_unknowns.h"
|
||||
#include "d/lyt/meter/d_lyt_meter.h"
|
||||
#include "toBeSorted/misc_actor.h"
|
||||
|
||||
class LytDoButtonRelatedClass {
|
||||
public:
|
||||
LytDoButtonRelatedClass();
|
||||
virtual ~LytDoButtonRelatedClass();
|
||||
|
||||
private:
|
||||
/* 0x04 */ u8 field_0x04;
|
||||
/* 0x05 */ u8 field_0x05;
|
||||
/* 0x06 */ u8 field_0x06;
|
||||
};
|
||||
|
||||
static LytDoButtonRelatedClass sDoButtonRelatedClass;
|
||||
|
||||
LytDoButtonRelatedClass::LytDoButtonRelatedClass() {
|
||||
field_0x04 = 0;
|
||||
field_0x05 = 0;
|
||||
field_0x06 = LytDoButtonRelated::ACT_IE_NONE;
|
||||
}
|
||||
LytDoButtonRelatedClass::~LytDoButtonRelatedClass() {}
|
||||
|
||||
LytDoButtonRelated *LytDoButtonRelated::sInstance;
|
||||
|
||||
LytDoButtonRelated::LytDoButtonRelated() {
|
||||
sInstance = this;
|
||||
@@ -7,7 +33,7 @@ LytDoButtonRelated::LytDoButtonRelated() {
|
||||
|
||||
bool LytDoButtonRelated::build(d2d::ResAccIf_c *resAcc) {
|
||||
for (int i = 0; i < 12; i++) {
|
||||
field_0x04[i] = DO_NONE;
|
||||
field_0x04[i] = ACT_IE_NONE;
|
||||
field_0x34[i] = 0;
|
||||
}
|
||||
|
||||
@@ -17,3 +43,174 @@ bool LytDoButtonRelated::build(d2d::ResAccIf_c *resAcc) {
|
||||
bool LytDoButtonRelated::remove() {
|
||||
return true;
|
||||
}
|
||||
|
||||
static const dLytDobutton_c::Act_Do_e sActIEtoDoConversionTable[LytDoButtonRelated::ACT_IE_NONE] = {
|
||||
dLytDobutton_c::ACT_DO_CLIMB_UP, // ACT_IE_INFO_CLIMB_UP
|
||||
dLytDobutton_c::ACT_DO_JUMP, // ACT_IE_INFO_JUMP
|
||||
dLytDobutton_c::ACT_DO_DROP_DOWN, // ACT_IE_INFO_DROP_DOWN
|
||||
dLytDobutton_c::ACT_DO_LET_GO, // ACT_IE_INFO_LET_GO
|
||||
dLytDobutton_c::ACT_DO_OPEN, // ACT_IE_INFO_OPEN
|
||||
dLytDobutton_c::ACT_DO_PUT_DOWN, // ACT_IE_INFO_DROP
|
||||
dLytDobutton_c::ACT_DO_THROW, // ACT_IE_INFO_THROW
|
||||
dLytDobutton_c::ACT_DO_BURROW, // ACT_IE_INFO_BURROW
|
||||
dLytDobutton_c::ACT_DO_ROLL, // ACT_IE_INFO_ROLL
|
||||
dLytDobutton_c::ACT_DO_9, // ACT_IE_INFO_9
|
||||
dLytDobutton_c::ACT_DO_MOVE, // ACT_IE_INFO_MOVE
|
||||
dLytDobutton_c::ACT_DO_GRAB, // ACT_IE_INFO_GRAB
|
||||
dLytDobutton_c::ACT_DO_SHOOT, // ACT_IE_INFO_SHOOT
|
||||
dLytDobutton_c::ACT_DO_13, // ACT_IE_INFO_13
|
||||
dLytDobutton_c::ACT_DO_14, // ACT_IE_INFO_14
|
||||
dLytDobutton_c::ACT_DO_15, // ACT_IE_INFO_15
|
||||
dLytDobutton_c::ACT_DO_TALK, // ACT_IE_INFO_TALK
|
||||
dLytDobutton_c::ACT_DO_EXAMINE, // ACT_IE_INFO_EXAMINE
|
||||
dLytDobutton_c::ACT_DO_DRAW, // ACT_IE_INFO_DRAW
|
||||
dLytDobutton_c::ACT_DO_19, // ACT_IE_INFO_19
|
||||
dLytDobutton_c::ACT_DO_BLOW, // ACT_IE_INFO_BLOW
|
||||
dLytDobutton_c::ACT_DO_21, // ACT_IE_INFO_21
|
||||
dLytDobutton_c::ACT_DO_22, // ACT_IE_INFO_22
|
||||
dLytDobutton_c::ACT_DO_SWIM, // ACT_IE_INFO_SWIM
|
||||
dLytDobutton_c::ACT_DO_LEAP, // ACT_IE_INFO_LEAP
|
||||
dLytDobutton_c::ACT_DO_DASH, // ACT_IE_INFO_DASH
|
||||
dLytDobutton_c::ACT_DO_GET_OUT, // ACT_IE_INFO_GET_OUT
|
||||
dLytDobutton_c::ACT_DO_27, // ACT_IE_INFO_27
|
||||
dLytDobutton_c::ACT_DO_PICK_UP, // ACT_IE_INFO_PICK_UP
|
||||
dLytDobutton_c::ACT_DO_SIT, // ACT_IE_INFO_SIT
|
||||
dLytDobutton_c::ACT_DO_STAND, // ACT_IE_INFO_STAND
|
||||
dLytDobutton_c::ACT_DO_DIG, // ACT_IE_INFO_DIG
|
||||
dLytDobutton_c::ACT_DO_32, // ACT_IE_INFO_32
|
||||
dLytDobutton_c::ACT_DO_33, // ACT_IE_INFO_33
|
||||
dLytDobutton_c::ACT_DO_BREAK_FREE, // ACT_IE_INFO_BREAK_FREE
|
||||
dLytDobutton_c::ACT_DO_35, // ACT_IE_INFO_35
|
||||
dLytDobutton_c::ACT_DO_36, // ACT_IE_INFO_36
|
||||
dLytDobutton_c::ACT_DO_PLANT, // ACT_IE_INFO_PLANT
|
||||
dLytDobutton_c::ACT_DO_CATCH, // ACT_IE_INFO_CATCH
|
||||
dLytDobutton_c::ACT_DO_SPEED_UP, // ACT_IE_INFO_SPEED_UP
|
||||
dLytDobutton_c::ACT_DO_SAILCLOTH, // ACT_IE_INFO_SAILCLOTH
|
||||
dLytDobutton_c::ACT_DO_PUT_AWAY, // ACT_IE_INFO_PUT_AWAY
|
||||
dLytDobutton_c::ACT_DO_EMERGE, // ACT_IE_INFO_EMERGE
|
||||
dLytDobutton_c::ACT_DO_INSERT, // ACT_IE_INFO_INSERT
|
||||
dLytDobutton_c::ACT_DO_44, // ACT_IE_INFO_44
|
||||
dLytDobutton_c::ACT_DO_TURN, // ACT_IE_INFO_TURN
|
||||
dLytDobutton_c::ACT_DO_PUSH_IN, // ACT_IE_INFO_ALIGN
|
||||
dLytDobutton_c::ACT_DO_47, // ACT_IE_INFO_47
|
||||
dLytDobutton_c::ACT_DO_DRAW_BOW, // ACT_IE_INFO_DRAW_BOW
|
||||
dLytDobutton_c::ACT_DO_49, // ACT_IE_INFO_49
|
||||
dLytDobutton_c::ACT_DO_50, // ACT_IE_INFO_50
|
||||
dLytDobutton_c::ACT_DO_51, // ACT_IE_INFO_51
|
||||
dLytDobutton_c::ACT_DO_SWING, // ACT_IE_INFO_SWING
|
||||
dLytDobutton_c::ACT_DO_BALANCE, // ACT_IE_INFO_BALANCE
|
||||
dLytDobutton_c::ACT_DO_JOSTLE, // ACT_IE_INFO_JOSTLE
|
||||
dLytDobutton_c::ACT_DO_55, // ACT_IE_INFO_55
|
||||
dLytDobutton_c::ACT_DO_SLEEP, // ACT_IE_INFO_SLEEP
|
||||
dLytDobutton_c::ACT_DO_DROP, // ACT_IE_INFO_DROP_2
|
||||
dLytDobutton_c::ACT_DO_LAUNCH, // ACT_IE_INFO_LAUNCH
|
||||
dLytDobutton_c::ACT_DO_READ, // ACT_IE_INFO_READ
|
||||
dLytDobutton_c::ACT_DO_WHIP, // ACT_IE_INFO_WHIP
|
||||
dLytDobutton_c::ACT_DO_PULL, // ACT_IE_INFO_PULL
|
||||
dLytDobutton_c::ACT_DO_DRINK, // ACT_IE_INFO_DRINK
|
||||
dLytDobutton_c::ACT_DO_63, // ACT_IE_INFO_63
|
||||
dLytDobutton_c::ACT_DO_GET_IN, // ACT_IE_INFO_GET_IN
|
||||
dLytDobutton_c::ACT_DO_FIRE, // ACT_IE_INFO_FIRE
|
||||
dLytDobutton_c::ACT_DO_ATTACK, // ACT_IE_INFO_ATTACK
|
||||
dLytDobutton_c::ACT_DO_FATAL_BLOW, // ACT_IE_INFO_FATAL_BLOW
|
||||
dLytDobutton_c::ACT_DO_JUMP_DOWN, // ACT_IE_INFO_JUMP_DOWN
|
||||
dLytDobutton_c::ACT_DO_STRUM, // ACT_IE_INFO_STRUM
|
||||
dLytDobutton_c::ACT_DO_70, // ACT_IE_INFO_70
|
||||
dLytDobutton_c::ACT_DO_RELEASE, // ACT_IE_INFO_RELEASE
|
||||
dLytDobutton_c::ACT_DO_GRAB_2, // ACT_IE_INFO_GRAB_2
|
||||
dLytDobutton_c::ACT_DO_READY_STANCE, // ACT_IE_INFO_READY_STANCE
|
||||
dLytDobutton_c::ACT_DO_REMOVE, // ACT_IE_INFO_REMOVE
|
||||
dLytDobutton_c::ACT_DO_READY_SWORD, // ACT_IE_INFO_READY_SWORD
|
||||
dLytDobutton_c::ACT_DO_THRUST_SWORD, // ACT_IE_INFO_THRUST_SWORD
|
||||
dLytDobutton_c::ACT_DO_USE, // ACT_IE_INFO_USE
|
||||
dLytDobutton_c::ACT_DO_SCOOP, // ACT_IE_INFO_SCOOP
|
||||
dLytDobutton_c::ACT_DO_79, // ACT_IE_INFO_79
|
||||
dLytDobutton_c::ACT_DO_80, // ACT_IE_INFO_80
|
||||
dLytDobutton_c::ACT_DO_LOOK, // ACT_IE_INFO_LOOK
|
||||
dLytDobutton_c::ACT_DO_DOWSE, // ACT_IE_INFO_DOWSE
|
||||
dLytDobutton_c::ACT_DO_PILOT, // ACT_IE_INFO_PILOT
|
||||
dLytDobutton_c::ACT_DO_LOOK_DOWN, // ACT_IE_INFO_LOOK_DOWN
|
||||
dLytDobutton_c::ACT_DO_DIVE, // ACT_IE_INFO_DIVE
|
||||
dLytDobutton_c::ACT_DO_SELECT, // ACT_IE_INFO_SELECT
|
||||
dLytDobutton_c::ACT_DO_GRAB_3, // ACT_IE_INFO_GRAB_3
|
||||
dLytDobutton_c::ACT_DO_MOVE_2, // ACT_IE_INFO_MOVE_1
|
||||
dLytDobutton_c::ACT_DO_ACCELERATE, // ACT_IE_INFO_ACCELERATE
|
||||
dLytDobutton_c::ACT_DO_CHARGE, // ACT_IE_INFO_CHARGE
|
||||
dLytDobutton_c::ACT_DO_LEAN, // ACT_IE_INFO_LEAN
|
||||
dLytDobutton_c::ACT_DO_PRESS, // ACT_IE_INFO_PRESS
|
||||
};
|
||||
|
||||
void LytDoButtonRelated::setCrossTop(Act_IE_e act, bool bHas) {
|
||||
LytDoButtonRelated *p = sInstance;
|
||||
if (p != nullptr) {
|
||||
if (act == ACT_IE_147) {
|
||||
p->field_0x04[DO_BUTTON_CROSS_T] = ACT_IE_NONE;
|
||||
p->field_0x34[DO_BUTTON_CROSS_T] = bHas;
|
||||
if (!checkIsInSkykeepPuzzle()) {
|
||||
dLytMeter_c::setCrossIconTop(dLytMeterCrossBtn_c::CROSS_ICON_TOP_1);
|
||||
} else {
|
||||
dLytMeter_c::setCrossIconTop(dLytMeterCrossBtn_c::CROSS_ICON_NONE);
|
||||
}
|
||||
} else if (act == ACT_IE_149) {
|
||||
p->field_0x04[DO_BUTTON_CROSS_T] = ACT_IE_NONE;
|
||||
p->field_0x34[DO_BUTTON_CROSS_T] = bHas;
|
||||
if (!checkIsInSkykeepPuzzle()) {
|
||||
dLytMeter_c::setCrossIconTop(dLytMeterCrossBtn_c::CROSS_ICON_TOP_3);
|
||||
} else {
|
||||
dLytMeter_c::setCrossIconTop(dLytMeterCrossBtn_c::CROSS_ICON_NONE);
|
||||
}
|
||||
} else if (act == ACT_IE_151) {
|
||||
p->field_0x04[DO_BUTTON_CROSS_T] = ACT_IE_NONE;
|
||||
p->field_0x34[DO_BUTTON_CROSS_T] = bHas;
|
||||
if (!checkIsInSkykeepPuzzle()) {
|
||||
dLytMeter_c::setCrossIconTop(dLytMeterCrossBtn_c::CROSS_ICON_TOP_4);
|
||||
} else {
|
||||
dLytMeter_c::setCrossIconTop(dLytMeterCrossBtn_c::CROSS_ICON_NONE);
|
||||
}
|
||||
} else {
|
||||
p->field_0x04[DO_BUTTON_CROSS_T] = act;
|
||||
p->field_0x34[DO_BUTTON_CROSS_T] = bHas;
|
||||
dLytMeter_c::setCrossIconTop(dLytMeterCrossBtn_c::CROSS_ICON_NONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LytDoButtonRelated::setCrossDown(Act_IE_e act, bool bHas) {
|
||||
LytDoButtonRelated *p = sInstance;
|
||||
if (p != nullptr) {
|
||||
if (act == ACT_IE_148) {
|
||||
p->field_0x04[DO_BUTTON_CROSS_D] = ACT_IE_NONE;
|
||||
p->field_0x34[DO_BUTTON_CROSS_D] = bHas;
|
||||
if (!checkIsInSkykeepPuzzle()) {
|
||||
dLytMeter_c::setCrossIconDown(dLytMeterCrossBtn_c::CROSS_ICON_DOWN_0);
|
||||
} else {
|
||||
dLytMeter_c::setCrossIconDown(dLytMeterCrossBtn_c::CROSS_ICON_NONE);
|
||||
}
|
||||
} else if (act == ACT_IE_150) {
|
||||
p->field_0x04[DO_BUTTON_CROSS_D] = ACT_IE_NONE;
|
||||
p->field_0x34[DO_BUTTON_CROSS_D] = bHas;
|
||||
if (!checkIsInSkykeepPuzzle()) {
|
||||
dLytMeter_c::setCrossIconDown(dLytMeterCrossBtn_c::CROSS_ICON_DOWN_2);
|
||||
} else {
|
||||
dLytMeter_c::setCrossIconDown(dLytMeterCrossBtn_c::CROSS_ICON_NONE);
|
||||
}
|
||||
} else if (act == ACT_IE_ETC_CENTER) {
|
||||
p->field_0x04[DO_BUTTON_CROSS_D] = ACT_IE_NONE;
|
||||
p->field_0x34[DO_BUTTON_CROSS_D] = bHas;
|
||||
dLytMeter_c::setCrossIconDown(dLytMeterCrossBtn_c::CROSS_ICON_DOWN_5);
|
||||
} else {
|
||||
p->field_0x04[DO_BUTTON_CROSS_D] = act;
|
||||
p->field_0x34[DO_BUTTON_CROSS_D] = bHas;
|
||||
dLytMeter_c::setCrossIconDown(dLytMeterCrossBtn_c::CROSS_ICON_NONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LytDoButtonRelated::Act_IE_e LytDoButtonRelated::convertDoButton(dLytDobutton_c::Act_Do_e act) {
|
||||
for (s32 i = 0; i < ACT_IE_NONE; i++) {
|
||||
if (sActIEtoDoConversionTable[i] == act) {
|
||||
return static_cast<Act_IE_e>(i);
|
||||
}
|
||||
}
|
||||
return (Act_IE_e)-1;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ dLytPauseDisp00_c::dLytPauseDisp00_c() : mStateMgr(*this, sStateID::null) {}
|
||||
|
||||
void dLytPauseDisp00_c::init() {
|
||||
mLytBase.build("pause_00.brlyt", nullptr);
|
||||
mLytBase.mPriority = 0x86;
|
||||
mLytBase.setPriority(0x86);
|
||||
|
||||
for (int i = 0; i < 0x7E; i++) {
|
||||
field_0x00D0[i].init(S_MAPPINGS[i].mFile, nullptr, mLytBase.getLayout(), S_MAPPINGS[i].mName);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "d/d_message.h"
|
||||
#include "d/d_tag_processor.h"
|
||||
#include "d/d_textunk.h"
|
||||
#include "d/lyt/msg_window/d_lyt_msg_window.h"
|
||||
#include "libms/msgfile.h"
|
||||
#include "m/m_color.h"
|
||||
#include "nw4r/lyt/lyt_common.h"
|
||||
@@ -500,7 +501,7 @@ void dTextBox_c::init() {
|
||||
SetFontSize(sz);
|
||||
mMyTextScale = sz;
|
||||
mMyScale = 1.0f;
|
||||
mWindowSubtype = 0x24;
|
||||
mWindowSubtype = dLytMsgWindow_c::MSG_WINDOW_36;
|
||||
field_0x201 = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "toBeSorted/arc_managers/layout_arc_manager.h"
|
||||
#include "toBeSorted/event_manager.h"
|
||||
#include "toBeSorted/minigame_mgr.h"
|
||||
#include "toBeSorted/misc_actor.h"
|
||||
#include "toBeSorted/small_sound_mgr.h"
|
||||
// clang-format on
|
||||
|
||||
@@ -848,8 +849,8 @@ bool dLytMeterMain_c::build(d2d::ResAccIf_c *resAcc) {
|
||||
}
|
||||
s32 zero = 0;
|
||||
|
||||
field_0x1374C = 0;
|
||||
field_0x13748 = 0;
|
||||
mSavedBasicPosition = 0;
|
||||
mBasicPosition = POSITION_NORMAL;
|
||||
field_0x13750 = 4;
|
||||
field_0x13770 = 3;
|
||||
field_0x13774 = 0;
|
||||
@@ -996,15 +997,15 @@ void dLytMeterMain_c::fn_800D5290() {
|
||||
meter->setFlags(METER_BTN_PLUS);
|
||||
}
|
||||
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_PLUS, LytDoButtonRelated::DO_0x74);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_PLUS, LytDoButtonRelated::ACT_IE_ETC_BACK_2);
|
||||
meter->clearFlags(METER_BTN_MINUS | METER_BTN_1 | METER_BTN_2);
|
||||
if (LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == LytDoButtonRelated::DO_NONE) {
|
||||
if (LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == LytDoButtonRelated::ACT_IE_NONE) {
|
||||
meter->clearFlags(METER_BTN_C);
|
||||
}
|
||||
}
|
||||
|
||||
bool dLytMeterMain_c::fn_800D5350() {
|
||||
if (field_0x13748 == 1 && dMessage_c::getInstance()->getField_0x328()) {
|
||||
if (mBasicPosition == POSITION_MAP && dMessage_c::getInstance()->getField_0x328()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -1019,7 +1020,6 @@ bool dLytMeterMain_c::fn_800D5380(u8 arg) {
|
||||
return false;
|
||||
}
|
||||
|
||||
extern "C" bool checkIsInSkykeepPuzzle();
|
||||
bool dLytMeterMain_c::fn_800D53D0() {
|
||||
if (checkIsInSkykeepPuzzle() && !field_0x13774) {
|
||||
return true;
|
||||
@@ -1130,14 +1130,14 @@ void dLytMeterMain_c::checkPaneVisibility() {
|
||||
const char *name = EventManager::getCurrentEventName();
|
||||
if (strequals(name, "SwordDraw") || strequals(name, "SwordDrawDoorNew")) {
|
||||
field_0x1377E = true;
|
||||
if (dLytDobutton_c::getNextActionToShow() != 0x12) {
|
||||
dLytDobutton_c::setActionTextStuff(0x29, 0x5E, true);
|
||||
if (dLytDobutton_c::getNextActionToShow() != dLytDobutton_c::ACT_DO_DRAW) {
|
||||
dLytDobutton_c::setActionTextStuff(dLytDobutton_c::ICON_NONE, dLytDobutton_c::ACT_DO_INVALID, true);
|
||||
}
|
||||
if (LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_A) != 0x12) {
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_A, LytDoButtonRelated::DO_NONE);
|
||||
if (LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_A) != LytDoButtonRelated::ACT_IE_INFO_DRAW) {
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_A, LytDoButtonRelated::ACT_IE_NONE);
|
||||
}
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_C, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_Z, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_C, LytDoButtonRelated::ACT_IE_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_Z, LytDoButtonRelated::ACT_IE_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1156,17 +1156,17 @@ void dLytMeterMain_c::checkPaneVisibility() {
|
||||
}
|
||||
|
||||
if ((!StoryflagManager::sInstance->getCounterOrFlag(58) &&
|
||||
((LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::DO_NONE &&
|
||||
((LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::ACT_IE_NONE &&
|
||||
mItemSelect.getField_0x5794() != 2 &&
|
||||
(!EventManager::isInEvent() || !EventManager::isCurrentEvent("ItemGetGorgeous")))))
|
||||
|
||||
|| (dStageMgr_c::GetInstance()->isAreaTypeHouse() &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::DO_NONE &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::ACT_IE_NONE &&
|
||||
!MinigameManager::isInMinigameState(MinigameManager::HOUSE_CLEANING) && !mItemSelect.fn_800F02F0())
|
||||
|
||||
||
|
||||
(isSilentRealm() && LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::DO_NONE &&
|
||||
!mItemSelect.fn_800F02F0())
|
||||
|| (isSilentRealm() &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::ACT_IE_NONE &&
|
||||
!mItemSelect.fn_800F02F0())
|
||||
|
||||
|| ((dAcPy_c::GetLink()->checkActionFlagsCont(0x400000) || fn_800D5420() ||
|
||||
dAcPy_c::GetLink()->checkActionFlags(dAcPy_c::FLG0_CRAWLING) || fn_800D5380(0) ||
|
||||
@@ -1175,7 +1175,7 @@ void dLytMeterMain_c::checkPaneVisibility() {
|
||||
MinigameManager::isInMinigameState(MinigameManager::BAMBOO_CUTTING)))
|
||||
|
||||
|| (MinigameManager::isInMinigameState(MinigameManager::TRIAL_TIME_ATTACK) &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::DO_NONE) ||
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::ACT_IE_NONE) ||
|
||||
(dLytMeter_c::getField_0x13B66() || (fn_800D56B0() && !mItemSelect.fn_800F02F0() && !fn_800D53D0()) ||
|
||||
fn_800D5650() || fn_800D5680())) {
|
||||
mPanesVisible[METER_ANIM_ITEM_SELECT] = false;
|
||||
@@ -1379,8 +1379,8 @@ void dLytMeterMain_c::checkPaneVisibility() {
|
||||
|
||||
if (dAcPy_c::GetLink()->getRidingActorType() != dAcPy_c::RIDING_LOFTWING || !field_0x13780 ||
|
||||
|
||||
(dLytDobutton_c::getFn0x8010E5D0() != 0x5E || fn_800D56B0() || dLytMeter_c::getField_0x13B66() ||
|
||||
fn_800D5420() || fn_800D5650() || fn_800D5680())) {
|
||||
(dLytDobutton_c::getAction() != dLytDobutton_c::ACT_DO_INVALID || fn_800D56B0() ||
|
||||
dLytMeter_c::getField_0x13B66() || fn_800D5420() || fn_800D5650() || fn_800D5680())) {
|
||||
mBirdGaugeVisible = false;
|
||||
}
|
||||
|
||||
@@ -1519,7 +1519,7 @@ bool dLytMeterMain_c::execute() {
|
||||
meter->clearFlags(METER_BTN_PLUS);
|
||||
}
|
||||
|
||||
if (field_0x13750 != 0 && field_0x13748 == 1) {
|
||||
if (field_0x13750 != 0 && mBasicPosition == POSITION_MAP) {
|
||||
fn_800D5290();
|
||||
}
|
||||
|
||||
@@ -1606,9 +1606,9 @@ bool dLytMeterMain_c::execute() {
|
||||
mNodes[METER_SHIELD].mpPane->SetTranslate(mShieldPos);
|
||||
}
|
||||
|
||||
if (field_0x13748 != field_0x1374C) {
|
||||
field_0x1374C = field_0x13748;
|
||||
mAnmGroups[METER_ANIM_POSITION].setFrame(field_0x13748);
|
||||
if (mBasicPosition != mSavedBasicPosition) {
|
||||
mSavedBasicPosition = mBasicPosition;
|
||||
mAnmGroups[METER_ANIM_POSITION].setFrame(mBasicPosition);
|
||||
mAnmGroups[METER_ANIM_POSITION].setAnimEnable(true);
|
||||
}
|
||||
|
||||
@@ -1653,19 +1653,19 @@ bool dLytMeterMain_c::execute() {
|
||||
}
|
||||
|
||||
meter->resetFlags();
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_A, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_B, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_A, LytDoButtonRelated::ACT_IE_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_B, LytDoButtonRelated::ACT_IE_NONE);
|
||||
|
||||
LytDoButtonRelated::fn_8010EC10(LytDoButtonRelated::DO_NONE, true);
|
||||
LytDoButtonRelated::fn_8010ED50(LytDoButtonRelated::DO_NONE, true);
|
||||
LytDoButtonRelated::setCrossTop(LytDoButtonRelated::ACT_IE_NONE, true);
|
||||
LytDoButtonRelated::setCrossDown(LytDoButtonRelated::ACT_IE_NONE, true);
|
||||
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_CROSS_L, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_CROSS_R, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_CROSS_L, LytDoButtonRelated::ACT_IE_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_CROSS_R, LytDoButtonRelated::ACT_IE_NONE);
|
||||
|
||||
LytDoButtonRelated::reset(LytDoButtonRelated::DO_BUTTON_C, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_Z, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::reset(LytDoButtonRelated::DO_BUTTON_NUN_STK, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_NUN_BG, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::reset(LytDoButtonRelated::DO_BUTTON_C, LytDoButtonRelated::ACT_IE_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_Z, LytDoButtonRelated::ACT_IE_NONE);
|
||||
LytDoButtonRelated::reset(LytDoButtonRelated::DO_BUTTON_NUN_STK, LytDoButtonRelated::ACT_IE_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_NUN_BG, LytDoButtonRelated::ACT_IE_NONE);
|
||||
|
||||
if (mpTimer != nullptr) {
|
||||
mpTimer->execute();
|
||||
@@ -1761,21 +1761,21 @@ bool dLytMeter_c::build() {
|
||||
if (dScTitle_c::sInstance != nullptr) {
|
||||
mpDoButton = nullptr;
|
||||
mpDoButtonRelated = nullptr;
|
||||
mpBirdRelated = nullptr;
|
||||
mpTargetBird = nullptr;
|
||||
} else {
|
||||
mpDoButton = new dLytDobutton_c();
|
||||
mpDoButtonRelated = new LytDoButtonRelated();
|
||||
mpBirdRelated = new LytBirdButtonRelated();
|
||||
mpTargetBird = new dLytTargetBird_c();
|
||||
}
|
||||
|
||||
if (mpDoButton != nullptr) {
|
||||
mpDoButton->init(&mResAcc);
|
||||
mpDoButton->build(&mResAcc);
|
||||
}
|
||||
if (mpDoButtonRelated != nullptr) {
|
||||
mpDoButtonRelated->build(&mResAcc);
|
||||
}
|
||||
if (mpBirdRelated != nullptr) {
|
||||
mpBirdRelated->build(&mResAcc);
|
||||
if (mpTargetBird != nullptr) {
|
||||
mpTargetBird->build(&mResAcc);
|
||||
}
|
||||
|
||||
fn_800D97E0(0xb);
|
||||
@@ -1810,10 +1810,10 @@ bool dLytMeter_c::remove() {
|
||||
delete mpEventSkip;
|
||||
mpEventSkip = nullptr;
|
||||
}
|
||||
if (mpBirdRelated != nullptr) {
|
||||
mpBirdRelated->remove();
|
||||
delete mpBirdRelated;
|
||||
mpBirdRelated = nullptr;
|
||||
if (mpTargetBird != nullptr) {
|
||||
mpTargetBird->remove();
|
||||
delete mpTargetBird;
|
||||
mpTargetBird = nullptr;
|
||||
}
|
||||
dLytAreaCaption_c::remove();
|
||||
mResAcc.detach();
|
||||
@@ -1833,8 +1833,8 @@ bool dLytMeter_c::execute() {
|
||||
mpDoButton->execute();
|
||||
}
|
||||
|
||||
if (mpBirdRelated != nullptr) {
|
||||
mpBirdRelated->execute();
|
||||
if (mpTargetBird != nullptr) {
|
||||
mpTargetBird->execute();
|
||||
}
|
||||
|
||||
if (field_0x13B61 || (!EventManager::isInEvent() && field_0x13B62)) {
|
||||
@@ -1871,8 +1871,8 @@ bool dLytMeter_c::draw() {
|
||||
if (mpDoButton != nullptr) {
|
||||
mpDoButton->draw();
|
||||
}
|
||||
if (mpBirdRelated != nullptr) {
|
||||
mpBirdRelated->draw();
|
||||
if (mpTargetBird != nullptr) {
|
||||
mpTargetBird->draw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "d/lyt/d_window.h"
|
||||
#include "d/lyt/meter/d_lyt_meter.h"
|
||||
#include "toBeSorted/event_manager.h"
|
||||
#include "toBeSorted/misc_actor.h"
|
||||
|
||||
STATE_DEFINE(dLytMeterABtn_c, InvisibleWait);
|
||||
STATE_DEFINE(dLytMeterABtn_c, In);
|
||||
@@ -81,7 +82,7 @@ void dLytMeterABtn_c::executeState_Wait() {
|
||||
}
|
||||
|
||||
if (field_0x1C0) {
|
||||
if (field_0x1BC != LytDoButtonRelated::DO_NONE) {
|
||||
if (field_0x1BC != LytDoButtonRelated::ACT_IE_NONE) {
|
||||
mAnm[A_BTN_ANIM_INPUT].setBackwardsOnce();
|
||||
mAnm[A_BTN_ANIM_INPUT].setToStart();
|
||||
mAnm[A_BTN_ANIM_INPUT].setAnimEnable(true);
|
||||
@@ -90,7 +91,7 @@ void dLytMeterABtn_c::executeState_Wait() {
|
||||
}
|
||||
field_0x1B8 = field_0x1BC;
|
||||
} else {
|
||||
if (field_0x1BC != LytDoButtonRelated::DO_NONE) {
|
||||
if (field_0x1BC != LytDoButtonRelated::ACT_IE_NONE) {
|
||||
setMessage(field_0x1BC);
|
||||
}
|
||||
field_0x1B8 = field_0x1BC;
|
||||
@@ -110,7 +111,7 @@ void dLytMeterABtn_c::finalizeState_On() {}
|
||||
void dLytMeterABtn_c::initializeState_Active() {}
|
||||
void dLytMeterABtn_c::executeState_Active() {
|
||||
if (field_0x1BC != field_0x1B8 || !field_0x1C0) {
|
||||
if (field_0x1BC == LytDoButtonRelated::DO_NONE || !field_0x1C0) {
|
||||
if (field_0x1BC == LytDoButtonRelated::ACT_IE_NONE || !field_0x1C0) {
|
||||
mAnm[A_BTN_ANIM_INPUT].setForwardOnce();
|
||||
mAnm[A_BTN_ANIM_INPUT].setFrame(0.0f);
|
||||
mAnm[A_BTN_ANIM_INPUT].setAnimEnable(true);
|
||||
@@ -122,7 +123,7 @@ void dLytMeterABtn_c::executeState_Active() {
|
||||
setMessage(field_0x1BC);
|
||||
}
|
||||
field_0x1B8 = field_0x1BC;
|
||||
} else if (field_0x1B8 == LytDoButtonRelated::DO_NONE) {
|
||||
} else if (field_0x1B8 == LytDoButtonRelated::ACT_IE_NONE) {
|
||||
mAnm[A_BTN_ANIM_INPUT].setForwardOnce();
|
||||
mAnm[A_BTN_ANIM_INPUT].setFrame(0.0f);
|
||||
mAnm[A_BTN_ANIM_INPUT].setAnimEnable(true);
|
||||
@@ -170,9 +171,9 @@ bool dLytMeterABtn_c::build(d2d::ResAccIf_c *resAcc) {
|
||||
mpSizeBox[i] = mLyt.getSizeBoxInWindow(sWindows[i]);
|
||||
}
|
||||
|
||||
field_0x1C4 = LytDoButtonRelated::DO_DASH;
|
||||
field_0x1B8 = LytDoButtonRelated::DO_DASH;
|
||||
field_0x1BC = LytDoButtonRelated::DO_DASH;
|
||||
field_0x1C4 = LytDoButtonRelated::ACT_IE_ETC_DASH;
|
||||
field_0x1B8 = LytDoButtonRelated::ACT_IE_ETC_DASH;
|
||||
field_0x1BC = LytDoButtonRelated::ACT_IE_ETC_DASH;
|
||||
field_0x1C8 = 0;
|
||||
field_0x1CA = 0;
|
||||
field_0x1C9 = 0;
|
||||
@@ -199,8 +200,6 @@ bool dLytMeterABtn_c::remove() {
|
||||
return true;
|
||||
}
|
||||
|
||||
extern "C" bool checkIsInSkykeepPuzzle();
|
||||
|
||||
bool dLytMeterABtn_c::execute() {
|
||||
if (mpOwnerPane == nullptr) {
|
||||
return true;
|
||||
@@ -211,17 +210,17 @@ bool dLytMeterABtn_c::execute() {
|
||||
mAnm[A_BTN_ANIM_INPUT].setToEnd2();
|
||||
}
|
||||
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_A, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_A, LytDoButtonRelated::ACT_IE_NONE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (dLytMeter_c::GetInstance()->getMeterField_0x13750() == 0) {
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_A, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_A, LytDoButtonRelated::ACT_IE_NONE);
|
||||
|
||||
if (field_0x1BC != LytDoButtonRelated::DO_NONE) {
|
||||
field_0x1BC = LytDoButtonRelated::DO_NONE;
|
||||
field_0x1B8 = LytDoButtonRelated::DO_NONE;
|
||||
if (field_0x1BC != LytDoButtonRelated::ACT_IE_NONE) {
|
||||
field_0x1BC = LytDoButtonRelated::ACT_IE_NONE;
|
||||
field_0x1B8 = LytDoButtonRelated::ACT_IE_NONE;
|
||||
}
|
||||
setMessage(field_0x1BC);
|
||||
}
|
||||
@@ -230,10 +229,10 @@ bool dLytMeterABtn_c::execute() {
|
||||
|
||||
if (EventManager::isInEvent() && !dLytMeter_c::GetInstance()->fn_800D5670() &&
|
||||
dLytMeter_c::GetMain()->getField_0x1377E() == 0 && !checkIsInSkykeepPuzzle() &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_A) == LytDoButtonRelated::DO_NONE) {
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_A) == LytDoButtonRelated::ACT_IE_NONE) {
|
||||
field_0x1C9 = 0;
|
||||
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_A, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_A, LytDoButtonRelated::ACT_IE_NONE);
|
||||
} else {
|
||||
field_0x1C9 = 1;
|
||||
}
|
||||
@@ -256,7 +255,7 @@ bool dLytMeterABtn_c::execute() {
|
||||
case 0x23:
|
||||
case 0x27:
|
||||
case 0x28: {
|
||||
LytDoButtonRelated::Action_e action = LytDoButtonRelated::convertDoButton(dLytDobutton_c::getField0x47C());
|
||||
LytDoButtonRelated::Act_IE_e action = LytDoButtonRelated::convertDoButton(dLytDobutton_c::getField0x47C());
|
||||
if (action >= 0) {
|
||||
state = true;
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_A, action);
|
||||
@@ -305,21 +304,21 @@ void dLytMeterABtn_c::setMessage(s32 id) {
|
||||
buf[i] = 0;
|
||||
}
|
||||
|
||||
if (id < LytDoButtonRelated::DO_NONE) {
|
||||
if (id < 0x5D) {
|
||||
if (id < LytDoButtonRelated::ACT_IE_NONE) {
|
||||
if (id < LytDoButtonRelated::ACT_IE_SEPARATOR) {
|
||||
sprintf(buf, "ACT_INFO_%03d", sActIds[id]);
|
||||
} else if (id == 0x5D) {
|
||||
} else if (id == LytDoButtonRelated::ACT_IE_SEPARATOR) {
|
||||
wchar_t b2[2];
|
||||
b2[0] = b2[1] = 0;
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mpTextBoxes[i]->setTextWithGlobalTextProcessor(b2);
|
||||
}
|
||||
} else {
|
||||
s32 id2 = id - 0x5E;
|
||||
s32 id2 = id - LytDoButtonRelated::ACT_IE_SEPARATOR - 1;
|
||||
sprintf(buf, "ACT_ETC_%03d", sActIds[id2]);
|
||||
}
|
||||
|
||||
if (id != 0x5D) {
|
||||
if (id != LytDoButtonRelated::ACT_IE_SEPARATOR) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mpTextBoxes[i]->SetVisible(true);
|
||||
mpTextBoxes[i]->setMessageWithGlobalTextProcessor2(buf, nullptr);
|
||||
|
||||
@@ -1,10 +1,150 @@
|
||||
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
|
||||
// 001-Action.msbt
|
||||
static const s32 sActIds[LytDoButtonRelated::ACT_IE_NONE] = {
|
||||
1, // ACT_IE_INFO_CLIMB_UP
|
||||
2, // ACT_IE_INFO_JUMP
|
||||
3, // ACT_IE_INFO_DROP_DOWN
|
||||
4, // ACT_IE_INFO_LET_GO
|
||||
5, // ACT_IE_INFO_OPEN
|
||||
6, // ACT_IE_INFO_DROP
|
||||
7, // ACT_IE_INFO_THROW
|
||||
8, // ACT_IE_INFO_BURROW
|
||||
9, // ACT_IE_INFO_ROLL
|
||||
10, // ACT_IE_INFO_9
|
||||
11, // ACT_IE_INFO_MOVE
|
||||
12, // ACT_IE_INFO_GRAB
|
||||
13, // ACT_IE_INFO_SHOOT
|
||||
14, // ACT_IE_INFO_13
|
||||
15, // ACT_IE_INFO_14
|
||||
16, // ACT_IE_INFO_15
|
||||
17, // ACT_IE_INFO_TALK
|
||||
18, // ACT_IE_INFO_EXAMINE
|
||||
19, // ACT_IE_INFO_DRAW
|
||||
20, // ACT_IE_INFO_19
|
||||
21, // ACT_IE_INFO_BLOW
|
||||
22, // ACT_IE_INFO_21
|
||||
23, // ACT_IE_INFO_22
|
||||
24, // ACT_IE_INFO_SWIM
|
||||
25, // ACT_IE_INFO_LEAP
|
||||
26, // ACT_IE_INFO_DASH
|
||||
27, // ACT_IE_INFO_GET_OUT
|
||||
28, // ACT_IE_INFO_27
|
||||
29, // ACT_IE_INFO_PICK_UP
|
||||
30, // ACT_IE_INFO_SIT
|
||||
31, // ACT_IE_INFO_STAND
|
||||
32, // ACT_IE_INFO_DIG
|
||||
33, // ACT_IE_INFO_32
|
||||
34, // ACT_IE_INFO_33
|
||||
35, // ACT_IE_INFO_BREAK_FREE
|
||||
36, // ACT_IE_INFO_35
|
||||
37, // ACT_IE_INFO_36
|
||||
38, // ACT_IE_INFO_PLANT
|
||||
39, // ACT_IE_INFO_CATCH
|
||||
40, // ACT_IE_INFO_SPEED_UP
|
||||
41, // ACT_IE_INFO_SAILCLOTH
|
||||
42, // ACT_IE_INFO_PUT_AWAY
|
||||
43, // ACT_IE_INFO_EMERGE
|
||||
44, // ACT_IE_INFO_INSERT
|
||||
45, // ACT_IE_INFO_44
|
||||
46, // ACT_IE_INFO_TURN
|
||||
47, // ACT_IE_INFO_ALIGN
|
||||
48, // ACT_IE_INFO_47
|
||||
49, // ACT_IE_INFO_DRAW_BOW
|
||||
50, // ACT_IE_INFO_49
|
||||
51, // ACT_IE_INFO_50
|
||||
52, // ACT_IE_INFO_51
|
||||
53, // ACT_IE_INFO_SWING
|
||||
54, // ACT_IE_INFO_BALANCE
|
||||
55, // ACT_IE_INFO_JOSTLE
|
||||
56, // ACT_IE_INFO_55
|
||||
57, // ACT_IE_INFO_SLEEP
|
||||
58, // ACT_IE_INFO_DROP_2
|
||||
59, // ACT_IE_INFO_LAUNCH
|
||||
60, // ACT_IE_INFO_READ
|
||||
61, // ACT_IE_INFO_WHIP
|
||||
62, // ACT_IE_INFO_PULL
|
||||
63, // ACT_IE_INFO_DRINK
|
||||
64, // ACT_IE_INFO_63
|
||||
65, // ACT_IE_INFO_GET_IN
|
||||
66, // ACT_IE_INFO_FIRE
|
||||
67, // ACT_IE_INFO_ATTACK
|
||||
68, // ACT_IE_INFO_FATAL_BLOW
|
||||
69, // ACT_IE_INFO_JUMP_DOWN
|
||||
70, // ACT_IE_INFO_STRUM
|
||||
71, // ACT_IE_INFO_70
|
||||
72, // ACT_IE_INFO_RELEASE
|
||||
73, // ACT_IE_INFO_GRAB_2
|
||||
74, // ACT_IE_INFO_READY_STANCE
|
||||
75, // ACT_IE_INFO_REMOVE
|
||||
76, // ACT_IE_INFO_READY_SWORD
|
||||
77, // ACT_IE_INFO_THRUST_SWORD
|
||||
78, // ACT_IE_INFO_USE
|
||||
79, // ACT_IE_INFO_SCOOP
|
||||
80, // ACT_IE_INFO_79
|
||||
81, // ACT_IE_INFO_80
|
||||
82, // ACT_IE_INFO_LOOK
|
||||
83, // ACT_IE_INFO_DOWSE
|
||||
84, // ACT_IE_INFO_PILOT
|
||||
85, // ACT_IE_INFO_LOOK_DOWN
|
||||
86, // ACT_IE_INFO_DIVE
|
||||
87, // ACT_IE_INFO_SELECT
|
||||
88, // ACT_IE_INFO_GRAB_3
|
||||
89, // ACT_IE_INFO_MOVE_1
|
||||
90, // ACT_IE_INFO_ACCELERATE
|
||||
91, // ACT_IE_INFO_CHARGE
|
||||
92, // ACT_IE_INFO_LEAN
|
||||
93, // ACT_IE_INFO_PRESS
|
||||
-1, // ACT_IE_SEPARATOR
|
||||
1, // ACT_IE_ETC_LOCK_ON
|
||||
2, // ACT_IE_ETC_DASH
|
||||
3, // ACT_IE_ETC_RAISE_SHIELD
|
||||
4, // ACT_IE_ETC_97
|
||||
5, // ACT_IE_ETC_SHIELD_BASH
|
||||
6, // ACT_IE_ETC_99
|
||||
7, // ACT_IE_ETC_ROLL
|
||||
8, // ACT_IE_ETC_DODGE
|
||||
9, // ACT_IE_ETC_102
|
||||
10, // ACT_IE_ETC_VIEW_SURFACE
|
||||
11, // ACT_IE_ETC_PUT_AWAY
|
||||
12, // ACT_IE_ETC_105
|
||||
13, // ACT_IE_ETC_106
|
||||
14, // ACT_IE_ETC_CENTER
|
||||
15, // ACT_IE_ETC_BACK
|
||||
16, // ACT_IE_ETC_WORLD_MAP
|
||||
17, // ACT_IE_ETC_ZOOM_OUT
|
||||
18, // ACT_IE_ETC_ZOOM_IN
|
||||
19, // ACT_IE_ETC_SCROLL
|
||||
20, // ACT_IE_ETC_CURRENT_LOCATION
|
||||
21, // ACT_IE_ETC_114
|
||||
22, // ACT_IE_ETC_115
|
||||
23, // ACT_IE_ETC_BACK_2
|
||||
24, // ACT_IE_ETC_ADD_BEACON
|
||||
25, // ACT_IE_ETC_REMOVE_BEACON
|
||||
26, // ACT_IE_ETC_ROTATE_MAP
|
||||
27, // ACT_IE_ETC_ROTATE_MAP_2
|
||||
28, // ACT_IE_ETC_121
|
||||
29, // ACT_IE_ETC_122
|
||||
30, // ACT_IE_ETC_123
|
||||
31, // ACT_IE_ETC_124
|
||||
32, // ACT_IE_ETC_GET_OFF
|
||||
33, // ACT_IE_ETC_STORE
|
||||
34, // ACT_IE_ETC_RETURN
|
||||
35, // ACT_IE_ETC_MOVE
|
||||
36, // ACT_IE_ETC_VIEW_LOCK
|
||||
37, // ACT_IE_ETC_RESET_POSITION
|
||||
38, // ACT_IE_ETC_CANCEL
|
||||
39, // ACT_IE_ETC_STOP
|
||||
40, // ACT_IE_ETC_ITEMS
|
||||
41, // ACT_IE_ETC_SPIN
|
||||
42, // ACT_IE_ETC_DONE
|
||||
43, // ACT_IE_ETC_RESET_PANELS
|
||||
44, // ACT_IE_ETC_BACK_3
|
||||
45, // ACT_IE_ETC_SLOW_DOWN
|
||||
46, // ACT_IE_ETC_DISPLAY
|
||||
47, // ACT_IE_ETC_SELECT_FLOOR
|
||||
48, // ACT_IE_ETC_SHOW_ISLAND_NAME
|
||||
49, // ACT_IE_ETC_HIDE_ISLAND_NAME
|
||||
50, // ACT_IE_ETC_READY_CANNON
|
||||
51, // ACT_IE_ETC_STOW_CANNON
|
||||
52, // ACT_IE_ETC_SAILCLOTH
|
||||
53, // ACT_IE_ETC_RETURN_2
|
||||
};
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "d/lyt/meter/d_lyt_meter.h"
|
||||
#include "toBeSorted/event_manager.h"
|
||||
#include "toBeSorted/fi_context.h"
|
||||
#include "toBeSorted/misc_actor.h"
|
||||
#include "toBeSorted/small_sound_mgr.h"
|
||||
|
||||
STATE_DEFINE(dLytMeterCrossBtnParts_c, Wait);
|
||||
@@ -21,6 +22,13 @@ STATE_DEFINE(dLytMeterCrossBtn_c, ToUse);
|
||||
STATE_DEFINE(dLytMeterCrossBtn_c, ToUnuse);
|
||||
STATE_DEFINE(dLytMeterCrossBtn_c, Unuse);
|
||||
|
||||
#define CROSS_BTN_PART_TOP 0
|
||||
#define CROSS_BTN_PART_DOWN 1
|
||||
#define CROSS_BTN_PART_LEFT 2
|
||||
#define CROSS_BTN_PART_RIGHT 3
|
||||
|
||||
#define CROSS_BTN_NUM_PARTS 4
|
||||
|
||||
void dLytMeterCrossBtnParts_c::initializeState_Wait() {
|
||||
mOnDelay = 15;
|
||||
}
|
||||
@@ -33,25 +41,25 @@ void dLytMeterCrossBtnParts_c::executeState_Wait() {
|
||||
if (field_0x7C) {
|
||||
if (field_0x68) {
|
||||
bool bDoUpdate = true;
|
||||
if (field_0x64 != LytDoButtonRelated::DO_NONE || field_0x70 != field_0x74) {
|
||||
if (mMessage != LytDoButtonRelated::ACT_IE_NONE || mSavedIcon != mCurrentIcon) {
|
||||
if (timer <= 0) {
|
||||
mStateMgr.changeState(StateID_On);
|
||||
setMessage(field_0x64);
|
||||
setMessage(mMessage);
|
||||
} else {
|
||||
bDoUpdate = false;
|
||||
mOnDelay -= 1;
|
||||
}
|
||||
}
|
||||
if (bDoUpdate) {
|
||||
field_0x60 = field_0x64;
|
||||
field_0x70 = field_0x74;
|
||||
mSavedMessage = mMessage;
|
||||
mSavedIcon = mCurrentIcon;
|
||||
}
|
||||
} else {
|
||||
if (field_0x64 != LytDoButtonRelated::DO_NONE || field_0x70 != field_0x74) {
|
||||
setMessage(field_0x64);
|
||||
if (mMessage != LytDoButtonRelated::ACT_IE_NONE || mSavedIcon != mCurrentIcon) {
|
||||
setMessage(mMessage);
|
||||
}
|
||||
field_0x60 = field_0x64;
|
||||
field_0x70 = field_0x74;
|
||||
mSavedMessage = mMessage;
|
||||
mSavedIcon = mCurrentIcon;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,18 +84,20 @@ void dLytMeterCrossBtnParts_c::finalizeState_On() {}
|
||||
|
||||
void dLytMeterCrossBtnParts_c::initializeState_Active() {}
|
||||
void dLytMeterCrossBtnParts_c::executeState_Active() {
|
||||
if (field_0x64 != field_0x60 || !field_0x68 || field_0x70 != field_0x74) {
|
||||
if ((field_0x64 == LytDoButtonRelated::DO_NONE && field_0x74 == 6) || !field_0x68) {
|
||||
if (field_0x60 != field_0x6C) {
|
||||
field_0x64 = field_0x6C;
|
||||
if (mMessage != mSavedMessage || !field_0x68 || mSavedIcon != mCurrentIcon) {
|
||||
if ((mMessage == LytDoButtonRelated::ACT_IE_NONE && mCurrentIcon == dLytMeterCrossBtn_c::CROSS_ICON_NONE) ||
|
||||
!field_0x68) {
|
||||
if (mSavedMessage != field_0x6C) {
|
||||
mMessage = field_0x6C;
|
||||
}
|
||||
mStateMgr.changeState(StateID_Off);
|
||||
} else {
|
||||
setMessage(field_0x64);
|
||||
setMessage(mMessage);
|
||||
}
|
||||
field_0x60 = field_0x64;
|
||||
field_0x70 = field_0x74;
|
||||
} else if (field_0x60 == LytDoButtonRelated::DO_NONE && field_0x74 == 6) {
|
||||
mSavedMessage = mMessage;
|
||||
mSavedIcon = mCurrentIcon;
|
||||
} else if (mSavedMessage == LytDoButtonRelated::ACT_IE_NONE &&
|
||||
mCurrentIcon == dLytMeterCrossBtn_c::CROSS_ICON_NONE) {
|
||||
mStateMgr.changeState(StateID_Off);
|
||||
}
|
||||
}
|
||||
@@ -107,19 +117,18 @@ void dLytMeterCrossBtnParts_c::executeState_Off() {
|
||||
void dLytMeterCrossBtnParts_c::finalizeState_Off() {}
|
||||
|
||||
void dLytMeterCrossBtnParts_c::init() {
|
||||
field_0x6C = LytDoButtonRelated::DO_NONE;
|
||||
field_0x60 = LytDoButtonRelated::DO_NONE;
|
||||
field_0x64 = LytDoButtonRelated::DO_NONE;
|
||||
field_0x6C = LytDoButtonRelated::ACT_IE_NONE;
|
||||
mSavedMessage = LytDoButtonRelated::ACT_IE_NONE;
|
||||
mMessage = LytDoButtonRelated::ACT_IE_NONE;
|
||||
field_0x7C = false;
|
||||
field_0x70 = 6;
|
||||
mSavedIcon = dLytMeterCrossBtn_c::CROSS_ICON_NONE;
|
||||
field_0x68 = 1;
|
||||
mOnDelay = 15;
|
||||
mpOwnerPane = 0;
|
||||
setMessage(LytDoButtonRelated::DO_NONE);
|
||||
setMessage(LytDoButtonRelated::ACT_IE_NONE);
|
||||
mStateMgr.changeState(StateID_Wait);
|
||||
}
|
||||
|
||||
extern "C" bool checkIsInSkykeepPuzzle();
|
||||
void dLytMeterCrossBtnParts_c::execute(bool bIsVisible) {
|
||||
if (mpOwnerPane == nullptr) {
|
||||
return;
|
||||
@@ -129,7 +138,7 @@ void dLytMeterCrossBtnParts_c::execute(bool bIsVisible) {
|
||||
if (!(*mStateMgr.getStateID() == StateID_On)) {
|
||||
return;
|
||||
}
|
||||
field_0x70 = 6;
|
||||
mSavedIcon = dLytMeterCrossBtn_c::CROSS_ICON_NONE;
|
||||
mpAnm[0]->setForwardOnce();
|
||||
mpAnm[0]->setToEnd2();
|
||||
mpAnm[0]->setAnimEnable(true);
|
||||
@@ -141,21 +150,21 @@ void dLytMeterCrossBtnParts_c::execute(bool bIsVisible) {
|
||||
}
|
||||
|
||||
if (dLytMeter_c::GetInstance()->getMeterField_0x13750() == 0) {
|
||||
if (mIndex == 0) {
|
||||
LytDoButtonRelated::fn_8010EC10(LytDoButtonRelated::DO_NONE, true);
|
||||
} else if (mIndex == 1) {
|
||||
LytDoButtonRelated::fn_8010ED50(LytDoButtonRelated::DO_NONE, true);
|
||||
} else if (mIndex == 2) {
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_CROSS_L, LytDoButtonRelated::DO_NONE);
|
||||
} else if (mIndex == 3) {
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_CROSS_R, LytDoButtonRelated::DO_NONE);
|
||||
if (mIndex == CROSS_BTN_PART_TOP) {
|
||||
LytDoButtonRelated::setCrossTop(LytDoButtonRelated::ACT_IE_NONE, true);
|
||||
} else if (mIndex == CROSS_BTN_PART_DOWN) {
|
||||
LytDoButtonRelated::setCrossDown(LytDoButtonRelated::ACT_IE_NONE, true);
|
||||
} else if (mIndex == CROSS_BTN_PART_LEFT) {
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_CROSS_L, LytDoButtonRelated::ACT_IE_NONE);
|
||||
} else if (mIndex == CROSS_BTN_PART_RIGHT) {
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_CROSS_R, LytDoButtonRelated::ACT_IE_NONE);
|
||||
}
|
||||
|
||||
if (field_0x64 != LytDoButtonRelated::DO_NONE) {
|
||||
field_0x64 = LytDoButtonRelated::DO_NONE;
|
||||
field_0x60 = LytDoButtonRelated::DO_NONE;
|
||||
if (mMessage != LytDoButtonRelated::ACT_IE_NONE) {
|
||||
mMessage = LytDoButtonRelated::ACT_IE_NONE;
|
||||
mSavedMessage = LytDoButtonRelated::ACT_IE_NONE;
|
||||
}
|
||||
setMessage(field_0x64);
|
||||
setMessage(mMessage);
|
||||
}
|
||||
|
||||
if (!bIsVisible && *mStateMgr.getStateID() == StateID_Off) {
|
||||
@@ -165,33 +174,33 @@ void dLytMeterCrossBtnParts_c::execute(bool bIsVisible) {
|
||||
|
||||
if ((EventManager::isInEvent() && dMessage_c::getInstance()->getField_0x32C() == 12 && !checkIsInSkykeepPuzzle() &&
|
||||
!dLytMeter_c::GetInstance()->fn_800D5670()) ||
|
||||
((dLytMeter_c::getItemSelect0x75A2() && (mIndex != 1 || field_0x74 != 0)) || !bIsVisible)) {
|
||||
((dLytMeter_c::getItemSelect0x75A2() && (mIndex != 1 || mCurrentIcon != 0)) || !bIsVisible)) {
|
||||
field_0x7C = 0;
|
||||
|
||||
if (mIndex == 0) {
|
||||
LytDoButtonRelated::fn_8010EC10(LytDoButtonRelated::DO_NONE, true);
|
||||
LytDoButtonRelated::setCrossTop(LytDoButtonRelated::ACT_IE_NONE, true);
|
||||
} else if (mIndex == 1) {
|
||||
LytDoButtonRelated::fn_8010ED50(LytDoButtonRelated::DO_NONE, true);
|
||||
LytDoButtonRelated::setCrossDown(LytDoButtonRelated::ACT_IE_NONE, true);
|
||||
} else if (mIndex == 2) {
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_CROSS_L, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_CROSS_L, LytDoButtonRelated::ACT_IE_NONE);
|
||||
} else if (mIndex == 3) {
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_CROSS_R, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_CROSS_R, LytDoButtonRelated::ACT_IE_NONE);
|
||||
}
|
||||
} else {
|
||||
field_0x7C = 1;
|
||||
}
|
||||
|
||||
if (mIndex == 0) {
|
||||
field_0x64 = LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_CROSS_T);
|
||||
mMessage = LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_CROSS_T);
|
||||
field_0x68 = LytDoButtonRelated::getHas(LytDoButtonRelated::DO_BUTTON_CROSS_T);
|
||||
} else if (mIndex == 1) {
|
||||
field_0x64 = LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_CROSS_D);
|
||||
mMessage = LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_CROSS_D);
|
||||
field_0x68 = LytDoButtonRelated::getHas(LytDoButtonRelated::DO_BUTTON_CROSS_D);
|
||||
} else if (mIndex == 2) {
|
||||
field_0x64 = LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_CROSS_L);
|
||||
mMessage = LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_CROSS_L);
|
||||
field_0x68 = LytDoButtonRelated::getHas(LytDoButtonRelated::DO_BUTTON_CROSS_L);
|
||||
} else if (mIndex == 3) {
|
||||
field_0x64 = LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_CROSS_R);
|
||||
mMessage = LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_CROSS_R);
|
||||
field_0x68 = LytDoButtonRelated::getHas(LytDoButtonRelated::DO_BUTTON_CROSS_R);
|
||||
}
|
||||
|
||||
@@ -213,7 +222,7 @@ void dLytMeterCrossBtnParts_c::setMessage(s32 id) {
|
||||
}
|
||||
|
||||
// If only there was an easier way to write this
|
||||
if (field_0x74 == 0 || field_0x74 == 1) {
|
||||
if (mCurrentIcon == 0 || mCurrentIcon == 1) {
|
||||
mpWindow->SetVisible(false);
|
||||
mpAnm[1]->setFrame(0.0f);
|
||||
mpAnm[1]->setAnimEnable(true);
|
||||
@@ -222,7 +231,7 @@ void dLytMeterCrossBtnParts_c::setMessage(s32 id) {
|
||||
mpLyt->getLayout()->Animate(0);
|
||||
mpLyt->calc();
|
||||
mpAnm[1]->setAnimEnable(false);
|
||||
} else if (field_0x74 == 2) {
|
||||
} else if (mCurrentIcon == 2) {
|
||||
mpWindow->SetVisible(false);
|
||||
mpAnm[1]->setFrame(2.0f);
|
||||
mpAnm[1]->setAnimEnable(true);
|
||||
@@ -231,7 +240,7 @@ void dLytMeterCrossBtnParts_c::setMessage(s32 id) {
|
||||
mpLyt->getLayout()->Animate(0);
|
||||
mpLyt->calc();
|
||||
mpAnm[1]->setAnimEnable(false);
|
||||
} else if (field_0x74 == 3) {
|
||||
} else if (mCurrentIcon == 3) {
|
||||
mpWindow->SetVisible(false);
|
||||
mpAnm[1]->setFrame(3.0f);
|
||||
mpAnm[1]->setAnimEnable(true);
|
||||
@@ -240,7 +249,7 @@ void dLytMeterCrossBtnParts_c::setMessage(s32 id) {
|
||||
mpLyt->getLayout()->Animate(0);
|
||||
mpLyt->calc();
|
||||
mpAnm[1]->setAnimEnable(false);
|
||||
} else if (field_0x74 == 4) {
|
||||
} else if (mCurrentIcon == 4) {
|
||||
mpWindow->SetVisible(false);
|
||||
mpAnm[1]->setFrame(4.0f);
|
||||
mpAnm[1]->setAnimEnable(true);
|
||||
@@ -249,7 +258,7 @@ void dLytMeterCrossBtnParts_c::setMessage(s32 id) {
|
||||
mpLyt->getLayout()->Animate(0);
|
||||
mpLyt->calc();
|
||||
mpAnm[1]->setAnimEnable(false);
|
||||
} else if (field_0x74 == 5) {
|
||||
} else if (mCurrentIcon == 5) {
|
||||
mpWindow->SetVisible(false);
|
||||
mpAnm[1]->setFrame(5.0f);
|
||||
mpAnm[1]->setAnimEnable(true);
|
||||
@@ -258,11 +267,11 @@ void dLytMeterCrossBtnParts_c::setMessage(s32 id) {
|
||||
mpLyt->getLayout()->Animate(0);
|
||||
mpLyt->calc();
|
||||
mpAnm[1]->setAnimEnable(false);
|
||||
} else if (id < LytDoButtonRelated::DO_NONE) {
|
||||
if (id < 0x5D) {
|
||||
} else if (id < LytDoButtonRelated::ACT_IE_NONE) {
|
||||
if (id < LytDoButtonRelated::ACT_IE_SEPARATOR) {
|
||||
sprintf(buf, "ACT_INFO_%03d", sActIds[id]);
|
||||
} else {
|
||||
s32 id2 = id - 0x5E;
|
||||
s32 id2 = id - LytDoButtonRelated::ACT_IE_SEPARATOR - 1;
|
||||
sprintf(buf, "ACT_ETC_%03d", sActIds[id2]);
|
||||
}
|
||||
|
||||
@@ -385,21 +394,21 @@ bool dLytMeterCrossBtn_c::build(d2d::ResAccIf_c *resAcc) {
|
||||
mpTextboxes[i] = mLyt.getTextBox(sTextBoxes[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < CROSS_BTN_NUM_PARTS; i++) {
|
||||
mpWindows[i] = mLyt.getWindow(sWindows[i]);
|
||||
mpSizeBoxes[i] = mLyt.getSizeBoxInWindow(sWindows[i]);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < CROSS_BTN_NUM_PARTS; i++) {
|
||||
mParts[i].mIndex = i;
|
||||
mParts[i].mpLyt = &mLyt;
|
||||
mParts[i].mpAnm[0] = &mAnm[i + CROSS_BTN_ANIM_INPUT_OFFSET];
|
||||
mParts[i].mpAnm[1] = &mAnm[i + CROSS_BTN_ANIM_PATTERN_OFFSET];
|
||||
mParts[i].mpTextBoxes[0] = mpTextboxes[i];
|
||||
mParts[i].mpTextBoxes[1] = mpTextboxes[i + 4];
|
||||
mParts[i].mpTextBoxes[1] = mpTextboxes[i + CROSS_BTN_NUM_PARTS];
|
||||
mParts[i].mpWindow = mpWindows[i];
|
||||
mParts[i].mpSizeBox = mpSizeBoxes[i];
|
||||
mParts[i].field_0x74 = 6;
|
||||
mParts[i].mCurrentIcon = dLytMeterCrossBtn_c::CROSS_ICON_NONE;
|
||||
mParts[i].init();
|
||||
}
|
||||
|
||||
@@ -410,8 +419,8 @@ bool dLytMeterCrossBtn_c::build(d2d::ResAccIf_c *resAcc) {
|
||||
mSavedFiFlow = 0xFFFF;
|
||||
mCallCount0 = 0;
|
||||
mCallCount1 = 0;
|
||||
field_0x620 = 6;
|
||||
field_0x624 = 6;
|
||||
mIconDown = CROSS_ICON_NONE;
|
||||
mIconTop = CROSS_ICON_NONE;
|
||||
|
||||
field_0x637 = 0;
|
||||
field_0x638 = 0;
|
||||
@@ -422,7 +431,7 @@ bool dLytMeterCrossBtn_c::build(d2d::ResAccIf_c *resAcc) {
|
||||
|
||||
mpOwnerPane = nullptr;
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < CROSS_BTN_NUM_PARTS; i++) {
|
||||
mAnm[i + CROSS_BTN_ANIM_INPUT_OFFSET].setToEnd();
|
||||
mAnm[i + CROSS_BTN_ANIM_INPUT_OFFSET].setAnimEnable(true);
|
||||
}
|
||||
@@ -436,7 +445,7 @@ bool dLytMeterCrossBtn_c::build(d2d::ResAccIf_c *resAcc) {
|
||||
|
||||
mLyt.calc();
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < CROSS_BTN_NUM_PARTS; i++) {
|
||||
mAnm[i + CROSS_BTN_ANIM_INPUT_OFFSET].setAnimEnable(false);
|
||||
}
|
||||
|
||||
@@ -465,11 +474,11 @@ bool dLytMeterCrossBtn_c::execute() {
|
||||
mCallCount0 = 0;
|
||||
}
|
||||
|
||||
mParts[0].field_0x74 = field_0x624;
|
||||
mParts[1].field_0x74 = field_0x620;
|
||||
mParts[CROSS_BTN_PART_TOP].mCurrentIcon = mIconTop;
|
||||
mParts[CROSS_BTN_PART_DOWN].mCurrentIcon = mIconDown;
|
||||
|
||||
if (mpOwnerPane != nullptr) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < CROSS_BTN_NUM_PARTS; i++) {
|
||||
mParts[i].execute(mpOwnerPane->IsVisible());
|
||||
}
|
||||
}
|
||||
@@ -481,7 +490,7 @@ bool dLytMeterCrossBtn_c::execute() {
|
||||
}
|
||||
|
||||
if (field_0x637 != 0) {
|
||||
if (field_0x620 == 0) {
|
||||
if (mIconDown == 0) {
|
||||
f32 frame = dAcPy_c::GetLink2()->getAnmMatClrFrame();
|
||||
if (frame == 0.0f) {
|
||||
mAnm[CROSS_BTN_ANIM_CALL_0].setToEnd();
|
||||
@@ -492,7 +501,8 @@ bool dLytMeterCrossBtn_c::execute() {
|
||||
|
||||
if (mAnm[CROSS_BTN_ANIM_CALL_0].isEnabled()) {
|
||||
mAnm[CROSS_BTN_ANIM_CALL_0].play();
|
||||
if (mParts[1].isActive() && mCallCount0 < 3 && mAnm[CROSS_BTN_ANIM_CALL_0].getFrame() == 1.0f) {
|
||||
if (mParts[CROSS_BTN_PART_DOWN].isActive() && mCallCount0 < 3 &&
|
||||
mAnm[CROSS_BTN_ANIM_CALL_0].getFrame() == 1.0f) {
|
||||
SmallSoundManager::GetInstance()->playSound(SE_S_SG_CALL);
|
||||
mCallCount0++;
|
||||
}
|
||||
@@ -505,14 +515,15 @@ bool dLytMeterCrossBtn_c::execute() {
|
||||
}
|
||||
|
||||
if (field_0x639 != 0) {
|
||||
if (field_0x624 == 3) {
|
||||
if (mIconTop == 3) {
|
||||
if (field_0x63A == 0) {
|
||||
mAnm[CROSS_BTN_ANIM_CALL_1].setToEnd();
|
||||
mAnm[CROSS_BTN_ANIM_CALL_1].setAnimEnable(true);
|
||||
}
|
||||
if (mAnm[CROSS_BTN_ANIM_CALL_1].isEnabled()) {
|
||||
mAnm[CROSS_BTN_ANIM_CALL_1].play();
|
||||
if (mParts[0].isActive() && mCallCount1 < 3 && mAnm[CROSS_BTN_ANIM_CALL_1].getFrame() == 1.0f) {
|
||||
if (mParts[CROSS_BTN_PART_TOP].isActive() && mCallCount1 < 3 &&
|
||||
mAnm[CROSS_BTN_ANIM_CALL_1].getFrame() == 1.0f) {
|
||||
SmallSoundManager::GetInstance()->playSound(SE_S_CATAPULT_READY);
|
||||
mCallCount1++;
|
||||
}
|
||||
@@ -525,7 +536,7 @@ bool dLytMeterCrossBtn_c::execute() {
|
||||
}
|
||||
|
||||
if (field_0x63B != 0) {
|
||||
if (field_0x620 == 2) {
|
||||
if (mIconDown == 2) {
|
||||
if (field_0x63C == 0) {
|
||||
mAnm[CROSS_BTN_ANIM_CALL_2].setToEnd();
|
||||
mAnm[CROSS_BTN_ANIM_CALL_2].setRate(2.0f);
|
||||
@@ -533,7 +544,7 @@ bool dLytMeterCrossBtn_c::execute() {
|
||||
}
|
||||
if (mAnm[CROSS_BTN_ANIM_CALL_2].isEnabled()) {
|
||||
mAnm[CROSS_BTN_ANIM_CALL_2].play();
|
||||
if (mParts[1].isActive() && mAnm[CROSS_BTN_ANIM_CALL_2].getFrame() == 1.0f) {
|
||||
if (mParts[CROSS_BTN_PART_DOWN].isActive() && mAnm[CROSS_BTN_ANIM_CALL_2].getFrame() == 1.0f) {
|
||||
SmallSoundManager::GetInstance()->playSound(SE_S_BIRD_CALL);
|
||||
}
|
||||
}
|
||||
@@ -548,8 +559,8 @@ bool dLytMeterCrossBtn_c::execute() {
|
||||
mAnm[CROSS_BTN_ANIM_LOOP].play();
|
||||
}
|
||||
|
||||
field_0x620 = 6;
|
||||
field_0x624 = 6;
|
||||
mIconDown = CROSS_ICON_NONE;
|
||||
mIconTop = CROSS_ICON_NONE;
|
||||
// Might be arrays
|
||||
field_0x638 = field_0x637;
|
||||
field_0x637 = 0;
|
||||
@@ -563,13 +574,13 @@ bool dLytMeterCrossBtn_c::execute() {
|
||||
|
||||
void dLytMeterCrossBtn_c::setOwnerPane(nw4r::lyt::Pane *pane) {
|
||||
mpOwnerPane = pane;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
for (int i = 0; i < CROSS_BTN_NUM_PARTS; i++) {
|
||||
mParts[i].mpOwnerPane = pane;
|
||||
}
|
||||
}
|
||||
|
||||
bool dLytMeterCrossBtn_c::fn_800FA730() const {
|
||||
if (field_0x620 == 2) {
|
||||
if (mIconDown == 2) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -824,9 +824,9 @@ bool dLytMeterDowsing_c::build(d2d::ResAccIf_c *resAcc) {
|
||||
field_0x54F8 = -1;
|
||||
mDemoFrame = 0;
|
||||
field_0x5500 = 0;
|
||||
field_0x54F0 = LytDoButtonRelated::DO_NONE;
|
||||
field_0x54E4 = LytDoButtonRelated::DO_NONE;
|
||||
field_0x54E8 = LytDoButtonRelated::DO_NONE;
|
||||
field_0x54F0 = LytDoButtonRelated::ACT_IE_NONE;
|
||||
field_0x54E4 = LytDoButtonRelated::ACT_IE_NONE;
|
||||
field_0x54E8 = LytDoButtonRelated::ACT_IE_NONE;
|
||||
field_0x54D8 = 15;
|
||||
field_0x5505 = 0;
|
||||
field_0x54EC = 1;
|
||||
@@ -895,7 +895,7 @@ bool dLytMeterDowsing_c::remove() {
|
||||
bool dLytMeterDowsing_c::execute() {
|
||||
if (dLytControlGame_c::getInstance()->isStateNormal()) {
|
||||
if (StoryflagManager::sInstance->getCounterOrFlag(566) &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) != LytDoButtonRelated::DO_NONE) {
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) != LytDoButtonRelated::ACT_IE_NONE) {
|
||||
if (dLytMeter_c::GetMain()->fn_800D5380(0)) {
|
||||
field_0x5508 = 0;
|
||||
StoryflagManager::sInstance->unsetFlag(566);
|
||||
@@ -965,7 +965,7 @@ bool dLytMeterDowsing_c::execute() {
|
||||
bool state = false;
|
||||
s32 action = dLytDobutton_c::getFn0x8010E5E0();
|
||||
if (action == 8 || action == 10 || action == 30) {
|
||||
LytDoButtonRelated::Action_e action = LytDoButtonRelated::convertDoButton(dLytDobutton_c::getFn0x8010E5D0());
|
||||
LytDoButtonRelated::Act_IE_e action = LytDoButtonRelated::convertDoButton(dLytDobutton_c::getAction());
|
||||
if (action >= 0) {
|
||||
state = true;
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_C, action);
|
||||
@@ -1222,11 +1222,11 @@ void dLytMeterDowsing_c::setMessage(s32 id) {
|
||||
buf[i] = 0;
|
||||
}
|
||||
|
||||
if (id < LytDoButtonRelated::DO_NONE) {
|
||||
if (id < 0x5D) {
|
||||
if (id < LytDoButtonRelated::ACT_IE_NONE) {
|
||||
if (id < LytDoButtonRelated::ACT_IE_SEPARATOR) {
|
||||
sprintf(buf, "ACT_INFO_%03d", sActIds[id]);
|
||||
} else {
|
||||
s32 id2 = id - 0x5E;
|
||||
s32 id2 = id - LytDoButtonRelated::ACT_IE_SEPARATOR - 1;
|
||||
sprintf(buf, "ACT_ETC_%03d", sActIds[id2]);
|
||||
}
|
||||
|
||||
@@ -1261,7 +1261,7 @@ s32 dLytMeterDowsing_c::fn_800FE9C0(s32 unkId) const {
|
||||
bool dLytMeterDowsing_c::shouldCall() const {
|
||||
if (dLytControlGame_c::getInstance()->isStateNormal() &&
|
||||
((StoryflagManager::sInstance->getCounterOrFlag(566) &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) != LytDoButtonRelated::DO_NONE) ||
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) != LytDoButtonRelated::ACT_IE_NONE) ||
|
||||
(StoryflagManager::sInstance->getCounterOrFlag(818) &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_C) == 0x52))) {
|
||||
return true;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "toBeSorted/d_emitter.h"
|
||||
#include "toBeSorted/event_manager.h"
|
||||
#include "toBeSorted/minigame_mgr.h"
|
||||
#include "toBeSorted/misc_actor.h"
|
||||
#include "toBeSorted/small_sound_mgr.h"
|
||||
|
||||
STATE_DEFINE(dLytMeterItemSelectIcon_c, Wait);
|
||||
@@ -666,7 +667,7 @@ void dLytMeterItemSelect_c::initializeState_Wait() {
|
||||
}
|
||||
void dLytMeterItemSelect_c::executeState_Wait() {
|
||||
if (field_0x57B3 == 1 && (field_0x5794 == I_INVALID || LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) ==
|
||||
LytDoButtonRelated::DO_STOP)) {
|
||||
LytDoButtonRelated::ACT_IE_ETC_STOP)) {
|
||||
mStateMgr.changeState(StateID_SetNone);
|
||||
} else if (field_0x57B3 == 0 && field_0x5794 == I_INVALID &&
|
||||
(field_0x579A == I_SAILCLOTH || field_0x579A == I_BOAT_CANNON || field_0x579A == I_HARP)) {
|
||||
@@ -687,10 +688,10 @@ void dLytMeterItemSelect_c::executeState_Wait() {
|
||||
} else if (!dLytMeter_c::GetInstance()->checkAllFlags(METER_BTN_B)) {
|
||||
mStateMgr.changeState(StateID_ToUnuse);
|
||||
} else if (!dLytMeter_c::GetMain()->fn_800D5650() && !dLytMeter_c::GetMain()->fn_800D5680() &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) != LytDoButtonRelated::DO_ITEMS &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) != LytDoButtonRelated::DO_RETURN &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) != LytDoButtonRelated::DO_DONE &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) != LytDoButtonRelated::DO_STOP &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) != LytDoButtonRelated::ACT_IE_ETC_ITEMS &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) != LytDoButtonRelated::ACT_IE_ETC_RETURN &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) != LytDoButtonRelated::ACT_IE_ETC_DONE &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) != LytDoButtonRelated::ACT_IE_ETC_STOP &&
|
||||
(field_0x5794 != I_BOAT_CANNON && field_0x5794 != I_HARP && field_0x5794 != I_INVALID &&
|
||||
field_0x5794 != I_SAILCLOTH)) {
|
||||
mStateMgr.changeState(StateID_ResetIn);
|
||||
@@ -790,7 +791,7 @@ void dLytMeterItemSelect_c::finalizeState_SelectIn() {
|
||||
|
||||
void dLytMeterItemSelect_c::initializeState_Select() {}
|
||||
void dLytMeterItemSelect_c::executeState_Select() {
|
||||
if (dLytMeter_c::getCrossBtn0x7BF8() == 0 && dPad::checkButtonDpadDownPressed()) {
|
||||
if (dLytMeter_c::getCrossIconDown() == 0 && dPad::checkButtonDpadDownPressed()) {
|
||||
if (field_0x5794 != I_INVALID) {
|
||||
field_0x5780 = 0.0f;
|
||||
mStateMgr.changeState(StateID_SetIn);
|
||||
@@ -1122,10 +1123,10 @@ void dLytMeterItemSelect_c::executeState_Reset() {
|
||||
fn_800F0310();
|
||||
} else if (field_0x5794 == I_SAILCLOTH || field_0x5794 == I_BOAT_CANNON || field_0x5794 == I_HARP) {
|
||||
mStateMgr.changeState(StateID_SetSpecialItemIn);
|
||||
} else if (LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::DO_ITEMS ||
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::DO_RETURN ||
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::DO_DONE ||
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::DO_STOP ||
|
||||
} else if (LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::ACT_IE_ETC_ITEMS ||
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::ACT_IE_ETC_RETURN ||
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::ACT_IE_ETC_DONE ||
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_B) == LytDoButtonRelated::ACT_IE_ETC_STOP ||
|
||||
field_0x5794 == I_INVALID || !dLytMeter_c::GetInstance()->checkAllFlags(METER_BTN_B) ||
|
||||
field_0x5754 == 1) {
|
||||
mStateMgr.changeState(StateID_ResetOut);
|
||||
@@ -1791,10 +1792,10 @@ bool dLytMeterItemSelect_c::build(d2d::ResAccIf_c *resAcc) {
|
||||
field_0x57BB = 0;
|
||||
field_0x57BC = 0;
|
||||
field_0x5774 = 0;
|
||||
mLastDoButtonRelatedAction = LytDoButtonRelated::DO_NONE;
|
||||
mLastDoButtonRelatedAction = LytDoButtonRelated::ACT_IE_NONE;
|
||||
field_0x5770 = 5;
|
||||
|
||||
setBtnText(LytDoButtonRelated::DO_NONE);
|
||||
setBtnText(LytDoButtonRelated::ACT_IE_NONE);
|
||||
|
||||
mStateMgr.changeState(StateID_InitWait);
|
||||
|
||||
@@ -1985,7 +1986,7 @@ bool dLytMeterItemSelect_c::execute() {
|
||||
}
|
||||
}
|
||||
|
||||
if (dLytDobutton_c::getField0x47C() == 0x28) {
|
||||
if (dLytDobutton_c::getField0x47C() == dLytDobutton_c::ACT_DO_SAILCLOTH) {
|
||||
if (field_0x5774 == 0) {
|
||||
SmallSoundManager::GetInstance()->playSound(SE_S_PARACHUTE_CALL);
|
||||
}
|
||||
@@ -2071,7 +2072,7 @@ bool dLytMeterItemSelect_c::execute() {
|
||||
mStateMgr.executeState();
|
||||
fn_800EF8C0(false);
|
||||
|
||||
if (dLytDobutton_c::getField0x47C() == 0x28) {
|
||||
if (dLytDobutton_c::getField0x47C() == dLytDobutton_c::ACT_DO_SAILCLOTH) {
|
||||
if (field_0x57C3 != 0) {
|
||||
field_0x57BB = 1;
|
||||
}
|
||||
@@ -2205,12 +2206,12 @@ bool dLytMeterItemSelect_c::execute() {
|
||||
}
|
||||
|
||||
if (field_0x5794 == I_SAILCLOTH) {
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_B, LytDoButtonRelated::DO_SAILCLOTH);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_B, LytDoButtonRelated::ACT_IE_ETC_SAILCLOTH);
|
||||
} else if (field_0x5794 == I_BOAT_CANNON) {
|
||||
if (field_0x57B3 != 0) {
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_B, LytDoButtonRelated::DO_STOW_CANNON);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_B, LytDoButtonRelated::ACT_IE_ETC_STOW_CANNON);
|
||||
} else {
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_B, LytDoButtonRelated::DO_READY_CANNON);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_B, LytDoButtonRelated::ACT_IE_ETC_READY_CANNON);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2222,8 +2223,8 @@ bool dLytMeterItemSelect_c::execute() {
|
||||
setBtnText(mLastDoButtonRelatedAction);
|
||||
}
|
||||
} else {
|
||||
if (mLastDoButtonRelatedAction != LytDoButtonRelated::DO_NONE) {
|
||||
mLastDoButtonRelatedAction = LytDoButtonRelated::DO_NONE;
|
||||
if (mLastDoButtonRelatedAction != LytDoButtonRelated::ACT_IE_NONE) {
|
||||
mLastDoButtonRelatedAction = LytDoButtonRelated::ACT_IE_NONE;
|
||||
setBtnText(mLastDoButtonRelatedAction);
|
||||
}
|
||||
|
||||
@@ -2232,7 +2233,7 @@ bool dLytMeterItemSelect_c::execute() {
|
||||
}
|
||||
}
|
||||
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_B, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_B, LytDoButtonRelated::ACT_IE_NONE);
|
||||
}
|
||||
|
||||
field_0x57C1 = isWheelBlockedByCurrentAction();
|
||||
@@ -2580,26 +2581,26 @@ void dLytMeterItemSelect_c::fn_800F0310() {
|
||||
|
||||
#include "d/lyt/meter/d_lyt_meter_action_table.inc"
|
||||
|
||||
void dLytMeterItemSelect_c::setBtnText(s32 unkId) {
|
||||
SizedString<16> id;
|
||||
if (unkId < LytDoButtonRelated::DO_NONE) {
|
||||
void dLytMeterItemSelect_c::setBtnText(s32 id) {
|
||||
SizedString<16> buf;
|
||||
if (id < LytDoButtonRelated::ACT_IE_NONE) {
|
||||
mpTextBoxes[8]->SetVisible(true);
|
||||
mpTextBoxes[9]->SetVisible(true);
|
||||
mpWindows[0]->SetVisible(true);
|
||||
mpTextBoxes[4]->SetVisible(true);
|
||||
mpTextBoxes[5]->SetVisible(true);
|
||||
mpWindows[3]->SetVisible(true);
|
||||
if (unkId < 0x5D) {
|
||||
id.sprintf("ACT_INFO_%03d", sActIds[unkId]);
|
||||
if (id < LytDoButtonRelated::ACT_IE_SEPARATOR) {
|
||||
buf.sprintf("ACT_INFO_%03d", sActIds[id]);
|
||||
} else {
|
||||
unkId -= 0x5E;
|
||||
id.sprintf("ACT_ETC_%03d", sActIds[unkId]);
|
||||
s32 tempId = id - LytDoButtonRelated::ACT_IE_SEPARATOR - 1;
|
||||
buf.sprintf("ACT_ETC_%03d", sActIds[tempId]);
|
||||
}
|
||||
mpTextBoxes[8]->setMessageWithGlobalTextProcessor2(id, nullptr);
|
||||
mpTextBoxes[9]->setMessageWithGlobalTextProcessor2(id, nullptr);
|
||||
mpTextBoxes[8]->setMessageWithGlobalTextProcessor2(buf, nullptr);
|
||||
mpTextBoxes[9]->setMessageWithGlobalTextProcessor2(buf, nullptr);
|
||||
mpWindows[0]->UpdateSize(mpSizeBoxes[0], 32.0f);
|
||||
mpTextBoxes[4]->setMessageWithGlobalTextProcessor2(id, nullptr);
|
||||
mpTextBoxes[5]->setMessageWithGlobalTextProcessor2(id, nullptr);
|
||||
mpTextBoxes[4]->setMessageWithGlobalTextProcessor2(buf, nullptr);
|
||||
mpTextBoxes[5]->setMessageWithGlobalTextProcessor2(buf, nullptr);
|
||||
mpWindows[3]->UpdateSize(mpSizeBoxes[3], 32.0f);
|
||||
} else {
|
||||
const wchar_t *empty = L"";
|
||||
@@ -2712,8 +2713,6 @@ s32 dLytMeterItemSelect_c::getBaseItemLytIndexforInternalId(s32 idx) const {
|
||||
return LYT_CMN_ItemInvalid;
|
||||
}
|
||||
|
||||
extern "C" bool checkIsInSkykeepPuzzle();
|
||||
|
||||
bool dLytMeterItemSelect_c::isWheelBlockedByCurrentAction() {
|
||||
if (dAcPy_c::LINK->getRidingActorType() == dAcPy_c::RIDING_LOFTWING ||
|
||||
dAcPy_c::LINK->checkActionFlags(dAcPy_c::FLG0_SWING_ROPE) || dAcPy_c::LINK->checkCurrentAction(0x9C) ||
|
||||
|
||||
@@ -27,7 +27,7 @@ void dLytMeterNunStk_c::executeState_Wait() {
|
||||
if (field_0x184) {
|
||||
if (field_0x178) {
|
||||
bool bDoUpdate = true;
|
||||
if (field_0x174 != LytDoButtonRelated::DO_NONE) {
|
||||
if (field_0x174 != LytDoButtonRelated::ACT_IE_NONE) {
|
||||
if (timer <= 0) {
|
||||
mAnm[NUN_STK_ANIM_INPUT].setBackwardsOnce();
|
||||
mAnm[NUN_STK_ANIM_INPUT].setToStart();
|
||||
@@ -43,7 +43,7 @@ void dLytMeterNunStk_c::executeState_Wait() {
|
||||
field_0x170 = field_0x174;
|
||||
}
|
||||
} else {
|
||||
if (field_0x174 != LytDoButtonRelated::DO_NONE) {
|
||||
if (field_0x174 != LytDoButtonRelated::ACT_IE_NONE) {
|
||||
setMessage(field_0x174);
|
||||
}
|
||||
field_0x170 = field_0x174;
|
||||
@@ -68,7 +68,7 @@ void dLytMeterNunStk_c::finalizeState_On() {}
|
||||
void dLytMeterNunStk_c::initializeState_Active() {}
|
||||
void dLytMeterNunStk_c::executeState_Active() {
|
||||
if (field_0x174 != field_0x170 || !field_0x178) {
|
||||
if (field_0x174 == LytDoButtonRelated::DO_NONE || !field_0x178) {
|
||||
if (field_0x174 == LytDoButtonRelated::ACT_IE_NONE || !field_0x178) {
|
||||
mAnm[NUN_STK_ANIM_INPUT].setForwardOnce();
|
||||
mAnm[NUN_STK_ANIM_INPUT].setFrame(0.0f);
|
||||
mAnm[NUN_STK_ANIM_INPUT].setAnimEnable(true);
|
||||
@@ -80,7 +80,7 @@ void dLytMeterNunStk_c::executeState_Active() {
|
||||
setMessage(field_0x174);
|
||||
}
|
||||
field_0x170 = field_0x174;
|
||||
} else if (field_0x170 == LytDoButtonRelated::DO_NONE) {
|
||||
} else if (field_0x170 == LytDoButtonRelated::ACT_IE_NONE) {
|
||||
mAnm[NUN_STK_ANIM_INPUT].setForwardOnce();
|
||||
mAnm[NUN_STK_ANIM_INPUT].setFrame(0.0f);
|
||||
mAnm[NUN_STK_ANIM_INPUT].setAnimEnable(true);
|
||||
@@ -127,9 +127,9 @@ bool dLytMeterNunStk_c::build(d2d::ResAccIf_c *resAcc) {
|
||||
mpSizeBox[i] = mLyt.getSizeBoxInWindow(sWindows[i]);
|
||||
}
|
||||
|
||||
mDisplayedAction = LytDoButtonRelated::DO_NONE;
|
||||
field_0x170 = LytDoButtonRelated::DO_NONE;
|
||||
field_0x174 = LytDoButtonRelated::DO_NONE;
|
||||
mDisplayedAction = LytDoButtonRelated::ACT_IE_NONE;
|
||||
field_0x170 = LytDoButtonRelated::ACT_IE_NONE;
|
||||
field_0x174 = LytDoButtonRelated::ACT_IE_NONE;
|
||||
field_0x184 = true;
|
||||
field_0x178 = true;
|
||||
|
||||
@@ -173,7 +173,7 @@ bool dLytMeterNunStk_c::execute() {
|
||||
mAnm[NUN_STK_ANIM_INPUT].setAnimEnable(false);
|
||||
mStateMgr.changeState(StateID_Wait);
|
||||
}
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_NUN_STK, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_NUN_STK, LytDoButtonRelated::ACT_IE_NONE);
|
||||
field_0x174 = LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_NUN_STK);
|
||||
setMessage(field_0x174);
|
||||
return true;
|
||||
@@ -202,11 +202,11 @@ void dLytMeterNunStk_c::setMessage(s32 id) {
|
||||
buf[i] = 0;
|
||||
}
|
||||
|
||||
if (id < LytDoButtonRelated::DO_NONE) {
|
||||
if (id < 0x5D) {
|
||||
if (id < LytDoButtonRelated::ACT_IE_NONE) {
|
||||
if (id < LytDoButtonRelated::ACT_IE_SEPARATOR) {
|
||||
sprintf(buf, "ACT_INFO_%03d", sActIds[id]);
|
||||
} else {
|
||||
s32 id2 = id - 0x5E;
|
||||
s32 id2 = id - LytDoButtonRelated::ACT_IE_SEPARATOR - 1;
|
||||
sprintf(buf, "ACT_ETC_%03d", sActIds[id2]);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ void dLytMeterNunchakuBg_c::executeState_Wait() {
|
||||
if (field_0x1C4) {
|
||||
if (field_0x1B8) {
|
||||
bool bDoUpdate = true;
|
||||
if (field_0x1B4 != LytDoButtonRelated::DO_NONE) {
|
||||
if (field_0x1B4 != LytDoButtonRelated::ACT_IE_NONE) {
|
||||
if (timer <= 0) {
|
||||
mAnm[NUN_BG_ANIM_INPUT].setBackwardsOnce();
|
||||
mAnm[NUN_BG_ANIM_INPUT].setToStart();
|
||||
@@ -46,7 +46,7 @@ void dLytMeterNunchakuBg_c::executeState_Wait() {
|
||||
field_0x1B0 = field_0x1B4;
|
||||
}
|
||||
} else {
|
||||
if (field_0x1B4 != LytDoButtonRelated::DO_NONE) {
|
||||
if (field_0x1B4 != LytDoButtonRelated::ACT_IE_NONE) {
|
||||
setMessage(field_0x1B4);
|
||||
}
|
||||
field_0x1B0 = field_0x1B4;
|
||||
@@ -71,7 +71,7 @@ void dLytMeterNunchakuBg_c::finalizeState_On() {}
|
||||
void dLytMeterNunchakuBg_c::initializeState_Active() {}
|
||||
void dLytMeterNunchakuBg_c::executeState_Active() {
|
||||
if (field_0x1B4 != field_0x1B0 || !field_0x1B8) {
|
||||
if (field_0x1B4 == LytDoButtonRelated::DO_NONE || !field_0x1B8) {
|
||||
if (field_0x1B4 == LytDoButtonRelated::ACT_IE_NONE || !field_0x1B8) {
|
||||
mAnm[NUN_BG_ANIM_INPUT].setForwardOnce();
|
||||
mAnm[NUN_BG_ANIM_INPUT].setFrame(0.0f);
|
||||
mAnm[NUN_BG_ANIM_INPUT].setAnimEnable(true);
|
||||
@@ -83,7 +83,7 @@ void dLytMeterNunchakuBg_c::executeState_Active() {
|
||||
setMessage(field_0x1B4);
|
||||
}
|
||||
field_0x1B0 = field_0x1B4;
|
||||
} else if (field_0x1B0 == LytDoButtonRelated::DO_NONE) {
|
||||
} else if (field_0x1B0 == LytDoButtonRelated::ACT_IE_NONE) {
|
||||
mAnm[NUN_BG_ANIM_INPUT].setForwardOnce();
|
||||
mAnm[NUN_BG_ANIM_INPUT].setFrame(0.0f);
|
||||
mAnm[NUN_BG_ANIM_INPUT].setAnimEnable(true);
|
||||
@@ -180,7 +180,7 @@ bool dLytMeterNunchakuBg_c::execute() {
|
||||
mAnm[NUN_BG_ANIM_INPUT].setAnimEnable(false);
|
||||
mStateMgr.changeState(StateID_Wait);
|
||||
}
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_NUN_BG, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_NUN_BG, LytDoButtonRelated::ACT_IE_NONE);
|
||||
field_0x1B4 = LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_NUN_STK);
|
||||
setMessage(field_0x1B4);
|
||||
return true;
|
||||
@@ -188,14 +188,14 @@ bool dLytMeterNunchakuBg_c::execute() {
|
||||
|
||||
if (EventManager::isInEvent()) {
|
||||
field_0x1C4 = false;
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_NUN_BG, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_NUN_BG, LytDoButtonRelated::ACT_IE_NONE);
|
||||
} else {
|
||||
field_0x1C4 = true;
|
||||
}
|
||||
|
||||
s32 d = dLytDobutton_c::getFn0x8010E5E0();
|
||||
if (d == 6 || d == 9) {
|
||||
LytDoButtonRelated::Action_e a = LytDoButtonRelated::convertDoButton(dLytDobutton_c::getFn0x8010E5D0());
|
||||
LytDoButtonRelated::Act_IE_e a = LytDoButtonRelated::convertDoButton(dLytDobutton_c::getAction());
|
||||
if (a >= 0) {
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_NUN_BG, a);
|
||||
}
|
||||
@@ -245,11 +245,11 @@ void dLytMeterNunchakuBg_c::setMessage(s32 id) {
|
||||
buf[i] = 0;
|
||||
}
|
||||
|
||||
if (id < LytDoButtonRelated::DO_NONE) {
|
||||
if (id < 0x5D) {
|
||||
if (id < LytDoButtonRelated::ACT_IE_NONE) {
|
||||
if (id < LytDoButtonRelated::ACT_IE_SEPARATOR) {
|
||||
sprintf(buf, "ACT_INFO_%03d", sActIds[id]);
|
||||
} else {
|
||||
s32 id2 = id - 0x5E;
|
||||
s32 id2 = id - LytDoButtonRelated::ACT_IE_SEPARATOR - 1;
|
||||
sprintf(buf, "ACT_ETC_%03d", sActIds[id2]);
|
||||
}
|
||||
|
||||
|
||||
@@ -121,10 +121,10 @@ bool dLytMeterPlusBtn_c::build(d2d::ResAccIf_c *resAcc) {
|
||||
mpWindow[i]->UpdateSize(mpSizeBox[i], 32.0f);
|
||||
}
|
||||
|
||||
field_0x1B0 = LytDoButtonRelated::DO_NONE;
|
||||
field_0x1B4 = LytDoButtonRelated::DO_NONE;
|
||||
field_0x1B0 = LytDoButtonRelated::ACT_IE_NONE;
|
||||
field_0x1B4 = LytDoButtonRelated::ACT_IE_NONE;
|
||||
|
||||
setMessage(LytDoButtonRelated::DO_NONE);
|
||||
setMessage(LytDoButtonRelated::ACT_IE_NONE);
|
||||
|
||||
field_0x1C0 = 0;
|
||||
field_0x1C1 = StoryflagManager::sInstance->getCounterOrFlag(212);
|
||||
@@ -218,7 +218,7 @@ bool dLytMeterPlusBtn_c::execute() {
|
||||
|
||||
mStateMgr.executeState();
|
||||
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_PLUS, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_PLUS, LytDoButtonRelated::ACT_IE_NONE);
|
||||
|
||||
if (mAnm[PLUS_BTN_ANIM_LOOP].isEnabled()) {
|
||||
mAnm[PLUS_BTN_ANIM_LOOP].play();
|
||||
@@ -313,11 +313,11 @@ void dLytMeterPlusBtn_c::setMessage(s32 id) {
|
||||
buf[i] = 0;
|
||||
}
|
||||
|
||||
if (id < LytDoButtonRelated::DO_NONE) {
|
||||
if (id < 0x5D) {
|
||||
if (id < LytDoButtonRelated::ACT_IE_NONE) {
|
||||
if (id < LytDoButtonRelated::ACT_IE_SEPARATOR) {
|
||||
sprintf(buf, "ACT_INFO_%03d", sActIds[id]);
|
||||
} else {
|
||||
s32 id2 = id - 0x5E;
|
||||
s32 id2 = id - LytDoButtonRelated::ACT_IE_SEPARATOR - 1;
|
||||
sprintf(buf, "ACT_ETC_%03d", sActIds[id2]);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,13 +50,13 @@ bool dLytMeterRemoconBg_c::remove() {
|
||||
bool dLytMeterRemoconBg_c::execute() {
|
||||
if (EventManager::isInEvent() || dLytMeter_c::getItemSelect0x75A2() != 0) {
|
||||
field_0xEC = 0;
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_REMOCON_BG, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_REMOCON_BG, LytDoButtonRelated::ACT_IE_NONE);
|
||||
} else {
|
||||
field_0xEC = 1;
|
||||
}
|
||||
s32 d = dLytDobutton_c::getFn0x8010E5E0();
|
||||
if (d == 1 || d == 2 || d == 3 || d == 4 || d == 12 || d == 13 || d == 14 || d == 6) {
|
||||
LytDoButtonRelated::Action_e a = LytDoButtonRelated::convertDoButton(dLytDobutton_c::getFn0x8010E5D0());
|
||||
LytDoButtonRelated::Act_IE_e a = LytDoButtonRelated::convertDoButton(dLytDobutton_c::getAction());
|
||||
if (a >= 0) {
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_REMOCON_BG, a);
|
||||
}
|
||||
@@ -65,6 +65,6 @@ bool dLytMeterRemoconBg_c::execute() {
|
||||
field_0xE0 = LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_REMOCON_BG);
|
||||
field_0xE4 = LytDoButtonRelated::getHas(LytDoButtonRelated::DO_BUTTON_REMOCON_BG);
|
||||
mStateMgr.executeState();
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_REMOCON_BG, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_REMOCON_BG, LytDoButtonRelated::ACT_IE_NONE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ void dLytMeterZBtn_c::executeState_Wait() {
|
||||
if (field_0x1C4) {
|
||||
if (field_0x1B8) {
|
||||
bool bDoUpdate = true;
|
||||
if (field_0x1B4 != LytDoButtonRelated::DO_NONE) {
|
||||
if (field_0x1B4 != LytDoButtonRelated::ACT_IE_NONE) {
|
||||
if (timer <= 0) {
|
||||
mAnm[Z_BTN_ANIM_INPUT].setBackwardsOnce();
|
||||
mAnm[Z_BTN_ANIM_INPUT].setToStart();
|
||||
@@ -51,7 +51,7 @@ void dLytMeterZBtn_c::executeState_Wait() {
|
||||
field_0x1B0 = field_0x1B4;
|
||||
}
|
||||
} else {
|
||||
if (field_0x1B4 != LytDoButtonRelated::DO_NONE) {
|
||||
if (field_0x1B4 != LytDoButtonRelated::ACT_IE_NONE) {
|
||||
setMessage(field_0x1B4);
|
||||
}
|
||||
field_0x1B0 = field_0x1B4;
|
||||
@@ -76,7 +76,7 @@ void dLytMeterZBtn_c::finalizeState_On() {}
|
||||
void dLytMeterZBtn_c::initializeState_Active() {}
|
||||
void dLytMeterZBtn_c::executeState_Active() {
|
||||
if (field_0x1B4 != field_0x1B0 || !field_0x1B8) {
|
||||
if (field_0x1B4 == LytDoButtonRelated::DO_NONE || !field_0x1B8) {
|
||||
if (field_0x1B4 == LytDoButtonRelated::ACT_IE_NONE || !field_0x1B8) {
|
||||
mAnm[Z_BTN_ANIM_INPUT].setForwardOnce();
|
||||
mAnm[Z_BTN_ANIM_INPUT].setFrame(0.0f);
|
||||
mAnm[Z_BTN_ANIM_INPUT].setAnimEnable(true);
|
||||
@@ -88,7 +88,7 @@ void dLytMeterZBtn_c::executeState_Active() {
|
||||
setMessage(field_0x1B4);
|
||||
}
|
||||
field_0x1B0 = field_0x1B4;
|
||||
} else if (field_0x1B0 == LytDoButtonRelated::DO_NONE) {
|
||||
} else if (field_0x1B0 == LytDoButtonRelated::ACT_IE_NONE) {
|
||||
mAnm[Z_BTN_ANIM_INPUT].setForwardOnce();
|
||||
mAnm[Z_BTN_ANIM_INPUT].setFrame(0.0f);
|
||||
mAnm[Z_BTN_ANIM_INPUT].setAnimEnable(true);
|
||||
@@ -182,14 +182,14 @@ bool dLytMeterZBtn_c::execute() {
|
||||
mAnm[Z_BTN_ANIM_INPUT].setAnimEnable(true);
|
||||
mStateMgr.changeState(StateID_Off);
|
||||
}
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_Z, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_Z, LytDoButtonRelated::ACT_IE_NONE);
|
||||
return true;
|
||||
}
|
||||
field_0x1C4 = true;
|
||||
if ((!fn_80081FE0(dScGame_c::getCamera(0)->getField_0xD98(), "mogu") || AttentionManager::GetInstance()->checkLink2()) &&
|
||||
LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_Z) == 0x67) {
|
||||
field_0x1C4 = false;
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_Z, LytDoButtonRelated::DO_NONE);
|
||||
LytDoButtonRelated::set(LytDoButtonRelated::DO_BUTTON_Z, LytDoButtonRelated::ACT_IE_NONE);
|
||||
}
|
||||
field_0x1B4 = LytDoButtonRelated::get(LytDoButtonRelated::DO_BUTTON_Z);
|
||||
field_0x1B8 = LytDoButtonRelated::getHas(LytDoButtonRelated::DO_BUTTON_Z) &&
|
||||
@@ -249,11 +249,11 @@ void dLytMeterZBtn_c::setMessage(s32 id) {
|
||||
buf[i] = 0;
|
||||
}
|
||||
|
||||
if (id < LytDoButtonRelated::DO_NONE) {
|
||||
if (id < 0x5D) {
|
||||
if (id < LytDoButtonRelated::ACT_IE_NONE) {
|
||||
if (id < LytDoButtonRelated::ACT_IE_SEPARATOR) {
|
||||
sprintf(buf, "ACT_INFO_%03d", sActIds[id]);
|
||||
} else {
|
||||
s32 id2 = id - 0x5E;
|
||||
s32 id2 = id - LytDoButtonRelated::ACT_IE_SEPARATOR - 1;
|
||||
sprintf(buf, "ACT_ETC_%03d", sActIds[id2]);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
// clang-format off
|
||||
// vtable order
|
||||
#include "d/lyt/meter/d_lyt_meter.h"
|
||||
#include "d/lyt/msg_window/d_lyt_msg_window_common.h"
|
||||
#include "d/lyt/msg_window/d_lyt_msg_window_talk.h"
|
||||
#include "d/lyt/msg_window/d_lyt_msg_window_link.h"
|
||||
@@ -167,6 +168,9 @@ bool dLytMsgWindow_c::remove() {
|
||||
|
||||
void dLytMsgWindow_c::initializeState_Invisible() {}
|
||||
void dLytMsgWindow_c::executeState_Invisible() {
|
||||
if (!EventManager::isInEvent() && dLytMeter_c::GetInstance()->getMeterField_0x13773()) {
|
||||
dLytMeter_c::GetInstance()->setMeterField_0x13773(false);
|
||||
}
|
||||
if (dMessage_c::getInstance()->getField_0x329()) {
|
||||
mStateMgr.changeState(StateID_MapOpen);
|
||||
} else if (dMessage_c::getInstance()->getField_0x32A()) {
|
||||
@@ -179,7 +183,7 @@ void dLytMsgWindow_c::executeState_Invisible() {
|
||||
|
||||
if (field_0x1220 == 0) {
|
||||
if (field_0x80D != 0) {
|
||||
if (mpTagProcessor->getMsgWindowSubtype() == 0x16) {
|
||||
if (mpTagProcessor->getMsgWindowSubtype() == MSG_WINDOW_22) {
|
||||
mpAutoCaption = new dLytAutoCaption_c();
|
||||
mpAutoCaption->build(&mResAcc1, &mResAcc2, mpTagProcessor);
|
||||
mpCurrentSubtype = mpAutoCaption;
|
||||
@@ -200,29 +204,29 @@ void dLytMsgWindow_c::executeState_Invisible() {
|
||||
createSubMsgManager(mpTagProcessor->getMsgWindowSubtype());
|
||||
field_0x828 = nullptr;
|
||||
mSpecialFiMenuValue = FiContext::KEN8_Nevermind;
|
||||
if (mpTagProcessor->getMsgWindowSubtype() == 6) {
|
||||
if (mpTagProcessor->getMsgWindowSubtype() == MSG_WINDOW_WOOD) {
|
||||
mpCurrentSubtype = mpWindowWood;
|
||||
dTextBox_c *box = mpCurrentSubtype->getTextBox();
|
||||
mpMsgWindowUnk->fn_800B2130(mNameCopy, box, nullptr, true);
|
||||
mpMsgWindowUnk->textAdvancingRelated(true, true);
|
||||
setTextToDisplay(mpMsgWindowUnk->getProcessedText());
|
||||
} else if (mpTagProcessor->getMsgWindowSubtype() == 7) {
|
||||
} else if (mpTagProcessor->getMsgWindowSubtype() == MSG_WINDOW_STONE) {
|
||||
mpCurrentSubtype = mpWindowStone;
|
||||
dTextBox_c *box = mpCurrentSubtype->getTextBox();
|
||||
mpMsgWindowUnk->fn_800B2130(mNameCopy, box, nullptr, true);
|
||||
mpMsgWindowUnk->textAdvancingRelated(true, true);
|
||||
setTextToDisplay(mpMsgWindowUnk->getProcessedText());
|
||||
} else if (mpTagProcessor->getMsgWindowSubtype() >= 2 &&
|
||||
mpTagProcessor->getMsgWindowSubtype() < 5) {
|
||||
} else if (mpTagProcessor->getMsgWindowSubtype() >= MSG_WINDOW_SWORD_FI &&
|
||||
mpTagProcessor->getMsgWindowSubtype() < MSG_WINDOW_SWORD_FI + 3) {
|
||||
mpCurrentSubtype = mpWindowSword;
|
||||
field_0x828 = mpWindowSword->getCharData();
|
||||
} else if (mpTagProcessor->getMsgWindowSubtype() == 9) {
|
||||
} else if (mpTagProcessor->getMsgWindowSubtype() == MSG_WINDOW_LINK) {
|
||||
mpCurrentSubtype = mpWindowLink;
|
||||
field_0x828 = mpWindowLink->getCharData();
|
||||
} else if (mpTagProcessor->getMsgWindowSubtype() == 5) {
|
||||
} else if (mpTagProcessor->getMsgWindowSubtype() == MSG_WINDOW_GET) {
|
||||
mpCurrentSubtype = mpWindowGet;
|
||||
field_0x828 = mpWindowGet->getCharData();
|
||||
} else if (mpTagProcessor->getMsgWindowSubtype() == 30) {
|
||||
} else if (mpTagProcessor->getMsgWindowSubtype() == MSG_WINDOW_DEMO) {
|
||||
mpCurrentSubtype = mpWindowDemo;
|
||||
field_0x828 = mpWindowDemo->getCharData();
|
||||
dTextBox_c *box = mpCurrentSubtype->getTextBox();
|
||||
@@ -298,9 +302,10 @@ void dLytMsgWindow_c::executeState_OutputText() {
|
||||
}
|
||||
}
|
||||
|
||||
if (mpTagProcessor->getMsgWindowSubtype() >= 2 && mpTagProcessor->getMsgWindowSubtype() < 5) {
|
||||
if (mpTagProcessor->getMsgWindowSubtype() >= MSG_WINDOW_SWORD_FI &&
|
||||
mpTagProcessor->getMsgWindowSubtype() < MSG_WINDOW_SWORD_FI + 3) {
|
||||
fn_803998A0(lbl_80575DE0, mpMsgWindowUnk->getField_0x147A(), mpMsgWindowUnk->getField_0x147C());
|
||||
} else if (mpTagProcessor->getMsgWindowSubtype() <= 1 && oldValue != mpMsgWindowUnk->getField_0x147A()) {
|
||||
} else if (mpTagProcessor->getMsgWindowSubtype() <= MSG_WINDOW_1 && oldValue != mpMsgWindowUnk->getField_0x147A()) {
|
||||
u16 a = mpMsgWindowUnk->getField_0x147C();
|
||||
f32 b = (dTagProcessor_c::fn_800B8040(0, 0) * 100.0f);
|
||||
SmallSoundManager::GetInstance()->playButtonPressSoundWhenAdvancingTextBoxes(a / b);
|
||||
@@ -362,7 +367,8 @@ void dLytMsgWindow_c::executeState_WaitKeyChangePage0() {
|
||||
mStateMgr.changeState(StateID_WaitKeyChangePage1);
|
||||
} else {
|
||||
mpMsgWindowUnk->fn_800B2AA0();
|
||||
if (mpTagProcessor->getMsgWindowSubtype() >= 6 && mpTagProcessor->getMsgWindowSubtype() < 8) {
|
||||
if (mpTagProcessor->getMsgWindowSubtype() >= MSG_WINDOW_WOOD &&
|
||||
mpTagProcessor->getMsgWindowSubtype() < MSG_WINDOW_WOOD + 2) {
|
||||
mpMsgWindowUnk->textAdvancingRelated(true, true);
|
||||
}
|
||||
setTextToDisplay(mpMsgWindowUnk->getProcessedText());
|
||||
@@ -377,7 +383,8 @@ void dLytMsgWindow_c::executeState_WaitKeyChangePage1() {
|
||||
if (mpCurrentSubtype->startDecide(false)) {
|
||||
field_0x817 = 0;
|
||||
mpMsgWindowUnk->fn_800B2AA0();
|
||||
if (mpTagProcessor->getMsgWindowSubtype() >= 6 && mpTagProcessor->getMsgWindowSubtype() < 8) {
|
||||
if (mpTagProcessor->getMsgWindowSubtype() >= MSG_WINDOW_WOOD &&
|
||||
mpTagProcessor->getMsgWindowSubtype() < MSG_WINDOW_WOOD + 2) {
|
||||
mpMsgWindowUnk->textAdvancingRelated(true, true);
|
||||
}
|
||||
setTextToDisplay(mpMsgWindowUnk->getProcessedText());
|
||||
@@ -487,18 +494,15 @@ void dLytMsgWindow_c::initializeState_WaitKeySelectQuestion() {
|
||||
mSelectBtn.setField_0x990(tmp);
|
||||
mSelectBtn.setTagProcessor(mpTagProcessor);
|
||||
|
||||
wchar_t **buf = sBufs;
|
||||
|
||||
buf[0] = mpTagProcessor->getBuf(0);
|
||||
buf[1] = mpTagProcessor->getBuf(1);
|
||||
buf[2] = mpTagProcessor->getBuf(2);
|
||||
buf[3] = mpTagProcessor->getBuf(3);
|
||||
for (s32 i = 0; i < 4; i++) {
|
||||
sBufs[i] = mpTagProcessor->getBuf(i);
|
||||
}
|
||||
|
||||
mSelectBtn.fn_8011E5D0(field_0x824, true);
|
||||
|
||||
for (int i = 0; i < field_0x824; i++) {
|
||||
for (int j = 0; j < 2; j++) {
|
||||
mSelectBtn.getSelectTextBox(i, j)->setTextWithGlobalTextProcessor(buf[i]);
|
||||
for (s32 i = 0, option = 0; i < field_0x824; option++, i++) {
|
||||
for (s32 j = 0; j < 2; j++) {
|
||||
mSelectBtn.getSelectTextBox(option, j)->setTextWithGlobalTextProcessor(sBufs[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -558,7 +562,13 @@ void dLytMsgWindow_c::executeState_WaitKeyMapClose() {
|
||||
void dLytMsgWindow_c::finalizeState_WaitKeyMapClose() {}
|
||||
|
||||
void dLytMsgWindow_c::initializeState_MapClose() {}
|
||||
void dLytMsgWindow_c::executeState_MapClose() {}
|
||||
void dLytMsgWindow_c::executeState_MapClose() {
|
||||
if (dLytMeter_c::GetInstance()->getBasicPosition() == dLytMeterMain_c::POSITION_NORMAL) {
|
||||
dMessage_c::getInstance()->setField_0x32A(false);
|
||||
dMessage_c::getInstance()->clearLightPillarRelatedArgs();
|
||||
mStateMgr.changeState(StateID_Invisible);
|
||||
}
|
||||
}
|
||||
void dLytMsgWindow_c::finalizeState_MapClose() {}
|
||||
|
||||
void dLytMsgWindow_c::initializeState_Out() {
|
||||
@@ -745,46 +755,42 @@ void dLytMsgWindow_c::setCurrentFlowFilename(const char *name) {
|
||||
|
||||
void dLytMsgWindow_c::createSubMsgManager(u8 type) {
|
||||
switch (type) {
|
||||
case 6:
|
||||
case MSG_WINDOW_WOOD:
|
||||
mpWindowWood = new dLytMsgWindowWood_c();
|
||||
mpWindowWood->build(&mResAcc1, &mResAcc2, mpTagProcessor);
|
||||
break;
|
||||
case 7:
|
||||
case MSG_WINDOW_STONE:
|
||||
mpWindowStone = new dLytMsgWindowStone_c();
|
||||
mpWindowStone->build(&mResAcc1, &mResAcc2, mpTagProcessor);
|
||||
break;
|
||||
case 2:
|
||||
case MSG_WINDOW_SWORD_FI:
|
||||
mpWindowSword = new dLytMsgWindowSword_c();
|
||||
mpWindowSword->setSwordType(dLytTextSword::FI);
|
||||
mpWindowSword->build(&mResAcc1, &mResAcc2, mpTagProcessor);
|
||||
break;
|
||||
case 3:
|
||||
case MSG_WINDOW_SWORD_GHIRAHIM:
|
||||
mpWindowSword = new dLytMsgWindowSword_c();
|
||||
mpWindowSword->setSwordType(dLytTextSword::GHIRAHIM);
|
||||
mpWindowSword->build(&mResAcc1, &mResAcc2, mpTagProcessor);
|
||||
break;
|
||||
case 4:
|
||||
case MSG_WINDOW_SWORD_LASTBOSS:
|
||||
mpWindowSword = new dLytMsgWindowSword_c();
|
||||
mpWindowSword->setSwordType(dLytTextSword::LASTBOSS);
|
||||
mpWindowSword->build(&mResAcc1, &mResAcc2, mpTagProcessor);
|
||||
break;
|
||||
case 9:
|
||||
// TODO Link
|
||||
case MSG_WINDOW_LINK:
|
||||
mpWindowLink = new dLytMsgWindowLink_c();
|
||||
mpWindowLink->build(&mResAcc1, &mResAcc2, mpTagProcessor);
|
||||
break;
|
||||
case 5:
|
||||
// TODO Get
|
||||
case MSG_WINDOW_GET:
|
||||
mpWindowGet = new dLytMsgWindowGet_c();
|
||||
mpWindowGet->build(&mResAcc1, &mResAcc2, mpTagProcessor);
|
||||
break;
|
||||
case 30:
|
||||
// TODO Demo
|
||||
case MSG_WINDOW_DEMO:
|
||||
mpWindowDemo = new dLytMsgWindowDemo_c();
|
||||
mpWindowDemo->build(&mResAcc1, &mResAcc2, mpTagProcessor);
|
||||
break;
|
||||
default:
|
||||
// TODO talk
|
||||
mpWindowTalk = new dLytMsgWindowTalk_c();
|
||||
mpWindowTalk->build(&mResAcc1, &mResAcc2, mpTagProcessor);
|
||||
break;
|
||||
|
||||
+2
-2
@@ -46,7 +46,7 @@ void defaultSet() {
|
||||
void draw(u8 priority) {
|
||||
for (Base_c *base = static_cast<Base_c *>(nw4r::ut::List_GetFirst(&l_list)); base != nullptr;
|
||||
base = static_cast<Base_c *>(nw4r::ut::List_GetNext(&l_list, base))) {
|
||||
if (base->mPriority >= priority) {
|
||||
if (base->getPriority() >= priority) {
|
||||
break;
|
||||
}
|
||||
base->draw();
|
||||
@@ -56,7 +56,7 @@ void draw(u8 priority) {
|
||||
void drawBefore(u8 priority) {
|
||||
for (Base_c *base = static_cast<Base_c *>(nw4r::ut::List_GetFirst(&l_list)); base != nullptr;
|
||||
base = static_cast<Base_c *>(nw4r::ut::List_GetNext(&l_list, base))) {
|
||||
if (base->mPriority > priority) {
|
||||
if (base->getPriority() > priority) {
|
||||
base->draw();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user