Improvements for VisualThinkers
Added BeginPlay virtual that's called after construction. Added getter for render style in ZScript.
This commit is contained in:
parent
98b5d8b1d2
commit
3db1ee9a1e
3 changed files with 26 additions and 2 deletions
|
|
@ -1052,6 +1052,16 @@ DVisualThinker* DVisualThinker::NewVisualThinker(FLevelLocals* Level, PClass* ty
|
|||
|
||||
auto zs = static_cast<DVisualThinker*>(Level->CreateThinker(type, DVisualThinker::DEFAULT_STAT));
|
||||
zs->Construct();
|
||||
|
||||
IFOVERRIDENVIRTUALPTRNAME(zs, NAME_VisualThinker, BeginPlay)
|
||||
{
|
||||
VMValue params[] = { zs };
|
||||
VMCall(func, params, 1, nullptr, 0);
|
||||
|
||||
if (zs->ObjectFlags & OF_EuthanizeMe)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return zs;
|
||||
}
|
||||
|
||||
|
|
@ -1269,11 +1279,22 @@ DEFINE_ACTION_FUNCTION_NATIVE(DVisualThinker, SetRenderStyle, SetRenderStyle)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int DVisualThinker::GetRenderStyle()
|
||||
int DVisualThinker::GetRenderStyle() const
|
||||
{
|
||||
return PT.style;
|
||||
}
|
||||
|
||||
static int GetRenderStyle(DVisualThinker* self)
|
||||
{
|
||||
return self->GetRenderStyle();
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(DVisualThinker, GetRenderStyle, GetRenderStyle)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(DVisualThinker);
|
||||
ACTION_RETURN_INT(self->GetRenderStyle());
|
||||
}
|
||||
|
||||
float DVisualThinker::GetOffset(bool y) const // Needed for the renderer.
|
||||
{
|
||||
if (y)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue