Skip to content

Commit

Permalink
Layout: Implement TestFilterGlasses (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
GRAnimated authored Jan 19, 2025
1 parent 46fc505 commit 8aed37d
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 11 deletions.
22 changes: 11 additions & 11 deletions data/odyssey_functions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -12894,17 +12894,17 @@ Address,Quality,Size,Name
0x000000710020e88c,U,000008,_ZNK12_GLOBAL__N_128TalkMessageNrvAppearWithText7executeEPN2al11NerveKeeperE
0x000000710020e894,U,000008,_ZNK12_GLOBAL__N_120TalkMessageNrvAppear7executeEPN2al11NerveKeeperE
0x000000710020e89c,U,000128,_ZNK12_GLOBAL__N_126TalkMessageNrvIconPageNext7executeEPN2al11NerveKeeperE
0x000000710020e91c,U,000184,_ZN17TestFilterGlassesC2EPKcRKN2al14LayoutInitInfoES1_
0x000000710020e9d4,U,000196,_ZN17TestFilterGlassesC1EPKcRKN2al14LayoutInitInfoES1_
0x000000710020ea98,U,000052,_ZN17TestFilterGlasses11startAppearEv
0x000000710020eacc,U,000012,_ZN17TestFilterGlasses3endEv
0x000000710020ead8,U,000100,_ZN17TestFilterGlasses9exeAppearEv
0x000000710020eb3c,U,000064,_ZN17TestFilterGlasses7exeWaitEv
0x000000710020eb7c,U,000100,_ZN17TestFilterGlasses6exeEndEv
0x000000710020ebe0,U,000028,_ZNK17TestFilterGlasses5isEndEv
0x000000710020ebfc,U,000104,_ZNK12_GLOBAL__N_126TestFilterGlassesNrvAppear7executeEPN2al11NerveKeeperE
0x000000710020ec64,U,000104,_ZNK12_GLOBAL__N_123TestFilterGlassesNrvEnd7executeEPN2al11NerveKeeperE
0x000000710020eccc,U,000068,_ZNK12_GLOBAL__N_124TestFilterGlassesNrvWait7executeEPN2al11NerveKeeperE
0x000000710020e91c,O,000184,_ZN17TestFilterGlassesC2EPKcRKN2al14LayoutInitInfoES1_
0x000000710020e9d4,O,000196,_ZN17TestFilterGlassesC1EPKcRKN2al14LayoutInitInfoES1_
0x000000710020ea98,O,000052,_ZN17TestFilterGlasses11startAppearEv
0x000000710020eacc,O,000012,_ZN17TestFilterGlasses3endEv
0x000000710020ead8,O,000100,_ZN17TestFilterGlasses9exeAppearEv
0x000000710020eb3c,O,000064,_ZN17TestFilterGlasses7exeWaitEv
0x000000710020eb7c,O,000100,_ZN17TestFilterGlasses6exeEndEv
0x000000710020ebe0,O,000028,_ZNK17TestFilterGlasses5isEndEv
0x000000710020ebfc,O,000104,_ZNK12_GLOBAL__N_126TestFilterGlassesNrvAppear7executeEPN2al11NerveKeeperE
0x000000710020ec64,O,000104,_ZNK12_GLOBAL__N_123TestFilterGlassesNrvEnd7executeEPN2al11NerveKeeperE
0x000000710020eccc,O,000068,_ZNK12_GLOBAL__N_124TestFilterGlassesNrvWait7executeEPN2al11NerveKeeperE
0x000000710020ed10,U,000248,_ZN18TestGrafittiLayoutC2ERKN2al14LayoutInitInfoE
0x000000710020ee08,U,000256,_ZN18TestGrafittiLayoutC1ERKN2al14LayoutInitInfoE
0x000000710020ef08,U,000044,_ZN18TestGrafittiLayout6appearEv
Expand Down
53 changes: 53 additions & 0 deletions src/Layout/TestFilterGlasses.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#include "Layout/TestFilterGlasses.h"

#include "Library/Layout/LayoutActionFunction.h"
#include "Library/Layout/LayoutInitInfo.h"
#include "Library/Nerve/NerveSetupUtil.h"

namespace {
NERVE_IMPL(TestFilterGlasses, Appear);
NERVE_IMPL(TestFilterGlasses, End);
NERVE_IMPL(TestFilterGlasses, Wait);

NERVES_MAKE_NOSTRUCT(TestFilterGlasses, Appear, End, Wait);
} // namespace

TestFilterGlasses::TestFilterGlasses(const char* name, const al::LayoutInitInfo& info,
const char* suffix)
: al::LayoutActor(name) {
al::initLayoutActor(this, info, "FilterGlasses", suffix);
initNerve(&Appear, 0);
kill();
}

void TestFilterGlasses::startAppear() {
appear();
al::setNerve(this, &Appear);
}

void TestFilterGlasses::end() {
al::setNerve(this, &End);
}

void TestFilterGlasses::exeAppear() {
if (al::isFirstStep(this))
al::startAction(this, "Appear", nullptr);
if (al::isActionEnd(this, nullptr))
al::setNerve(this, &Wait);
}

void TestFilterGlasses::exeWait() {
if (al::isFirstStep(this))
al::startAction(this, "Wait", nullptr);
}

void TestFilterGlasses::exeEnd() {
if (al::isFirstStep(this))
al::startAction(this, "End", nullptr);
if (al::isActionEnd(this, nullptr))
kill();
}

bool TestFilterGlasses::isEnd() const {
return !isAlive() || al::isNerve(this, &End);
}
20 changes: 20 additions & 0 deletions src/Layout/TestFilterGlasses.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once

#include "Library/Layout/LayoutActor.h"

namespace al {
class LayoutInitInfo;
}

class TestFilterGlasses : public al::LayoutActor {
public:
TestFilterGlasses(const char* name, const al::LayoutInitInfo& info, const char* suffix);

void startAppear();
void end();

void exeAppear();
void exeWait();
void exeEnd();
bool isEnd() const;
};

0 comments on commit 8aed37d

Please sign in to comment.