forked from kakysha/HonorSpy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport.lua
More file actions
executable file
·64 lines (56 loc) · 1.97 KB
/
Copy pathexport.lua
File metadata and controls
executable file
·64 lines (56 loc) · 1.97 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
63
64
function RankCollector:ExportCSV()
local _G = getfenv(0)
local PaneBackdrop = {
bgFile = [[Interface\DialogFrame\UI-DialogBox-Background]],
edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]],
tile = true, tileSize = 16, edgeSize = 16,
insets = { left = 3, right = 3, top = 5, bottom = 3 }
}
-- If we haven't created these frames, then lets do so now.
if (not _G["ARLCopyFrame"]) then
local frame = CreateFrame("Frame", "ARLCopyFrame", UIParent)
tinsert(UISpecialFrames, "ARLCopyFrame")
frame:SetBackdrop(PaneBackdrop)
frame:SetBackdropColor(0,0,0,1)
frame:SetWidth(500)
frame:SetHeight(400)
frame:SetPoint("CENTER", UIParent, "CENTER")
frame:SetFrameStrata("DIALOG")
local scrollArea = CreateFrame("ScrollFrame", "ARLCopyScroll", frame, "UIPanelScrollFrameTemplate")
scrollArea:SetPoint("TOPLEFT", frame, "TOPLEFT", 8, -30)
scrollArea:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -30, 8)
local editBox = CreateFrame("EditBox", "ARLCopyEdit", frame)
editBox:SetMultiLine(true)
editBox:SetMaxLetters(99999)
editBox:EnableMouse(true)
editBox:SetAutoFocus(false)
editBox:SetFontObject(ChatFontNormal)
editBox:SetWidth(400)
editBox:SetHeight(270)
editBox:SetScript("OnEscapePressed", function() frame:Hide() end)
scrollArea:SetScrollChild(editBox)
local close = CreateFrame("Button", nil, frame, "UIPanelCloseButton")
close:SetPoint("TOPRIGHT",frame,"TOPRIGHT")
end
local exportwindow = _G["ARLCopyFrame"]
local editbox = _G["ARLCopyEdit"]
local data = RankCollector:BuildStandingsTable();
local text = "";
for _, row in pairs(data) do
text = ""
for _, value in pairs(row) do
if (type(value) == "number") then
if (value < 1486253610) then
text = text..string.format("%d", value)..","
else
text = text..date("!%x %X", value)..","
end
elseif (type(value) == "string") then
text = text..value..","
end
end
editbox:Insert(text.."\n")
end
editbox:HighlightText(0)
exportwindow:Show()
end