VR-compatible build

This commit is contained in:
Eddoursul 2024-02-03 12:29:58 +01:00
parent 78519a773a
commit bc71ba52b0
2 changed files with 32 additions and 27 deletions

View File

@ -48,6 +48,7 @@ namespace {
GetMessagingInterface()->RegisterListener([](MessagingInterface::Message* message) { GetMessagingInterface()->RegisterListener([](MessagingInterface::Message* message) {
if (message->type == MessagingInterface::kPostLoad) { if (message->type == MessagingInterface::kPostLoad) {
if (!REL::Module::IsVR()) {
if (g_settings.at("StayAtSystemPage")) { if (g_settings.at("StayAtSystemPage")) {
if (const auto pluginInfo = GetLoadInterface()->GetPluginInfo("StayAtSystemPage"); pluginInfo) { 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"Enderal SE 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);
@ -64,6 +65,7 @@ namespace {
logger::info("Initializing map market placement fixes..."); logger::info("Initializing map market placement fixes...");
MapMarkerPlacement::Install(); MapMarkerPlacement::Install();
} }
}
} else if (message->type == MessagingInterface::kDataLoaded) { } else if (message->type == MessagingInterface::kDataLoaded) {
if (REL::Module::get().version() > REL::Version(1, 5, 97, 0)) { if (REL::Module::get().version() > REL::Version(1, 5, 97, 0)) {
RE::INIPrefSettingCollection::GetSingleton()->GetSetting("bFreebiesSeen:General")->data.b = true; RE::INIPrefSettingCollection::GetSingleton()->GetSetting("bFreebiesSeen:General")->data.b = true;
@ -157,13 +159,10 @@ SKSEPluginLoad(const LoadInterface* skse) {
auto version = plugin->GetVersion(); auto version = plugin->GetVersion();
logger::info("{} {} is loading...", plugin->GetName(), version); logger::info("{} {} is loading...", plugin->GetName(), version);
LoadINI(&g_settings, "Data/SKSE/Plugins/EnderalSE.ini");
Init(skse); Init(skse);
InitializeMessaging(); InitializeMessaging();
RE::INISettingCollection::GetSingleton()->GetSetting("sIntroSequence:General")->data.s = nullptr; RE::INISettingCollection::GetSingleton()->GetSetting("sIntroSequence:General")->data.s = nullptr;
RE::INISettingCollection::GetSingleton()->GetSetting("bModManagerMenuEnabled:General")->data.b = false;
EventListener::Install(); EventListener::Install();
@ -174,17 +173,21 @@ SKSEPluginLoad(const LoadInterface* skse) {
TweenMenuPatch::Install(); TweenMenuPatch::Install();
HUDMenuPatch::Install(); HUDMenuPatch::Install();
if (g_settings.at("VideoInterruptPatch")) { if (!REL::Module::IsVR()) {
logger::info("Making videos interruptible..."); LoadINI(&g_settings, "Data/SKSE/Plugins/EnderalSE.ini");
BinkInterruptPatch::Install();
} RE::INISettingCollection::GetSingleton()->GetSetting("bModManagerMenuEnabled:General")->data.b = false;
if (g_settings.at("AchievementFix")) { if (g_settings.at("AchievementFix")) {
logger::info("Patching achievements..."); logger::info("Patching achievements...");
AchievementFix::Install(); AchievementFix::Install();
} }
if (!REL::Module::IsVR()) { if (g_settings.at("VideoInterruptPatch")) {
logger::info("Making videos interruptible...");
BinkInterruptPatch::Install();
}
if (g_settings.at("ForceBorderless")) { if (g_settings.at("ForceBorderless")) {
ForceBorderless::Install(); ForceBorderless::Install();
} }

View File

@ -21,11 +21,14 @@ public:
RE::UI_MESSAGE_RESULTS Hook_ProcessMessage(RE::UIMessage& a_message) RE::UI_MESSAGE_RESULTS Hook_ProcessMessage(RE::UIMessage& a_message)
{ {
static REL::Relocation<Tab*> _savedTabIdx{ REL::RelocationID(520167, 406697) };
switch (a_message.type.get()) { switch (a_message.type.get()) {
case RE::UI_MESSAGE_TYPE::kShow: case RE::UI_MESSAGE_TYPE::kShow:
{ {
auto UI = RE::UI::GetSingleton(); auto UI = RE::UI::GetSingleton();
auto InterfaceStrings = RE::InterfaceStrings::GetSingleton(); auto InterfaceStrings = RE::InterfaceStrings::GetSingleton();
if (UI && InterfaceStrings && UI->IsMenuOpen(InterfaceStrings->mapMenu)) { if (UI && InterfaceStrings && UI->IsMenuOpen(InterfaceStrings->mapMenu)) {
*_savedTabIdx = Tab::kQuest; *_savedTabIdx = Tab::kQuest;
} else { } else {
@ -54,5 +57,4 @@ public:
static inline REL::Relocation<decltype(&Hook_Accept)> _Accept; static inline REL::Relocation<decltype(&Hook_Accept)> _Accept;
static inline REL::Relocation<decltype(&Hook_ProcessMessage)> _ProcessMessage; static inline REL::Relocation<decltype(&Hook_ProcessMessage)> _ProcessMessage;
static inline REL::Relocation<Tab*> _savedTabIdx{ REL::RelocationID(520167, 406697) };
}; };