diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-05-27 01:13:14 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-05-27 01:13:14 +0100 |
commit | 0de847bb4832c201233c87fa37867b9d89f0e8c8 (patch) | |
tree | f05add722b788d32aae40663e7748234452a3443 /NorthstarDLL/modlocalisation.cpp | |
parent | 2171d95e1221442081bade7929c05b82ca0f2a08 (diff) | |
download | NorthstarLauncher-0de847bb4832c201233c87fa37867b9d89f0e8c8.tar.gz NorthstarLauncher-0de847bb4832c201233c87fa37867b9d89f0e8c8.zip |
rename project folder (:tf: commit log)
Diffstat (limited to 'NorthstarDLL/modlocalisation.cpp')
-rw-r--r-- | NorthstarDLL/modlocalisation.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/NorthstarDLL/modlocalisation.cpp b/NorthstarDLL/modlocalisation.cpp new file mode 100644 index 00000000..ad01192d --- /dev/null +++ b/NorthstarDLL/modlocalisation.cpp @@ -0,0 +1,33 @@ +#include "pch.h" +#include "modmanager.h" + +AUTOHOOK_INIT() + +AUTOHOOK(AddLocalisationFile, localize.dll + 0x6D80, +bool,, (void* pVguiLocalize, const char* path, const char* pathId, char unknown), +{ + static bool bLoadModLocalisationFiles = true; + bool ret = AddLocalisationFile(pVguiLocalize, path, pathId, unknown); + + if (ret) + spdlog::info("Loaded localisation file {} successfully", path); + + if (!bLoadModLocalisationFiles) + return ret; + + bLoadModLocalisationFiles = false; + + for (Mod mod : g_pModManager->m_loadedMods) + if (mod.Enabled) + for (std::string& localisationFile : mod.LocalisationFiles) + AddLocalisationFile(pVguiLocalize, localisationFile.c_str(), pathId, unknown); + + bLoadModLocalisationFiles = true; + + return ret; +}) + +ON_DLL_LOAD_CLIENT("localize.dll", Localize, [](HMODULE baseAddress) +{ + AUTOHOOK_DISPATCH() +})
\ No newline at end of file |