Mercurial > wow > hotcorners
diff Libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua @ 11:371e14cd2feb
- major fixes with icons not showing correctly.
author | Tercio |
---|---|
date | Thu, 08 Dec 2016 13:01:40 -0200 |
parents | fc346da3afd9 |
children |
line wrap: on
line diff
--- a/Libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua Tue Oct 25 15:59:51 2016 -0200 +++ b/Libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua Thu Dec 08 13:01:40 2016 -0200 @@ -2,7 +2,7 @@ Keybinding Widget Set Keybindings in the Config UI. -------------------------------------------------------------------------------]] -local Type, Version = "Keybinding", 24 +local Type, Version = "Keybinding", 25 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end @@ -17,12 +17,6 @@ -- List them here for Mikk's FindGlobals script -- GLOBALS: NOT_BOUND -local wowMoP -do - local _, _, _, interface = GetBuildInfo() - wowMoP = (interface >= 50000) -end - --[[----------------------------------------------------------------------------- Scripts -------------------------------------------------------------------------------]] @@ -40,11 +34,13 @@ local self = frame.obj if self.waitingForKey then frame:EnableKeyboard(false) + frame:EnableMouseWheel(false) self.msgframe:Hide() frame:UnlockHighlight() self.waitingForKey = nil else frame:EnableKeyboard(true) + frame:EnableMouseWheel(true) self.msgframe:Show() frame:LockHighlight() self.waitingForKey = true @@ -79,6 +75,7 @@ end frame:EnableKeyboard(false) + frame:EnableMouseWheel(false) self.msgframe:Hide() frame:UnlockHighlight() self.waitingForKey = nil @@ -103,6 +100,16 @@ Keybinding_OnKeyDown(frame, button) end +local function Keybinding_OnMouseWheel(frame, direction) + local button + if direction >= 0 then + button = "MOUSEWHEELUP" + else + button = "MOUSEWHEELDOWN" + end + Keybinding_OnKeyDown(frame, button) +end + --[[----------------------------------------------------------------------------- Methods -------------------------------------------------------------------------------]] @@ -115,6 +122,7 @@ self.msgframe:Hide() self:SetDisabled(false) self.button:EnableKeyboard(false) + self.button:EnableMouseWheel(false) end, -- ["OnRelease"] = nil, @@ -180,15 +188,17 @@ local name = "AceGUI30KeybindingButton" .. AceGUI:GetNextWidgetNum(Type) local frame = CreateFrame("Frame", nil, UIParent) - local button = CreateFrame("Button", name, frame, wowMoP and "UIPanelButtonTemplate" or "UIPanelButtonTemplate2") + local button = CreateFrame("Button", name, frame, "UIPanelButtonTemplate") button:EnableMouse(true) + button:EnableMouseWheel(false) button:RegisterForClicks("AnyDown") button:SetScript("OnEnter", Control_OnEnter) button:SetScript("OnLeave", Control_OnLeave) button:SetScript("OnClick", Keybinding_OnClick) button:SetScript("OnKeyDown", Keybinding_OnKeyDown) button:SetScript("OnMouseDown", Keybinding_OnMouseDown) + button:SetScript("OnMouseWheel", Keybinding_OnMouseWheel) button:SetPoint("BOTTOMLEFT") button:SetPoint("BOTTOMRIGHT") button:SetHeight(24)