WoWInterface SVN RecapFu

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 3 to Rev 4
    Reverse comparison

Rev 3 → Rev 4

trunk/FuBar_RecapFu/RecapFu.lua
20,143 → 20,143
local options = {
type = 'group',
args = {
pause = {
type = "toggle",
order = 100,
name = L["Pause"],
desc = L["Pause/Resume Monitoring"],
get = function()
return RecapFu.state and ("Stopped" == RecapFu.state);
end,
set = function()
Recap_OnClick("Pause")
end,
},
display = {
type = "group",
order = 102,
name = L["Display"],
desc = L["Toggle what is displayed on the panel"],
args = {
label = {
type = "toggle",
order = 100,
name = L["Label"],
desc = L["Show/Hide the DPS label"],
get = function()
return RecapFu.db.profile.showlabel
end,
set = function()
RecapFu.db.profile.showlabel = not RecapFu.db.profile.showlabel
RecapFu:UpdateText()
end,
},
dps = {
type = "toggle",
order = 110,
name = L["DPS"],
desc = L["Your DPS"],
get = function()
return RecapFu.db.profile.DPS
end,
set = function()
RecapFu.db.profile.DPS = not RecapFu.db.profile.DPS
RecapFu:UpdateText()
end,
},
-- dmgin = {
-- type = "toggle",
-- order = 120,
-- name = L["Received"],
-- desc = L["Your damage received"],
-- get = function()
-- return RecapFu.db.profile.DMG_IN
-- end,
-- set = function()
-- RecapFu.db.profile.DMG_IN = not RecapFu.db.profile.DMG_IN
-- RecapFu:UpdateText()
-- end,
-- },
-- dmgout = {
-- type = "toggle",
-- order = 130,
-- name = L["Dealt"],
-- desc = L["Your damage dealt"],
-- get = function()
-- return RecapFu.db.profile.DMG_OUT
-- end,
-- set = function()
-- RecapFu.db.profile.DMG_OUT = not RecapFu.db.profile.DMG_OUT
-- RecapFu:UpdateText()
-- end,
-- },
healing = {
type = "toggle",
order = 140,
name = L["Healing"],
desc = L["Your healing"],
get = function()
return RecapFu.db.profile.HEALING
end,
set = function()
RecapFu.db.profile.HEALING = not RecapFu.db.profile.HEALING
RecapFu:UpdateText()
end,
},
-- overheal = {
-- type = "toggle",
-- order = 150,
-- name = L["Overhealing"],
-- desc = L["Your over-healing percentage"],
-- get = function()
-- return RecapFu.db.profile.OVERHEAL
-- end,
-- set = function()
-- RecapFu.db.profile.OVERHEAL = not RecapFu.db.profile.OVERHEAL
-- RecapFu:UpdateText()
-- end,
-- },
-- maxhit = {
-- type = "toggle",
-- order = 160,
-- name = L["Max"],
-- desc = L["Your max hit"],
-- get = function()
-- return RecapFu.db.profile.MAXHIT
-- end,
-- set = function()
-- RecapFu.db.profile.MAXHIT = not RecapFu.db.profile.MAXHIT
-- RecapFu:UpdateText()
-- end,
-- },
dpsin = {
type = "toggle",
order = 170,
name = L["DPSin"],
desc = L["Total DPS In"],
get = function()
return RecapFu.db.profile.DPS_IN
end,
set = function()
RecapFu.db.profile.DPS_IN = not RecapFu.db.profile.DPS_IN
RecapFu:UpdateText()
end,
},
dpsout = {
type = "toggle",
order = 180,
name = L["DPSout"],
desc = L["Total DPS Out"],
get = function()
return RecapFu.db.profile.DPS_OUT
end,
set = function()
RecapFu.db.profile.DPS_OUT = not RecapFu.db.profile.DPS_OUT
RecapFu:UpdateText()
end,
},
}
},
pause = {
type = "toggle",
order = 100,
name = L["Pause"],
desc = L["Pause/Resume Monitoring"],
get = function()
return RecapFu.state and ("Stopped" == RecapFu.state);
end,
set = function()
Recap_OnClick("Pause")
end,
},
display = {
type = "group",
order = 102,
name = L["Display"],
desc = L["Toggle what is displayed on the panel"],
args = {
label = {
type = "toggle",
order = 100,
name = L["Label"],
desc = L["Show/Hide the DPS label"],
get = function()
return RecapFu.db.profile.showlabel
end,
set = function()
RecapFu.db.profile.showlabel = not RecapFu.db.profile.showlabel
RecapFu:UpdateText()
end,
},
dps = {
type = "toggle",
order = 110,
name = L["DPS"],
desc = L["Your DPS"],
get = function()
return RecapFu.db.profile.DPS
end,
set = function()
RecapFu.db.profile.DPS = not RecapFu.db.profile.DPS
RecapFu:UpdateText()
end,
},
-- dmgin = {
-- type = "toggle",
-- order = 120,
-- name = L["Received"],
-- desc = L["Your damage received"],
-- get = function()
-- return RecapFu.db.profile.DMG_IN
-- end,
-- set = function()
-- RecapFu.db.profile.DMG_IN = not RecapFu.db.profile.DMG_IN
-- RecapFu:UpdateText()
-- end,
-- },
-- dmgout = {
-- type = "toggle",
-- order = 130,
-- name = L["Dealt"],
-- desc = L["Your damage dealt"],
-- get = function()
-- return RecapFu.db.profile.DMG_OUT
-- end,
-- set = function()
-- RecapFu.db.profile.DMG_OUT = not RecapFu.db.profile.DMG_OUT
-- RecapFu:UpdateText()
-- end,
-- },
healing = {
type = "toggle",
order = 140,
name = L["Healing"],
desc = L["Your healing"],
get = function()
return RecapFu.db.profile.HEALING
end,
set = function()
RecapFu.db.profile.HEALING = not RecapFu.db.profile.HEALING
RecapFu:UpdateText()
end,
},
-- overheal = {
-- type = "toggle",
-- order = 150,
-- name = L["Overhealing"],
-- desc = L["Your over-healing percentage"],
-- get = function()
-- return RecapFu.db.profile.OVERHEAL
-- end,
-- set = function()
-- RecapFu.db.profile.OVERHEAL = not RecapFu.db.profile.OVERHEAL
-- RecapFu:UpdateText()
-- end,
-- },
-- maxhit = {
-- type = "toggle",
-- order = 160,
-- name = L["Max"],
-- desc = L["Your max hit"],
-- get = function()
-- return RecapFu.db.profile.MAXHIT
-- end,
-- set = function()
-- RecapFu.db.profile.MAXHIT = not RecapFu.db.profile.MAXHIT
-- RecapFu:UpdateText()
-- end,
-- },
dpsin = {
type = "toggle",
order = 170,
name = L["DPSin"],
desc = L["Total DPS In"],
get = function()
return RecapFu.db.profile.DPS_IN
end,
set = function()
RecapFu.db.profile.DPS_IN = not RecapFu.db.profile.DPS_IN
RecapFu:UpdateText()
end,
},
dpsout = {
type = "toggle",
order = 180,
name = L["DPSout"],
desc = L["Total DPS Out"],
get = function()
return RecapFu.db.profile.DPS_OUT
end,
set = function()
RecapFu.db.profile.DPS_OUT = not RecapFu.db.profile.DPS_OUT
RecapFu:UpdateText()
end,
},
}
},
}
}
 
