1
Fork 0

Removed redundant checks and updates from _00E_Game_SkillmenuSC intended to fix hotkey registrations, prone to breaking due to missing RegisterForMenu() in OnPlayerLoadGame

development
Eddoursul 5 months ago
parent 9a50707a1e
commit 2b3f294bb4
  1. BIN
      scripts/_00e_game_skillmenusc.pex
  2. 64
      source/scripts/_00e_game_skillmenusc.psc

Binary file not shown.

@ -23,7 +23,6 @@ endFunction
Event OnInit() Event OnInit()
FixedBugs1_2 = True
iCurrentAffinityIndex = -1 iCurrentAffinityIndex = -1
InitAffinitySystem() InitAffinitySystem()
@ -33,9 +32,11 @@ Event OnInit()
EndEvent EndEvent
Event OnUpdate() Event OnPlayerLoadGame()
InitAffinitySystem()
UpdateKeyRegistration() UpdateKeyRegistration()
RegisterForMenu("Journal Menu")
EndEvent EndEvent
@ -66,18 +67,10 @@ EndEvent
Event OnMenuClose(String MenuName) Event OnMenuClose(String MenuName)
If MenuName == ("Journal Menu")
UpdateKeyRegistration() UpdateKeyRegistration()
EndIf
EndEvent EndEvent
Event OnLocationChange(Location akOldLoc, Location akNewLoc)
; Gavrant:
; I don't know the purpose of re-registering keys on location change, but someone added this to _00E_Game_TalentControlSC in the first place.
UpdateKeyRegistration()
EndEvent
;===================================================================================== ;=====================================================================================
; FUNCTIONS ; FUNCTIONS
@ -148,20 +141,11 @@ Function OpenSkillmenu()
If PlayerREF.GetCurrentLocation() != _00E_Dreamworld_Location If PlayerREF.GetCurrentLocation() != _00E_Dreamworld_Location
MenuOpen = True MenuOpen = True
UpdateKeyRegistration()
; if !Game.IsMovementControlsEnabled()
; bControlsHaveBeenDisabled = True
; EndIf
_00E_Game_MenuIMOD.Apply() _00E_Game_MenuIMOD.Apply()
UI.OpenCustomMenu("00E_heromenu") UI.OpenCustomMenu("00E_heromenu")
UI.InvokeStringA("CustomMenu", "_root.heromenu_mc.SetStringValues", GetStrings()) UI.InvokeStringA("CustomMenu", "_root.heromenu_mc.SetStringValues", GetStrings())
UI.InvokeFloatA("CustomMenu", "_root.heromenu_mc.SetIntValues", GetFloats()) UI.InvokeFloatA("CustomMenu", "_root.heromenu_mc.SetIntValues", GetFloats())
UI.InvokeFloatA("CustomMenu", "_root.heromenu_mc.SetModifier", GetMods()) UI.InvokeFloatA("CustomMenu", "_root.heromenu_mc.SetModifier", GetMods())
RegisterForSingleUpdate(8)
EndIf EndIf
EndFunction EndFunction
@ -169,17 +153,8 @@ EndFunction
Function CloseSkillmenu() Function CloseSkillmenu()
UI.CloseCustomMenu() UI.CloseCustomMenu()
; If !bControlsHaveBeenDisabled
; Game.EnablePlayerControls()
; EndIf
; bControlsHaveBeenDisabled = False
_00E_Game_MenuIMOD.Remove() _00E_Game_MenuIMOD.Remove()
MenuOpen = False MenuOpen = False
UpdateKeyRegistration()
RegisterForSingleUpdate(15)
EndFunction EndFunction
@ -392,33 +367,11 @@ Function InitAffinitySystem()
EndWhile EndWhile
EndIf EndIf
; Fix 1.2.x.x bugs if needed
If FixedBugs1_2 == False
If bHasAffinityBonus == False
iCurrentAffinityIndex = -1
EndIf
If iCurrentAffinityIndex >= 0
Spell affSpell = Affinity_Spells[iCurrentAffinityIndex]
If PlayerREF.HasSpell(affSpell) == False
PlayerREF.AddSpell(affSpell)
EndIf
EndIf
Int[] PerkDistribution = GetPerkDistribution()
UpdateClassIndices(PerkDistribution)
FixedBugs1_2 = True
Else
; Init MajorSchool ; Init MajorSchool
If MajorSchool == 0 If MajorSchool == 0
UpdateMajorSchool() UpdateMajorSchool()
EndIf EndIf
EndIf
BlockClassUpdates = False BlockClassUpdates = False
EndFunction EndFunction
@ -832,16 +785,6 @@ String Function GetPlayerClassName()
EndIf EndIf
EndFunction EndFunction
Event OnPlayerLoadGame()
InitAffinitySystem()
; Post-1.2.5.0 update
If bMeditateKeyRegistered == False
UpdateKeyRegistration()
EndIf
EndEvent
;===================================================================================== ;=====================================================================================
; PROPERTIES ; PROPERTIES
@ -1078,7 +1021,6 @@ Int Affinity_RavagerIndex
Int Affinity_ScourgeOfTheWildsIndex Int Affinity_ScourgeOfTheWildsIndex
Int Affinity_SoulcallerIndex Int Affinity_SoulcallerIndex
Bool FixedBugs1_2
Bool BlockClassUpdates Bool BlockClassUpdates
Bool bMeditateKeyRegistered = False Bool bMeditateKeyRegistered = False

Loading…
Cancel
Save