From fc7bb4a7e674cf47eb9363a51e4adc22b6a2b607 Mon Sep 17 00:00:00 2001 From: Boondorl <59555366+Boondorl@users.noreply.github.com> Date: Thu, 10 Nov 2022 22:48:59 -0500 Subject: [PATCH] Exposed LevelLocals' LookupString functionality --- src/scripting/vmthunks.cpp | 13 +++++++++++++ wadsrc/static/zscript/doombase.zs | 1 + 2 files changed, 14 insertions(+) diff --git a/src/scripting/vmthunks.cpp b/src/scripting/vmthunks.cpp index 10220fd639..a5ee95448a 100644 --- a/src/scripting/vmthunks.cpp +++ b/src/scripting/vmthunks.cpp @@ -2450,6 +2450,19 @@ DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, SphericalCoords, SphericalCoords) ACTION_RETURN_VEC3(result); } +static void LookupString(FLevelLocals *level, uint32_t index, FString *res) +{ + *res = level->Behaviors.LookupString(index); +} + +DEFINE_ACTION_FUNCTION_NATIVE(FLevelLocals, LookupString, LookupString) +{ + PARAM_SELF_STRUCT_PROLOGUE(FLevelLocals); + PARAM_UINT(index); + FString res; + LookupString(self, index, &res); + ACTION_RETURN_STRING(res); +} static int isFrozen(FLevelLocals *self) { diff --git a/wadsrc/static/zscript/doombase.zs b/wadsrc/static/zscript/doombase.zs index 1d6210bc5c..b7377baa36 100644 --- a/wadsrc/static/zscript/doombase.zs +++ b/wadsrc/static/zscript/doombase.zs @@ -474,6 +474,7 @@ struct LevelLocals native native vector3, int PickPlayerStart(int pnum, int flags = 0); native int isFrozen() const; native void setFrozen(bool on); + native string LookupString(uint index); native clearscope Sector PointInSector(Vector2 pt) const;