forked from Ellypse/Ellyb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPatreon.lua
More file actions
72 lines (60 loc) · 2.01 KB
/
Copy pathPatreon.lua
File metadata and controls
72 lines (60 loc) · 2.01 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
65
66
67
68
69
70
71
72
----------------------------------------------------------------------------------
--- List of Ellypse's Patreon supporters
--- http://patreon.com/Ellypse
---
--- The Ellyb library is made thanks to the generous contribution of my Patreon supporters
--- This file lists those supporters and prepares and formatted list for me to easily insert
--- inside my add-ons
----------------------------------------------------------------------------------
---@type Ellyb
local Ellyb = Ellyb(...);
if Ellyb.GetPatreonSupporters then
return
end
-- Lua imports
local sort = sort;
local pairs = pairs;
local format = format;
---@type Ellyb_Color
local PURPLE = Ellyb.ColorManager.PURPLE;
local GOLDEN_SUPPORTERS = {
"Connor Macleod",
"Andiss Aaren",
"Adam M",
"Vlad",
}
local PATREON_SUPPORTERS = {
"Solanya",
"Ripperley",
"Keyboardturner",
"Petr Cihelka",
"Syccor",
"Donnie Bellorniere",
}
sort(GOLDEN_SUPPORTERS);
sort(PATREON_SUPPORTERS);
local LINE_FORMAT = "- %s\n";
local patreonMessage = "";
for _, patreonSupporter in pairs(GOLDEN_SUPPORTERS) do
patreonMessage = patreonMessage .. LINE_FORMAT:format(PURPLE:WrapTextInColorCode(patreonSupporter));
end
patreonMessage = patreonMessage .. "\n";
for _, patreonSupporter in pairs(PATREON_SUPPORTERS) do
patreonMessage = patreonMessage .. LINE_FORMAT:format(patreonSupporter);
end
Ellyb.PATREON_SUPPORTERS_LIST = patreonMessage;
--- Get the list of Patreon supporters. It will look for the most recent version of the library to make sure we
--- always display a list that is the most up to date
---@return string listOfPatreonSupporters @ Return the list of Patreon supporters
function Ellyb:GetPatreonSupporters()
return self:GetMostUpToDateVersion().PATREON_SUPPORTERS_LIST;
end
---@param HTML SimpleHTML
function Ellyb:SetUpHTMLPatreonMessage(HTML)
HTML:SetText(format(Ellyb.loc.PATREON_SUPPORTERS, Ellyb:GetPatreonSupporters()));
HTML:HookScript("OnHyperlinkClick", function(_, url)
if url == "ellypse_patreon" then
Ellyb.Popups:OpenURL("http://patreon.com/Ellypse");
end
end);
end