aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/scriptsrson.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-07-28 04:16:20 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-07-28 04:16:20 +0100
commita5a937d19fcb51fe4168345d09596784e174726e (patch)
tree08eaf40ed362348c1ea187a477b71f70c6fe74a1 /NorthstarDedicatedTest/scriptsrson.cpp
parent5ed2fbecaa3a96b69b97d889a28bd2f96fcf2572 (diff)
downloadNorthstarLauncher-a5a937d19fcb51fe4168345d09596784e174726e.tar.gz
NorthstarLauncher-a5a937d19fcb51fe4168345d09596784e174726e.zip
improve lookup speeds for mod files
Diffstat (limited to 'NorthstarDedicatedTest/scriptsrson.cpp')
-rw-r--r--NorthstarDedicatedTest/scriptsrson.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/NorthstarDedicatedTest/scriptsrson.cpp b/NorthstarDedicatedTest/scriptsrson.cpp
index 1f08e7f1..b5aef421 100644
--- a/NorthstarDedicatedTest/scriptsrson.cpp
+++ b/NorthstarDedicatedTest/scriptsrson.cpp
@@ -20,6 +20,11 @@ void ModManager::BuildScriptsRson()
for (Mod* mod : m_loadedMods)
{
+ // this isn't needed at all, just nice to have imo
+ scriptsRson += "// MOD: ";
+ scriptsRson += mod->Name;
+ scriptsRson += ":\n\n";
+
for (ModScript* script : mod->Scripts)
{
/* should create something with this format for each script
@@ -47,8 +52,12 @@ void ModManager::BuildScriptsRson()
ModOverrideFile* overrideFile = new ModOverrideFile;
overrideFile->owningMod = nullptr;
- overrideFile->path = "scripts/vscripts/scripts.rson";
- m_modFiles.push_back(overrideFile);
+ overrideFile->path = VPK_SCRIPTS_RSON_PATH;
+
+ if (m_modFiles.find(VPK_SCRIPTS_RSON_PATH) == m_modFiles.end())
+ m_modFiles.insert(std::make_pair(VPK_SCRIPTS_RSON_PATH, overrideFile));
+ else
+ m_modFiles[VPK_SCRIPTS_RSON_PATH] = overrideFile;
// todo: for preventing dupe scripts in scripts.rson, we could actually parse when conditions with the squirrel vm, just need a way to get a result out of squirrelmanager.ExecuteCode
// this would probably be the best way to do this, imo