206,7 → 206,7
 
function RecapFu:UpdateData()
self:Debug(" Update Data ")
 
 
self.text.DPS = crayon:White(self.yourdps)
self.text.DPS_IN = crayon:Red(self.dpsin)
self.text.DPS_OUT = crayon:Green(self.dpsout)
221,39 → 221,39
self:Debug(" Update Text")
-- format the colored status bubble
if (self:IsIconShown()) then
if self.state=="Idle" then
self.iconFrame:SetVertexColor(.5,.5,.5)
elseif self.state=="Active" then
self.iconFrame:SetVertexColor(0,1,0)
elseif self.state=="Stopped" then
self.iconFrame:SetVertexColor(1,0,0)
end
if self.state=="Idle" then
self.iconFrame:SetVertexColor(.5,.5,.5)
elseif self.state=="Active" then
self.iconFrame:SetVertexColor(0,1,0)
elseif self.state=="Stopped" then
self.iconFrame:SetVertexColor(1,0,0)
end
end
 
local t = {}
if self.db.profile.showlabel then
table.insert(t, L["DPS"]..": ")
table.insert(t, L["DPS"]..": ")
end
 
 
for i,e in self:pairsByKeys(TYPES) do
if self.db.profile[e.var] then
table.insert(t, self.text[e.var])
end
if self.db.profile[e.var] then
table.insert(t, self.text[e.var])
end
end
 
 
self:SetText(table.concat(t, " "))
end
 
function RecapFu:OnTooltipUpdate()
self:Debug(" Update Tooltip")
local cat = tablet:AddCategory(
'columns', 2,
'child_textR', 1,
'child_textG', 1,
'child_textB', 0,
'child_text2R', 1,
'child_text2G', 1,
'child_text2B', 1
'columns', 2,
'child_textR', 1,
'child_textG', 1,
'child_textB', 0,
'child_text2R', 1,
'child_text2G', 1,
'child_text2B', 1
)
cat:AddLine('text', L["State"],
'text2', self.state,
267,15 → 267,15
'arg1', self,
'arg2', 0
)
 
 
local cat = tablet:AddCategory(
'columns', 2,
'child_textR', 1,
'child_textG', 1,
'child_textB', 0
'columns', 2,
'child_textR', 1,
'child_textG', 1,
'child_textB', 0
)
for i,e in self:pairsByKeys(TYPES) do
cat:AddLine('text', e.text, 'text2', self.text[e.var])
cat:AddLine('text', e.text, 'text2', self.text[e.var])
end
tablet:SetHint(L["Left-click to toggle Recap window"])
end
284,17 → 284,17
--taken from an example in the Programming in Lua book
local a = {}
for n in pairs(t) do
table.insert(a, n)
table.insert(a, n)
end
table.sort(a, f)
local i = 0 -- iterator variable
local iter = function () -- iterator function
i = i + 1
if a[i] == nil then
return nil
else
return a[i], t[a[i]]
end
i = i + 1
if a[i] == nil then
return nil
else
return a[i], t[a[i]]
end
end
return iter
end