From 09f7922554bf3e9e02f61e3c27746c45f2b88534 Mon Sep 17 00:00:00 2001 From: Eddoursul Date: Thu, 29 Sep 2022 21:41:38 +0200 Subject: [PATCH] Added Address Library for 1.6.659; removed INI manipulation, failing in the GOG release --- SKSE/Plugins/EnderalSE.dll | 4 +- SKSE/Plugins/versionlib-1-6-659-0.bin | 3 ++ _build/loose_files.txt | 2 + source/Enderal DLL/CMakeLists.txt | 2 +- source/Enderal DLL/src/Main.cpp | 62 +++++++++++++++++---------- source/Enderal DLL/src/Util.h | 21 --------- 6 files changed, 47 insertions(+), 47 deletions(-) create mode 100644 SKSE/Plugins/versionlib-1-6-659-0.bin diff --git a/SKSE/Plugins/EnderalSE.dll b/SKSE/Plugins/EnderalSE.dll index 7200f73d..8b941d04 100644 --- a/SKSE/Plugins/EnderalSE.dll +++ b/SKSE/Plugins/EnderalSE.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fb9b9f1cd7a9282e823e9575091d0932489238e984c3fe72877fc5a23b282c9d -size 734720 +oid sha256:3016f8c4ddfddc95705f09ea9041f8b1e8f9cb1bf13a4f81217bed18dfa2d037 +size 734208 diff --git a/SKSE/Plugins/versionlib-1-6-659-0.bin b/SKSE/Plugins/versionlib-1-6-659-0.bin new file mode 100644 index 00000000..9c0b0d15 --- /dev/null +++ b/SKSE/Plugins/versionlib-1-6-659-0.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74116dfc7d9cfe591c1363e95ad144609262566f78b6cb18f4ce880085f441f1 +size 764300 diff --git a/_build/loose_files.txt b/_build/loose_files.txt index 25a0ca2e..aef17ea9 100644 --- a/_build/loose_files.txt +++ b/_build/loose_files.txt @@ -33,6 +33,8 @@ SKSE\Plugins\EnderalSE.ini SKSE\Plugins\EnderalVersion.ini SKSE\Plugins\version-1-5-97-0.bin SKSE\Plugins\versionlib-1-6-353-0.bin +SKSE\Plugins\versionlib-1-6-640-0.bin +SKSE\Plugins\versionlib-1-6-659-0.bin SKSE\SKSE.ini Skyrim.esm Update.esm diff --git a/source/Enderal DLL/CMakeLists.txt b/source/Enderal DLL/CMakeLists.txt index e74a3d46..219901e2 100644 --- a/source/Enderal DLL/CMakeLists.txt +++ b/source/Enderal DLL/CMakeLists.txt @@ -6,7 +6,7 @@ message("Using toolchain file ${CMAKE_TOOLCHAIN_FILE}.") ######################################################################################################################## project( EnderalSE - VERSION 1.0.0 + VERSION 1.1 DESCRIPTION "Enderal SE DLL" LANGUAGES CXX) set(CMAKE_CXX_STANDARD 23) diff --git a/source/Enderal DLL/src/Main.cpp b/source/Enderal DLL/src/Main.cpp index 55736038..bedb3db4 100644 --- a/source/Enderal DLL/src/Main.cpp +++ b/source/Enderal DLL/src/Main.cpp @@ -34,18 +34,8 @@ namespace { void InitializeMessaging() { GetMessagingInterface()->RegisterListener([](MessagingInterface::Message* message) { + if (message->type == MessagingInterface::kPostLoad) { - if (DataFileExists("Dawnguard.esm") || DataFileExists("Dragonborn.esm") || DataFileExists("HearthFires.esm") || DataFileExists("Update.esm")) { - MessageBoxW(NULL, L"Skyrim DLCs are incompatible with Enderal.", L"Error", MB_OK | MB_ICONERROR); - exit(EXIT_FAILURE); - } - if (DataFileExists("Unofficial Skyrim Special Edition Patch.esp")) { - MessageBoxW(NULL, L"Unofficial Skyrim Special Edition Patch is incompatible with Enderal.", L"Error", MB_OK | MB_ICONERROR); - exit(EXIT_FAILURE); - } - - CheckCCMods(); - if (g_settings.at("StayAtSystemPage")) { if (const auto pluginInfo = GetLoadInterface()->GetPluginInfo("StayAtSystemPage"); pluginInfo) { MessageBoxW(NULL, L"Stay At The System Page is already included in Enderal, please, disable it.", L"Error", MB_OK | MB_ICONERROR); @@ -59,11 +49,6 @@ namespace { } } - SetINISettings(); - EventListener::Install(); - - } else if (message->type == MessagingInterface::kPostPostLoad) { - SKSE::GetModCallbackEventSource()->AddEventSink(EventListener::GetSingleton()); } else if (message->type == MessagingInterface::kDataLoaded) { const auto dataHandler = RE::TESDataHandler::GetSingleton(); if (dataHandler) { @@ -77,21 +62,38 @@ namespace { } } + if (!RE::BSScript::Internal::VirtualMachine::GetSingleton()->TypeIsValid("UI")) { + RE::DebugMessageBox("Unable to detect SKSE scripts, make sure SKSE is properly installed."); + } + bool bScripts = RE::BSScript::Internal::VirtualMachine::GetSingleton()->TypeIsValid("PRKF__00E_CraftQuestPotionPe_0300146D"); + bool bInterface = RE::BSResourceNiBinaryStream("interface/00e_heromenu.swf").good(); + + if (!bScripts || !bInterface) { + RE::DebugMessageBox("E - Misc.bsa is not loaded or is outdated. Make sure Enderal - Forgotten Stories.esm is enabled and revalidate your files."); + } + bool bSounds = RE::BSResourceNiBinaryStream("sound/fx/enderal/laughingchild.wav").good(); + + if (!bSounds) { + RE::DebugMessageBox("E - Sounds.bsa is not loaded. Make sure Enderal - Forgotten Stories.esm is enabled and revalidate your files."); + } + bool bVoices = RE::BSResourceNiBinaryStream("sound/voice/enderal - forgotten stories.esm/vt_calia/fs_mq18c__0002a4ed_1.fuz").good(); - bool bMeshes = RE::BSResourceNiBinaryStream("meshes/enderal/loadscreenart/loadscreenundercity.nif").good(); - bool bTextures = RE::BSResourceNiBinaryStream("textures/enderal/forgottenstories/theriantrophist/theriantrophistrecipe.dds").good(); - bool bInterface = RE::BSResourceNiBinaryStream("interface/00e_heromenu.swf").good(); - if (!bScripts || !bSounds || !bVoices || !bMeshes || !bTextures || !bInterface) { - MessageBoxW(NULL, L"One or more of Enderal's BSA archives are not loaded. Make sure Enderal - Forgotten Stories.esm is enabled and revalidate your files.", L"Error", MB_OK | MB_ICONERROR); + if (!bVoices) { + RE::DebugMessageBox("L - Voices.bsa is not loaded. Make sure Enderal - Forgotten Stories.esm is enabled and revalidate your files."); exit(EXIT_FAILURE); } + bool bMeshes = RE::BSResourceNiBinaryStream("meshes/enderal/loadscreenart/loadscreenundercity.nif").good(); + + if (!bMeshes) { + RE::DebugMessageBox("E - Meshes.bsa is not loaded. Make sure Enderal - Forgotten Stories.esm is enabled and revalidate your files."); + } + CheckIncompatibleMods(); - } else if (message->type == MessagingInterface::kPreLoadGame) { - // + } else if ((message->type == MessagingInterface::kPostLoadGame && message->data) || message->type == MessagingInterface::kNewGame) { NewGameCount(true); } @@ -101,6 +103,18 @@ namespace { SKSEPluginLoad(const LoadInterface* skse) { + if (DataFileExists("Dawnguard.esm") || DataFileExists("Dragonborn.esm") || DataFileExists("HearthFires.esm") || DataFileExists("Update.esm")) { + MessageBoxW(NULL, L"Skyrim DLCs are incompatible with Enderal.", L"Error", MB_OK | MB_ICONERROR); + exit(EXIT_FAILURE); + } + + if (DataFileExists("Unofficial Skyrim Special Edition Patch.esp")) { + MessageBoxW(NULL, L"Unofficial Skyrim Special Edition Patch is incompatible with Enderal.", L"Error", MB_OK | MB_ICONERROR); + exit(EXIT_FAILURE); + } + + CheckCCMods(); + GetLoadInterface(skse); InitializeLogging(); @@ -114,6 +128,8 @@ SKSEPluginLoad(const LoadInterface* skse) { Init(skse); InitializeMessaging(); + SKSE::GetModCallbackEventSource()->AddEventSink(EventListener::GetSingleton()); + GetPapyrusInterface()->Register(Papyrus::Bind); if (!IsVR()) { diff --git a/source/Enderal DLL/src/Util.h b/source/Enderal DLL/src/Util.h index 1e89046f..ba92f790 100644 --- a/source/Enderal DLL/src/Util.h +++ b/source/Enderal DLL/src/Util.h @@ -34,27 +34,6 @@ inline bool IsVR() return GetLoadInterface()->RuntimeVersion() == SKSE::RUNTIME_VR_1_4_15 || GetLoadInterface()->RuntimeVersion() == SKSE::RUNTIME_LATEST_VR; } -inline void SetINISettings() -{ - auto* setting = RE::INIPrefSettingCollection::GetSingleton()->GetSetting("bFreebiesSeen:General"); - if (setting && !setting->GetBool()) { - setting->data.b = true; - RE::INIPrefSettingCollection::GetSingleton()->WriteSetting(setting); - } - - setting = RE::INISettingCollection::GetSingleton()->GetSetting("bInvalidateOlderFiles:Archive"); - if (setting && !setting->GetBool()) { - setting->data.b = true; - RE::INISettingCollection::GetSingleton()->WriteSetting(setting); - } - - setting = RE::INISettingCollection::GetSingleton()->GetSetting("bModManagerMenuEnabled:General"); - if (setting && setting->GetBool()) { - setting->data.b = false; - RE::INISettingCollection::GetSingleton()->WriteSetting(setting); - } -} - inline void CheckIncompatibleMods() { bool bPrinted = false;