From 950304dbeff0163b90a9e5d97fabac3d13942067 Mon Sep 17 00:00:00 2001 From: guymakinggames <66076221+guymakinggames@users.noreply.github.com> Date: Wed, 22 Apr 2026 09:55:56 +0100 Subject: [PATCH] Layout: Implement CursorParts --- data/file_list.yml | 28 ++++++++-------- src/Layout/CursorParts.cpp | 68 ++++++++++++++++++++++++++++++++++++++ src/Layout/CursorParts.h | 22 ++++++++++++ 3 files changed, 104 insertions(+), 14 deletions(-) create mode 100644 src/Layout/CursorParts.cpp create mode 100644 src/Layout/CursorParts.h diff --git a/data/file_list.yml b/data/file_list.yml index 64c53263..96fd6478 100644 --- a/data/file_list.yml +++ b/data/file_list.yml @@ -53113,62 +53113,62 @@ Layout/CursorParts.o: - offset: 0x1e9b4c size: 184 label: _ZN11CursorPartsC2EPN2al11LayoutActorERKNS0_14LayoutInitInfoEPKcS7_ - status: NotDecompiled + status: Matching - offset: 0x1e9c04 size: 180 label: _ZN11CursorPartsC1EPN2al11LayoutActorERKNS0_14LayoutInitInfoEPKcS7_ - status: NotDecompiled + status: Matching - offset: 0x1e9cb8 size: 68 label: _ZN11CursorParts11appearStartEv - status: NotDecompiled + status: Matching - offset: 0x1e9cfc size: 88 label: _ZN11CursorParts3endEv - status: NotDecompiled + status: Matching - offset: 0x1e9d54 size: 64 label: _ZN11CursorParts4hideEv - status: NotDecompiled + status: Matching - offset: 0x1e9d94 size: 100 label: _ZN11CursorParts15tryAppearIfHideEv - status: NotDecompiled + status: Matching - offset: 0x1e9df8 size: 68 label: _ZN11CursorParts9exeAppearEv - status: NotDecompiled + status: Matching - offset: 0x1e9e3c size: 64 label: _ZN11CursorParts7exeWaitEv - status: NotDecompiled + status: Matching - offset: 0x1e9e7c size: 68 label: _ZN11CursorParts6exeEndEv - status: NotDecompiled + status: Matching - offset: 0x1e9ec0 size: 12 label: _ZN11CursorParts7exeHideEv - status: NotDecompiled + status: Matching - offset: 0x1e9ecc size: 68 label: _ZNK12_GLOBAL__N_120CursorPartsNrvAppear7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true - offset: 0x1e9f10 size: 68 label: _ZNK12_GLOBAL__N_117CursorPartsNrvEnd7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true - offset: 0x1e9f54 size: 16 label: _ZNK12_GLOBAL__N_118CursorPartsNrvHide7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true - offset: 0x1e9f64 size: 68 label: _ZNK12_GLOBAL__N_118CursorPartsNrvWait7executeEPN2al11NerveKeeperE - status: NotDecompiled + status: Matching guess: true Layout/DecideIconLayout.o: '.text': diff --git a/src/Layout/CursorParts.cpp b/src/Layout/CursorParts.cpp new file mode 100644 index 00000000..62254518 --- /dev/null +++ b/src/Layout/CursorParts.cpp @@ -0,0 +1,68 @@ +#include "Layout/CursorParts.h" + +#include "Library/Layout/LayoutActionFunction.h" +#include "Library/Layout/LayoutInitInfo.h" +#include "Library/Nerve/NerveSetupUtil.h" +#include "Library/Nerve/NerveUtil.h" + +namespace { +NERVE_IMPL(CursorParts, Appear); +NERVE_IMPL(CursorParts, End); +NERVE_IMPL(CursorParts, Hide); +NERVE_IMPL(CursorParts, Wait); + +NERVES_MAKE_NOSTRUCT(CursorParts, End, Wait, Appear, Hide); +} // namespace + +CursorParts::CursorParts(al::LayoutActor* parentLayout, const al::LayoutInitInfo& info, + const char* name, const char* archiveName) + : al::LayoutActor(name) { + al::initLayoutPartsActor(this, parentLayout, info, archiveName); + initNerve(&Appear); +} + +void CursorParts::appearStart() { + al::startAction(this, "Appear"); + al::LayoutActor::appear(); + al::setNerve(this, &Appear); +} + +void CursorParts::end() { + if (al::isNerve(this, &End)) + return; + + al::startAction(this, "End"); + al::setNerve(this, &End); +} + +void CursorParts::hide() { + al::startAction(this, "Hide"); + al::setNerve(this, &Hide); +} + +void CursorParts::tryAppearIfHide() { + if (al::isNerve(this, &Hide)) { + al::startAction(this, "Appear"); + al::LayoutActor::appear(); + al::setNerve(this, &Appear); + } +} + +void CursorParts::exeAppear() { + if (al::isActionEnd(this)) + al::setNerve(this, &Wait); +} + +void CursorParts::exeWait() { + if (al::isFirstStep(this)) + al::startAction(this, "Wait"); +} + +void CursorParts::exeEnd() { + if (al::isActionEnd(this)) + kill(); +} + +void CursorParts::exeHide() { + kill(); +} diff --git a/src/Layout/CursorParts.h b/src/Layout/CursorParts.h new file mode 100644 index 00000000..58b08d76 --- /dev/null +++ b/src/Layout/CursorParts.h @@ -0,0 +1,22 @@ +#pragma once + +#include "Library/Layout/LayoutActor.h" + +namespace al { +class LayoutInitInfo; +} + +class CursorParts : public al::LayoutActor { +public: + CursorParts(al::LayoutActor* parentLayout, const al::LayoutInitInfo& info, const char* name, + const char* archiveName); + + void appearStart(); + void end(); + void hide(); + void tryAppearIfHide(); + void exeAppear(); + void exeWait(); + void exeEnd(); + void exeHide(); +};