-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathGUI_DeathGraph.lua
More file actions
62 lines (50 loc) · 1.72 KB
/
GUI_DeathGraph.lua
File metadata and controls
62 lines (50 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
local Recount = _G.Recount
local Graph = LibStub:GetLibrary("LibGraph-2.0")
local AceLocale = LibStub("AceLocale-3.0")
local L = AceLocale:GetLocale("Recount")
local revision = tonumber(string.sub("$Revision: 1254 $", 12, -3))
if Recount.Version < revision then
Recount.Version = revision
end
local me = {}
function me:CreateDeathGraphWindow()
local theFrame = Recount:CreateFrame("Recount_DeathGraph", L["Death Graph"], 182, 200)
local g = Graph:CreateGraphLine("Recount_DeathScatter", theFrame, "BOTTOM", "BOTTOM", 0, 2, 197, 149)
g:SetXAxis(-15, 1)
g:SetYAxis(0, 100)
g:SetGridSpacing(1, 25)
g:SetGridColor({0.5, 0.5, 0.5, 0.5})
g:SetAxisDrawing(true, true)
g:SetAxisColor({1.0, 1.0, 1.0, 1.0})
g:SetYLabels(true, false)
theFrame.Graph = g
g = Graph:CreateGraphScatterPlot("Recount_DeathScatter", theFrame, "BOTTOM", "BOTTOM", 0, 2, 197, 149)
g:SetXAxis(-15, 1)
g:SetYAxis(0, 100)
g:SetGridSpacing(100, 100)
g:SetGridColor({0.5, 0.5, 0.5, 0})
g:SetAxisDrawing(false, false)
g:SetAxisColor({1.0, 1.0, 1.0, 0})
g:SetFrameLevel(theFrame.Graph:GetFrameLevel() + 1)
theFrame.Scatter = g
--Need to add it to our window ordering system
Recount:AddWindow(theFrame)
Recount.DeathGraph = theFrame
end
function Recount:ShowDeathGraph(Health, Heals, Hits)
if not Recount.DeathGraph then
me:CreateDeathGraphWindow()
end
local DeathGraph = Recount.DeathGraph
DeathGraph:Show()
--DeathGraph.Title:SetText("Death Graph - "..Title)
DeathGraph.Graph:ResetData()
DeathGraph.Graph:AddDataSeries(Health, {0.2, 1.0, 0.2, 0.8}, false)
DeathGraph.Scatter:ResetData()
if Heals then
DeathGraph.Scatter:AddDataSeries(Heals, {0.1, 1.0, 0.1, 0.8})
end
if Hits then
DeathGraph.Scatter:AddDataSeries(Hits, {1.0, 0.1, 0.1, 0.8})
end
end