From 33beca6e6fa70addbb2184c71ba2731b4539206e Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 7 Aug 2017 15:24:18 +0300 Subject: [PATCH] Exposed ToLower() and ToUpper() string functions to ZScript https://forum.zdoom.org/viewtopic.php?t=57515 --- src/scripting/thingdef_data.cpp | 13 +++++++++++++ wadsrc/static/zscript/base.txt | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index f7b84f21b..274c865bf 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -1267,3 +1267,16 @@ DEFINE_ACTION_FUNCTION(FStringStruct, LastIndexOf) ACTION_RETURN_INT(self->LastIndexOf(substr)); } +DEFINE_ACTION_FUNCTION(FStringStruct, ToUpper) +{ + PARAM_SELF_STRUCT_PROLOGUE(FString); + self->ToUpper(); + return 0; +} + +DEFINE_ACTION_FUNCTION(FStringStruct, ToLower) +{ + PARAM_SELF_STRUCT_PROLOGUE(FString); + self->ToLower(); + return 0; +} diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index b2fd9c6c8..b7607d555 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -658,6 +658,8 @@ struct StringStruct native native String Filter(); native int IndexOf(String substr, int startIndex = 0) const; native int LastIndexOf(String substr) const; + native void ToUpper(); + native void ToLower(); } class SectorEffect : Thinker native