Enforce bFreebiesSeen, bUpsellOwned, bModManagerMenuEnabled with DLL

This commit is contained in:
Eddoursul 2023-12-15 09:21:50 +01:00
parent 13635df9f8
commit 98e9f0c5c7
2 changed files with 10 additions and 5 deletions

BIN
SKSE/Plugins/EnderalSE.dll (Stored with Git LFS)

Binary file not shown.

View File

@ -60,6 +60,13 @@ namespace {
MapMarkerPlacement::Install(); MapMarkerPlacement::Install();
} }
} else if (message->type == MessagingInterface::kDataLoaded) { } else if (message->type == MessagingInterface::kDataLoaded) {
if (GetLoadInterface()->RuntimeVersion().minor() > 5) {
RE::INIPrefSettingCollection::GetSingleton()->GetSetting("bFreebiesSeen:General")->data.b = true;
if (GetLoadInterface()->RuntimeVersion().minor() > 6 || GetLoadInterface()->RuntimeVersion().patch() >= 1130) {
RE::INIPrefSettingCollection::GetSingleton()->GetSetting("bUpsellOwned:General")->data.b = true;
}
}
const auto dataHandler = RE::TESDataHandler::GetSingleton(); const auto dataHandler = RE::TESDataHandler::GetSingleton();
if (dataHandler) { if (dataHandler) {
if (!dataHandler->LookupLoadedModByName("Update.esm")) { if (!dataHandler->LookupLoadedModByName("Update.esm")) {
@ -111,7 +118,6 @@ namespace {
} }
SKSEPluginLoad(const LoadInterface* skse) { SKSEPluginLoad(const LoadInterface* skse) {
std::string filenames[4] = { std::string filenames[4] = {
"fs.dll", "fs.dll",
"fs_se.dll", "fs_se.dll",
@ -155,9 +161,8 @@ SKSEPluginLoad(const LoadInterface* skse) {
Init(skse); Init(skse);
InitializeMessaging(); InitializeMessaging();
auto setting = RE::INISettingCollection::GetSingleton()->GetSetting("sIntroSequence:General"); RE::INISettingCollection::GetSingleton()->GetSetting("sIntroSequence:General")->data.s = nullptr;
setting->data.s = nullptr; RE::INISettingCollection::GetSingleton()->GetSetting("bModManagerMenuEnabled:General")->data.b = false;
RE::INISettingCollection::GetSingleton()->WriteSetting(setting);
EventListener::Install(); EventListener::Install();