-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSkinRegistry.lua
More file actions
141 lines (133 loc) · 3.75 KB
/
SkinRegistry.lua
File metadata and controls
141 lines (133 loc) · 3.75 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
local AceAddon = LibStub("AceAddon-3.0")
local addon = AceAddon and AceAddon:GetAddon("SimpleUnitFrames", true)
if not addon then
return
end
local function CopyTableDeepLocal(source)
local out = {}
for key, value in pairs(source or {}) do
out[key] = (type(value) == "table") and CopyTableDeepLocal(value) or value
end
return out
end
local REPEATING_SUFFIXES = {
"",
".NineSlice",
".NineSlice.TopEdge",
".NineSlice.RightEdge",
".NineSlice.LeftEdge",
".NineSlice.BottomEdge",
".NineSlice.TopRightCorner",
".NineSlice.TopLeftCorner",
".NineSlice.BottomRightCorner",
".NineSlice.BottomLeftCorner",
".Inset",
".Inset.Bg",
".Inset.NineSlice",
".Inset.NineSlice.TopEdge",
".Inset.NineSlice.RightEdge",
".Inset.NineSlice.LeftEdge",
".Inset.NineSlice.BottomEdge",
".Inset.NineSlice.TopRightCorner",
".Inset.NineSlice.TopLeftCorner",
".Inset.NineSlice.BottomRightCorner",
".Inset.NineSlice.BottomLeftCorner",
".ScrollBar.Background",
}
local REGISTRY = {
groups = {
spellbook = {
"PlayerSpellsFrame.SpellBookFrame.BookBGHalved",
"PlayerSpellsFrame.SpellBookFrame.BookBGLeft",
"PlayerSpellsFrame.SpellBookFrame.BookBGRight",
"PlayerSpellsFrame.SpellBookFrame.BookCornerFlipbook",
},
map = {
"WorldMapFrame.BorderFrame",
"WorldMapFrame.MiniBorderFrame",
},
professions = {
"ProfessionsFrame.TabSystem",
"ProfessionsFrame.CraftingPage.CraftingOutputLog",
"ProfessionsBookFrame",
"ProfessionsCustomerOrdersFrame",
},
guild = {
"CommunitiesFrame.GuildMemberDetailFrame.Border",
"CommunitiesFrame.Chat.MessageFrame.ScrollBar",
},
achievement = {
"WeeklyRewardsFrame.BorderContainer",
"WeeklyRewardsFrame.SelectRewardButton.Background",
},
calendar = {
"TimeManagerFrame",
"StopwatchFrame",
"TimeManagerClockButton",
},
lfg = {
"CompactRaidFrameManager",
"CompactRaidFrameManagerDisplayFrame",
"RolePollPopup",
},
},
repeatingRootsByGroup = {
map = { "WorldMapFrame", "QuestMapFrame" },
spellbook = { "PlayerSpellsFrame", "ClassTalentFrame" },
professions = { "ProfessionsFrame" },
achievement = { "WeeklyRewardsFrame" },
guild = { "CommunitiesFrame" },
},
requiredAddons = {
Blizzard_TimeManager = true,
},
groupAddons = {
calendar = { "Blizzard_TimeManager" },
},
textureBlocklist = {
["Interface\\QuestFrame\\UI-QuestLog-BookIcon"] = true,
["Interface\\Spellbook\\Spellbook-Icon"] = true,
["Interface\\FriendsFrame\\FriendsFrameScrollIcon"] = true,
["Interface\\MacroFrame\\MacroFrame-Icon"] = true,
["Interface\\TimeManager\\GlobeIcon"] = true,
["Interface\\MailFrame\\Mail-Icon"] = true,
["Interface\\ContainerFrame\\UI-Bag-1Slot"] = true,
["Interface\\SpellBook\\SpellBook-SkillLineTab-Glow"] = true,
[130724] = true,
[136797] = true,
[131116] = true,
[136382] = true,
[130709] = true,
[136830] = true,
},
textureAllowlist = {
-- Explicitly permit known chrome assets when blocklist heuristics would otherwise skip.
["Interface\\DialogFrame\\UI-DialogBox-Gold-Background"] = true,
["UI-Frame-OrnateMetal-Border"] = true,
},
}
local cachedRegistry = nil
function addon:GetBlizzardSkinRegistry()
if cachedRegistry then
return cachedRegistry
end
local out = CopyTableDeepLocal(REGISTRY)
out.groups = out.groups or {}
local rootsByGroup = out.repeatingRootsByGroup or {}
for groupKey, roots in pairs(rootsByGroup) do
if type(groupKey) == "string" and type(roots) == "table" then
out.groups[groupKey] = out.groups[groupKey] or {}
local groupList = out.groups[groupKey]
for i = 1, #roots do
local root = roots[i]
if type(root) == "string" and root ~= "" then
for s = 1, #REPEATING_SUFFIXES do
groupList[#groupList + 1] = root .. REPEATING_SUFFIXES[s]
end
end
end
end
end
cachedRegistry = out
return cachedRegistry
end