Read version from file
This commit is contained in:
parent
27d46d3033
commit
bc7488c8d0
1
SKSE/Plugins/EnderalVersion.ini
Normal file
1
SKSE/Plugins/EnderalVersion.ini
Normal file
@ -0,0 +1 @@
|
||||
version = 2.0.12.3
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include "CheckInvalidForms.h"
|
||||
#include <SimpleIni.h>
|
||||
#include <regex>
|
||||
|
||||
inline const SKSE::LoadInterface* GetLoadInterface(const SKSE::LoadInterface* loadInterface = nullptr)
|
||||
{
|
||||
@ -56,7 +57,23 @@ inline void SetINISettings()
|
||||
|
||||
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();
|
||||
CheckWorldspaces();
|
||||
|
Loading…
Reference in New Issue
Block a user