mirror of
https://github.com/MonsterDruide1/OdysseyDecomp
synced 2026-04-23 09:04:21 +00:00
Library/Event: Implement EventFlowNodeActionOneTime (#952)
This commit is contained in:
parent
33097d8def
commit
117f9279c4
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -18,4 +18,6 @@ private:
|
|||
f32 mActionFrameRate = -1.0f;
|
||||
bool mIsStartRandomFrame = false;
|
||||
};
|
||||
|
||||
static_assert(sizeof(EventFlowNodeActionLoop) == 0x80);
|
||||
} // namespace al
|
||||
|
|
|
|||
28
lib/al/Library/Event/EventFlowNodeActionOneTime.cpp
Normal file
28
lib/al/Library/Event/EventFlowNodeActionOneTime.cpp
Normal 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
|
||||
20
lib/al/Library/Event/EventFlowNodeActionOneTime.h
Normal file
20
lib/al/Library/Event/EventFlowNodeActionOneTime.h
Normal 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
|
||||
Loading…
Reference in a new issue