4
Fork 0

Read version from file

master
Eddoursul 2 years ago
parent 27d46d3033
commit bc7488c8d0
  1. 1
      SKSE/Plugins/EnderalVersion.ini
  2. 19
      source/Enderal DLL/src/Util.h

@ -0,0 +1 @@
version = 2.0.12.3

@ -2,6 +2,7 @@
#include "CheckInvalidForms.h" #include "CheckInvalidForms.h"
#include <SimpleIni.h> #include <SimpleIni.h>
#include <regex>
inline const SKSE::LoadInterface* GetLoadInterface(const SKSE::LoadInterface* loadInterface = nullptr) inline const SKSE::LoadInterface* GetLoadInterface(const SKSE::LoadInterface* loadInterface = nullptr)
{ {
@ -56,7 +57,23 @@ inline void SetINISettings()
inline void CheckIncompatibleMods() inline void CheckIncompatibleMods()
{ {
RE::ConsoleLog::GetSingleton()->Print("Loaded SureAI's Enderal: Forgotten Stories | Special Edition v2.0.12 by Eddoursul and contributors"); bool bPrinted = false;
if (std::filesystem::exists("Data\\SKSE\\Plugins\\EnderalVersion.ini")) {
CSimpleIniA ini;
ini.SetUnicode(false);
ini.SetMultiKey(false);
ini.LoadFile("Data/SKSE/Plugins/EnderalVersion.ini");
const char* version = ini.GetValue("", "version", "2.0.x");
std::regex version_expr("^[\\d\\.]+$");
if (std::regex_match(version, version_expr)) {
RE::ConsoleLog::GetSingleton()->Print(std::format("Loaded SureAI's Enderal: Forgotten Stories | Special Edition v{} by Eddoursul and contributors", version).c_str());
bPrinted = true;
}
}
if (!bPrinted) {
RE::ConsoleLog::GetSingleton()->Print("Loaded SureAI's Enderal: Forgotten Stories | Special Edition v2.0.x by Eddoursul and contributors");
}
CheckBlacklist(); CheckBlacklist();
CheckWorldspaces(); CheckWorldspaces();

Loading…
Cancel
Save