mirror of
https://github.com/zeldaret/ss
synced 2026-08-10 03:05:33 -04:00
d_lyt_drop_line almost OK
This commit is contained in:
@@ -3,9 +3,74 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "d/a/d_a_item.h"
|
||||
#include "d/d_base.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "nw4r/lyt/lyt_pane.h"
|
||||
#include "s/s_State.hpp"
|
||||
#include "toBeSorted/d_emitter.h"
|
||||
|
||||
class dLytDropLine_c {
|
||||
class dLytDropLine_c;
|
||||
|
||||
class dLytDropLineParts_c {
|
||||
public:
|
||||
dLytDropLineParts_c() : mStateMgr(*this) {}
|
||||
|
||||
int create(dLytDropLine_c *main);
|
||||
int doDelete();
|
||||
int execute();
|
||||
int draw();
|
||||
|
||||
/** Starts a line from the tear's world position to the tear slot, when picking up a tear. */
|
||||
void startPickup(mVec3_c tearWorldPos, s32 trial);
|
||||
|
||||
/** Starts a line from the tear slot to the flower. */
|
||||
void startChange(mVec3_c startPos, s32 trial, bool leftRight);
|
||||
|
||||
bool isMoveRequest() const {
|
||||
return mMoveRequest;
|
||||
}
|
||||
|
||||
bool isDone() const {
|
||||
return mIsDone;
|
||||
}
|
||||
|
||||
void setTargetPane(nw4r::lyt::Pane *pane) {
|
||||
mIsDone = false;
|
||||
mIsChangeAnim = false;
|
||||
mpTargetPane = pane;
|
||||
}
|
||||
|
||||
void finish() {
|
||||
mIsDone = false;
|
||||
mIsChangeAnim = false;
|
||||
}
|
||||
|
||||
nw4r::lyt::Pane *getTargetPane() const {
|
||||
return mpTargetPane;
|
||||
}
|
||||
|
||||
private:
|
||||
STATE_FUNC_DECLARE(dLytDropLineParts_c, Wait);
|
||||
STATE_FUNC_DECLARE(dLytDropLineParts_c, Move);
|
||||
|
||||
void reset();
|
||||
|
||||
/* 0x00 */ UI_STATE_MGR_DECLARE(dLytDropLineParts_c);
|
||||
/* 0x3C */ nw4r::lyt::Pane *mpTargetPane;
|
||||
/* 0x40 */ dEmitter_c mEmitter;
|
||||
/* 0x74 */ mVec3_c mStartPos;
|
||||
/* 0x80 */ mVec3_c mEffectPos;
|
||||
/* 0x8C */ mVec3_c field_0x8C;
|
||||
/* 0x98 */ s32 mTrial;
|
||||
/* 0x9C */ s32 mMoveTimer;
|
||||
/* 0xA0 */ bool mMoveRequest;
|
||||
/* 0xA1 */ bool mIsDone;
|
||||
/* 0xA2 */ bool mLeftRight;
|
||||
/* 0xA3 */ bool mIsChangeAnim;
|
||||
};
|
||||
|
||||
/** 2D UI - Silent realm tear trail. */
|
||||
class dLytDropLine_c : public dBase_c {
|
||||
public:
|
||||
dLytDropLine_c() {
|
||||
sInstance = this;
|
||||
@@ -18,13 +83,35 @@ public:
|
||||
return sInstance;
|
||||
}
|
||||
|
||||
virtual int create() override;
|
||||
virtual int doDelete() override;
|
||||
virtual int execute() override;
|
||||
virtual int draw() override;
|
||||
|
||||
static bool finishPart();
|
||||
static void setPane(nw4r::lyt::Pane *pane);
|
||||
static nw4r::lyt::Pane *getActivePane();
|
||||
static nw4r::lyt::Pane *setPane(nw4r::lyt::Pane *pane);
|
||||
static nw4r::lyt::Pane *update(nw4r::lyt::Pane *pane, nw4r::lyt::Pane *otherPane, dAcItem_c::Trial_e, bool);
|
||||
static bool finishPartMaybe();
|
||||
static void startPickup(mVec3_c tearWorldPos, dAcItem_c::Trial_e trial);
|
||||
static void startChange(nw4r::lyt::Pane *tearSlotPane, nw4r::lyt::Pane *flowerPane, dAcItem_c::Trial_e trial, bool leftRight);
|
||||
|
||||
private:
|
||||
static dLytDropLine_c *sInstance;
|
||||
|
||||
static const s32 NUM_PARTS = 15;
|
||||
|
||||
int createInternal();
|
||||
int doDeleteInternal();
|
||||
int executeInternal();
|
||||
int drawInternal();
|
||||
|
||||
bool finishPartInternal();
|
||||
void setPaneInternal(nw4r::lyt::Pane *pane);
|
||||
nw4r::lyt::Pane *getActivePaneInternal();
|
||||
|
||||
void startPickupInternal(mVec3_c tearWorldPos, dAcItem_c::Trial_e trial);
|
||||
void startChangeInternal(nw4r::lyt::Pane *tearSlotPane, nw4r::lyt::Pane *flowerPane, dAcItem_c::Trial_e trial, bool leftRight);
|
||||
|
||||
/* 0x68 */ dLytDropLineParts_c mParts[NUM_PARTS];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
class LytMeterTimerPart1_c : public d2d::dSubPane {
|
||||
public:
|
||||
LytMeterTimerPart1_c()
|
||||
: mActualTearCount(0), mDisplayedTearCount(0), field_0x760(0), mTrial(dAcItem_c::TRIAL_NONE), field_0x780(0) {
|
||||
: mActualTearCount(0), mDisplayedTearCount(0), field_0x760(0), mTrial(dAcItem_c::TRIAL_NONE), mChangeFruitIndex(0) {
|
||||
sInstance = this;
|
||||
}
|
||||
virtual bool build(d2d::ResAccIf_c *resAcc) override;
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
bool isOutAnimFinished();
|
||||
void startFruitAnim(s32 index);
|
||||
void resetBowlNuts();
|
||||
void updateDropLine(nw4r::lyt::Pane *pane);
|
||||
void startDropLineChange(nw4r::lyt::Pane *pane);
|
||||
|
||||
void startEffect(s32 fruitIndex);
|
||||
bool incrementTearCount();
|
||||
@@ -64,12 +64,12 @@ public:
|
||||
return mDisplayedTearCount;
|
||||
}
|
||||
|
||||
s32 getField0x780() const {
|
||||
return field_0x780;
|
||||
s32 getChangeFruitIndex() const {
|
||||
return mChangeFruitIndex;
|
||||
}
|
||||
|
||||
void setField0x780(s32 val) {
|
||||
field_0x780 = val;
|
||||
void setChangeFruitIndex(s32 val) {
|
||||
mChangeFruitIndex = val;
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -92,7 +92,7 @@ private:
|
||||
/* 0x764 */ dAcItem_c::Trial_e mTrial;
|
||||
/* 0x768 */ mColor mColors1[3];
|
||||
/* 0x774 */ mColor mColors2[3];
|
||||
/* 0x780 */ s32 field_0x780;
|
||||
/* 0x780 */ s32 mChangeFruitIndex;
|
||||
};
|
||||
|
||||
class LytMeterTimerPart2_c : public d2d::dSubPane {
|
||||
|
||||
Reference in New Issue
Block a user