diff --git a/SKSE/Plugins/EnderalSE.dll b/SKSE/Plugins/EnderalSE.dll index 19d46c4e..a7135c07 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:8e26462b367894584664fea9fa029f1766ba7d38dd6357b5e832696c2b4f9b47 -size 735744 +oid sha256:bfeeb196e7eab311b69046d73815f780c10366623d693900b043c3916e059db9 +size 733696 diff --git a/Update.esm b/Update.esm index 4fe7177a..6e3eaae2 100644 Binary files a/Update.esm and b/Update.esm differ diff --git a/scripts/_00e_confirmdialogquit.pex b/scripts/_00e_confirmdialogquit.pex deleted file mode 100644 index 336f943c..00000000 Binary files a/scripts/_00e_confirmdialogquit.pex and /dev/null differ diff --git a/source/Enderal DLL/src/DialogueMenuPatch.h b/source/Enderal DLL/src/DialogueMenuPatch.h index 942b4c15..f9d38e9f 100644 --- a/source/Enderal DLL/src/DialogueMenuPatch.h +++ b/source/Enderal DLL/src/DialogueMenuPatch.h @@ -29,10 +29,7 @@ private: // Escape triggers a kTab event, added kEscape just in case if (key && (key->keyCode == RE::GFxKey::kTab || key->keyCode == RE::GFxKey::kEscape) && !RE::UI::GetSingleton()->IsMenuOpen(RE::ContainerMenu::MENU_NAME) && !RE::UI::GetSingleton()->IsMenuOpen(RE::BarterMenu::MENU_NAME)) { - // The best solution is to show the quest journal, like in LE, but showing a journal seems to mess with framerate of the UI, see dialogue menu after showing journal - //RE::UIMessageQueue::GetSingleton()->AddMessage(RE::InterfaceStrings::GetSingleton()->journalMenu, RE::UI_MESSAGE_TYPE::kShow, 0i64); - RE::BSTSmartPointer stackCallback; - RE::BSScript::Internal::VirtualMachine::GetSingleton()->DispatchStaticCall("_00E_ConfirmDialogQuit", "Show", RE::MakeFunctionArguments(), stackCallback); + OpenJournal(false); return RE::UI_MESSAGE_RESULTS::kIgnore; } } diff --git a/source/Enderal DLL/src/EventListener.cpp b/source/Enderal DLL/src/EventListener.cpp index 12999a8c..ac27aabd 100644 --- a/source/Enderal DLL/src/EventListener.cpp +++ b/source/Enderal DLL/src/EventListener.cpp @@ -49,19 +49,7 @@ auto EventListener::ProcessEvent( -> RE::BSEventNotifyControl { if (a_event->opening) { - if (a_event->menuName == RE::JournalMenu::MENU_NAME) { - if (RE::UI::GetSingleton()->IsMenuOpen(RE::DialogueMenu::MENU_NAME)) { - const auto movie = RE::UI::GetSingleton()->GetMovieView(RE::JournalMenu::MENU_NAME); - if (movie) { - // UIMessage opens quest journal uninitialized, without any tab active and hotkeys bound - // We have to activate a tab for it to work properly - std::array args; - args[0].SetNumber(2); - args[1].SetBoolean(false); - movie->Invoke("_root.QuestJournalFader.Menu_mc.RestoreSavedSettings", nullptr, args.data(), static_cast(args.size())); - } - } - } else if (a_event->menuName == RE::DialogueMenu::MENU_NAME) { + if (a_event->menuName == RE::DialogueMenu::MENU_NAME) { // Make sure Tab is not blocked. If it should be, a Papyrus script will block it a few frames later. DialogueMenuPatch::BlockTab(false); } diff --git a/source/Enderal DLL/src/Util.h b/source/Enderal DLL/src/Util.h index 60326295..b95dcac1 100644 --- a/source/Enderal DLL/src/Util.h +++ b/source/Enderal DLL/src/Util.h @@ -163,4 +163,12 @@ inline void LoadINI(std::map* settings, const char* iniPath) } catch (const std::exception& e) { logger::error("{}", e.what()); } -} \ No newline at end of file +} + +// When opening from dialogue menu, a_bool must be false to not break framerate of the UI +inline void OpenJournal(bool a_bool) +{ + using func_t = decltype(&OpenJournal); + REL::Relocation func{ REL::RelocationID(52428, 53327) }; + return func(a_bool); +} diff --git a/source/scripts/_00e_confirmdialogquit.psc b/source/scripts/_00e_confirmdialogquit.psc deleted file mode 100644 index b279a972..00000000 --- a/source/scripts/_00e_confirmdialogquit.psc +++ /dev/null @@ -1,7 +0,0 @@ -Scriptname _00E_ConfirmDialogQuit Hidden - -function Show() global - if (Game.GetFormFromFile(0x163D, "Update.esm") as Message).Show() == 1 - Game.QuitToMainMenu() - endif -endfunction