aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/scriptsrson.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/scriptsrson.cpp')
-rw-r--r--NorthstarDLL/scriptsrson.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/NorthstarDLL/scriptsrson.cpp b/NorthstarDLL/scriptsrson.cpp
index 2346e7e1..1e0ded27 100644
--- a/NorthstarDLL/scriptsrson.cpp
+++ b/NorthstarDLL/scriptsrson.cpp
@@ -12,15 +12,12 @@ void ModManager::BuildScriptsRson()
fs::path MOD_SCRIPTS_RSON_PATH = fs::path(GetCompiledAssetsPath() / MOD_SCRIPTS_RSON_SUFFIX);
fs::remove(MOD_SCRIPTS_RSON_PATH);
- // not really important since it doesn't affect actual functionality at all, but the rson we output is really weird
- // has a shitload of newlines added, even in places where we don't modify it at all
-
- std::string scriptsRson = ReadVPKOriginalFile(VPK_SCRIPTS_RSON_PATH);
+ std::string scriptsRson = R2::ReadVPKOriginalFile(VPK_SCRIPTS_RSON_PATH);
scriptsRson += "\n\n// START MODDED SCRIPT CONTENT\n\n"; // newline before we start custom stuff
- for (Mod& mod : m_loadedMods)
+ for (Mod& mod : m_LoadedMods)
{
- if (!mod.Enabled)
+ if (!mod.m_bEnabled)
continue;
// this isn't needed at all, just nice to have imo
@@ -38,7 +35,7 @@ void ModManager::BuildScriptsRson()
]*/
scriptsRson += "When: \"";
- scriptsRson += script.RsonRunOn;
+ scriptsRson += script.RunOn;
scriptsRson += "\"\n";
scriptsRson += "Scripts:\n[\n\t";
@@ -54,13 +51,13 @@ void ModManager::BuildScriptsRson()
writeStream.close();
ModOverrideFile overrideFile;
- overrideFile.owningMod = nullptr;
- overrideFile.path = VPK_SCRIPTS_RSON_PATH;
+ overrideFile.m_pOwningMod = nullptr;
+ overrideFile.m_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));
+ 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;
+ 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