Mercurial > wow > reaction
comparison MultiCastButton.lua @ 259:c918ff9ac787
Add option to make buttons activate on mouse/key down
| author | Flick |
|---|---|
| date | Mon, 25 Apr 2011 11:43:42 -0700 |
| parents | 65f2805957a0 |
| children | 36a29870bf34 |
comparison
equal
deleted
inserted
replaced
| 256:5ab04f393b0b | 259:c918ff9ac787 |
|---|---|
| 393 f:SetAttribute("_childupdate",_childupdate) | 393 f:SetAttribute("_childupdate",_childupdate) |
| 394 end | 394 end |
| 395 barFrame:WrapScript(f, "OnEnter", _onEnter) | 395 barFrame:WrapScript(f, "OnEnter", _onEnter) |
| 396 | 396 |
| 397 -- event registration | 397 -- event registration |
| 398 f:EnableMouse(true) | |
| 399 f:RegisterForClicks("AnyUp") | |
| 400 for _, evt in pairs(eventList) do | 398 for _, evt in pairs(eventList) do |
| 401 f:RegisterEvent(evt) | 399 f:RegisterEvent(evt) |
| 402 end | 400 end |
| 403 | 401 |
| 404 -- Set up a proxy for the icon texture for use with ButtonFacade | 402 -- Set up a proxy for the icon texture for use with ButtonFacade |
| 732 b.icon = b:CreateTexture("BACKGROUND") | 730 b.icon = b:CreateTexture("BACKGROUND") |
| 733 b.icon:SetAllPoints() | 731 b.icon:SetAllPoints() |
| 734 b.icon:Show() | 732 b.icon:Show() |
| 735 b:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Square") | 733 b:SetHighlightTexture("Interface\\Buttons\\ButtonHilight-Square") |
| 736 b:GetHighlightTexture():SetBlendMode("ADD") | 734 b:GetHighlightTexture():SetBlendMode("ADD") |
| 737 b:RegisterForClicks("AnyUp") | 735 b:EnableMouse(true) |
| 736 b:RegisterForClicks(bar:GetConfig().clickDown and "AnyDown" or "AnyUp") | |
| 738 b:SetScript("OnShow",UpdateFlyoutIcon) | 737 b:SetScript("OnShow",UpdateFlyoutIcon) |
| 739 b:SetScript("OnEnter",ShowFlyoutTooltip) | 738 b:SetScript("OnEnter",ShowFlyoutTooltip) |
| 740 b:SetScript("OnLeave",HideFlyoutTooltip) | 739 b:SetScript("OnLeave",HideFlyoutTooltip) |
| 741 b:SetAttribute("index",i) | 740 b:SetAttribute("index",i) |
| 742 f:SetAttribute("flyout-child-idx",i) | 741 f:SetAttribute("flyout-child-idx",i) |
