mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 04:22:34 +00:00
- added a GetRenderStyle function to Actor, so that the internal render style can be retrieved in a format suitable for scripting.
This commit is contained in:
parent
fea2361815
commit
d0c77d7264
2 changed files with 14 additions and 1 deletions
|
@ -6796,4 +6796,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetMugshotState)
|
|||
if (self->CheckLocalView(consoleplayer))
|
||||
StatusBar->SetMugShotState(name);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// This needs to account for the fact that internally renderstyles are stored as a series of operations,
|
||||
// but the script side only cares about symbolic constants.
|
||||
DEFINE_ACTION_FUNCTION(AActor, GetRenderStyle)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AActor);
|
||||
for(unsigned i=0;i<STYLE_Count;i++)
|
||||
{
|
||||
if (self->RenderStyle == LegacyRenderStyles[i]) ACTION_RETURN_INT(i);
|
||||
}
|
||||
ACTION_RETURN_INT(-1); // no symbolic constant exists to handle this style.
|
||||
}
|
||||
|
|
|
@ -449,6 +449,7 @@ class Actor : Thinker native
|
|||
native void ChangeTid(int newtid);
|
||||
native static int FindUniqueTid(int start = 0, int limit = 0);
|
||||
native void SetShade(color col);
|
||||
native clearscope int GetRenderStyle() const;
|
||||
|
||||
native clearscope string GetTag(string defstr = "") const;
|
||||
native void SetTag(string defstr = "");
|
||||
|
|
Loading…
Reference in a new issue