33
44#include " common.h"
55#include " d/a/d_a_item.h"
6+ #include " d/d_base.h"
7+ #include " m/m_vec.h"
68#include " nw4r/lyt/lyt_pane.h"
9+ #include " s/s_State.hpp"
10+ #include " toBeSorted/d_emitter.h"
711
8- class dLytDropLine_c {
12+ class dLytDropLine_c ;
13+
14+ class dLytDropLineParts_c {
15+ public:
16+ dLytDropLineParts_c () : mStateMgr (*this ) {}
17+
18+ int create (dLytDropLine_c *main);
19+ int doDelete ();
20+ int execute ();
21+ int draw ();
22+
23+ /* * Starts a line from the tear's world position to the tear slot, when picking up a tear. */
24+ void startPickup (mVec3_c tearWorldPos, s32 trial);
25+
26+ /* * Starts a line from the tear slot to the flower. */
27+ void startChange (mVec3_c startPos, s32 trial, bool leftRight);
28+
29+ bool isMoveRequest () const {
30+ return mMoveRequest ;
31+ }
32+
33+ bool isDone () const {
34+ return mIsDone ;
35+ }
36+
37+ void setTargetPane (nw4r::lyt::Pane *pane) {
38+ mIsDone = false ;
39+ mIsChangeAnim = false ;
40+ mpTargetPane = pane;
41+ }
42+
43+ void finish () {
44+ mIsDone = false ;
45+ mIsChangeAnim = false ;
46+ }
47+
48+ nw4r::lyt::Pane *getTargetPane () const {
49+ return mpTargetPane;
50+ }
51+
52+ private:
53+ STATE_FUNC_DECLARE (dLytDropLineParts_c, Wait);
54+ STATE_FUNC_DECLARE (dLytDropLineParts_c, Move);
55+
56+ void reset ();
57+
58+ /* 0x00 */ UI_STATE_MGR_DECLARE(dLytDropLineParts_c);
59+ /* 0x3C */ nw4r::lyt::Pane *mpTargetPane;
60+ /* 0x40 */ dEmitter_c mEmitter ;
61+ /* 0x74 */ mVec3_c mStartPos ;
62+ /* 0x80 */ mVec3_c mEffectPos ;
63+ /* 0x8C */ mVec3_c mMoveLinearCoeff ;
64+ /* 0x98 */ s32 mTrial ;
65+ /* 0x9C */ s32 mMoveTimer ;
66+ /* 0xA0 */ bool mMoveRequest ;
67+ /* 0xA1 */ bool mIsDone ;
68+ /* 0xA2 */ bool mLeftRight ;
69+ /* 0xA3 */ bool mIsChangeAnim ;
70+ };
71+
72+ /* * 2D UI - Silent realm tear trail. */
73+ class dLytDropLine_c : public dBase_c {
974public:
1075 dLytDropLine_c () {
1176 sInstance = this ;
@@ -18,13 +83,35 @@ class dLytDropLine_c {
1883 return sInstance ;
1984 }
2085
86+ virtual int create () override ;
87+ virtual int doDelete () override ;
88+ virtual int execute () override ;
89+ virtual int draw () override ;
90+
91+ static bool finishPart ();
92+ static void setPane (nw4r::lyt::Pane *pane);
2193 static nw4r::lyt::Pane *getActivePane ();
22- static nw4r::lyt::Pane *setPane (nw4r::lyt::Pane *pane);
23- static nw4r::lyt::Pane *update (nw4r::lyt::Pane *pane, nw4r::lyt::Pane *otherPane, dAcItem_c::Trial_e, bool );
24- static bool finishPartMaybe ();
94+ static void startPickup (mVec3_c tearWorldPos, dAcItem_c::Trial_e trial);
95+ static void startChange (nw4r::lyt::Pane *tearSlotPane, nw4r::lyt::Pane *flowerPane, dAcItem_c::Trial_e trial, bool leftRight);
2596
2697private:
2798 static dLytDropLine_c *sInstance ;
99+
100+ static const s32 NUM_PARTS = 15 ;
101+
102+ int createInternal ();
103+ int doDeleteInternal ();
104+ int executeInternal ();
105+ int drawInternal ();
106+
107+ bool finishPartInternal ();
108+ void setPaneInternal (nw4r::lyt::Pane *pane);
109+ nw4r::lyt::Pane *getActivePaneInternal ();
110+
111+ void startPickupInternal (mVec3_c tearWorldPos, dAcItem_c::Trial_e trial);
112+ void startChangeInternal (nw4r::lyt::Pane *tearSlotPane, nw4r::lyt::Pane *flowerPane, dAcItem_c::Trial_e trial, bool leftRight);
113+
114+ /* 0x68 */ dLytDropLineParts_c mParts [NUM_PARTS];
28115};
29116
30117#endif
0 commit comments