diff --git a/Separated health bar controls.esp b/Separated health bar controls.esp index d81bff1f..8edd72a7 100644 Binary files a/Separated health bar controls.esp and b/Separated health bar controls.esp differ diff --git a/interface/translate_english.txt b/interface/translate_english.txt index 090d666c..f347ff7c 100644 Binary files a/interface/translate_english.txt and b/interface/translate_english.txt differ diff --git a/scripts/_00e_enderalmcm.pex b/scripts/_00e_enderalmcm.pex index cdab063d..6293aca8 100644 Binary files a/scripts/_00e_enderalmcm.pex and b/scripts/_00e_enderalmcm.pex differ diff --git a/scripts/_00e_gui_actorhealthbar.pex b/scripts/_00e_gui_actorhealthbar.pex index d2cecd5b..9f833a2d 100644 Binary files a/scripts/_00e_gui_actorhealthbar.pex and b/scripts/_00e_gui_actorhealthbar.pex differ diff --git a/source/scripts/_00e_enderalmcm.psc b/source/scripts/_00e_enderalmcm.psc index bd667f8c..0b834566 100644 --- a/source/scripts/_00e_enderalmcm.psc +++ b/source/scripts/_00e_enderalmcm.psc @@ -10,10 +10,6 @@ endFunction Event OnPageReset(string page) - If _00E_ConfigMenu_Meditate == None - _00E_ConfigMenu_Meditate = Game.GetFormFromFile(0x00046D98, "Skyrim.esm") as Message - EndIf - ; adding options to rebind new key options: 1) Hero menu 2) meditation 3) Phasmalist summon apparition 4) Horseflute SetCursorFillMode(TOP_TO_BOTTOM) @@ -26,6 +22,7 @@ Event OnPageReset(string page) AddHeaderOption(_00E_ConfigMenu_GameplayOptions.GetName()) toggleOID_ReadAloudBooks = AddToggleOption(_00E_ConfigMenu_DisableReadAloudBooks.GetName(), _00E_DisableReadAloudBooks.GetValue() != 0) toggleOID_VideoSkip = AddToggleOption(_00E_ConfigMenu_VideoSkip.GetName(), _00E_VideoSkip.GetValue() != 0) + toggleOID_ActorHealthBars = AddToggleOption(_00E_ConfigMenu_ActorHealthBars.GetName(), _00E_ActorHealthBarsEnabled.GetValue() != 0) SetCursorPosition(1) @@ -79,6 +76,14 @@ Event OnOptionSelect(int option) ChangeCheckbox(toggleOID_ReadAloudBooks, _00E_DisableReadAloudBooks) ElseIf option == toggleOID_VideoSkip ChangeCheckbox(toggleOID_VideoSkip, _00E_VideoSkip) + elseif option == toggleOID_ActorHealthBars + ChangeCheckbox(toggleOID_ActorHealthBars, _00E_ActorHealthBarsEnabled) + + if _00E_ActorHealthBarsEnabled.GetValue() + ActorHealthBarWidget.RegisterEvents() + else + ActorHealthBarWidget.UnregisterEvents() + endif EndIf EndEvent @@ -107,6 +112,8 @@ Event OnOptionHighlight(int option) SetInfoText("$ConfigMenuReadAloudBooksInfo") ElseIf option == toggleOID_VideoSkip SetInfoText("$ConfigMenuVideoSkipInfo") + ElseIf option == toggleOID_ActorHealthBars + SetInfoText("$ConfigMenuActorHealthBars") EndIf EndEvent @@ -129,9 +136,9 @@ EndFunction Int iKeyMeditateID int iKeyID02 int iKeyMountID -;int iMeditateKeycode = 21 int iFSPhasmalistTeleportKeymap = 34 int iFSMountTeleportKeymap = 38 + int toggleOID_MenuTutorials int toggleOID_CraftingTutorials int toggleOID_SkillTutorials @@ -139,6 +146,7 @@ int toggleOID_QuestTutorials int toggleOID_OtherTutorials int toggleOID_ReadAloudBooks int toggleOID_VideoSkip +int toggleOID_ActorHealthBars Message Property _00E_ConfigMenu_Keybindings Auto Message Property _00E_ConfigMenu_OtherOptions Auto @@ -153,6 +161,7 @@ Message Property _00E_ConfigMenu_DisableQuestTutorials Auto Message Property _00E_ConfigMenu_DisableOtherTutorials Auto Message Property _00E_ConfigMenu_DisableReadAloudBooks Auto Message Property _00E_ConfigMenu_VideoSkip Auto +Message Property _00E_ConfigMenu_ActorHealthBars Auto _FS_Phasmalist_ControlQuest Property controlQuest Auto _00E_Horseflute_SC Property _00E_HorseFlute_New Auto @@ -164,4 +173,8 @@ GlobalVariable Property _00E_DisableQuestTutorials Auto GlobalVariable Property _00E_DisableOtherTutorials Auto GlobalVariable Property _00E_DisableReadAloudBooks Auto GlobalVariable Property _00E_VideoSkip Auto +GlobalVariable Property _00E_ActorHealthBarsEnabled Auto + _00E_MeditationHotkeyAlias Property PlayerMeditation Auto + +_00E_GUI_ActorHealthBar Property ActorHealthBarWidget Auto diff --git a/source/scripts/_00e_gui_actorhealthbar.psc b/source/scripts/_00e_gui_actorhealthbar.psc index 8eb9653c..5f215a72 100644 --- a/source/scripts/_00e_gui_actorhealthbar.psc +++ b/source/scripts/_00e_gui_actorhealthbar.psc @@ -111,20 +111,13 @@ endEvent event OnGameReload() - If Game.GetModByName("SkyUI_SE.esp") == 255 - return - endif - parent.OnGameReload() - if _currentlyDisplayedActors.length == 0 - _currentlyDisplayedActors = new Form[4] + If Game.GetModByName("SkyUI_SE.esp") == 255 || _00E_ActorHealthBarsEnabled.GetValue() == 0 + return endif - UI.Invoke(HUD_MENU, WidgetRoot + ".removeAllActors") - - RegisterForModEvent("Enderal_ShowActorHealth", "AddActors") - RegisterForModEvent("Enderal_HideActorHealth", "RemoveActors") + RegisterEvents() Utility.Wait(FadeOutDuration / 1000.0 + 1.0) @@ -152,6 +145,24 @@ event OnGameReload() Endevent +function RegisterEvents() + + if _currentlyDisplayedActors.length == 0 + _currentlyDisplayedActors = new Form[4] + endif + + UI.Invoke(HUD_MENU, WidgetRoot + ".removeAllActors") + RegisterForModEvent("Enderal_ShowActorHealth", "AddActors") + RegisterForModEvent("Enderal_HideActorHealth", "RemoveActors") + +endfunction + +function UnregisterEvents() + UI.Invoke(HUD_MENU, WidgetRoot + ".removeAllActors") + UnregisterForModEvent("Enderal_ShowActorHealth") + UnregisterForModEvent("Enderal_HideActorHealth") +endfunction + Function UpdateWidgetScale() UI.InvokeFloat(HUD_MENU, WidgetRoot + ".setScale", _scale * 100.0) EndFunction @@ -208,3 +219,5 @@ EndFunction Function RemoveActorRaw(Form aActor) UI.InvokeForm(HUD_MENU, WidgetRoot + ".removePanelActors", aActor) EndFunction + +GlobalVariable Property _00E_ActorHealthBarsEnabled Auto