diff --git a/SKSE/Plugins/EnderalSE.dll b/SKSE/Plugins/EnderalSE.dll index 82b84246..d7e9b50e 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:ece6ce0175d4726a9a3d39a215bf7e9b1b8f82b16a7493872b88a0d08cd1453d -size 731136 +oid sha256:f434a341dd7afe4d276460075a77e297f9d8952b38c9940cd09a4ea5d0fb868d +size 731648 diff --git a/source/Enderal DLL/src/FlatMapMarkers.h b/source/Enderal DLL/src/FlatMapMarkers.h index b106f5e8..a9889a5a 100644 --- a/source/Enderal DLL/src/FlatMapMarkers.h +++ b/source/Enderal DLL/src/FlatMapMarkers.h @@ -3,6 +3,7 @@ #include "Util.h" // Based on Ryan McKenzie's Flat Map Markers +// CommonLibSSE-NG update by Eddoursul namespace FlatMapMarkers { inline void Hook_WorldPtToScreenPt3(RE::NiCamera* a_camera, RE::NiPoint3& a_in, float& a_xOut, float& a_yOut, float& a_zOut, float a_zeroTolerance) @@ -13,7 +14,7 @@ namespace FlatMapMarkers inline void Install() { - REL::Relocation offset{ RELOCATION_ID(52224, 53111), IsSE() ? 0x22F : 0x21F }; + REL::Relocation offset{ REL::RelocationID(52224, 53111), REL::Relocate(0x22F, 0x21F) }; SKSE::AllocTrampoline(14); auto& trampoline = SKSE::GetTrampoline(); trampoline.write_call<5>(offset.address(), &Hook_WorldPtToScreenPt3); diff --git a/source/Enderal DLL/src/Main.cpp b/source/Enderal DLL/src/Main.cpp index ee9031d8..0aea79b6 100644 --- a/source/Enderal DLL/src/Main.cpp +++ b/source/Enderal DLL/src/Main.cpp @@ -42,13 +42,13 @@ namespace { if (message->type == MessagingInterface::kPostLoad) { 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); + MessageBoxW(NULL, L"Stay At The System Page is already included in Enderal, please, disable it.", L"Enderal SE Error", MB_OK | MB_ICONERROR); exit(EXIT_FAILURE); } } if (g_settings.at("FlatMapMarkers")) { if (const auto pluginInfo = GetLoadInterface()->GetPluginInfo("FlatMapMarkersSSE"); pluginInfo) { - MessageBoxW(NULL, L"Flat Map Markers is already included in Enderal, please, disable it (remove file Data\\SKSE\\Plugins\\FlatMapMarkersSSE.dll).", L"Error", MB_OK | MB_ICONERROR); + MessageBoxW(NULL, L"Flat Map Markers is already included in Enderal, please, disable it (remove file Data\\SKSE\\Plugins\\FlatMapMarkersSSE.dll).", L"Enderal SE Error", MB_OK | MB_ICONERROR); exit(EXIT_FAILURE); } } @@ -60,11 +60,11 @@ namespace { const auto dataHandler = RE::TESDataHandler::GetSingleton(); if (dataHandler) { if (!dataHandler->LookupLoadedModByName("Update.esm")) { - MessageBoxW(NULL, L"Update.esm is not loaded!", L"Error", MB_OK | MB_ICONERROR); + MessageBoxW(NULL, L"Update.esm is not loaded!", L"Enderal SE Error", MB_OK | MB_ICONERROR); exit(EXIT_FAILURE); } if (!dataHandler->LookupLoadedModByName("Enderal - Forgotten Stories.esm")) { - MessageBoxW(NULL, L"Enderal - Forgotten Stories.esm is not loaded!", L"Error", MB_OK | MB_ICONERROR); + MessageBoxW(NULL, L"Enderal - Forgotten Stories.esm is not loaded!", L"Enderal SE Error", MB_OK | MB_ICONERROR); exit(EXIT_FAILURE); } } @@ -117,18 +117,23 @@ SKSEPluginLoad(const LoadInterface* skse) { }; for (int i = 0; i < 4; i++) { if (std::filesystem::exists(std::format("Data\\SKSE\\Plugins\\{}", filenames[i]))) { - MessageBoxA(NULL, std::format("Found a leftover file from a previous version of Enderal SE. Please, delete Data\\SKSE\\Plugins\\{}.", filenames[i]).c_str(), "Error", MB_OK | MB_ICONERROR); + MessageBoxA(NULL, std::format("Found a leftover file from a previous version of Enderal SE. Please, delete Data\\SKSE\\Plugins\\{}.", filenames[i]).c_str(), "Enderal SE Error", MB_OK | MB_ICONERROR); exit(EXIT_FAILURE); } } 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); + MessageBoxW(NULL, L"Skyrim DLCs are incompatible with Enderal.", L"Enderal SE 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); + MessageBoxW(NULL, L"Unofficial Skyrim Special Edition Patch is incompatible with Enderal.", L"Enderal SE Error", MB_OK | MB_ICONERROR); + exit(EXIT_FAILURE); + } + + if (!DataFileExists("Enderal - Forgotten Stories.esm")) { + MessageBoxW(NULL, L"Enderal - Forgotten Stories.esm is not loaded!", L"Enderal SE Error", MB_OK | MB_ICONERROR); exit(EXIT_FAILURE); } @@ -147,6 +152,10 @@ SKSEPluginLoad(const LoadInterface* skse) { Init(skse); InitializeMessaging(); + auto setting = RE::INISettingCollection::GetSingleton()->GetSetting("sIntroSequence:General"); + setting->data.s = nullptr; + RE::INISettingCollection::GetSingleton()->WriteSetting(setting); + SKSE::GetModCallbackEventSource()->AddEventSink(EventListener::GetSingleton()); RE::UI::GetSingleton()->AddEventSink(EventListener::GetSingleton()); @@ -157,7 +166,7 @@ SKSEPluginLoad(const LoadInterface* skse) { AchievementFix::Install(); } - if (!IsVR()) { + if (!REL::Module::IsVR()) { if (g_settings.at("FlatMapMarkers")) { logger::info("Initializing Flat Map Markers..."); FlatMapMarkers::Install(); diff --git a/source/Enderal DLL/src/MapMarkerPlacement.h b/source/Enderal DLL/src/MapMarkerPlacement.h index 506c3f30..c45d5620 100644 --- a/source/Enderal DLL/src/MapMarkerPlacement.h +++ b/source/Enderal DLL/src/MapMarkerPlacement.h @@ -1,6 +1,5 @@ #pragma once -// Based on powerofthree's Tweaks 1.8.1 by powerofthree (MIT) namespace MapMarkerPlacement { constexpr std::uint8_t NOP{ 0x90 }; @@ -20,6 +19,7 @@ namespace MapMarkerPlacement static inline REL::Relocation func; }; + // Based on powerofthree's Tweaks 1.8.1 by powerofthree (MIT) void InstallPlacementDiscoveredFix() { // Place a marker, if a location has been discovered and fast travel is disabled diff --git a/source/Enderal DLL/src/Util.h b/source/Enderal DLL/src/Util.h index 533d2349..60326295 100644 --- a/source/Enderal DLL/src/Util.h +++ b/source/Enderal DLL/src/Util.h @@ -24,16 +24,6 @@ inline uint8_t NewGameCount(bool increment = false) return g_NewGameStarted; } -inline bool IsSE() -{ - return GetLoadInterface()->RuntimeVersion().minor() == 5; -} - -inline bool IsVR() -{ - return GetLoadInterface()->RuntimeVersion() == SKSE::RUNTIME_VR_1_4_15 || GetLoadInterface()->RuntimeVersion() == SKSE::RUNTIME_LATEST_VR; -} - inline void CheckIncompatibleMods() { bool bPrinted = false;