MCPcopy Create free account
hub / github.com/R2Northstar/NorthstarLauncher / CompileAssetsForFile

Method CompileAssetsForFile

primedev/mods/modmanager.cpp:829–856  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

827}
828
829void ModManager::CompileAssetsForFile(const char* filename)
830{
831 size_t fileHash = STR_HASH(NormaliseModFilePath(fs::path(filename)));
832
833 if (fileHash == m_hScriptsRsonHash)
834 BuildScriptsRson();
835 else if (fileHash == m_hPdefHash)
836 BuildPdef();
837 else if (fileHash == m_hKBActHash)
838 BuildKBActionsList();
839 else if (fileHash == m_particlesManifestHash)
840 BuildParticlesManifest();
841 else
842 {
843 // check if we should build keyvalues, depending on whether any of our mods have patch kvs for this file
844 for (Mod& mod : m_LoadedMods)
845 {
846 if (!mod.m_bEnabled)
847 continue;
848
849 if (mod.KeyValues.find(fileHash) != mod.KeyValues.end())
850 {
851 TryBuildKeyValues(filename);
852 return;
853 }
854 }
855 }
856}
857
858void ConCommand_reload_mods(const CCommand& args)
859{

Callers 1

TryReplaceFileFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected