Mercurial > wow > reaction
comparison classes/ReAction_ActionDisplay.lua @ 10:f3a7bfebc283
Version 0.33
author | Flick <flickerstreak@gmail.com> |
---|---|
date | Tue, 20 Mar 2007 21:37:38 +0000 |
parents | 650f75d08952 |
children |
comparison
equal
deleted
inserted
replaced
9:650f75d08952 | 10:f3a7bfebc283 |
---|---|
105 -- ??? odd: why do we have to increment the cooldown frame level to get it to show? | 105 -- ??? odd: why do we have to increment the cooldown frame level to get it to show? |
106 -- (otherwise it's behind the icon). The default UI doesn't have to (or at least I can't | 106 -- (otherwise it's behind the icon). The default UI doesn't have to (or at least I can't |
107 -- find where it does) but for some reason we have to here. | 107 -- find where it does) but for some reason we have to here. |
108 self.frames.cooldown:SetFrameLevel(self.frames.cooldown:GetFrameLevel() + 1) | 108 self.frames.cooldown:SetFrameLevel(self.frames.cooldown:GetFrameLevel() + 1) |
109 | 109 |
110 -- create a right-click hotkey label | |
111 local hkr = b:CreateFontString(nil,"ARTWORK","NumberFontNormalSmallGray") | |
112 hkr:SetWidth(36) | |
113 hkr:SetHeight(10) | |
114 hkr:Hide() | |
115 self.frames.hotkeyright = hkr | |
116 | |
110 b:EnableMouse() | 117 b:EnableMouse() |
111 b:RegisterForDrag("LeftButton", "RightButton") | 118 b:RegisterForDrag("LeftButton", "RightButton") |
112 b:RegisterForClicks("AnyUp") | 119 b:RegisterForClicks("AnyUp") |
113 b:SetScript("PostClick", function(arg1) self:PostClick(arg1) end) | 120 b:SetScript("PostClick", function(arg1) self:PostClick(arg1) end) |
114 b:SetScript("OnDragStart", function(arg1) self:OnDragStart(arg1) end) | 121 b:SetScript("OnDragStart", function(arg1) self:OnDragStart(arg1) end) |
148 local f = self.frames.actionID | 155 local f = self.frames.actionID |
149 if show then | 156 if show then |
150 if not f then | 157 if not f then |
151 -- create the actionID label | 158 -- create the actionID label |
152 f = self.frames.button:CreateFontString(nil,"ARTWORK","NumberFontNormalSmall") | 159 f = self.frames.button:CreateFontString(nil,"ARTWORK","NumberFontNormalSmall") |
153 f:SetPoint("BOTTOMLEFT") | 160 f:SetPoint("CENTER") |
154 f:SetTextColor( tcolor(actionIDColor) ) | 161 f:SetTextColor( tcolor(actionIDColor) ) |
155 self.frames.actionID = f | 162 self.frames.actionID = f |
156 end | 163 end |
157 f:SetText(tostring(self:GetID())) | 164 f:SetText(tostring(self:GetID())) |
158 f:Show() | 165 f:Show() |
159 elseif f then | 166 elseif f then |
160 f:Hide() | 167 f:Hide() |
161 end | 168 end |
162 end | 169 end |
163 | 170 |
164 function RAAD:DisplayHotkey(txt) | 171 function RAAD:DisplayHotkey(txt,button) |
165 self.frames.hotkey:SetText(string.upper(txt or "")) | 172 button = button or "LeftButton" |
173 if button == "LeftButton" then | |
174 self.frames.hotkey:SetText(string.upper(txt or "")) | |
175 elseif button == "RightButton" then | |
176 self.frames.hotkeyright:SetText(string.upper(txt or "")) | |
177 end | |
166 self:UpdateUsable() | 178 self:UpdateUsable() |
167 end | 179 end |
168 | 180 |
169 function RAAD:DisplayUsable( isUsable, notEnoughMana, outOfRange ) | 181 function RAAD:DisplayUsable( isUsable, notEnoughMana, outOfRange ) |
170 local f = self.frames | 182 local f = self.frames |
171 f.icon:SetVertexColor( self:GetIconColor(isUsable, notEnoughMana, outOfRange) ) | 183 f.icon:SetVertexColor( self:GetIconColor(isUsable, notEnoughMana, outOfRange) ) |
172 f.button:GetNormalTexture():SetVertexColor( self:GetBorderColor(isUsable, notEnoughMana, outOfRange) ) | 184 f.button:GetNormalTexture():SetVertexColor( self:GetBorderColor(isUsable, notEnoughMana, outOfRange) ) |
173 f.hotkey:SetTextColor( self:GetHotkeyColor(isUsable, notEnoughMana, outOfRange, f.hotkey:GetText()) ) | 185 f.hotkey:SetTextColor( self:GetHotkeyColor(isUsable, notEnoughMana, outOfRange, f.hotkey:GetText()) ) |
186 f.hotkeyright:SetTextColor( self:GetHotkeyColor(isUsable, notEnoughMana, outOfRange, f.hotkeyright:GetText()) ) | |
174 | 187 |
175 local o | 188 local o |
176 if isUsable then | 189 if isUsable then |
177 o = self.config.opacity and self.config.opacity.usable or 1 | 190 o = self.config.opacity and self.config.opacity.usable or 1 |
178 else | 191 else |
347 | 360 |
348 if self.config.keyBindLoc then | 361 if self.config.keyBindLoc then |
349 placeLabel(f.hotkey, self.config.keyBindLoc) | 362 placeLabel(f.hotkey, self.config.keyBindLoc) |
350 end | 363 end |
351 | 364 |
365 if self.config.keyBindRightLoc then | |
366 placeLabel(f.hotkeyright, self.config.keyBindRightLoc) | |
367 end | |
368 | |
352 if self.config.stackCountLoc then | 369 if self.config.stackCountLoc then |
353 placeLabel(f.count, self.config.stackCountLoc) | 370 placeLabel(f.count, self.config.stackCountLoc) |
354 end | 371 end |
355 | 372 |
356 if self.config.showKeyBind then | 373 if self.config.showKeyBind then |
357 f.hotkey:Show() | 374 f.hotkey:Show() |
358 else | 375 else |
359 f.hotkey:Hide() | 376 f.hotkey:Hide() |
377 end | |
378 | |
379 if self.config.showKeyBindRight then | |
380 f.hotkeyright:Show() | |
381 else | |
382 f.hotkeyright:Hide() | |
360 end | 383 end |
361 | 384 |
362 if self.config.showStackCount then | 385 if self.config.showStackCount then |
363 f.count:Show() | 386 f.count:Show() |
364 else | 387 else |
375 | 398 |
376 function RAAD:ApplyStyle() | 399 function RAAD:ApplyStyle() |
377 local f = self.frames | 400 local f = self.frames |
378 -- for now, just a static style | 401 -- for now, just a static style |
379 f.hotkey:SetFontObject(NumberFontNormal) | 402 f.hotkey:SetFontObject(NumberFontNormal) |
403 f.hotkeyright:SetFontObject(NumberFontNormalSmall) | |
380 f.count:SetFontObject(NumberFontNormalYellow) | 404 f.count:SetFontObject(NumberFontNormalYellow) |
381 f.border:SetVertexColor( tcolor(equippedActionBorderColor) ) | 405 f.border:SetVertexColor( tcolor(equippedActionBorderColor) ) |
382 end | 406 end |
383 | 407 |
384 function RAAD:StartFlash() | 408 function RAAD:StartFlash() |