mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
Layout/CoinCounter: Fix ordering of nerves (#720)
This commit is contained in:
parent
874fb1bf6c
commit
4186cc6521
|
|
@ -20,7 +20,7 @@ NERVE_IMPL(CoinCounter, CountAnimAdd);
|
|||
NERVE_IMPL(CoinCounter, CountAnimSub);
|
||||
|
||||
NERVES_MAKE_NOSTRUCT(CoinCounter, Wait);
|
||||
NERVES_MAKE_STRUCT(CoinCounter, Appear, End, Add, Sub, CountAnimAdd, CountAnimSub);
|
||||
NERVES_MAKE_STRUCT(CoinCounter, End, Appear, CountAnimAdd, CountAnimSub, Add, Sub);
|
||||
} // namespace
|
||||
|
||||
CoinCounter::CoinCounter(const char* name, const al::LayoutInitInfo& initInfo, bool isCoin)
|
||||
|
|
@ -37,13 +37,13 @@ CoinCounter::CoinCounter(const char* name, const al::LayoutInitInfo& initInfo, b
|
|||
al::setPaneString(this, "TxtIconSh", rs::getWorldCoinCollectPictureFont(this), 0);
|
||||
}
|
||||
|
||||
initNerve(&NrvCoinCounter.Appear, 0);
|
||||
initNerve(&NrvCoinCounter.End, 0);
|
||||
kill();
|
||||
updatePanel(mCoinNum, mNumDigits);
|
||||
}
|
||||
|
||||
void CoinCounter::kill() {
|
||||
al::setNerve(this, &NrvCoinCounter.Appear);
|
||||
al::setNerve(this, &NrvCoinCounter.End);
|
||||
al::LayoutActor::kill();
|
||||
}
|
||||
|
||||
|
|
@ -67,11 +67,11 @@ bool CoinCounter::isWait() const {
|
|||
}
|
||||
|
||||
void CoinCounter::tryStart() {
|
||||
if (al::isNerve(this, &NrvCoinCounter.Appear)) {
|
||||
if (al::isNerve(this, &NrvCoinCounter.End)) {
|
||||
al::startAction(this, "Appear", nullptr);
|
||||
updateCountImmidiate();
|
||||
al::LayoutActor::appear();
|
||||
al::setNerve(this, &NrvCoinCounter.End);
|
||||
al::setNerve(this, &NrvCoinCounter.Appear);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -85,8 +85,8 @@ void CoinCounter::updateCountImmidiate() {
|
|||
}
|
||||
|
||||
void CoinCounter::tryEnd() {
|
||||
if (!al::isNerve(this, &NrvCoinCounter.Appear))
|
||||
al::setNerve(this, &NrvCoinCounter.Appear);
|
||||
if (!al::isNerve(this, &NrvCoinCounter.End))
|
||||
al::setNerve(this, &NrvCoinCounter.End);
|
||||
}
|
||||
|
||||
void CoinCounter::startCountAnim(s32 coinNum) {
|
||||
|
|
@ -96,9 +96,9 @@ void CoinCounter::startCountAnim(s32 coinNum) {
|
|||
mTotalCoins = getCountTotalFromData();
|
||||
|
||||
if (coinNum < prevCoinCount)
|
||||
al::setNerve(this, &NrvCoinCounter.Sub);
|
||||
al::setNerve(this, &NrvCoinCounter.CountAnimSub);
|
||||
else
|
||||
al::setNerve(this, &NrvCoinCounter.Add);
|
||||
al::setNerve(this, &NrvCoinCounter.CountAnimAdd);
|
||||
}
|
||||
|
||||
bool CoinCounter::tryUpdateCount() {
|
||||
|
|
@ -112,9 +112,9 @@ bool CoinCounter::tryUpdateCount() {
|
|||
|
||||
al::Nerve* nerve;
|
||||
if (mTotalCoins < newTotalCoins)
|
||||
nerve = &NrvCoinCounter.CountAnimAdd;
|
||||
nerve = &NrvCoinCounter.Add;
|
||||
else
|
||||
nerve = &NrvCoinCounter.CountAnimSub;
|
||||
nerve = &NrvCoinCounter.Sub;
|
||||
|
||||
mTotalCoins = newTotalCoins;
|
||||
mCoinNum = newCoinNum;
|
||||
|
|
|
|||
Loading…
Reference in a new issue