aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/squirrel/squirrel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/squirrel/squirrel.cpp')
-rw-r--r--NorthstarDLL/squirrel/squirrel.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/NorthstarDLL/squirrel/squirrel.cpp b/NorthstarDLL/squirrel/squirrel.cpp
index 5e968daa..8761fb13 100644
--- a/NorthstarDLL/squirrel/squirrel.cpp
+++ b/NorthstarDLL/squirrel/squirrel.cpp
@@ -88,6 +88,18 @@ eSQReturnType SQReturnTypeFromString(const char* pReturnType)
return eSQReturnType::Default; // previous default value
}
+ScriptContext ScriptContextFromString(std::string string)
+{
+ if (string == "UI")
+ return ScriptContext::UI;
+ if (string == "CLIENT")
+ return ScriptContext::CLIENT;
+ if (string == "SERVER")
+ return ScriptContext::SERVER;
+ else
+ return ScriptContext::INVALID;
+}
+
const char* SQTypeNameFromID(int type)
{
switch (type)