Mercurial > wow > kbf
comparison KBF.lua @ 9:ede17cc71b66
Don't set bars to full & then actual value every update, flicker is bad
author | Chris Mellon <arkanes@gmai.com> |
---|---|
date | Tue, 12 Oct 2010 22:11:46 -0500 |
parents | d0b83b70c7f8 |
children | 7309cc67cac0 |
comparison
equal
deleted
inserted
replaced
8:d0b83b70c7f8 | 9:ede17cc71b66 |
---|---|
45 local frame = self.secureFrame:GetAttribute("child"..idx) | 45 local frame = self.secureFrame:GetAttribute("child"..idx) |
46 if not frame then break end | 46 if not frame then break end |
47 if self.dirty then | 47 if self.dirty then |
48 local unit = self.secureFrame:GetAttribute("unit") | 48 local unit = self.secureFrame:GetAttribute("unit") |
49 self:BindBarToBuff(frame, unit) | 49 self:BindBarToBuff(frame, unit) |
50 elseif frame.expirationTime then | 50 end |
51 if frame.expirationTime then | |
51 local remaining = frame.expirationTime - GetTime() | 52 local remaining = frame.expirationTime - GetTime() |
52 remaining = math.max(0, remaining) | 53 remaining = math.max(0, remaining) |
53 local perc = remaining / frame.duration | 54 local perc = remaining / frame.duration |
54 frame.timertext:SetText(self:FormatTimeText(remaining)) | 55 frame.timertext:SetText(self:FormatTimeText(remaining)) |
55 frame.statusbar:SetValue(remaining) | 56 frame.statusbar:SetValue(remaining) |
81 -- store duration information | 82 -- store duration information |
82 if duration and duration > 0 then | 83 if duration and duration > 0 then |
83 parentFrame.expirationTime = expirationTime | 84 parentFrame.expirationTime = expirationTime |
84 parentFrame.duration = duration | 85 parentFrame.duration = duration |
85 parentFrame.statusbar:SetMinMaxValues(0, duration) | 86 parentFrame.statusbar:SetMinMaxValues(0, duration) |
86 parentFrame.statusbar:SetValue(duration) | |
87 else | 87 else |
88 parentFrame.expirationTime = nil | 88 parentFrame.expirationTime = nil |
89 parentFrame.duration = 0 | 89 parentFrame.duration = 0 |
90 parentFrame.statusbar:SetMinMaxValues(0,1) | 90 parentFrame.statusbar:SetMinMaxValues(0,1) |
91 parentFrame.statusbar:SetValue(1) | 91 parentFrame.statusbar:SetValue(1) |