Allow creating script from direct string instead of invoking load function.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-02-16 13:33:58 +01:00
parent a31477d4cb
commit bb06026587
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 4 additions and 1 deletions

View File

@ -113,5 +113,7 @@ void AngelScripResolver::FinalizeModule() {
void AngelScripResolver::CreateScript(ScriptCategory category, const char* scriptName) { void AngelScripResolver::CreateScript(ScriptCategory category, const char* scriptName) {
auto scriptString = _loadFunc(category, scriptName); auto scriptString = _loadFunc(category, scriptName);
_mainModule->AddScriptSection(scriptName, scriptString); _mainModule->AddScriptSection(scriptName, scriptString);
}
void AngelScripResolver::CreateScript(const char* name, const char* script) {
_mainModule->AddScriptSection(name, script);
} }

View File

@ -41,6 +41,7 @@ public:
} }
void CreateScript(ScriptCategory category, const char* scriptName); void CreateScript(ScriptCategory category, const char* scriptName);
void CreateScript(const char* name, const char* script);
void FinalizeModule(); void FinalizeModule();