Library/Event: Implement EventFlowNode (#918)

This commit is contained in:
Fuzzy2319 2026-02-24 21:56:09 +01:00 committed by GitHub
parent b65ba0f9c0
commit b52cd38bf9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 107 additions and 19 deletions

View file

@ -45266,57 +45266,57 @@ Event/EventFlowNodeAmiiboTouchLayout.o:
- offset: 0x1b10b0
size: 8
label: _ZNK2al13EventFlowNode22getEventFlowDataHolderEv
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x1b10b8
size: 4
label: _ZN2al13EventFlowNode14initAfterChartEv
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x1b10bc
size: 4
label: _ZN2al13EventFlowNode18initAfterPlacementEv
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x1b10c0
size: 8
label: _ZN2al13EventFlowNode3endEv
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x1b10c8
size: 4
label: _ZN2al13EventFlowNode7controlEv
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x1b10cc
size: 8
label: _ZNK2al13EventFlowNode12getNextEntryEv
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x1b10d4
size: 8
label: _ZNK2al13EventFlowNode16getMessageSystemEv
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x1b10dc
size: 8
label: _ZNK2al13EventFlowNode14getNerveKeeperEv
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x1b10e4
size: 8
label: _ZNK2al13EventFlowNode15isEnableEndForkEv
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x1b10ec
size: 8
label: _ZThn8_NK2al13EventFlowNode16getMessageSystemEv
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x1b10f4
size: 8
label: _ZThn16_NK2al13EventFlowNode14getNerveKeeperEv
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x1b10fc
size: 88
@ -45374,7 +45374,7 @@ Event/EventFlowNodeAppearMapAmiiboHint.o:
- offset: 0x1b1554
size: 8
label: _ZNK2al13EventFlowNode9getNextIdEv
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x1b155c
size: 20
@ -46213,7 +46213,7 @@ Event/EventFlowNodeBindKeepDemoStart.o:
- offset: 0x1b5f8c
size: 12
label: _ZN2al13EventFlowNode5startEv
status: NotDecompiled
status: Matching
lazy: true
- offset: 0x1b5f98
size: 68
@ -237722,7 +237722,7 @@ Library/Event/EventFlowMovementWait.o:
label: _ZNK2al21EventFlowMovementWait21isWaitAtPointMovementEv
status: NotDecompiled
lazy: true
Library/Event/EventFlowNode.o:
Library/Event/EventFlowMovementWander.o:
'.text':
- offset: 0x88d4f8
size: 88
@ -237774,25 +237774,26 @@ Library/Event/EventFlowNode.o:
size: 20
label: ''
status: NotDecompiled
Library/Event/EventFlowNode.o:
'.text':
- offset: 0x88dc2c
size: 60
label:
- _ZN2al13EventFlowNodeC1EPKc
- _ZN2al13EventFlowNodeC2EPKc
status: NotDecompiled
status: Matching
- offset: 0x88dc68
size: 76
label: _ZN2al13EventFlowNode9initNerveEPKNS_5NerveEi
status: NotDecompiled
status: Matching
- offset: 0x88dcb4
size: 52
label: _ZN2al13EventFlowNode7executeEv
status: NotDecompiled
status: Matching
- offset: 0x88dce8
size: 4
label: _ZN2al13EventFlowNode4initERKNS_21EventFlowNodeInitInfoE
status: NotDecompiled
lazy: true
status: Matching
Library/Event/EventFlowNodeActionLoop.o:
'.text':
- offset: 0x88dcec

View file

@ -0,0 +1,20 @@
#include "Library/Event/EventFlowNode.h"
#include "Library/Nerve/NerveKeeper.h"
namespace al {
EventFlowNode::EventFlowNode(const char* name) : mName(name) {}
void EventFlowNode::initNerve(const Nerve* nerve, s32 maxStates) {
mNerveKeeper = new NerveKeeper(this, nerve, maxStates);
}
void EventFlowNode::execute() {
if (mNerveKeeper)
mNerveKeeper->update();
control();
}
void EventFlowNode::init(const EventFlowNodeInitInfo& initInfo) {}
} // namespace al

View file

@ -0,0 +1,67 @@
#pragma once
#include <basis/seadTypes.h>
#include "Library/Event/IUseEventFlowData.h"
#include "Library/HostIO/HioNode.h"
#include "Library/Message/IUseMessageSystem.h"
#include "Library/Nerve/IUseNerve.h"
namespace al {
class Nerve;
class LiveActor;
class SceneEventFlowMsg;
class EventFlowNodeHolder;
class EventFlowNodeCaseEventHolder;
class EventFlowNodeInitInfo;
class EventFlowNode : public IUseEventFlowData,
public IUseMessageSystem,
public IUseNerve,
public IUseHioNode {
public:
EventFlowNode(const char* name);
EventFlowDataHolder* getEventFlowDataHolder() const override { return mEventFlowDataHolder; }
virtual void init(const EventFlowNodeInitInfo& initInfo);
virtual void initAfterChart() {}
virtual void initAfterPlacement() {}
virtual void start() { mIsStarted = true; }
virtual void end() { mIsStarted = false; }
virtual void control() {}
virtual s32 getNextId() const { return mNextId; }
virtual const char* getNextEntry() const { return nullptr; }
const MessageSystem* getMessageSystem() const override { return mMessageSystem; }
NerveKeeper* getNerveKeeper() const override { return mNerveKeeper; }
virtual bool isEnableEndFork() const { return false; }
void initNerve(const Nerve* nerve, s32 maxStates);
void execute();
private:
LiveActor* mActor = nullptr;
s32 mId = -1;
s32 mNextId = -1;
const char* mName;
bool mIsStarted = false;
EventFlowDataHolder* mEventFlowDataHolder = nullptr;
EventFlowNodeHolder* mEventFlowNodeHolder = nullptr;
EventFlowNodeCaseEventHolder* mEventFlowNodeCaseEventHolder = nullptr;
SceneEventFlowMsg* mSceneEventFlowMsg = nullptr;
MessageSystem* mMessageSystem = nullptr;
NerveKeeper* mNerveKeeper = nullptr;
};
static_assert(sizeof(EventFlowNode) == 0x68);
} // namespace al