diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 5cdc9c2c..8ad20404 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -4496,10 +4496,10 @@ finalizeState_Out__16dLytMeterParts_cFv = .text:0x800C9EC0; // type:function siz build__16dLytMeterParts_cFl = .text:0x800C9ED0; // type:function size:0x24 execute__16dLytMeterParts_cFv = .text:0x800C9F00; // type:function size:0x10 executeState__85sStateMgr_c<16dLytMeterParts_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x800C9F10; // type:function size:0x10 -fn_800C9F20 = .text:0x800C9F20; // type:function size:0x44 -fn_800C9F70 = .text:0x800C9F70; // type:function size:0x70 +isNotSilentRealmOrLoftwing__11dLytMeter_cFv = .text:0x800C9F20; // type:function size:0x44 +fn_800C9F70__11dLytMeter_cFv = .text:0x800C9F70; // type:function size:0x70 fn_800C9FE0__11dLytMeter_cFv = .text:0x800C9FE0; // type:function size:0x60 -fn_800CA040 = .text:0x800CA040; // type:function size:0x60 +fn_800CA040__11dLytMeter_cFv = .text:0x800CA040; // type:function size:0x60 setUiMode__11dLytMeter_cCFUs = .text:0x800CA0A0; // type:function size:0x1C getUiMode__11dLytMeter_cFv = .text:0x800CA0C0; // type:function size:0x38 __ct__11dLytMeter_cFv = .text:0x800CA100; // type:function size:0x1C0 @@ -4752,7 +4752,7 @@ fn_800D5650__11dLytMeter_cFv = .text:0x800D5650; // type:function size:0x24 fn_800D5680__11dLytMeter_cFv = .text:0x800D5680; // type:function size:0x28 fn_800D56B0 = .text:0x800D56B0; // type:function size:0xFC fn_800D57B0 = .text:0x800D57B0; // type:function size:0x1A58 -fn_800D7210 = .text:0x800D7210; // type:function size:0x92C +execute__11dLytMeter_cFv = .text:0x800D7210; // type:function size:0x92C fn_800D7B40 = .text:0x800D7B40; // type:function size:0xC draw__11dLytMeter_cFv = .text:0x800D7B50; // type:function size:0x128 getLyt__20LytMeterTimerPart1_cFv = .text:0x800D7C80; // type:function size:0x8 @@ -4772,19 +4772,19 @@ __dt__83sStateMgr_c<14dLytDobutton_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sSt __dt__53sFStateMgr_c<14dLytDobutton_c,20sStateMethodUsr_FI_c>Fv = .text:0x800D8FB0; // type:function size:0xA4 remove__20dLytMeterContainer_cFv = .text:0x800D9060; // type:function size:0x16C __dt__14dLytDobutton_cFv = .text:0x800D91D0; // type:function size:0xE4 -fn_800D92C0 = .text:0x800D92C0; // type:function size:0x48 -fn_800D9310 = .text:0x800D9310; // type:function size:0xD8 -fn_800D93F0 = .text:0x800D93F0; // type:function size:0x1F0 +__dt__18LytDoButtonRelatedFv = .text:0x800D92C0; // type:function size:0x48 +__dt__20dLytMeterEventSkip_cFv = .text:0x800D9310; // type:function size:0xD8 +execute__20dLytMeterContainer_cFv = .text:0x800D93F0; // type:function size:0x1F0 draw__20dLytMeterContainer_cFv = .text:0x800D95E0; // type:function size:0x90 fn_800D5670__20dLytMeterContainer_cFv = .text:0x800D9670; // type:function size:0x8 fn_800D9680 = .text:0x800D9680; // type:function size:0x64 fn_800D96F0 = .text:0x800D96F0; // type:function size:0x20 fn_800D9710 = .text:0x800D9710; // type:function size:0x10 -fn_800D9720 = .text:0x800D9720; // type:function size:0x8 +setStaminaWheelPercentInternal__20dLytMeterContainer_cFf = .text:0x800D9720; // type:function size:0x8 fn_800D9730 = .text:0x800D9730; // type:function size:0x4C fn_800D9780 = .text:0x800D9780; // type:function size:0x18 fn_800D97A0__20dLytMeterContainer_cFv = .text:0x800D97A0; // type:function size:0x20 -setStaminaWheelPercent = .text:0x800D97C0; // type:function size:0x14 +setStaminaWheelPercent__20dLytMeterContainer_cFf = .text:0x800D97C0; // type:function size:0x14 fn_800D97E0 = .text:0x800D97E0; // type:function size:0x1C fn_800D9800 = .text:0x800D9800; // type:function size:0x18 changeState__83sStateMgr_c<14dLytSkyGauge_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x800D9820; // type:function size:0x10 @@ -6528,7 +6528,7 @@ executeState_Out__14dLytDobutton_cFv = .text:0x8010D3F0; // type:function size:0 finalizeState_Out__14dLytDobutton_cFv = .text:0x8010D480; // type:function size:0x4 init__14dLytDobutton_cFPQ23m2d10ResAccIf_c = .text:0x8010D490; // type:function size:0x1D4 remove__14dLytDobutton_cFv = .text:0x8010D670; // type:function size:0x50 -fn_8010D6C0 = .text:0x8010D6C0; // type:function size:0x80C +execute__14dLytDobutton_cFv = .text:0x8010D6C0; // type:function size:0x80C draw__14dLytDobutton_cFv = .text:0x8010DED0; // type:function size:0x28 fn_8010DF00 = .text:0x8010DF00; // type:function size:0x4CC fn_8010E3D0 = .text:0x8010E3D0; // type:function size:0x1F0 @@ -6736,7 +6736,7 @@ __dt__35sFStateID_c<20dLytCommonIconItem_c>Fv = .text:0x80113DF0; // type:functi isSameName__35sFStateID_c<20dLytCommonIconItem_c>CFPCc = .text:0x80113E50; // type:function size:0x88 build__20LytBirdButtonRelatedFPQ23d2d10ResAccIf_c = .text:0x80113EE0; // type:function size:0x224 remove__20LytBirdButtonRelatedFv = .text:0x80114110; // type:function size:0x58 -fn_80114170 = .text:0x80114170; // type:function size:0x10C +execute__20LytBirdButtonRelatedFv = .text:0x80114170; // type:function size:0x10C draw__20LytBirdButtonRelatedFv = .text:0x80114280; // type:function size:0x44 fn_801142D0 = .text:0x801142D0; // type:function size:0x168 fn_80114440 = .text:0x80114440; // type:function size:0x248 diff --git a/include/d/a/d_a_player.h b/include/d/a/d_a_player.h index b355121a..7adcc2dd 100644 --- a/include/d/a/d_a_player.h +++ b/include/d/a/d_a_player.h @@ -57,6 +57,13 @@ public: FLG0_HANGING_ITEM | FLG0_HANGING_LEDGE | FLG0_UNK_0x10 | FLG0_IN_AIR, }; + enum dAcPy_RidingActor { + RIDING_NONE = 0, + RIDING_TRUCK_MINECART = 1, + RIDING_LOFTWING = 2, + RIDING_BOAT = 3, + }; + dAcPy_c(); virtual ~dAcPy_c(); @@ -303,11 +310,11 @@ public: } inline bool isAffectedByStaminaPotion() const { - return FileManager::GetInstance()->hasStaminaPotionNormal() && getRidingActorType() != 3; + return FileManager::GetInstance()->hasStaminaPotionNormal() && getRidingActorType() != RIDING_BOAT; } inline bool isAffectedByStaminaPotionPlus() const { - return FileManager::GetInstance()->hasStaminaPotionPlus() && getRidingActorType() != 3; + return FileManager::GetInstance()->hasStaminaPotionPlus() && getRidingActorType() != RIDING_BOAT; } static nw4r::g3d::ResFile getItemResFile(const char *name, mAllocator_c &allocator); diff --git a/include/d/lyt/d_lyt_do_button.h b/include/d/lyt/d_lyt_do_button.h index ed4c5351..bb55159f 100644 --- a/include/d/lyt/d_lyt_do_button.h +++ b/include/d/lyt/d_lyt_do_button.h @@ -4,7 +4,6 @@ #include "common.h" #include "d/lyt/d2d.h" #include "s/s_State.hpp" -#include "s/s_StateMgr.hpp" class dLytDobutton_c { public: @@ -17,6 +16,7 @@ public: bool init(m2d::ResAccIf_c *resAcc); bool remove(); + bool execute(); bool draw(); static dLytDobutton_c *GetInstance() { diff --git a/include/d/lyt/d_lyt_unknowns.h b/include/d/lyt/d_lyt_unknowns.h index ca6764f8..806c4b9f 100644 --- a/include/d/lyt/d_lyt_unknowns.h +++ b/include/d/lyt/d_lyt_unknowns.h @@ -7,7 +7,9 @@ class LytDoButtonRelated { public: LytDoButtonRelated(); - virtual ~LytDoButtonRelated(); + virtual ~LytDoButtonRelated() { + sInstance = nullptr; + } bool build(d2d::ResAccIf_c *resAcc); bool remove(); @@ -100,6 +102,7 @@ public: } bool build(d2d::ResAccIf_c *resAcc); bool remove(); + bool execute(); bool draw(); static LytBirdButtonRelated *sInstance; diff --git a/include/d/lyt/meter/d_lyt_meter.h b/include/d/lyt/meter/d_lyt_meter.h index ae5a77f1..62252b84 100644 --- a/include/d/lyt/meter/d_lyt_meter.h +++ b/include/d/lyt/meter/d_lyt_meter.h @@ -64,10 +64,17 @@ public: bool remove(); bool draw(); + bool isNotSilentRealmOrLoftwing(); + + bool fn_800C9F70(); + bool fn_800C9FE0(); + bool fn_800CA040(); + bool fn_800D5380(u8); bool fn_800D5650(); bool fn_800D5680(); - bool fn_800C9FE0(); + bool fn_800D56B0(); + bool execute(); bool isSilentRealm(); @@ -196,11 +203,15 @@ public: bool build(); bool remove(); + bool execute(); bool draw(); bool fn_800D5670(); bool fn_800D97A0(); + static void setStaminaWheelPercent(f32 percent); + void setStaminaWheelPercentInternal(f32 percent); + static dLytMeterContainer_c *GetInstance() { return sInstance; } @@ -257,14 +268,6 @@ public: } } - static u8 getField_0x13B63() { - if (sInstance != nullptr) { - return sInstance->field_0x13B63; - } else { - return 0; - } - } - static void setRupyField_0x8A9(u8 val) { if (sInstance != nullptr) { sInstance->mMeter.mRupy.setField_0x8A9(val); @@ -305,6 +308,20 @@ public: } } + static void setField_0x13B63(u8 val) { + if (sInstance != nullptr) { + sInstance->field_0x13B63 = val; + } + } + + static u8 getField_0x13B63() { + if (sInstance != nullptr) { + return sInstance->field_0x13B63; + } else { + return 0; + } + } + static void setField_0x13B64(u8 val) { if (sInstance != nullptr) { sInstance->field_0x13B64 = val; @@ -346,7 +363,8 @@ private: /* 0x13B49 */ u8 _0x13B49[0x13B50 - 0x13B49]; /* 0x13B50 */ s32 mFlags; /* 0x13B54 */ s32 field_0x13B54; - /* 0x13B58 */ u8 _0x13B58[0x13B60 - 0x13B58]; + /* 0x13B58 */ s32 field_0x13B58; + /* 0x13B5C */ s32 field_0x13B5C; /* 0x13B60 */ u8 field_0x13B60; /* 0x13B61 */ u8 field_0x13B61; /* 0x13B62 */ u8 field_0x13B62; diff --git a/include/d/lyt/meter/d_lyt_meter_dowsing.h b/include/d/lyt/meter/d_lyt_meter_dowsing.h index 9a60fd52..17659593 100644 --- a/include/d/lyt/meter/d_lyt_meter_dowsing.h +++ b/include/d/lyt/meter/d_lyt_meter_dowsing.h @@ -160,6 +160,10 @@ public: mpOwnerPane = pane; } + void setField_0x54E0(s32 value) { + field_0x54E0 = value; + } + private: void setItemName(s32 id); void setMessage(s32 id); diff --git a/include/d/lyt/meter/d_lyt_meter_ganbari_gauge.h b/include/d/lyt/meter/d_lyt_meter_ganbari_gauge.h index 0567416b..eb6faca0 100644 --- a/include/d/lyt/meter/d_lyt_meter_ganbari_gauge.h +++ b/include/d/lyt/meter/d_lyt_meter_ganbari_gauge.h @@ -31,6 +31,10 @@ public: mpOwnerPane = pane; } + void setStaminaPercent(f32 value) { + mStaminaPercent = value; + } + private: void realizeAnimState(); static bool isStaminaLow(f32); @@ -61,7 +65,7 @@ private: /* 0x080 */ d2d::dLytSub mLyt; /* 0x114 */ d2d::AnmGroup_c mAnm[16]; /* 0x514 */ nw4r::lyt::Pane *mpOwnerPane; - /* 0x518 */ f32 field_0x518; + /* 0x518 */ f32 mStaminaPercent; /* 0x51C */ f32 field_0x51C; /* 0x520 */ u8 _0x520[0x524 - 0x520]; /* 0x524 */ mVec3_c field_0x524; diff --git a/include/d/lyt/meter/d_lyt_meter_minus_btn.h b/include/d/lyt/meter/d_lyt_meter_minus_btn.h index 208c6dfe..653305d8 100644 --- a/include/d/lyt/meter/d_lyt_meter_minus_btn.h +++ b/include/d/lyt/meter/d_lyt_meter_minus_btn.h @@ -126,6 +126,10 @@ public: mpOwnerPane = pane; } + void setField_0x4E80(s32 value) { + field_0x4E80 = value; + } + private: bool shouldCall() const; bool fn_800F75E0() const; diff --git a/src/d/lyt/meter/d_lyt_meter.cpp b/src/d/lyt/meter/d_lyt_meter.cpp index 58794a9c..987c6609 100644 --- a/src/d/lyt/meter/d_lyt_meter.cpp +++ b/src/d/lyt/meter/d_lyt_meter.cpp @@ -1,5 +1,6 @@ // clang-format off #include "common.h" +#include "d/a/d_a_player.h" #include "d/d_message.h" #include "d/d_sc_game.h" #include "d/d_sc_title.h" @@ -13,6 +14,7 @@ #include "m/m_vec.h" #include "nw4r/lyt/lyt_group.h" #include "toBeSorted/arc_managers/layout_arc_manager.h" +#include "toBeSorted/event_manager.h" #include "toBeSorted/small_sound_mgr.h" // clang-format on @@ -493,6 +495,34 @@ void dLytMeterParts_c::execute() { mStateMgr.executeState(); } +bool dLytMeter_c::isNotSilentRealmOrLoftwing() { + if (isSilentRealm() || dAcPy_c::GetLink()->getRidingActorType() == dAcPy_c::RIDING_LOFTWING) { + return false; + } + return true; +} + +bool dLytMeter_c::fn_800C9F70() { + if ((fn_800D56B0() && !field_0x13775) || fn_800D5650() || fn_800D5680()) { + return true; + } + return false; +} + +bool dLytMeter_c::fn_800C9FE0() { + if (fn_800D56B0() || !field_0x13750 || fn_800D5680()) { + return true; + } + return false; +} + +bool dLytMeter_c::fn_800CA040() { + if (field_0x13774 || fn_800D5650() || fn_800D5680()) { + return true; + } + return false; +} + void floats() { 32.0f; 1.0f; @@ -637,7 +667,7 @@ bool dLytMeter_c::build(d2d::ResAccIf_c *resAcc) { field_0x13760 = 0; mRupyPos = mRupyPositions[field_0x13760]; mPos3.x = mPos3.y = mPos3.z = 0.0f; - field_0x137C0 = 0; + field_0x137C0 = 0x3C; for (int i = 0; i < METER_NUM_PANES; i++) { if (mNodes[i].mpLytPane != nullptr) { @@ -697,7 +727,7 @@ bool dLytMeter_c::build(d2d::ResAccIf_c *resAcc) { if (dStageMgr_c::GetInstance()->isAreaTypeDungeon() && (!(dScGame_c::currentSpawnInfo.stageName == "F100_1") && !(dScGame_c::currentSpawnInfo.stageName == "F103_1")) || - dScGame_c::currentSpawnInfo.stageName == "F302" || dScGame_c::currentSpawnInfo.stageName == "F302") { + dScGame_c::currentSpawnInfo.stageName == "F302" || dScGame_c::currentSpawnInfo.stageName == "F303") { mpSmallKey = new dLytMeterSmallKey_c(); mpSmallKey->build(resAcc); } else { @@ -796,7 +826,6 @@ bool dLytMeter_c::build(d2d::ResAccIf_c *resAcc) { field_0x1377F = 0; field_0x13754 = 0; - mAnmGroups[METER_ANIM_POSITION].setFrame(zero); mAnmGroups[METER_ANIM_POSITION].setAnimEnable(true); @@ -1036,6 +1065,46 @@ bool dLytMeterContainer_c::remove() { return true; } +bool dLytMeterContainer_c::execute() { + mMeter.mMinusBtn.setField_0x4E80(field_0x13B58); + mMeter.mDowsing.setField_0x54E0(field_0x13B5C); + if (mpEventSkip != nullptr) { + mpEventSkip->execute(); + } + + dLytAreaCaption_c::update(); + mMeter.execute(); + if (mpDoButton != nullptr) { + mpDoButton->execute(); + } + + if (mpBirdRelated != nullptr) { + mpBirdRelated->execute(); + } + + if (field_0x13B61 || (!EventManager::isInEvent() && field_0x13B62)) { + field_0x13B60 = 0; + field_0x13B61 = 0; + field_0x13B62 = 0; + } + + if (fn_800D97A0() && EventManager::isInEvent()) { + field_0x13B62 = 1; + } + + if (field_0x13B64 || (!EventManager::isInEvent() && field_0x13B65)) { + dLytMeterContainer_c::setField_0x13B63(0); + field_0x13B64 = 0; + field_0x13B65 = 0; + } + + if (dLytMeterContainer_c::getField_0x13B63() && EventManager::isInEvent()) { + field_0x13B65 = 1; + } + + return true; +} + bool dLytMeterContainer_c::draw() { if (mVisible) { mMeter.draw(); @@ -1055,3 +1124,13 @@ bool dLytMeterContainer_c::draw() { return true; } + +void dLytMeterContainer_c::setStaminaWheelPercentInternal(f32 percent) { + mMeter.mGanbariGauge.setStaminaPercent(percent); +} + +void dLytMeterContainer_c::setStaminaWheelPercent(f32 percent) { + if (sInstance != nullptr) { + sInstance->setStaminaWheelPercentInternal(percent); + } +} diff --git a/src/d/lyt/meter/d_lyt_meter_ganbari_gauge.cpp b/src/d/lyt/meter/d_lyt_meter_ganbari_gauge.cpp index f366d960..aeb3f9e1 100644 --- a/src/d/lyt/meter/d_lyt_meter_ganbari_gauge.cpp +++ b/src/d/lyt/meter/d_lyt_meter_ganbari_gauge.cpp @@ -73,7 +73,7 @@ void dLytMeterGanbariGauge_c::executeState_InvisibleWait() {} void dLytMeterGanbariGauge_c::finalizeState_InvisibleWait() {} void dLytMeterGanbariGauge_c::initializeState_In() { - if (dAcPy_c::GetLink()->getRidingActorType() == 3) { + if (dAcPy_c::GetLink()->getRidingActorType() == dAcPy_c::RIDING_BOAT) { field_0x554 = 3.0f; } else if (swimmingRelated()) { field_0x554 = 1.0f; @@ -89,7 +89,7 @@ void dLytMeterGanbariGauge_c::executeState_In() { realizeAnimState(); if (*mStateMgrWheel.getStateID() == StateID_Caution || *mStateMgrWheel.getStateID() == StateID_ToMin || *mStateMgrWheel.getStateID() == StateID_Recovery || *mStateMgrWheel.getStateID() == StateID_ToMax) { - if (field_0x518 > 0.95f) { + if (mStaminaPercent > 0.95f) { mStateMgrWheel.changeState(StateID_Normal); } else { mStateMgrWheel.changeState(*mStateMgrWheel.getStateID()); @@ -117,7 +117,7 @@ void dLytMeterGanbariGauge_c::initializeState_OutWait() { void dLytMeterGanbariGauge_c::executeState_OutWait() { if (--mOutWaitTimer <= 0) { mStateMgrMain.changeState(StateID_Out); - } else if (field_0x518 < 0.9999f) { + } else if (mStaminaPercent < 0.9999f) { mStateMgrMain.changeState(StateID_Wait); } } @@ -154,7 +154,7 @@ void dLytMeterGanbariGauge_c::finalizeState_CameraOut() { void dLytMeterGanbariGauge_c::initializeState_Full() {} void dLytMeterGanbariGauge_c::executeState_Full() { - if (field_0x518 < 0.9999f) { + if (mStaminaPercent < 0.9999f) { mStateMgrWheel.changeState(StateID_Normal); } else if (dAcPy_c::GetLink()->checkSwordAndMoreStates(0x200 | 0x40 | 0x20) || field_0x558 != 0) { mStateMgrWheel.changeState(StateID_FullGutsUse); @@ -164,7 +164,7 @@ void dLytMeterGanbariGauge_c::finalizeState_Full() {} void dLytMeterGanbariGauge_c::initializeState_FullGutsUse() {} void dLytMeterGanbariGauge_c::executeState_FullGutsUse() { - if (field_0x518 < 0.9999f) { + if (mStaminaPercent < 0.9999f) { mStateMgrWheel.changeState(StateID_Normal); } else if (!dAcPy_c::GetLink()->checkSwordAndMoreStates(0x200 | 0x40 | 0x20) && field_0x558 == 0) { mStateMgrWheel.changeState(StateID_Full); @@ -174,13 +174,13 @@ void dLytMeterGanbariGauge_c::finalizeState_FullGutsUse() {} void dLytMeterGanbariGauge_c::initializeState_Normal() {} void dLytMeterGanbariGauge_c::executeState_Normal() { - if (isStaminaLow(field_0x518)) { + if (isStaminaLow(mStaminaPercent)) { mAnm[GANBARI_ANIM_CAUTION].setRate(1.0f); mStateMgrWheel.changeState(StateID_Caution); - } else if (isStaminaCritical(field_0x518)) { + } else if (isStaminaCritical(mStaminaPercent)) { mAnm[GANBARI_ANIM_CAUTION].setRate(3.0f); mStateMgrWheel.changeState(StateID_Caution); - } else if (field_0x518 >= 0.9999f) { + } else if (mStaminaPercent >= 0.9999f) { mStateMgrWheel.changeState(StateID_ToMax); } } @@ -191,11 +191,11 @@ void dLytMeterGanbariGauge_c::initializeState_Caution() { mAnm[GANBARI_ANIM_CAUTION].setFrame(0.0f); } void dLytMeterGanbariGauge_c::executeState_Caution() { - if (field_0x518 <= 0.0001f) { + if (mStaminaPercent <= 0.0001f) { mStateMgrWheel.changeState(StateID_ToMin); - } else if (isStaminaCritical(field_0x518)) { + } else if (isStaminaCritical(mStaminaPercent)) { mAnm[GANBARI_ANIM_CAUTION].setRate(3.0f); - } else if (isStaminaLow(field_0x518)) { + } else if (isStaminaLow(mStaminaPercent)) { mAnm[GANBARI_ANIM_CAUTION].setRate(1.0f); } else { mStateMgrWheel.changeState(StateID_Normal); @@ -217,7 +217,7 @@ void dLytMeterGanbariGauge_c::initializeState_ToMin() { mAnm[GANBARI_ANIM_TO_MIN].setToStart(); } void dLytMeterGanbariGauge_c::executeState_ToMin() { - if (field_0x518 >= 0.9999f) { + if (mStaminaPercent >= 0.9999f) { mAnm[GANBARI_ANIM_TO_MIN].setToStart(); mLyt.calc(); mAnm[GANBARI_ANIM_TO_MIN].setAnimEnable(false); @@ -237,7 +237,7 @@ void dLytMeterGanbariGauge_c::initializeState_Recovery() { mAnm[GANBARI_ANIM_TO_MIN_LOOP].setAnimEnable(true); mAnm[GANBARI_ANIM_TO_MIN_LOOP].setFrame(0.0f); - if (dAcPy_c::GetLink()->getRidingActorType() == 3) { + if (dAcPy_c::GetLink()->getRidingActorType() == dAcPy_c::RIDING_BOAT) { field_0x554 = 4.0f; } else if (swimmingRelated()) { field_0x554 = 1.0f; @@ -247,7 +247,7 @@ void dLytMeterGanbariGauge_c::initializeState_Recovery() { } void dLytMeterGanbariGauge_c::executeState_Recovery() { if (swimmingRelated()) { - if (field_0x518 >= 0.0001f) { + if (mStaminaPercent >= 0.0001f) { mAnm[GANBARI_ANIM_TO_MIN_LOOP].setFrame(0.0f); mAnm[GANBARI_ANIM_TO_MAX].setAnimEnable(true); mAnm[GANBARI_ANIM_TO_MAX].setToEnd2(); @@ -259,7 +259,7 @@ void dLytMeterGanbariGauge_c::executeState_Recovery() { mAnm[GANBARI_ANIM_UPDOWN_1].setAnimEnable(false); mStateMgrWheel.changeState(StateID_Normal); } - } else if (field_0x518 >= 0.9999f) { + } else if (mStaminaPercent >= 0.9999f) { mAnm[GANBARI_ANIM_TO_MIN_LOOP].setFrame(0.0f); mLyt.calc(); mAnm[GANBARI_ANIM_TO_MIN_LOOP].setAnimEnable(false); @@ -324,7 +324,7 @@ bool dLytMeterGanbariGauge_c::build(d2d::ResAccIf_c *resAcc) { mAnm[GANBARI_ANIM_OUT].setAnimEnable(false); mAnm[GANBARI_ANIM_CAMERA_OUT].setAnimEnable(false); - field_0x518 = 1.0f; + mStaminaPercent = 1.0f; field_0x51C = 1.0f; field_0x54C = 1.0f; field_0x550 = 1.0f; @@ -455,7 +455,7 @@ bool dLytMeterGanbariGauge_c::execute() { f32 scale; if (fn_80104710(false) || (isCrawling() && !fn_801047B0())) { - if (dAcPy_c::GetLink()->getRidingActorType() == 3) { + if (dAcPy_c::GetLink()->getRidingActorType() == dAcPy_c::RIDING_BOAT) { angle = 4; v1.x = 232.0f; v1.y = 145.0f; @@ -479,7 +479,7 @@ bool dLytMeterGanbariGauge_c::execute() { v2.y = -105.0f; v2.y += 46.0f; scale = 1.0f; - } else if (dAcPy_c::GetLink()->getRidingActorType() == 3) { + } else if (dAcPy_c::GetLink()->getRidingActorType() == dAcPy_c::RIDING_BOAT) { angle = 3; v2.set(-95.0f, -50.0f); scale = 0.9f; @@ -519,17 +519,17 @@ bool dLytMeterGanbariGauge_c::execute() { } } - mAnm[GANBARI_ANIM_UPDOWN_0].setFrame(field_0x518 * 100.0f); + mAnm[GANBARI_ANIM_UPDOWN_0].setFrame(mStaminaPercent * 100.0f); mAnm[GANBARI_ANIM_ANGLE].setFrame(angle); mStateMgrWheel.executeState(); if (field_0x544 != 0) { - if (field_0x518 < field_0x550 && - field_0x518 < field_0x51C - dLytMeterConfiguration_c::GetInstance()->getField_0x1CC()) { + if (mStaminaPercent < field_0x550 && + mStaminaPercent < field_0x51C - dLytMeterConfiguration_c::GetInstance()->getField_0x1CC()) { field_0x548 = dLytMeterConfiguration_c::GetInstance()->getField_0x1C8(); field_0x54C = field_0x51C; - field_0x550 = field_0x518; + field_0x550 = mStaminaPercent; mAnm[GANBARI_ANIM_UPDOWN_1].setFrame(field_0x54C * 100.0f); mAnm[GANBARI_ANIM_UPDOWN_1].setAnimEnable(true); } else { @@ -538,7 +538,7 @@ bool dLytMeterGanbariGauge_c::execute() { } if (field_0x548 == 0) { field_0x54C -= dLytMeterConfiguration_c::GetInstance()->getField_0x1D0(); - if (field_0x54C < field_0x518) { + if (field_0x54C < mStaminaPercent) { field_0x544 = 0; mAnm[GANBARI_ANIM_UPDOWN_1].setAnimEnable(true); mAnm[GANBARI_ANIM_UPDOWN_1].setFrame(0.0f); @@ -552,15 +552,15 @@ bool dLytMeterGanbariGauge_c::execute() { } } } else { - if (field_0x518 < field_0x51C - dLytMeterConfiguration_c::GetInstance()->getField_0x1C4()) { + if (mStaminaPercent < field_0x51C - dLytMeterConfiguration_c::GetInstance()->getField_0x1C4()) { field_0x544 = 1; field_0x54C = field_0x51C; - field_0x550 = field_0x518; + field_0x550 = mStaminaPercent; field_0x548 = dLytMeterConfiguration_c::GetInstance()->getField_0x1C8(); mAnm[GANBARI_ANIM_UPDOWN_1].setFrame(field_0x54C * 100.0f); mAnm[GANBARI_ANIM_UPDOWN_1].setAnimEnable(true); } else { - mAnm[GANBARI_ANIM_UPDOWN_1].setFrame(field_0x518 * 100.0f); + mAnm[GANBARI_ANIM_UPDOWN_1].setFrame(mStaminaPercent * 100.0f); mAnm[GANBARI_ANIM_UPDOWN_1].setAnimEnable(true); } } @@ -585,7 +585,7 @@ bool dLytMeterGanbariGauge_c::execute() { mAnm[GANBARI_ANIM_M_CAUTION].setAnimEnable(false); } - if (!b12 && field_0x518 < field_0x51C) { + if (!b12 && mStaminaPercent < field_0x51C) { if (!mAnm[GANBARI_ANIM_LOOP].isEnabled()) { mAnm[GANBARI_ANIM_LOOP].setFrame(0.0f); mAnm[GANBARI_ANIM_LOOP].setAnimEnable(true); @@ -629,7 +629,7 @@ bool dLytMeterGanbariGauge_c::execute() { } mStateMgrMain.executeState(); - field_0x51C = field_0x518; + field_0x51C = mStaminaPercent; return true; } @@ -716,7 +716,7 @@ void dLytMeterGanbariGauge_c::realizeAnimState() { mAnm[GANBARI_ANIM_UPDOWN_1].setAnimEnable(false); if (dAcPy_c::GetLink() != nullptr) { - if (dAcPy_c::GetLink()->getRidingActorType() == 3) { + if (dAcPy_c::GetLink()->getRidingActorType() == dAcPy_c::RIDING_BOAT) { field_0x554 = 3.0f; } else if (swimmingRelated()) { field_0x554 = 1.0f; diff --git a/src/d/lyt/meter/d_lyt_meter_item_select.cpp b/src/d/lyt/meter/d_lyt_meter_item_select.cpp index fb2c0205..3ce84db6 100644 --- a/src/d/lyt/meter/d_lyt_meter_item_select.cpp +++ b/src/d/lyt/meter/d_lyt_meter_item_select.cpp @@ -2715,8 +2715,9 @@ s32 dLytMeterItemSelect_c::getBaseItemLytIndexforInternalId(s32 idx) const { extern "C" bool checkIsInSkykeepPuzzle(); bool dLytMeterItemSelect_c::isWheelBlockedByCurrentAction() { - if (dAcPy_c::LINK->getRidingActorType() == 2 || dAcPy_c::LINK->checkActionFlags(dAcPy_c::FLG0_SWING_ROPE) || - dAcPy_c::LINK->checkCurrentAction(0x9C) || dAcPy_c::LINK->getRidingActorType() == 1 || + if (dAcPy_c::LINK->getRidingActorType() == dAcPy_c::RIDING_LOFTWING || + dAcPy_c::LINK->checkActionFlags(dAcPy_c::FLG0_SWING_ROPE) || dAcPy_c::LINK->checkCurrentAction(0x9C) || + dAcPy_c::LINK->getRidingActorType() == dAcPy_c::RIDING_TRUCK_MINECART || dAcPy_c::LINK->checkCurrentAction(0x95) || isInSpiralChargeTutorialMinigame() || isInRollercoasterMinigame() || dAcPy_c::LINK->checkCurrentAction(0x8C) || dLytMeterContainer_c::GetMeter()->getField_0x1377E() != 0 || checkIsInSkykeepPuzzle() || dLytMeterContainer_c::GetInstance()->getMeterField_0x13770() == 0) {