Skip to content

Commit

Permalink
fixed pushedtexture when modifier is used
Browse files Browse the repository at this point in the history
  • Loading branch information
1onar committed Oct 27, 2024
1 parent 953db6d commit b0d7e40
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions KeyUI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,10 @@ eventFrame:SetScript("OnEvent", function(self, event, ...)
if addon.current_hovered_button then
addon:ButtonMouseOver(addon.current_hovered_button)
end

if addon.current_pushed_button then
addon.current_pushed_button:Hide()
end
end
end
else
Expand Down
5 changes: 4 additions & 1 deletion KeyboardFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ function addon:CreateKeyboardButtons()

-- Define the mouse hover behavior to show tooltips.
keyboard_button:SetScript("OnEnter", function()
addon.current_hovered_button = keyboard_button --save the current hovered button to re-trigger tooltip
addon.current_hovered_button = keyboard_button -- save the current hovered button to re-trigger tooltip
addon:ButtonMouseOver(keyboard_button)
keyboard_button:EnableKeyboard(true)
keyboard_button:EnableMouseWheel(true)
Expand Down Expand Up @@ -953,6 +953,8 @@ function addon:CreateKeyboardButtons()
local pushedTexture = mappedButton:GetPushedTexture()
if pushedTexture then
pushedTexture:Show() -- Show the pushed texture
addon.current_pushed_button = pushedTexture -- save the current pushed button to hide when modifier pushed
print(pushedTexture)
end
end
end
Expand Down Expand Up @@ -990,6 +992,7 @@ function addon:CreateKeyboardButtons()
local pushedTexture = mappedButton:GetPushedTexture()
if pushedTexture then
pushedTexture:Hide() -- Hide the pushed texture
addon.current_pushed_button = nil -- Clear the current pushed button
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions MouseFrame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ function addon:CreateMouseButtons()
mouse_button.icon:SetPoint("TOPLEFT", mouse_button, "TOPLEFT", 5, -5)

mouse_button:SetScript("OnEnter", function()
addon.current_hovered_button = mouse_button --save the current hovered button to re-trigger tooltip
addon.current_hovered_button = mouse_button -- save the current hovered button to re-trigger tooltip
addon:ButtonMouseOver(mouse_button)
mouse_button:EnableKeyboard(true)
mouse_button:EnableMouseWheel(true)
Expand Down Expand Up @@ -696,7 +696,7 @@ function addon:CreateMouseButtons()
local pushedTexture = mappedButton:GetPushedTexture()
if pushedTexture then
pushedTexture:Show() -- Show the pushed texture
--print("Showing PushedTexture for button in slot", Mousebutton.slot)
addon.current_pushed_button = pushedTexture -- save the current pushed button to hide when modifier pushed
end
end
end
Expand Down Expand Up @@ -735,7 +735,7 @@ function addon:CreateMouseButtons()
local pushedTexture = mappedButton:GetPushedTexture()
if pushedTexture then
pushedTexture:Hide() -- Hide the pushed texture
--print("Hiding PushedTexture for button in slot", Mousebutton.slot)
addon.current_pushed_button = nil -- Clear the current pushed button
end
end
end
Expand Down

0 comments on commit b0d7e40

Please sign in to comment.