Skip to content

Commit

Permalink
Dont throttle combat time
Browse files Browse the repository at this point in the history
  • Loading branch information
Zariel committed Apr 20, 2010
1 parent dfa35ee commit 441f0c3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
13 changes: 6 additions & 7 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ local timer = 0
local OnUpdate = function(self, elapsed)
timer = timer + elapsed

for unit, guid in self:IterateUnitRoster() do
if UnitAffectingCombat(unit) then
self.combatTime[guid] = (self.combatTime[guid] or 0) + timer
end
end

if timer > 0.5 then
if self.currentDisplay and self.currentDisplay.dirty then
self.currentDisplay:UpdateDisplay()
end

-- Dont throttle this ?
for unit, guid in self:IterateUnitRoster() do
if UnitAffectingCombat(unit) then
self.combatTime[guid] = (self.combatTime[guid] or 0) + timer
end
end

if self.currentDisplay and self.currentDisplay.tip then
self.OnEnter(GameTooltip:GetOwner())
end
Expand Down
11 changes: 6 additions & 5 deletions display.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ local Display = {}

function Display:Update(guid, ammount, name)
local bar = self.guids[guid]
bar.name = name

if name then
bar.name = string.match(name, "(%w*)%-?")
end

bar.total = bar.total + ammount
self.total = self.total + ammount
Expand Down Expand Up @@ -187,7 +190,7 @@ function Display:Output(count, where, player)
for i = 1, count or #self.bars do
if not self.bars[i] then break end
bar = self.bars[i]
output(string.format("%d. %s - %d (%d%s) - %d%%", i, bar.name, bar.total, GetDPS(bar), self.suffix, (math.floor(bar.total * 10000 / self.total) / 100)))
output(string.format("%d. %s - %d (%d%s - %s) - %d%%", i, bar.name, bar.total, GetDPS(bar), self.suffix, SecondsToTimeAbbrev(Fiend.combatTime[bar.guid]), (math.floor(bar.total * 10000 / self.total) / 100)))
end
end

Expand Down Expand Up @@ -264,13 +267,12 @@ fiend.Display = setmetatable({}, { __call = function(self, title, size, bg, suff

local class = select(2, GetPlayerInfoByGUID(guid)) or "WARRIOR"
local col = RAID_CLASS_COLORS[class]
--local name = UnitName(unit)

bar:SetHeight(size)
bar:SetStatusBarColor(col.r, col.g, col.b)
bar.bg:SetVertexColor(col.r, col.g, col.b, 0.1)

bar.left:SetText(name)
bar.left:SetText(UnitName(unit))
bar.right:SetText(0)

bar.guid = guid
Expand All @@ -279,7 +281,6 @@ fiend.Display = setmetatable({}, { __call = function(self, title, size, bg, suff
bar.pos = 0
bar.class = class
bar.col = col
--bar.name = name

fiend.combatTime[guid] = 0

Expand Down

0 comments on commit 441f0c3

Please sign in to comment.