Mercurial > wow > reaction
comparison modules/ReAction_Action/ReAction_Action.lua @ 108:b2fb8f7dc780
ButtonFacade support
| author | Flick <flickerstreak@gmail.com> |
|---|---|
| date | Wed, 07 Jan 2009 00:57:02 +0000 |
| parents | ad49739d110d |
| children |
comparison
equal
deleted
inserted
replaced
| 107:110ec60c7a66 | 108:b2fb8f7dc780 |
|---|---|
| 18 | 18 |
| 19 ReAction:UpdateRevision("$Revision$") | 19 ReAction:UpdateRevision("$Revision$") |
| 20 | 20 |
| 21 -- libraries | 21 -- libraries |
| 22 local KB = LibStub("LibKeyBound-1.0") | 22 local KB = LibStub("LibKeyBound-1.0") |
| 23 local LBF -- initialized later | |
| 23 | 24 |
| 24 -- module declaration | 25 -- module declaration |
| 25 local moduleID = "Action" | 26 local moduleID = "Action" |
| 26 local module = ReAction:NewModule( moduleID ) | 27 local module = ReAction:NewModule( moduleID ) |
| 27 | 28 |
| 47 ReAction.RegisterCallback(self, "OnRefreshBar") | 48 ReAction.RegisterCallback(self, "OnRefreshBar") |
| 48 ReAction.RegisterCallback(self, "OnDestroyBar") | 49 ReAction.RegisterCallback(self, "OnDestroyBar") |
| 49 ReAction.RegisterCallback(self, "OnEraseBar") | 50 ReAction.RegisterCallback(self, "OnEraseBar") |
| 50 ReAction.RegisterCallback(self, "OnRenameBar") | 51 ReAction.RegisterCallback(self, "OnRenameBar") |
| 51 ReAction.RegisterCallback(self, "OnConfigModeChanged") | 52 ReAction.RegisterCallback(self, "OnConfigModeChanged") |
| 53 | |
| 54 LBF = LibStub("LibButtonFacade",true) | |
| 52 | 55 |
| 53 KB.RegisterCallback(self, "LIBKEYBOUND_ENABLED") | 56 KB.RegisterCallback(self, "LIBKEYBOUND_ENABLED") |
| 54 KB.RegisterCallback(self, "LIBKEYBOUND_DISABLED") | 57 KB.RegisterCallback(self, "LIBKEYBOUND_DISABLED") |
| 55 KB.RegisterCallback(self, "LIBKEYBOUND_MODE_COLOR_CHANGED","LIBKEYBOUND_ENABLED") | 58 KB.RegisterCallback(self, "LIBKEYBOUND_MODE_COLOR_CHANGED","LIBKEYBOUND_ENABLED") |
| 56 end | 59 end |
| 960 return "clear" | 963 return "clear" |
| 961 end | 964 end |
| 962 ]]) | 965 ]]) |
| 963 | 966 |
| 964 self.frame = f | 967 self.frame = f |
| 965 self.normalTexture = getglobal(format("%sNormalTexture",f:GetName())) | 968 |
| 966 | 969 |
| 967 -- initialize the hide state | 970 -- initialize the hide state |
| 968 f:SetAttribute("showgrid",0) | 971 f:SetAttribute("showgrid",0) |
| 969 self:ShowGrid(not barConfig.hideEmpty) | 972 self:ShowGrid(not barConfig.hideEmpty) |
| 970 if ReAction:GetConfigMode() then | 973 if ReAction:GetConfigMode() then |
| 974 -- show the ID label if applicable | 977 -- show the ID label if applicable |
| 975 self:ShowActionIDLabel(ReAction:GetConfigMode()) | 978 self:ShowActionIDLabel(ReAction:GetConfigMode()) |
| 976 | 979 |
| 977 -- attach the keybinder | 980 -- attach the keybinder |
| 978 KBAttach(self) | 981 KBAttach(self) |
| 982 | |
| 983 -- attach to skinner | |
| 984 bar:SkinButton(self, | |
| 985 { | |
| 986 HotKey = self.hotkey, | |
| 987 } | |
| 988 ) | |
| 979 | 989 |
| 980 self:Refresh() | 990 self:Refresh() |
| 981 return self | 991 return self |
| 982 end | 992 end |
| 983 | 993 |
| 1101 count = 0 | 1111 count = 0 |
| 1102 end | 1112 end |
| 1103 f:SetAttribute("showgrid",count) | 1113 f:SetAttribute("showgrid",count) |
| 1104 | 1114 |
| 1105 if count >= 1 and not f:GetAttribute("statehidden") then | 1115 if count >= 1 and not f:GetAttribute("statehidden") then |
| 1106 self.normalTexture:SetVertexColor(1.0, 1.0, 1.0, 0.5); | 1116 if LBF then |
| 1117 LBF:SetNormalVertexColor(self.frame, 1.0, 1.0, 1.0, 0.5) | |
| 1118 else | |
| 1119 self.frame:GetNormalTexture():SetVertexColor(1.0, 1.0, 1.0, 0.5); | |
| 1120 end | |
| 1107 f:Show() | 1121 f:Show() |
| 1108 elseif count < 1 and not HasAction(self:GetActionID()) then | 1122 elseif count < 1 and not HasAction(self:GetActionID()) then |
| 1109 f:Hide() | 1123 f:Hide() |
| 1110 end | 1124 end |
| 1111 end | 1125 end |
