Mercurial > wow > buffalo2
comparison Modules/BuffFrame.lua @ 97:5476337198ec
- apply default anchors when docking modules
- Arifact Power tracker: totals AP items in bags and bank, and forecasts progress on each weapon. Requires user to shift-click each weapon at least once to get initial XP data.
author | Nenue |
---|---|
date | Mon, 16 Jan 2017 20:24:12 -0500 |
parents | bb38bc0e787f |
children | 6fa74abd83fd |
comparison
equal
deleted
inserted
replaced
96:bb38bc0e787f | 97:5476337198ec |
---|---|
33 local COUNT_ANCHOR = 'TOPRIGHT' | 33 local COUNT_ANCHOR = 'TOPRIGHT' |
34 local COUNT_INSET = 4 | 34 local COUNT_INSET = 4 |
35 local COUNT_PARENT | 35 local COUNT_PARENT |
36 | 36 |
37 local DURATION_ANCHOR = 'BOTTOMLEFT' | 37 local DURATION_ANCHOR = 'BOTTOMLEFT' |
38 local DURATION_INSET = 4 | 38 local DURATION_INSET = 1 |
39 local DURATION_PARENT | 39 local DURATION_PARENT |
40 | 40 |
41 VeneerBuffFrameMixin = { | 41 VeneerBuffFrameMixin = { |
42 moduleName = 'Buff Frames', | 42 moduleName = 'Buff Frames', |
43 defaultCluster = 'TOPRIGHT', | 43 defaultCluster = 'TOPRIGHT', |
241 self.count:ClearAllPoints() | 241 self.count:ClearAllPoints() |
242 self.count:SetPoint(COUNT_ANCHOR, COUNT_PARENT or self, COUNT_ANCHOR, | 242 self.count:SetPoint(COUNT_ANCHOR, COUNT_PARENT or self, COUNT_ANCHOR, |
243 (ANCHOR_INSET_DELTA[COUNT_ANCHOR][1] * COUNT_INSET), | 243 (ANCHOR_INSET_DELTA[COUNT_ANCHOR][1] * COUNT_INSET), |
244 (ANCHOR_INSET_DELTA[COUNT_ANCHOR][2] * COUNT_INSET)) | 244 (ANCHOR_INSET_DELTA[COUNT_ANCHOR][2] * COUNT_INSET)) |
245 | 245 |
246 | |
247 self.underlay:SetParent(UIParent) | 246 self.underlay:SetParent(UIParent) |
248 | 247 |
249 self.underlay:SetFrameStrata('BACKGROUND') | 248 self.underlay:SetFrameStrata('BACKGROUND') |
250 self.border:SetColorTexture(0,0,0,1) | 249 self.border:SetColorTexture(0,0,0,1) |
251 self.border:SetPoint('TOPLEFT', self, 'TOPLEFT', -BORDER_SIZE_L, BORDER_SIZE_U) | 250 self.border:SetPoint('TOPLEFT', self, 'TOPLEFT', -BORDER_SIZE_L, BORDER_SIZE_U) |
288 | 287 |
289 function plugin:Setup() | 288 function plugin:Setup() |
290 | 289 |
291 | 290 |
292 hooksecurefunc("BuffFrame_Update", function(...) self:OnBuffFrameUpdate(...) end) | 291 hooksecurefunc("BuffFrame_Update", function(...) self:OnBuffFrameUpdate(...) end) |
293 --hooksecurefunc("AuraButton_UpdateDuration", function(...) self:OnUpdateDuration(...) end) | 292 hooksecurefunc("AuraButton_UpdateDuration", function(...) self:OnUpdateDuration(...) end) |
294 hooksecurefunc("AuraButton_Update", function(...) self:OnAuraButton_Update(...) end) | 293 hooksecurefunc("AuraButton_Update", function(...) self:OnAuraButton_Update(...) end) |
295 hooksecurefunc("BuffFrame_UpdateAllBuffAnchors", function(...) self:OnUpdateAllBuffAnchors(...) end) | 294 hooksecurefunc("BuffFrame_UpdateAllBuffAnchors", function(...) self:OnUpdateAllBuffAnchors(...) end) |
296 hooksecurefunc("TemporaryEnchantFrame_Update", function(...) self:OnTemporaryEnchantFrameUpdate(...) end) | 295 hooksecurefunc("TemporaryEnchantFrame_Update", function(...) self:OnTemporaryEnchantFrameUpdate(...) end) |
297 for i = 1, 3 do | 296 for i = 1, 3 do |
298 self:SetupButton('TempEnchant'..i) | 297 self:SetupButton('TempEnchant'..i) |
562 local name = 'DebuffButton' .. i | 561 local name = 'DebuffButton' .. i |
563 local button = self:AcquireConfigButton(name) | 562 local button = self:AcquireConfigButton(name) |
564 end | 563 end |
565 end | 564 end |
566 function plugin:OnUpdateDuration (frame, timeLeft) | 565 function plugin:OnUpdateDuration (frame, timeLeft) |
567 local veneer = self:Acquire(frame) | 566 local veneer = self:Acquire(frame:GetName()) |
568 local hours = floor(timeLeft/3600) | 567 local hours = floor(timeLeft/3600) |
569 local minutes = floor(mod(timeLeft, 3600)/60) | 568 local minutes = floor(mod(timeLeft, 3600)/60) |
570 local seconds = floor(mod(timeLeft, 60)) | 569 local seconds = floor(mod(timeLeft, 60)) |
571 local timeString = '%ds' | 570 local timeString = '%ds' |
572 if timeLeft > 3600 then | 571 if timeLeft > 3600 then |
578 end | 577 end |
579 | 578 |
580 if timeLeft < 10 then | 579 if timeLeft < 10 then |
581 if not veneer.duration.getHuge then | 580 if not veneer.duration.getHuge then |
582 veneer.duration.getHuge = true | 581 veneer.duration.getHuge = true |
583 veneer.duration:SetFontObject(VeneerNumberFontLarge) | 582 veneer.duration:SetTextColor(1,.5,0,1) |
584 veneer.duration:SetTextColor(1,1,0,1) | |
585 end | 583 end |
586 else | 584 else |
587 if veneer.duration.getHuge then | 585 if veneer.duration.getHuge then |
588 veneer.duration.getHuge = nil | 586 veneer.duration.getHuge = nil |
589 veneer.duration:SetFontObject(VeneerNumberFont) | |
590 veneer.duration:SetTextColor(1,1,1,1) | 587 veneer.duration:SetTextColor(1,1,1,1) |
591 end | 588 end |
592 end | 589 end |
593 | 590 |
594 veneer.duration:SetText(timeString) | 591 veneer.duration:SetText(timeString) |