Skip to content

Commit

Permalink
another attempt at solving keybind persistence for some players
Browse files Browse the repository at this point in the history
  • Loading branch information
Road-block authored and Rottenbeer committed Jan 20, 2024
1 parent 9c52da4 commit 8e0ef25
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ItemRack/ItemRack.lua
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ function ItemRack.InitEventHandlers()
handler.CHARACTER_POINTS_CHANGED = ItemRack.UpdateClassSpecificStuff
handler.PLAYER_TALENT_UPDATE = ItemRack.UpdateClassSpecificStuff
handler.PLAYER_ENTERING_WORLD = ItemRack.OnEnterWorld
handler.PLAYER_LOGOUT = ItemRack.OnPlayerLogout
handler.ACTIVE_TALENT_GROUP_CHANGED = ItemRack.UpdateClassSpecificStuff
-- handler.PET_BATTLE_OPENING_START = ItemRack.OnEnteringPetBattle
-- handler.PET_BATTLE_CLOSE = ItemRack.OnLeavingPetBattle
Expand Down Expand Up @@ -266,10 +267,19 @@ function ItemRack.OnPlayerLogin()
ItemRack.InitEvents()
end

function ItemRack.OnEnterWorld()
function ItemRack.OnPlayerLogout()
ItemRack.SetSetBindings()
end

function ItemRack.OnEnterWorld(self,event,...)
local isLogin,isReload = ...
if isLogin or isReload then
C_Timer.After(15,function()
ItemRack.SetSetBindings()
end)
end
end

local loader = CreateFrame("Frame",nil, self, BackdropTemplateMixin and "BackdropTemplate") -- need a new temp frame here, ItemRackFrame is not created yet

loader:RegisterEvent("PLAYER_LOGIN")
Expand Down

0 comments on commit 8e0ef25

Please sign in to comment.