mirror of
https://github.com/MonsterDruide1/OdysseyDecomp.git
synced 2024-11-23 13:29:49 +00:00
Layout: Implement CoinCollectLayout
(#111)
This commit is contained in:
parent
5f6ab794a9
commit
56c1a5a4ea
@ -11683,16 +11683,16 @@ Address,Quality,Size,Name
|
||||
0x00000071001ddd98,U,000076,_ZNK12_GLOBAL__N_122CinemaCaptionNrvAppear7executeEPN2al11NerveKeeperE
|
||||
0x00000071001ddde4,U,000108,_ZNK12_GLOBAL__N_119CinemaCaptionNrvEnd7executeEPN2al11NerveKeeperE
|
||||
0x00000071001dde50,U,000064,_ZNK12_GLOBAL__N_120CinemaCaptionNrvWait7executeEPN2al11NerveKeeperE
|
||||
0x00000071001dde90,U,000176,_ZN17CoinCollectLayoutC2ERKN2al14LayoutInitInfoE
|
||||
0x00000071001ddf40,U,000172,_ZN17CoinCollectLayoutC1ERKN2al14LayoutInitInfoE
|
||||
0x00000071001ddfec,U,000204,_ZN17CoinCollectLayout13appearCounterEiiPKN2al9LiveActorE
|
||||
0x00000071001de0b8,U,000180,_ZN17CoinCollectLayout8exeStartEv
|
||||
0x00000071001de16c,U,000116,_ZN17CoinCollectLayout9updatePosEv
|
||||
0x00000071001de1e0,U,000188,_ZN17CoinCollectLayout7exeWaitEv
|
||||
0x00000071001de29c,U,000192,_ZN17CoinCollectLayout6exeEndEv
|
||||
0x00000071001de35c,U,000008,_ZNK12_GLOBAL__N_125CoinCollectLayoutNrvStart7executeEPN2al11NerveKeeperE
|
||||
0x00000071001de364,U,000008,_ZNK12_GLOBAL__N_124CoinCollectLayoutNrvWait7executeEPN2al11NerveKeeperE
|
||||
0x00000071001de36c,U,000008,_ZNK12_GLOBAL__N_123CoinCollectLayoutNrvEnd7executeEPN2al11NerveKeeperE
|
||||
0x00000071001dde90,O,000176,_ZN17CoinCollectLayoutC2ERKN2al14LayoutInitInfoE
|
||||
0x00000071001ddf40,O,000172,_ZN17CoinCollectLayoutC1ERKN2al14LayoutInitInfoE
|
||||
0x00000071001ddfec,O,000204,_ZN17CoinCollectLayout13appearCounterEiiPKN2al9LiveActorE
|
||||
0x00000071001de0b8,O,000180,_ZN17CoinCollectLayout8exeStartEv
|
||||
0x00000071001de16c,O,000116,_ZN17CoinCollectLayout9updatePosEv
|
||||
0x00000071001de1e0,O,000188,_ZN17CoinCollectLayout7exeWaitEv
|
||||
0x00000071001de29c,O,000192,_ZN17CoinCollectLayout6exeEndEv
|
||||
0x00000071001de35c,O,000008,_ZNK12_GLOBAL__N_125CoinCollectLayoutNrvStart7executeEPN2al11NerveKeeperE
|
||||
0x00000071001de364,O,000008,_ZNK12_GLOBAL__N_124CoinCollectLayoutNrvWait7executeEPN2al11NerveKeeperE
|
||||
0x00000071001de36c,O,000008,_ZNK12_GLOBAL__N_123CoinCollectLayoutNrvEnd7executeEPN2al11NerveKeeperE
|
||||
0x00000071001de374,U,000388,_ZN11CoinCounterC2EPKcRKN2al14LayoutInitInfoEb
|
||||
0x00000071001de4f8,U,000176,
|
||||
0x00000071001de5a8,U,000404,_ZN11CoinCounterC1EPKcRKN2al14LayoutInitInfoEb
|
||||
|
Can't render this file because it is too large.
|
74
src/Layout/CoinCollectLayout.cpp
Normal file
74
src/Layout/CoinCollectLayout.cpp
Normal file
@ -0,0 +1,74 @@
|
||||
#include "Layout/CoinCollectLayout.h"
|
||||
|
||||
#include "Library/Layout/LayoutActionFunction.h"
|
||||
#include "Library/Layout/LayoutActorUtil.h"
|
||||
#include "Library/Layout/LayoutInitInfo.h"
|
||||
#include "Library/LiveActor/ActorPoseKeeper.h"
|
||||
#include "Library/LiveActor/LiveActor.h"
|
||||
#include "Library/Nerve/NerveSetupUtil.h"
|
||||
#include "Library/Nerve/NerveUtil.h"
|
||||
#include "Library/Screen/ScreenFunction.h"
|
||||
|
||||
namespace {
|
||||
NERVE_IMPL(CoinCollectLayout, Start);
|
||||
NERVE_IMPL(CoinCollectLayout, Wait);
|
||||
NERVE_IMPL(CoinCollectLayout, End);
|
||||
|
||||
NERVES_MAKE_NOSTRUCT(CoinCollectLayout, Start, Wait, End);
|
||||
} // namespace
|
||||
|
||||
CoinCollectLayout::CoinCollectLayout(const al::LayoutInitInfo& info)
|
||||
: al::LayoutActor("コレクトコインレイアウト") {
|
||||
al::initLayoutActor(this, info, "PopUpCollectCoin", nullptr);
|
||||
initNerve(&Start, 0);
|
||||
}
|
||||
|
||||
void CoinCollectLayout::appearCounter(s32 maxCoins, s32 currentCoins,
|
||||
const al::LiveActor* coinActor) {
|
||||
mCoinActor = coinActor;
|
||||
al::setPaneStringFormat(this, "TxtCollectCoin", "%d/%d", currentCoins, maxCoins);
|
||||
al::setNerve(this, &Start);
|
||||
|
||||
// regswap when using updatePos() directly because coinActor is used instead of mCoinActor
|
||||
sead::Vector2f layoutPos = sead::Vector2f::zero;
|
||||
sead::Vector3f coinPos = al::getTrans(coinActor);
|
||||
al::calcLayoutPosFromWorldPos(&layoutPos, coinActor, coinPos);
|
||||
al::setLocalTrans(this, layoutPos);
|
||||
|
||||
appear();
|
||||
}
|
||||
|
||||
void CoinCollectLayout::exeStart() {
|
||||
if (al::isFirstStep(this))
|
||||
al::startAction(this, "Appear", nullptr);
|
||||
if (al::isActionEnd(this, nullptr))
|
||||
al::setNerve(this, &Wait);
|
||||
updatePos();
|
||||
}
|
||||
|
||||
void CoinCollectLayout::updatePos() {
|
||||
sead::Vector2f layoutPos = sead::Vector2f::zero;
|
||||
sead::Vector3f coinPos = al::getTrans(mCoinActor);
|
||||
al::calcLayoutPosFromWorldPos(&layoutPos, mCoinActor, coinPos);
|
||||
al::setLocalTrans(this, layoutPos);
|
||||
}
|
||||
|
||||
void CoinCollectLayout::exeWait() {
|
||||
if (al::isFirstStep(this))
|
||||
al::startAction(this, "Wait", nullptr);
|
||||
if (al::isGreaterEqualStep(this, 120)) {
|
||||
al::setNerve(this, &End);
|
||||
return;
|
||||
}
|
||||
updatePos();
|
||||
}
|
||||
|
||||
void CoinCollectLayout::exeEnd() {
|
||||
if (al::isFirstStep(this))
|
||||
al::startAction(this, "End", nullptr);
|
||||
if (al::isActionEnd(this, nullptr)) {
|
||||
kill();
|
||||
return;
|
||||
}
|
||||
updatePos();
|
||||
}
|
22
src/Layout/CoinCollectLayout.h
Normal file
22
src/Layout/CoinCollectLayout.h
Normal file
@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include "Library/Layout/LayoutActor.h"
|
||||
|
||||
namespace al {
|
||||
class LayoutInitInfo;
|
||||
class LiveActor;
|
||||
} // namespace al
|
||||
|
||||
class CoinCollectLayout : public al::LayoutActor {
|
||||
public:
|
||||
CoinCollectLayout(const al::LayoutInitInfo& info);
|
||||
|
||||
void appearCounter(s32 maxCoins, s32 currentCoins, const al::LiveActor* coinActor);
|
||||
void exeStart();
|
||||
void updatePos();
|
||||
void exeWait();
|
||||
void exeEnd();
|
||||
|
||||
private:
|
||||
const al::LiveActor* mCoinActor = nullptr;
|
||||
};
|
Loading…
Reference in New Issue
Block a user