From 8e0ef254ab3429eb015acc0d51721b047b5a4c40 Mon Sep 17 00:00:00 2001 From: Road-block Date: Sun, 14 Jan 2024 12:26:20 +0200 Subject: [PATCH] another attempt at solving keybind persistence for some players --- ItemRack/ItemRack.lua | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ItemRack/ItemRack.lua b/ItemRack/ItemRack.lua index 6a92973..0fea9b6 100644 --- a/ItemRack/ItemRack.lua +++ b/ItemRack/ItemRack.lua @@ -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 @@ -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")