diff --git a/Leatrix_Plus.lua b/Leatrix_Plus.lua index 7872eac..7a8c133 100644 --- a/Leatrix_Plus.lua +++ b/Leatrix_Plus.lua @@ -2228,11 +2228,18 @@ function LeaPlusLC:Isolated() --===== Disable Auto Loot button in Interface menu and add tooltip to it. =====-- -- if aura_env.config["autoLootGlobalEnabled"] then - InterfaceOptionsControlsPanelAutoLootCorpse:Disable() + -- The CoA client's reworked Controls panel may not expose + -- these legacy globals; guard each access so a missing widget + -- cannot abort the login event handler. + if InterfaceOptionsControlsPanelAutoLootCorpse then + InterfaceOptionsControlsPanelAutoLootCorpse:Disable() + end local autoLootText = InterfaceOptionsControlsPanelAutoLootCorpseText - autoLootText:SetText("Auto Loot option is controlled by Leatrix Plus.") - autoLootText:SetAlpha(0.6) + if autoLootText then + autoLootText:SetText("Auto Loot option is controlled by Leatrix Plus.") + autoLootText:SetAlpha(0.6) + end -- print("Auto Loot Set") @@ -6084,7 +6091,12 @@ function LeaPlusLC:Player() -- Set hover scripts for all buttons local function SetupButtonHoverScripts() for _, button in pairs(minimapButtons) do - if button then + -- Hook each button only once. The ticker below runs every + -- second; HookScript chains its closures, so re-hooking each + -- cycle accumulates hundreds of nested handlers and eventually + -- overflows the C stack when OnEnter/OnLeave fires. + if button and not button.leaPlusHoverHooked then + button.leaPlusHoverHooked = true button:HookScript("OnEnter", function() -- Show all buttons when hovering over one for _, btn in pairs(minimapButtons) do @@ -6192,6 +6204,10 @@ function LeaPlusLC:Player() -- This function is called when the mouse enters the minimap area. local function Minimap_OnEnter() + -- Install the OnUpdate driver only once. Hooking it on every + -- minimap enter chains closures and overflows the C stack. + if Minimap.leaPlusHideButtonsOnUpdate then return end + Minimap.leaPlusHideButtonsOnUpdate = true -- If the mouse is over a child, we show all minimap buttons. Minimap:HookScript("OnUpdate", function(self, elapsed) local numChildren = Minimap:GetNumChildren()