annotate 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
rev   line source
flickerstreak@7 1 -- The ReAction.ActionDisplay mixin defines 'regular' action button display functionality
flickerstreak@7 2 -- and is an implementation of the ReAction.IDisplay and ReAction.ActionType.IDisplay interfaces.
flickerstreak@7 3 --
flickerstreak@7 4 -- This Mixin assumes that it has been mixed in with a ReAction-derived class which implements
flickerstreak@7 5 -- the ReAction.IActionType and ReAction.IColorScheme interfaces.
flickerstreak@7 6 --
flickerstreak@7 7 -- This mixin uses properties of self.config to define display elements:
flickerstreak@7 8 --
flickerstreak@7 9 -- self.config = {
flickerstreak@8 10 -- keyBindLoc = "POSITION", -- keybind anchor location
flickerstreak@8 11 -- stackCountLoc = "POSITION", -- stack count anchor location
flickerstreak@8 12 -- showKeyBind = true/false, -- show keybind labels
flickerstreak@8 13 -- showStackCount = true/false, -- show stack count labels
flickerstreak@8 14 -- showMacroText = true/false, -- show macro name labels
flickerstreak@8 15 -- showGrid = true/false, -- always show empty buttons
flickerstreak@8 16 -- hideCooldown = true/false, -- hide the cooldown timer
flickerstreak@8 17 -- hideGlobalCooldown = true/false, -- hide cooldown timers if duration < 1.5 seconds (global)
flickerstreak@8 18 -- opacity = {
flickerstreak@8 19 -- default = 0-100 [100], -- button opacity when the action is usable (default opacity)
flickerstreak@8 20 -- notUsable = 0-100 [100], -- button opacity when the action is not usable
flickerstreak@8 21 -- oom = 0-100 [notUsable], -- button opacity when the action is not usable due to OOM
flickerstreak@8 22 -- ooRange = 0-100 [notUsable], -- button opacity when the action is not usable due to out of range
flickerstreak@8 23 -- empty = 0-100 [0], -- button opacity when the action slot is empty
flickerstreak@8 24 -- },
flickerstreak@8 25 -- hideEmptySlots = true/false, -- show/hide empty buttons rather than change opacity to 0
flickerstreak@7 26 -- }
flickerstreak@7 27 --
flickerstreak@7 28
flickerstreak@7 29 local AceOO = AceLibrary("AceOO-2.0")
flickerstreak@7 30
flickerstreak@7 31 ReAction.ActionDisplay = AceOO.Mixin {
flickerstreak@7 32 -- ReAction.IDisplay interface
flickerstreak@7 33 "SetupDisplay",
flickerstreak@7 34 "UpdateDisplay",
flickerstreak@7 35 "TempShow",
flickerstreak@7 36 "GetActionFrame",
flickerstreak@7 37 "GetBaseButtonSize",
flickerstreak@7 38 "DisplayID",
flickerstreak@7 39 "DisplayHotkey",
flickerstreak@7 40
flickerstreak@7 41 -- ReAction.ActionType.IDisplay interface
flickerstreak@7 42 "DisplayUsable",
flickerstreak@7 43 "DisplayEquipped",
flickerstreak@7 44 "DisplayAutoRepeat",
flickerstreak@7 45 "DisplayInUse",
flickerstreak@7 46 "DisplayIcon",
flickerstreak@7 47 "DisplayName",
flickerstreak@7 48 "DisplayCount",
flickerstreak@7 49 "DisplayCooldown",
flickerstreak@7 50
flickerstreak@7 51 -- Event handlers
flickerstreak@7 52 "PostClick",
flickerstreak@7 53 "OnDragStart",
flickerstreak@7 54 "OnReceiveDrag",
flickerstreak@7 55 "OnEnter",
flickerstreak@7 56 "OnLeave",
flickerstreak@7 57 "OnUpdate",
flickerstreak@7 58
flickerstreak@7 59 -- internal functions
flickerstreak@7 60 "ApplyLayout",
flickerstreak@7 61 "ApplyStyle",
flickerstreak@7 62 "StartFlash",
flickerstreak@7 63 "StopFlash",
flickerstreak@7 64 "IsFlashing",
flickerstreak@7 65 "DisplayVisibility",
flickerstreak@7 66 }
flickerstreak@7 67
flickerstreak@7 68 local RAAD = ReAction.ActionDisplay
flickerstreak@7 69
flickerstreak@7 70
flickerstreak@7 71 -- private constants
flickerstreak@7 72 local _G = getfenv(0)
flickerstreak@7 73
flickerstreak@7 74 local equippedActionBorderColor = { r=0.00, g=1.00, b=0.00, a=0.35 } -- transparent green
flickerstreak@7 75 local actionIDColor = { r=1.00, g=0.82, b=0.00, a=1.00 } -- gold
flickerstreak@7 76
flickerstreak@7 77 -- private functions
flickerstreak@7 78 -- extract and return color fields from a table, to be fed into SetVertexColor()/SetTextColor()
flickerstreak@7 79 local function tcolor(c)
flickerstreak@7 80 return c.r, c.g, c.b, c.a
flickerstreak@7 81 end
flickerstreak@7 82
flickerstreak@7 83
flickerstreak@7 84 -----------------------------------
flickerstreak@7 85 -- Interface Implementation Methods
flickerstreak@7 86 -----------------------------------
flickerstreak@7 87 function RAAD:SetupDisplay( name )
flickerstreak@7 88 -- create the button widget
flickerstreak@7 89 local b = CreateFrame("CheckButton", name, nil, "SecureActionButtonTemplate, ActionButtonTemplate")
flickerstreak@7 90
flickerstreak@7 91 -- store references to the various sub-frames of ActionButtonTemplate so we don't have to look it up all the time
flickerstreak@7 92 self.frames = {
flickerstreak@7 93 button = b,
flickerstreak@7 94 hotkey = _G[name.."HotKey"],
flickerstreak@7 95 count = _G[name.."Count"],
flickerstreak@7 96 cooldown = _G[name.."Cooldown"],
flickerstreak@7 97 macro = _G[name.."Name"],
flickerstreak@7 98 icon = _G[name.."Icon"],
flickerstreak@7 99 border = _G[name.."Border"],
flickerstreak@7 100 flash = _G[name.."Flash"],
flickerstreak@7 101 normalTexture = _G[name.."NormalTexture"],
flickerstreak@7 102 actionID = nil, -- defer creating actionID font string until it's actually requested
flickerstreak@7 103 }
flickerstreak@7 104
flickerstreak@7 105 -- ??? odd: why do we have to increment the cooldown frame level to get it to show?
flickerstreak@7 106 -- (otherwise it's behind the icon). The default UI doesn't have to (or at least I can't
flickerstreak@7 107 -- find where it does) but for some reason we have to here.
flickerstreak@7 108 self.frames.cooldown:SetFrameLevel(self.frames.cooldown:GetFrameLevel() + 1)
flickerstreak@7 109
flickerstreak@10 110 -- create a right-click hotkey label
flickerstreak@10 111 local hkr = b:CreateFontString(nil,"ARTWORK","NumberFontNormalSmallGray")
flickerstreak@10 112 hkr:SetWidth(36)
flickerstreak@10 113 hkr:SetHeight(10)
flickerstreak@10 114 hkr:Hide()
flickerstreak@10 115 self.frames.hotkeyright = hkr
flickerstreak@10 116
flickerstreak@7 117 b:EnableMouse()
flickerstreak@7 118 b:RegisterForDrag("LeftButton", "RightButton")
flickerstreak@7 119 b:RegisterForClicks("AnyUp")
flickerstreak@7 120 b:SetScript("PostClick", function(arg1) self:PostClick(arg1) end)
flickerstreak@7 121 b:SetScript("OnDragStart", function(arg1) self:OnDragStart(arg1) end)
flickerstreak@7 122 b:SetScript("OnReceiveDrag", function() self:OnReceiveDrag() end)
flickerstreak@7 123 b:SetScript("OnEnter", function() self:OnEnter() end)
flickerstreak@7 124 b:SetScript("OnLeave", function() self:OnLeave() end)
flickerstreak@7 125 -- defer setting OnUpdate until actions are actually attached
flickerstreak@7 126
flickerstreak@7 127 self.tmpShow_ = 0
flickerstreak@7 128 end
flickerstreak@7 129
flickerstreak@7 130 function RAAD:UpdateDisplay()
flickerstreak@7 131 self:ApplyLayout()
flickerstreak@7 132 self:ApplyStyle()
flickerstreak@7 133 self:DisplayVisibility()
flickerstreak@7 134 -- refresh the action ID display
flickerstreak@7 135 if ReAction.showIDs_ then
flickerstreak@8 136 self:DisplayID(true)
flickerstreak@7 137 end
flickerstreak@7 138 end
flickerstreak@7 139
flickerstreak@7 140 function RAAD:TempShow( visible )
flickerstreak@7 141 visible = visible and true or false -- force data integrity
flickerstreak@7 142 self.showTmp_ = max(0, (self.showTmp_ or 0) + (visible and 1 or -1))
flickerstreak@7 143 self:DisplayVisibility()
flickerstreak@7 144 end
flickerstreak@7 145
flickerstreak@7 146 function RAAD:GetActionFrame()
flickerstreak@7 147 return self.frames.button
flickerstreak@7 148 end
flickerstreak@7 149
flickerstreak@7 150 function RAAD:GetBaseButtonSize()
flickerstreak@7 151 return 36
flickerstreak@7 152 end
flickerstreak@7 153
flickerstreak@8 154 function RAAD:DisplayID( show )
flickerstreak@7 155 local f = self.frames.actionID
flickerstreak@8 156 if show then
flickerstreak@7 157 if not f then
flickerstreak@7 158 -- create the actionID label
flickerstreak@7 159 f = self.frames.button:CreateFontString(nil,"ARTWORK","NumberFontNormalSmall")
flickerstreak@10 160 f:SetPoint("CENTER")
flickerstreak@7 161 f:SetTextColor( tcolor(actionIDColor) )
flickerstreak@7 162 self.frames.actionID = f
flickerstreak@7 163 end
flickerstreak@8 164 f:SetText(tostring(self:GetID()))
flickerstreak@7 165 f:Show()
flickerstreak@7 166 elseif f then
flickerstreak@7 167 f:Hide()
flickerstreak@7 168 end
flickerstreak@7 169 end
flickerstreak@7 170
flickerstreak@10 171 function RAAD:DisplayHotkey(txt,button)
flickerstreak@10 172 button = button or "LeftButton"
flickerstreak@10 173 if button == "LeftButton" then
flickerstreak@10 174 self.frames.hotkey:SetText(string.upper(txt or ""))
flickerstreak@10 175 elseif button == "RightButton" then
flickerstreak@10 176 self.frames.hotkeyright:SetText(string.upper(txt or ""))
flickerstreak@10 177 end
flickerstreak@7 178 self:UpdateUsable()
flickerstreak@7 179 end
flickerstreak@7 180
flickerstreak@7 181 function RAAD:DisplayUsable( isUsable, notEnoughMana, outOfRange )
flickerstreak@7 182 local f = self.frames
flickerstreak@7 183 f.icon:SetVertexColor( self:GetIconColor(isUsable, notEnoughMana, outOfRange) )
flickerstreak@7 184 f.button:GetNormalTexture():SetVertexColor( self:GetBorderColor(isUsable, notEnoughMana, outOfRange) )
flickerstreak@7 185 f.hotkey:SetTextColor( self:GetHotkeyColor(isUsable, notEnoughMana, outOfRange, f.hotkey:GetText()) )
flickerstreak@10 186 f.hotkeyright:SetTextColor( self:GetHotkeyColor(isUsable, notEnoughMana, outOfRange, f.hotkeyright:GetText()) )
flickerstreak@8 187
flickerstreak@8 188 local o
flickerstreak@8 189 if isUsable then
flickerstreak@8 190 o = self.config.opacity and self.config.opacity.usable or 1
flickerstreak@8 191 else
flickerstreak@8 192 o = self.config.opacity and self.config.opacity.notUsable or 1
flickerstreak@8 193 if notEnoughMana then
flickerstreak@8 194 o = self.config.opacity and self.config.opacity.oom or o
flickerstreak@8 195 elseif outOfRange then
flickerstreak@8 196 o = self.config.opacity and self.config.opacity.ooRange or o
flickerstreak@8 197 end
flickerstreak@8 198 end
flickerstreak@8 199
flickerstreak@8 200 self.currentOpacity = o -- store for use in DisplayVisibility
flickerstreak@8 201 self:DisplayVisibility()
flickerstreak@7 202 end
flickerstreak@7 203
flickerstreak@7 204 function RAAD:DisplayEquipped( equipped )
flickerstreak@7 205 local b = self.frames.border
flickerstreak@7 206 if equipped then
flickerstreak@7 207 b:Show()
flickerstreak@7 208 else
flickerstreak@7 209 b:Hide()
flickerstreak@7 210 end
flickerstreak@7 211 end
flickerstreak@7 212
flickerstreak@7 213 function RAAD:DisplayAutoRepeat( r )
flickerstreak@7 214 if r then
flickerstreak@7 215 self:StartFlash()
flickerstreak@7 216 else
flickerstreak@7 217 self:StopFlash()
flickerstreak@7 218 end
flickerstreak@7 219 end
flickerstreak@7 220
flickerstreak@7 221 function RAAD:DisplayInUse( inUse )
flickerstreak@7 222 self.frames.button:SetChecked( inUse and 1 or 0 )
flickerstreak@7 223 end
flickerstreak@7 224
flickerstreak@7 225 function RAAD:DisplayIcon( texture )
flickerstreak@7 226 local f = self.frames.button
flickerstreak@7 227 local icon = self.frames.icon
flickerstreak@7 228 if texture then
flickerstreak@7 229 icon:SetTexture(texture)
flickerstreak@7 230 icon:Show()
flickerstreak@7 231 self.rangeTimer = -1
flickerstreak@7 232 f:SetNormalTexture("Interface\\Buttons\\UI-Quickslot2")
flickerstreak@7 233 if f:GetScript("OnUpdate") == nil then
flickerstreak@7 234 f:SetScript("OnUpdate", function(frame, elapsed) self:OnUpdate(elapsed) end)
flickerstreak@7 235 end
flickerstreak@7 236 else
flickerstreak@7 237 icon:Hide()
flickerstreak@7 238 self.rangeTimer = nil
flickerstreak@7 239 f:SetNormalTexture("Interface\\Buttons\\UI-Quickslot")
flickerstreak@7 240 f:SetScript("OnUpdate",nil)
flickerstreak@7 241 end
flickerstreak@7 242 self:DisplayVisibility()
flickerstreak@7 243 end
flickerstreak@7 244
flickerstreak@7 245 function RAAD:DisplayCooldown( start, duration, enable )
flickerstreak@9 246 enable = (enable > 0 ) and not self.config.hideCooldown and (not self.config.hideGlobalCooldown or duration > 1.5) and 1 or 0
flickerstreak@7 247 CooldownFrame_SetTimer(self.frames.cooldown, start, duration, enable)
flickerstreak@7 248 end
flickerstreak@7 249
flickerstreak@7 250 function RAAD:DisplayName( name )
flickerstreak@7 251 self.frames.macro:SetText(name and tostring(name) or "")
flickerstreak@7 252 end
flickerstreak@7 253
flickerstreak@7 254 function RAAD:DisplayCount( count )
flickerstreak@7 255 self.frames.count:SetText(count and tostring(count) or "")
flickerstreak@7 256 end
flickerstreak@7 257
flickerstreak@7 258
flickerstreak@7 259
flickerstreak@7 260
flickerstreak@7 261
flickerstreak@7 262 ----------------------
flickerstreak@7 263 -- Event Handlers
flickerstreak@7 264 ----------------------
flickerstreak@7 265 function RAAD:PostClick()
flickerstreak@7 266 self:UpdateInUse()
flickerstreak@7 267 end
flickerstreak@7 268
flickerstreak@7 269 function RAAD:OnDragStart()
flickerstreak@7 270 if LOCK_ACTIONBAR ~= "1" or IsShiftKeyDown() then
flickerstreak@7 271 self:PickupAction()
flickerstreak@7 272 end
flickerstreak@7 273 end
flickerstreak@7 274
flickerstreak@7 275 function RAAD:OnReceiveDrag()
flickerstreak@7 276 self:PlaceAction()
flickerstreak@7 277 end
flickerstreak@7 278
flickerstreak@7 279 function RAAD:OnEnter()
flickerstreak@7 280 self:SetTooltip() -- from ReAction base class
flickerstreak@7 281 self.tooltipTime = TOOLTIP_UPDATE_TIME
flickerstreak@7 282 end
flickerstreak@7 283
flickerstreak@7 284 function RAAD:OnLeave()
flickerstreak@7 285 self:ClearTooltip() -- from ReAction base class
flickerstreak@7 286 self.tooltipTime = nil
flickerstreak@7 287 end
flickerstreak@7 288
flickerstreak@7 289 function RAAD:OnUpdate(elapsed)
flickerstreak@7 290 -- handle flashing
flickerstreak@7 291 if self:IsFlashing() then
flickerstreak@7 292 self.flashtime = self.flashtime - elapsed
flickerstreak@7 293 if self.flashtime <= 0 then
flickerstreak@7 294 local overtime = -self.flashtime
flickerstreak@7 295 if overtime >= ATTACK_BUTTON_FLASH_TIME then
flickerstreak@7 296 overtime = 0
flickerstreak@7 297 end
flickerstreak@7 298 self.flashtime = ATTACK_BUTTON_FLASH_TIME - overtime
flickerstreak@7 299
flickerstreak@7 300 local f = self.frames.flash
flickerstreak@7 301 if f then
flickerstreak@7 302 if f:IsVisible() then
flickerstreak@7 303 f:Hide()
flickerstreak@7 304 else
flickerstreak@7 305 f:Show()
flickerstreak@7 306 end
flickerstreak@7 307 end
flickerstreak@7 308 end
flickerstreak@7 309 end
flickerstreak@7 310
flickerstreak@7 311 -- Handle range indicator
flickerstreak@7 312 if self.rangeTimer then
flickerstreak@7 313 self.rangeTimer = self.rangeTimer - elapsed
flickerstreak@7 314 if self.rangeTimer <= 0 then
flickerstreak@7 315 self:UpdateUsable()
flickerstreak@7 316 self.rangeTimer = TOOLTIP_UPDATE_TIME
flickerstreak@7 317 end
flickerstreak@7 318 end
flickerstreak@7 319
flickerstreak@7 320 -- handle tooltip update
flickerstreak@7 321 if self.tooltipTime then
flickerstreak@7 322 self.tooltipTime = self.tooltipTime - elapsed
flickerstreak@7 323 if self.tooltipTime <= 0 then
flickerstreak@7 324 if GameTooltip:IsOwned(self.frames.button) then
flickerstreak@7 325 self:UpdateTooltip()
flickerstreak@7 326 self.tooltipTime = TOOLTIP_UPDATE_TIME
flickerstreak@7 327 else
flickerstreak@7 328 self.tooltipTime = nil
flickerstreak@7 329 end
flickerstreak@7 330 end
flickerstreak@7 331 end
flickerstreak@7 332 end
flickerstreak@7 333
flickerstreak@7 334
flickerstreak@7 335
flickerstreak@7 336 ----------------------
flickerstreak@7 337 -- Internal methods
flickerstreak@7 338 ----------------------
flickerstreak@7 339
flickerstreak@7 340 local function placeLabel( label, anchor )
flickerstreak@7 341 local top = string.match(anchor,"TOP")
flickerstreak@7 342 local bottom = string.match(anchor, "BOTTOM")
flickerstreak@7 343 label:ClearAllPoints()
flickerstreak@7 344 label:SetWidth(40)
flickerstreak@7 345 label:SetPoint(top or bottom or "CENTER",0,top and 2 or bottom and -2 or 0)
flickerstreak@7 346 local j
flickerstreak@7 347 if string.match(anchor,"LEFT") then
flickerstreak@7 348 j = "LEFT"
flickerstreak@7 349 elseif string.match(anchor,"RIGHT") then
flickerstreak@7 350 j = "RIGHT"
flickerstreak@7 351 else
flickerstreak@7 352 j = "CENTER"
flickerstreak@7 353 end
flickerstreak@7 354 label:SetJustifyH(j)
flickerstreak@7 355 end
flickerstreak@7 356
flickerstreak@7 357
flickerstreak@7 358 function RAAD:ApplyLayout()
flickerstreak@7 359 local f = self.frames
flickerstreak@7 360
flickerstreak@7 361 if self.config.keyBindLoc then
flickerstreak@7 362 placeLabel(f.hotkey, self.config.keyBindLoc)
flickerstreak@7 363 end
flickerstreak@7 364
flickerstreak@10 365 if self.config.keyBindRightLoc then
flickerstreak@10 366 placeLabel(f.hotkeyright, self.config.keyBindRightLoc)
flickerstreak@10 367 end
flickerstreak@10 368
flickerstreak@7 369 if self.config.stackCountLoc then
flickerstreak@7 370 placeLabel(f.count, self.config.stackCountLoc)
flickerstreak@7 371 end
flickerstreak@7 372
flickerstreak@7 373 if self.config.showKeyBind then
flickerstreak@7 374 f.hotkey:Show()
flickerstreak@7 375 else
flickerstreak@7 376 f.hotkey:Hide()
flickerstreak@7 377 end
flickerstreak@7 378
flickerstreak@10 379 if self.config.showKeyBindRight then
flickerstreak@10 380 f.hotkeyright:Show()
flickerstreak@10 381 else
flickerstreak@10 382 f.hotkeyright:Hide()
flickerstreak@10 383 end
flickerstreak@10 384
flickerstreak@7 385 if self.config.showStackCount then
flickerstreak@7 386 f.count:Show()
flickerstreak@7 387 else
flickerstreak@7 388 f.count:Hide()
flickerstreak@7 389 end
flickerstreak@7 390
flickerstreak@7 391 if self.config.showMacroName then
flickerstreak@7 392 f.macro:Show()
flickerstreak@7 393 else
flickerstreak@7 394 f.macro:Hide()
flickerstreak@7 395 end
flickerstreak@7 396
flickerstreak@7 397 end
flickerstreak@7 398
flickerstreak@7 399 function RAAD:ApplyStyle()
flickerstreak@7 400 local f = self.frames
flickerstreak@7 401 -- for now, just a static style
flickerstreak@7 402 f.hotkey:SetFontObject(NumberFontNormal)
flickerstreak@10 403 f.hotkeyright:SetFontObject(NumberFontNormalSmall)
flickerstreak@7 404 f.count:SetFontObject(NumberFontNormalYellow)
flickerstreak@7 405 f.border:SetVertexColor( tcolor(equippedActionBorderColor) )
flickerstreak@7 406 end
flickerstreak@7 407
flickerstreak@7 408 function RAAD:StartFlash()
flickerstreak@7 409 self.flashing = true
flickerstreak@7 410 self.flashtime = 0
flickerstreak@7 411 end
flickerstreak@7 412
flickerstreak@7 413 function RAAD:StopFlash()
flickerstreak@7 414 self.flashing = false
flickerstreak@7 415 self.frames.flash:Hide()
flickerstreak@7 416 end
flickerstreak@7 417
flickerstreak@7 418 function RAAD:IsFlashing()
flickerstreak@7 419 return self.flashing
flickerstreak@7 420 end
flickerstreak@7 421
flickerstreak@7 422 function RAAD:DisplayVisibility()
flickerstreak@7 423 local b = self.frames.button
flickerstreak@7 424
flickerstreak@7 425 if b:GetAttribute("statehidden") then
flickerstreak@7 426 -- can't hide/show in combat
flickerstreak@7 427 if not InCombatLockdown() then
flickerstreak@7 428 b:Hide()
flickerstreak@7 429 end
flickerstreak@8 430 elseif self.showTmp_ and self.showTmp_ > 0 then
flickerstreak@8 431 b:GetNormalTexture():SetAlpha(0.5)
flickerstreak@8 432 if self:IsActionEmpty() then
flickerstreak@8 433 self.frames.cooldown:Hide()
flickerstreak@8 434 if not InCombatLockdown() and not b:IsShown() then
flickerstreak@8 435 b:Show()
flickerstreak@8 436 end
flickerstreak@8 437 end
flickerstreak@8 438 b:SetAlpha(1)
flickerstreak@7 439 elseif not self:IsActionEmpty() then
flickerstreak@7 440 b:GetNormalTexture():SetAlpha(1.0)
flickerstreak@8 441 b:SetAlpha(self.currentOpacity or (self.config.opacity and self.config.opacity.usable) or 1)
flickerstreak@7 442 else
flickerstreak@8 443 if self.config.hideEmptySlots then
flickerstreak@8 444 if not InCombatLockdown() then
flickerstreak@8 445 b:Hide()
flickerstreak@8 446 end
flickerstreak@8 447 else
flickerstreak@8 448 b:SetAlpha(self.config.opacity and self.config.opacity.empty or 0)
flickerstreak@8 449 end
flickerstreak@7 450 end
flickerstreak@7 451 end
flickerstreak@7 452