Skip to content

Commit

Permalink
Fix dps reset
Browse files Browse the repository at this point in the history
  • Loading branch information
Zariel committed Jan 7, 2011
1 parent f5d3a3e commit ffe14f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Fiend.toc
@@ -1,4 +1,4 @@
## Interface: 305000 ## Interface: 400000


## Title: Fiend ## Title: Fiend
## Notes: Tracks Damage, Healing, Overhealing. And some DPS for fun. ## Notes: Tracks Damage, Healing, Overhealing. And some DPS for fun.
Expand Down
14 changes: 12 additions & 2 deletions display.lua
Expand Up @@ -104,6 +104,12 @@ if(fiend.trackDPS) then


return total return total
end end

function View:ResetDPS()
for k, v in pairs(self.dps) do
v.reset = true
end
end
end end


function View:Update(guid, ammount, name) function View:Update(guid, ammount, name)
Expand Down Expand Up @@ -189,6 +195,10 @@ function View:UpdateDisplay()
end end


function View:RemoveAllBars() function View:RemoveAllBars()
if(self.dps) then
self:ResetDPS()
end

local bar local bar
for i = 1, #self.bars do for i = 1, #self.bars do
bar = table.remove(self.bars, 1) bar = table.remove(self.bars, 1)
Expand Down Expand Up @@ -454,7 +464,7 @@ function Display:NewView(title, events, size, bg, color, dps)
if(fiend.trackDPS) then if(fiend.trackDPS) then
t.dps = setmetatable({}, dpsMeta) t.dps = setmetatable({}, dpsMeta)


if dps then if(dps) then
t.showDPS = true t.showDPS = true
end end
elseif(dps) then elseif(dps) then
Expand Down Expand Up @@ -587,7 +597,7 @@ function Display:ToolTip()
text = L["Reset"], text = L["Reset"],
owner = drop, owner = drop,
func = function() func = function()
if self.currentView then if(self.currentView) then
self.currentView:RemoveAllBars() self.currentView:RemoveAllBars()
end end
end, end,
Expand Down

0 comments on commit ffe14f4

Please sign in to comment.