aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/mods/modmanager.cpp
diff options
context:
space:
mode:
authorErlite <ys.aameziane@gmail.com>2023-02-09 01:44:44 +0100
committerGitHub <noreply@github.com>2023-02-09 00:44:44 +0000
commitb61ed18a86ddd2d7ab0e80992859750a49a9c4f6 (patch)
treed8a3dc1230d8a1da8feda6d1f41980dfa5eab15e /NorthstarDLL/mods/modmanager.cpp
parentb77baa4d09dae917c3fc9f9fc7d6b37c8d3c5205 (diff)
downloadNorthstarLauncher-1.12.3-rc1.tar.gz
NorthstarLauncher-1.12.3-rc1.zip
Add Destroy callback for squirrel scripts. (#383)v1.12.3-rc2v1.12.3-rc1v1.12.3
* Add Destroy callback for squirrel scripts. * Switch _call() to Call()
Diffstat (limited to 'NorthstarDLL/mods/modmanager.cpp')
-rw-r--r--NorthstarDLL/mods/modmanager.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/NorthstarDLL/mods/modmanager.cpp b/NorthstarDLL/mods/modmanager.cpp
index 38966236..e37df6e5 100644
--- a/NorthstarDLL/mods/modmanager.cpp
+++ b/NorthstarDLL/mods/modmanager.cpp
@@ -198,6 +198,9 @@ Mod::Mod(fs::path modDir, char* jsonBuf)
if (scriptObj["ServerCallback"].HasMember("After") && scriptObj["ServerCallback"]["After"].IsString())
callback.AfterCallback = scriptObj["ServerCallback"]["After"].GetString();
+ if (scriptObj["ServerCallback"].HasMember("Destroy") && scriptObj["ServerCallback"]["Destroy"].IsString())
+ callback.DestroyCallback = scriptObj["ServerCallback"]["Destroy"].GetString();
+
script.Callbacks.push_back(callback);
}
@@ -212,6 +215,9 @@ Mod::Mod(fs::path modDir, char* jsonBuf)
if (scriptObj["ClientCallback"].HasMember("After") && scriptObj["ClientCallback"]["After"].IsString())
callback.AfterCallback = scriptObj["ClientCallback"]["After"].GetString();
+ if (scriptObj["ClientCallback"].HasMember("Destroy") && scriptObj["ClientCallback"]["Destroy"].IsString())
+ callback.DestroyCallback = scriptObj["ClientCallback"]["Destroy"].GetString();
+
script.Callbacks.push_back(callback);
}
@@ -226,6 +232,9 @@ Mod::Mod(fs::path modDir, char* jsonBuf)
if (scriptObj["UICallback"].HasMember("After") && scriptObj["UICallback"]["After"].IsString())
callback.AfterCallback = scriptObj["UICallback"]["After"].GetString();
+ if (scriptObj["UICallback"].HasMember("Destroy") && scriptObj["UICallback"]["Destroy"].IsString())
+ callback.DestroyCallback = scriptObj["UICallback"]["Destroy"].GetString();
+
script.Callbacks.push_back(callback);
}