Store player's KillMove preference in KillMoveConfig since KillMove may be routinely manipulated in runtime

This commit is contained in:
Eddoursul 2025-08-10 22:57:53 +02:00
parent 01d2b4cfd8
commit 10e0891a83
8 changed files with 17 additions and 14 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -181,7 +181,7 @@ SKSEPluginLoad(const LoadInterface* skse) {
auto* plugin = PluginDeclaration::GetSingleton(); auto* plugin = PluginDeclaration::GetSingleton();
auto version = plugin->GetVersion(); auto version = plugin->GetVersion();
logger::info("{} {} is loading...", plugin->GetName(), version); logger::info("{} {} ({}) is loading...", plugin->GetName(), version, SemVerToInt({ version.major(), version.minor(), version.patch(), version.build() }));
Init(skse); Init(skse);
InitializeMessaging(); InitializeMessaging();

View File

@ -123,7 +123,7 @@ inline void CheckScriptVersions()
scripts["_00E_ContainerBonusControl"] = 2; scripts["_00E_ContainerBonusControl"] = 2;
scripts["_00E_AffinityControl"] = 1; scripts["_00E_AffinityControl"] = 1;
scripts["_00E_SympathyControl"] = 1; scripts["_00E_SympathyControl"] = 1;
scripts["_00E_EnderalMCM"] = 1; scripts["_00E_EnderalMCM"] = 2;
scripts["_00E_SkillControl"] = 1; scripts["_00E_SkillControl"] = 1;
scripts["_00E_VisionControl"] = 1; scripts["_00E_VisionControl"] = 1;
scripts["_00E_EnderalControls"] = 1; scripts["_00E_EnderalControls"] = 1;

View File

@ -19,8 +19,15 @@ EndEvent
Event OnPlayerLoadGame() Event OnPlayerLoadGame()
if iPatchVersion < GetVersion() if iPatchVersion < 33620992 ; 2.1.4
iPatchVersion = GetVersion() Debug.Trace("Updating to v2.1.4 (33620992)...")
; Synchronize KillMoveConfig with KillMove
(Game.GetForm(0x49425) as GlobalVariable).SetValue((Game.GetForm(0x100F19) as GlobalVariable).GetValue())
endif endif
if iPatchVersion < GetVersion()
Debug.Trace("Setting current version to " + GetVersion())
iPatchVersion = GetVersion()
endif
EndEvent EndEvent

View File

@ -5,10 +5,11 @@ Scriptname _00E_EnderalMCM extends SKI_ConfigBase
;===================================================================================== ;=====================================================================================
int function _GetScriptVersion() Global int function _GetScriptVersion() Global
return 1 return 2
endFunction endFunction
event OnGameReload() event OnGameReload()
_00E_KillMove.SetValue(KillMoveConfig.GetValue() as bool)
if SKSE.GetVersion() == 0 if SKSE.GetVersion() == 0
Debug.Trace("NO SKSE: the Mod Configuration Menu is disabled") Debug.Trace("NO SKSE: the Mod Configuration Menu is disabled")
return return
@ -31,7 +32,7 @@ Event OnPageReset(string page)
toggleOID_ReadAloudBooks = AddToggleOption(_00E_ConfigMenu_DisableReadAloudBooks.GetName(), _00E_DisableReadAloudBooks.GetValue() != 0) toggleOID_ReadAloudBooks = AddToggleOption(_00E_ConfigMenu_DisableReadAloudBooks.GetName(), _00E_DisableReadAloudBooks.GetValue() != 0)
toggleOID_VideoSkip = AddToggleOption(_00E_ConfigMenu_VideoSkip.GetName(), _00E_VideoSkip.GetValue() != 0) toggleOID_VideoSkip = AddToggleOption(_00E_ConfigMenu_VideoSkip.GetName(), _00E_VideoSkip.GetValue() != 0)
toggleOID_ActorHealthBars = AddToggleOption(_00E_ConfigMenu_ActorHealthBars.GetName(), _00E_ActorHealthBarsEnabled.GetValue() != 0) toggleOID_ActorHealthBars = AddToggleOption(_00E_ConfigMenu_ActorHealthBars.GetName(), _00E_ActorHealthBarsEnabled.GetValue() != 0)
toggleOID_KillMoves = AddToggleOption(_00E_ConfigMenu_KillMove.GetName(), KillMove.GetValue() != 0) toggleOID_KillMoves = AddToggleOption(_00E_ConfigMenu_KillMove.GetName(), KillMoveConfig.GetValue() != 0)
SetCursorPosition(1) SetCursorPosition(1)
@ -94,13 +95,8 @@ Event OnOptionSelect(int option)
ActorHealthBarWidget.UnregisterEvents() ActorHealthBarWidget.UnregisterEvents()
endif endif
elseif option == toggleOID_KillMoves elseif option == toggleOID_KillMoves
ChangeCheckbox(toggleOID_KillMoves, KillMove) ChangeCheckbox(toggleOID_KillMoves, KillMoveConfig)
_00E_KillMove.SetValue(KillMoveConfig.GetValue() as bool)
if KillMove.GetValue()
Utility.SetINIBool("bVATSDisable:VATS", false)
else
Utility.SetINIBool("bVATSDisable:VATS", true)
endif
EndIf EndIf
EndEvent EndEvent
@ -195,7 +191,7 @@ GlobalVariable Property _00E_DisableOtherTutorials Auto
GlobalVariable Property _00E_DisableReadAloudBooks Auto GlobalVariable Property _00E_DisableReadAloudBooks Auto
GlobalVariable Property _00E_VideoSkip Auto GlobalVariable Property _00E_VideoSkip Auto
GlobalVariable Property _00E_ActorHealthBarsEnabled Auto GlobalVariable Property _00E_ActorHealthBarsEnabled Auto
GlobalVariable Property KillMove Auto GlobalVariable Property KillMoveConfig Auto
_00E_MeditationHotkeyAlias Property PlayerMeditation Auto _00E_MeditationHotkeyAlias Property PlayerMeditation Auto