Compare commits

...

2 Commits

6 changed files with 61 additions and 22 deletions

View File

@ -5,3 +5,4 @@ AchievementFix = true
VideoInterruptPatch = true VideoInterruptPatch = true
ForceBorderless = true ForceBorderless = true
AttachLightHitEffectCrashFix = true AttachLightHitEffectCrashFix = true
AutoScaleHeroMenu = true

View File

@ -23,7 +23,8 @@ static std::map<std::string, bool> g_settings{
{ "AchievementFix", true }, { "AchievementFix", true },
{ "VideoInterruptPatch", true }, { "VideoInterruptPatch", true },
{ "ForceBorderless", true }, { "ForceBorderless", true },
{ "AttachLightHitEffectCrashFix", true } { "AttachLightHitEffectCrashFix", true },
{ "AutoScaleHeroMenu", true }
}; };
namespace { namespace {
@ -191,14 +192,14 @@ SKSEPluginLoad(const LoadInterface* skse) {
GetPapyrusInterface()->Register(Papyrus::Bind); GetPapyrusInterface()->Register(Papyrus::Bind);
LoadINI(&g_settings, "Data/SKSE/Plugins/EnderalSE.ini");
MainMenuPatch::Install(); MainMenuPatch::Install();
DialogueMenuPatch::Install(); DialogueMenuPatch::Install();
HeroMenuPatch::Install(); HeroMenuPatch::Install(g_settings.at("AutoScaleHeroMenu"));
TweenMenuPatch::Install(); TweenMenuPatch::Install();
HUDMenuPatch::Install(); HUDMenuPatch::Install();
LoadINI(&g_settings, "Data/SKSE/Plugins/EnderalSE.ini");
if (g_settings.at("AchievementFix")) { if (g_settings.at("AchievementFix")) {
logger::info("Patching achievements..."); logger::info("Patching achievements...");
AchievementFix::Install(); AchievementFix::Install();

View File

@ -21,8 +21,14 @@ RE::BSEventNotifyControl HeroMenuPatch::ProcessEvent_Hook(RE::InputEvent** a_eve
return _ProcessEvent(this, a_event, a_source); return _ProcessEvent(this, a_event, a_source);
} }
void HeroMenuPatch::Install() void HeroMenuPatch::Install(bool aAutoScaleHeroMenu)
{ {
HeroMenuPatch::bAutoScaleHeroMenu = aAutoScaleHeroMenu;
if (HeroMenuPatch::bAutoScaleHeroMenu) {
logger::info("Hero menu autoscaling has been enabled.");
}
// Patch MenuControls to close the menu // Patch MenuControls to close the menu
REL::Relocation<std::uintptr_t> vTable(RE::VTABLE_MenuControls[0]); REL::Relocation<std::uintptr_t> vTable(RE::VTABLE_MenuControls[0]);
_ProcessEvent = vTable.write_vfunc(0x1, &HeroMenuPatch::ProcessEvent_Hook); _ProcessEvent = vTable.write_vfunc(0x1, &HeroMenuPatch::ProcessEvent_Hook);
@ -80,7 +86,7 @@ void HeroMenuPatch::FillMenuValues()
return; return;
} }
if (!REL::Module::IsVR()) { if (HeroMenuPatch::bAutoScaleHeroMenu && !REL::Module::IsVR()) {
// Fit the movie into the screen (widescreen support) // Fit the movie into the screen (widescreen support)
uiMovie->SetViewScaleMode(RE::BSScaleformManager::ScaleModeType::kShowAll); uiMovie->SetViewScaleMode(RE::BSScaleformManager::ScaleModeType::kShowAll);
} }

View File

@ -5,7 +5,7 @@
class HeroMenuPatch : public RE::MenuControls class HeroMenuPatch : public RE::MenuControls
{ {
public: public:
static void Install(); static void Install(bool bAutoScaleHeroMenu = true);
static uint64_t OpenStats(uint32_t arg_1, uint32_t arg_2, uint32_t arg_3, uint32_t arg_4, uint32_t arg_5); static uint64_t OpenStats(uint32_t arg_1, uint32_t arg_2, uint32_t arg_3, uint32_t arg_4, uint32_t arg_5);
@ -19,4 +19,6 @@ public:
using ProcessEvent_t = decltype(static_cast<RE::BSEventNotifyControl (RE::MenuControls::*)(RE::InputEvent* const*, RE::BSTEventSource<RE::InputEvent*>*)>(&RE::MenuControls::ProcessEvent)); using ProcessEvent_t = decltype(static_cast<RE::BSEventNotifyControl (RE::MenuControls::*)(RE::InputEvent* const*, RE::BSTEventSource<RE::InputEvent*>*)>(&RE::MenuControls::ProcessEvent));
static inline REL::Relocation<ProcessEvent_t> _ProcessEvent; static inline REL::Relocation<ProcessEvent_t> _ProcessEvent;
inline static bool bAutoScaleHeroMenu;
}; };

View File

@ -1,11 +1,15 @@
Scriptname _00E_Complex_AddSilenceSC extends ObjectReference Scriptname _00E_Complex_AddSilenceSC extends ObjectReference
; Eddoursul: Reworked in 2.1.4 to use states and the OnTrigger() event to encure silence track removal
Event OnTriggerEnter(ObjectReference akActionRef) Event OnTriggerEnter(ObjectReference akActionRef)
If akActionRef == PlayerREF If akActionRef == PlayerREF
If (__Config_QuestToSet.GetCurrentStageID() >= __Config_iMinStage) && (__Config_QuestToSet.GetCurrentStageID() <= __Config_iMaxStage) If (__Config_QuestToSet.GetCurrentStageID() >= __Config_iMinStage) && (__Config_QuestToSet.GetCurrentStageID() <= __Config_iMaxStage)
_00E_SilenceLongTransitionHighPriority.Add() if GetState() == ""
bActive = true _00E_SilenceLongTransitionHighPriority.Add()
GoToState("WaitLeave")
endif
EndIf EndIf
EndIf EndIf
@ -15,27 +19,52 @@ Event OnTriggerLeave(ObjectReference akActionRef)
If akActionRef == PlayerREF If akActionRef == PlayerREF
_00E_SilenceLongTransitionHighPriority.Remove() _00E_SilenceLongTransitionHighPriority.Remove()
GoToState("")
UnregisterForUpdate() UnregisterForUpdate()
bActive = false ;Debug.Notification("Leaving area")
EndIf EndIf
EndEvent EndEvent
; 2.1.4 Failsafe to ensure silence removal when OnTriggerLeave does not fire Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
Event OnTrigger(ObjectReference akActionRef) ;
If bActive && akActionRef == PlayerREF endEvent
State WaitLeave
Event OnBeginState()
RegisterForSingleUpdate(3.0) RegisterForSingleUpdate(3.0)
EndIf ;Debug.Notification("Waiting to leave")
EndEvent EndEvent
Event OnUpdate() Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
_00E_SilenceLongTransitionHighPriority.Remove() if akTarget == PlayerREF
bActive = false ; Remove silence on combat start
EndEvent if aeCombatState == 1
GoToState("")
endif
endif
endEvent
Event OnTrigger(ObjectReference akActionRef)
If akActionRef == PlayerREF
RegisterForSingleUpdate(3.0)
EndIf
EndEvent
Event OnUpdate()
GoToState("")
EndEvent
Event OnEndState()
_00E_SilenceLongTransitionHighPriority.Remove()
;Debug.Notification("Leaving area")
EndEvent
EndState
int Property __Config_iMinStage Auto int Property __Config_iMinStage Auto
int Property __Config_iMaxStage Auto int Property __Config_iMaxStage Auto
Actor Property PlayerREF Auto Actor Property PlayerREF Auto
Quest Property __Config_QuestToSet Auto Quest Property __Config_QuestToSet Auto
MusicType Property _00E_SilenceLongTransitionHighPriority Auto MusicType Property _00E_SilenceLongTransitionHighPriority Auto
bool bActive