Library/Event: Implement EventFlowNodeActionOneTime (#952)

This commit is contained in:
Fuzzy2319 2026-03-14 14:17:34 +01:00 committed by GitHub
parent 33097d8def
commit 117f9279c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 54 additions and 4 deletions

View file

@ -237819,19 +237819,19 @@ Library/Event/EventFlowNodeActionOneTime.o:
label:
- _ZN2al26EventFlowNodeActionOneTimeC1EPKc
- _ZN2al26EventFlowNodeActionOneTimeC2EPKc
status: NotDecompiled
status: Matching
- offset: 0x88dea8
size: 72
label: _ZN2al26EventFlowNodeActionOneTime4initERKNS_21EventFlowNodeInitInfoE
status: NotDecompiled
status: Matching
- offset: 0x88def0
size: 80
label: _ZN2al26EventFlowNodeActionOneTime5startEv
status: NotDecompiled
status: Matching
- offset: 0x88df40
size: 64
label: _ZN2al26EventFlowNodeActionOneTime7controlEv
status: NotDecompiled
status: Matching
Library/Event/EventFlowNodeActorKill.o:
'.text':
- offset: 0x88df80

View file

@ -18,4 +18,6 @@ private:
f32 mActionFrameRate = -1.0f;
bool mIsStartRandomFrame = false;
};
static_assert(sizeof(EventFlowNodeActionLoop) == 0x80);
} // namespace al

View file

@ -0,0 +1,28 @@
#include "Library/Event/EventFlowNodeActionOneTime.h"
#include "Library/Event/EventFlowFunction.h"
#include "Library/Event/EventFlowUtil.h"
#include "Library/LiveActor/ActorActionFunction.h"
namespace al {
EventFlowNodeActionOneTime::EventFlowNodeActionOneTime(const char* name) : EventFlowNode(name) {}
void EventFlowNodeActionOneTime::init(const EventFlowNodeInitInfo& info) {
initEventFlowNode(this, info);
mActionName = getParamIterKeyString(info, "ActionName");
tryGetParamIterKeyFloat(&mActionFrameRate, info, "ActionFrameRate");
}
void EventFlowNodeActionOneTime::start() {
EventFlowNode::start();
startEventAction(getActor(), this, mActionName);
if (mActionFrameRate > 0.0f)
setActionFrameRate(getActor(), mActionFrameRate);
}
void EventFlowNodeActionOneTime::control() {
if (isActionEnd(getActor()))
end();
}
} // namespace al

View file

@ -0,0 +1,20 @@
#pragma once
#include "Library/Event/EventFlowNode.h"
namespace al {
class EventFlowNodeActionOneTime : public EventFlowNode {
public:
EventFlowNodeActionOneTime(const char* name);
void init(const EventFlowNodeInitInfo& info) override;
void start() override;
void control() override;
private:
const char* mActionName = nullptr;
f32 mActionFrameRate = -1.0f;
};
static_assert(sizeof(EventFlowNodeActionOneTime) == 0x78);
} // namespace al