diff --git a/cmake/ports/.gitkeep b/cmake/ports/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/XSEPlugin.cpp b/src/XSEPlugin.cpp index 3413053c1e..fbd2263b8a 100644 --- a/src/XSEPlugin.cpp +++ b/src/XSEPlugin.cpp @@ -3,6 +3,7 @@ #include "ShaderCache.h" #include "State.h" #include "Menu.h" +#include #include "ENB/ENBSeriesAPI.h" @@ -28,25 +29,39 @@ void MessageHandler(SKSE::MessagingInterface::Message* message) switch (message->type) { case SKSE::MessagingInterface::kPostPostLoad: { - Hooks::Install(); + const std::array dlls = { + L"ShaderTools", + L"ENBHelperSE", + L"ENBHelperVR", + L"ENBHelperPlus" + }; + auto incompatible = false; + for (const auto dll : dlls) { + if (GetModuleHandle(dll)) { + logger::info(fmt::runtime("Incompatible DLL {} detected, will disable all hooks and features"), stl::utf16_to_utf8(dll).value_or(""s)); + incompatible = true; + } + } + if (!incompatible) { + Hooks::Install(); - //auto& shaderCache = SIE::ShaderCache::Instance(); + //auto& shaderCache = SIE::ShaderCache::Instance(); - //shaderCache.SetEnabled(true); - //shaderCache.SetAsync(true); - //shaderCache.SetDiskCache(true); + //shaderCache.SetEnabled(true); + //shaderCache.SetAsync(true); + //shaderCache.SetDiskCache(true); - //State::GetSingleton()->Load(); + //State::GetSingleton()->Load(); - //shaderCache.ValidateDiskCache(); + //shaderCache.ValidateDiskCache(); - if (reshade::register_addon(m_hModule)) { - logger::info("ReShade: Registered add-on"); - // reshade::register_event(DrawOverlayCallback); - } else { - logger::info("ReShade: Could not register add-on"); + if (reshade::register_addon(m_hModule)) { + logger::info("ReShade: Registered add-on"); + // reshade::register_event(DrawOverlayCallback); + } else { + logger::info("ReShade: Could not register add-on"); + } } - break; } case SKSE::MessagingInterface::kDataLoaded: