From e49b87833b27387b066ba333d895de6c53b929a1 Mon Sep 17 00:00:00 2001 From: 1onar Date: Sat, 9 Nov 2024 18:42:19 +0100 Subject: [PATCH] minor improvements and bug fixes --- KeyUI.lua | 8 ++++---- KeyboardFrame.lua | 2 +- MouseFrame.lua | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/KeyUI.lua b/KeyUI.lua index 8e03f40..ee6251c 100644 --- a/KeyUI.lua +++ b/KeyUI.lua @@ -282,8 +282,8 @@ function addon:Load() addon:refresh_layouts() end -function addon:LoadSpells() - addon.spells = {} +function addon:LoadSpells() -- DIFFERENCE Retail Code + addon.spells = {} -- Loop through all spellbook tabs in Classic WoW for i = 1, GetNumSpellTabs() do @@ -305,7 +305,7 @@ function addon:LoadSpells() end end end -end +end -- DIFFERENCE Retail Code -- Update the visibility of keyboard and mouse based on settings, only if addon is open function addon:UpdateInterfaceVisibility() @@ -785,7 +785,7 @@ function addon:SetKey(button) end -- Calculate the maximum allowed characters based on button width - local max_allowed_chars = math.floor(button:GetWidth() / 8) + local max_allowed_chars = math.floor(button:GetWidth() / 9) local combined_text = button.short_key:GetText() -- Combined text with modifiers if present -- Use Condensed font if the combined text exceeds max_allowed_chars diff --git a/KeyboardFrame.lua b/KeyboardFrame.lua index 74dd896..f838b05 100644 --- a/KeyboardFrame.lua +++ b/KeyboardFrame.lua @@ -726,7 +726,7 @@ function addon:CreateKeyboardControl() keyboard_control_frame.MinMax = CreateFrame("Frame", nil, keyboard_control_frame, "MaximizeMinimizeButtonFrameTemplate") keyboard_control_frame.MinMax:SetSize(34, 34) - keyboard_control_frame.MinMax:SetPoint("RIGHT", Controls.Close, "LEFT", 14, 0) + keyboard_control_frame.MinMax:SetPoint("RIGHT", keyboard_control_frame.Close, "LEFT", 14, 0) keyboard_control_frame.MinMax:SetOnMaximizedCallback(OnMaximize) -- DIFFERENCE Retail Code keyboard_control_frame.MinMax:SetOnMinimizedCallback(OnMinimize) -- DIFFERENCE Retail Code diff --git a/MouseFrame.lua b/MouseFrame.lua index eade741..4494d49 100644 --- a/MouseFrame.lua +++ b/MouseFrame.lua @@ -425,7 +425,7 @@ function addon:CreateMouseControl() mouse_control_frame.MinMax = CreateFrame("Frame", nil, mouse_control_frame, "MaximizeMinimizeButtonFrameTemplate") mouse_control_frame.MinMax:SetSize(42, 42) -- DIFFERENCE Retail Code - mouse_control_frame.MinMax:SetPoint("RIGHT", MouseControls.Close, "LEFT", 18, 0) -- DIFFERENCE Retail Code + mouse_control_frame.MinMax:SetPoint("RIGHT", mouse_control_frame.Close, "LEFT", 18, 0) -- DIFFERENCE Retail Code mouse_control_frame.MinMax:SetOnMaximizedCallback(OnMaximizeMouse) mouse_control_frame.MinMax:SetOnMinimizedCallback(OnMinimizeMouse)