-
Notifications
You must be signed in to change notification settings - Fork 6
/
sample.lua
117 lines (106 loc) · 3.03 KB
/
sample.lua
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
local frame = CreateFrame("ScrollFrame", nil, InterfaceOptionsFramePanelContainer)
frame.name = "tekticles"
frame:Hide()
frame:SetScript("OnShow", function(self)
local title, subtitle = LibStub("tekKonfig-Heading").new(self, "tekticles", "This panel shows a preview for every major font template provided by Blizzard.")
local group = LibStub("tekKonfig-Group").new(self)
group:SetPoint("TOP", subtitle, "BOTTOM", 0, -8)
group:SetPoint("BOTTOMLEFT", 16, 16)
group:SetPoint("BOTTOMRIGHT", -16, 16)
local tex = group:CreateTexture(nil, "BACKGROUND")
tex:SetTexture("Interface\\FrameGeneral\\UI-Background-Rock")
tex:SetPoint("TOPLEFT", 4, -4)
tex:SetPoint("BOTTOMRIGHT", -4, 4)
local alpha = group:CreateTexture(nil, "BACKGROUND")
alpha:SetTexture(1, 1, 1, 0.5)
alpha:SetBlendMode('ADD')
alpha:SetAllPoints(tex)
local GAP = 5
local frame = CreateFrame("Frame", nil, group)
frame:SetPoint("TOPRIGHT", -GAP, -GAP)
frame:SetPoint("BOTTOMLEFT", GAP, GAP)
local last
local fonts, needbackground = {
"GameFontNormal",
"GameFontHighlight",
"GameFontDisable",
"GameFontNormalSmall",
"WhiteNormalNumberFont",
"GameNormalNumberFont",
"GameFontHighlightExtraSmall",
"GameFontHighlightMedium",
"GameFontNormalLarge",
"GameFontNormalHuge",
"GameFont_Gigantic",
"BossEmoteNormalHuge",
"NumberFontNormal",
"NumberFontNormalSmall",
"NumberFontNormalLarge",
"NumberFontNormalHuge",
"ChatFontNormal",
"ChatFontSmall",
"DialogButtonNormalText",
"ZoneTextFont",
"SubZoneTextFont",
"PVPInfoTextFont",
"QuestFont_Huge",
"QuestFont_Super_Huge",
"QuestFont_Shadow_Small",
"ErrorFont",
"TextStatusBarText",
"CombatLogFont",
"GameTooltipText",
"GameTooltipTextSmall",
"GameTooltipHeaderText",
"WorldMapTextFont",
"CombatTextFont",
"MovieSubtitleFont",
"AchievementPointsFont",
"AchievementPointsFontSmall",
"AchievementDescriptionFont",
"AchievementCriteriaFont",
"AchievementDateFont",
"ReputationDetailFont",
"QuestTitleFont",
"QuestFont",
"QuestFontNormalSmall",
"QuestFontHighlight",
"ItemTextFontNormal",
"MailTextFontNormal",
"SubSpellFont",
"InvoiceTextFontNormal",
"InvoiceTextFontSmall",
}, {
QuestFont = true,
QuestFontNormalSmall = true,
QuestTitleFont = true,
QuestFontHighlight = true,
ItemTextFontNormal = true,
InvoiceTextFontNormal = true,
InvoiceTextFontSmall = true,
MailTextFontNormal = true,
SubSpellFont = true,
}
for i,font in pairs(fonts) do
local fs = frame:CreateFontString(nil, "ARTWORK", font)
if i == 1 then
fs:SetPoint("TOPLEFT", frame, "TOPLEFT", 30, -15)
elseif i == 23 then
fs:SetPoint("TOPLEFT", frame, "TOP", 30, -15)
else
fs:SetPoint("TOPLEFT", last, "BOTTOMLEFT", 0, -4)
end
fs:SetText(font)
if needbackground[font] then
local tex = frame:CreateTexture(nil, "ARTWORK")
tex:SetPoint("TOPLEFT", fs, -2, 2)
tex:SetPoint("BOTTOM", fs, 0, -2)
tex:SetWidth(150)
tex:SetTexture(1, 1, 1, 0.4)
tex:SetBlendMode('ADD')
end
last = fs
end
self:SetScript("OnShow", nil)
end)
InterfaceOptions_AddCategory(frame)