Mercurial > wow > reaction
comparison classes/Button.lua @ 183:1696ff2c80cc
minor library rename/storage/cleanup
| author | Flick <flickerstreak@gmail.com> |
|---|---|
| date | Fri, 22 Oct 2010 15:56:08 +0000 |
| parents | df68b5a40490 |
| children | 8ba8ab8bf6dd |
comparison
equal
deleted
inserted
replaced
| 182:55c2fc0c8d55 | 183:1696ff2c80cc |
|---|---|
| 4 | 4 |
| 5 -- local imports | 5 -- local imports |
| 6 local addonName, addonTable = ... | 6 local addonName, addonTable = ... |
| 7 local ReAction = addonTable.ReAction | 7 local ReAction = addonTable.ReAction |
| 8 local L = ReAction.L | 8 local L = ReAction.L |
| 9 local LKB = ReAction.LKB | |
| 9 local _G = _G | 10 local _G = _G |
| 10 local CreateFrame = CreateFrame | 11 local CreateFrame = CreateFrame |
| 11 local GetBindingKey = GetBindingKey | 12 local GetBindingKey = GetBindingKey |
| 12 local format = string.format | 13 local format = string.format |
| 13 | 14 |
| 14 -- libraries | 15 -- libraries |
| 15 local KB = LibStub("LibKeyBound-1.0") | |
| 16 local LBF = LibStub("LibButtonFacade",true) -- optional | 16 local LBF = LibStub("LibButtonFacade",true) -- optional |
| 17 | 17 |
| 18 -- private | 18 -- private |
| 19 local trash = CreateFrame("Frame") | 19 local trash = CreateFrame("Frame") |
| 20 local frameList = { } | 20 local frameList = { } |
| 21 local idPools = { } | 21 local idPools = { } |
| 22 | 22 |
| 23 local function kb_onEnter( frame ) | 23 local function kb_onEnter( frame ) |
| 24 KB:Set(frame) | 24 LKB:Set(frame) |
| 25 end | 25 end |
| 26 | 26 |
| 27 -- Button class | 27 -- Button class |
| 28 local Button = { } | 28 local Button = { } |
| 29 | 29 |
| 77 return format("%s:%s", bar:GetName(), idx) | 77 return format("%s:%s", bar:GetName(), idx) |
| 78 end | 78 end |
| 79 | 79 |
| 80 local clickBinding = format("CLICK %s:LeftButton", name) | 80 local clickBinding = format("CLICK %s:LeftButton", name) |
| 81 function f:GetHotkey() | 81 function f:GetHotkey() |
| 82 return KB:ToShortKey(GetBindingKey(clickBinding)) | 82 return LKB:ToShortKey(GetBindingKey(clickBinding)) |
| 83 end | 83 end |
| 84 | 84 |
| 85 return self | 85 return self |
| 86 end | 86 end |
| 87 | 87 |
| 203 | 203 |
| 204 function Button:UpdateKeybindModeDisplay( mode ) | 204 function Button:UpdateKeybindModeDisplay( mode ) |
| 205 local border = self.frames.border or _G[format("%sBorder",tostring(self:GetName()))] | 205 local border = self.frames.border or _G[format("%sBorder",tostring(self:GetName()))] |
| 206 if border then | 206 if border then |
| 207 if mode then | 207 if mode then |
| 208 border:SetVertexColor(KB:GetColorKeyBoundMode()) | 208 border:SetVertexColor(LKB:GetColorKeyBoundMode()) |
| 209 border:Show() | 209 border:Show() |
| 210 else | 210 else |
| 211 border:Hide() | 211 border:Hide() |
| 212 end | 212 end |
| 213 end | 213 end |
