From d03c33f39330121a7e42c1d70c750a4d94410f65 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 14 Apr 2017 17:40:05 +0200 Subject: [PATCH] - added Translation.GetID. --- src/r_data/r_translate.cpp | 7 +++++++ wadsrc/static/zscript/base.txt | 1 + 2 files changed, 8 insertions(+) diff --git a/src/r_data/r_translate.cpp b/src/r_data/r_translate.cpp index 3c61ec4ac..b069aa9f3 100644 --- a/src/r_data/r_translate.cpp +++ b/src/r_data/r_translate.cpp @@ -1356,6 +1356,13 @@ int R_FindCustomTranslation(FName name) return (t != nullptr)? *t : -1; } +DEFINE_ACTION_FUNCTION(_Translation, GetID) +{ + PARAM_PROLOGUE; + PARAM_NAME(t); + ACTION_RETURN_INT(R_FindCustomTranslation(t)); +} + //---------------------------------------------------------------------------- // // diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index 7d0e54213..bb941b414 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -258,6 +258,7 @@ struct Translation version("2.4") native int AddTranslation(); native static bool SetPlayerTranslation(int group, int num, int plrnum, PlayerClass pclass); + native static int GetID(Name transname); static int MakeID(int group, int num) { return (group << 16) + num;