From bb06026587c7981853e77ff9f44228057e32c11f Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 16 Feb 2020 13:33:58 +0100 Subject: [PATCH] Allow creating script from direct string instead of invoking load function. --- src/ScriptResolving/AngelScript/AngelScripResolver.cpp | 4 +++- src/ScriptResolving/AngelScript/AngelScripResolver.hpp | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ScriptResolving/AngelScript/AngelScripResolver.cpp b/src/ScriptResolving/AngelScript/AngelScripResolver.cpp index bd70e17..e9f7395 100644 --- a/src/ScriptResolving/AngelScript/AngelScripResolver.cpp +++ b/src/ScriptResolving/AngelScript/AngelScripResolver.cpp @@ -113,5 +113,7 @@ void AngelScripResolver::FinalizeModule() { void AngelScripResolver::CreateScript(ScriptCategory category, const char* scriptName) { auto scriptString = _loadFunc(category, scriptName); _mainModule->AddScriptSection(scriptName, scriptString); - +} +void AngelScripResolver::CreateScript(const char* name, const char* script) { + _mainModule->AddScriptSection(name, script); } diff --git a/src/ScriptResolving/AngelScript/AngelScripResolver.hpp b/src/ScriptResolving/AngelScript/AngelScripResolver.hpp index 9d823bd..e5ef710 100644 --- a/src/ScriptResolving/AngelScript/AngelScripResolver.hpp +++ b/src/ScriptResolving/AngelScript/AngelScripResolver.hpp @@ -41,6 +41,7 @@ public: } void CreateScript(ScriptCategory category, const char* scriptName); + void CreateScript(const char* name, const char* script); void FinalizeModule();