Skip to content

Commit d02b05a

Browse files
committed
Initial upload
1 parent e8a38b4 commit d02b05a

File tree

105 files changed

+32321
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+32321
-0
lines changed

Config.lua

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
local SLDataText = LibStub("AceAddon-3.0"):GetAddon("SLDataText")
2+
local L = LibStub("AceLocale-3.0"):GetLocale("SLDataText")
3+
local media = LibStub("LibSharedMedia-3.0")
4+
5+
local function makeSlashCmd(...)
6+
local global = string.upper(SLDataText:GetName())
7+
SlashCmdList[global] = function() LibStub("AceConfigDialog-3.0"):Open("SLDataText") end
8+
for i = 1,select("#",...) do
9+
local slash = select(i,...)
10+
setglobal("SLASH_"..global..i,slash)
11+
end
12+
end
13+
14+
local optGetter, optSetter
15+
do
16+
function optGetter(info)
17+
local key = info[#info]
18+
return SLDataText.db.profile[key]
19+
end
20+
21+
function optSetter(info, value)
22+
local key = info[#info]
23+
SLDataText.db.profile[key] = value
24+
SLDataText:Refresh()
25+
end
26+
end
27+
28+
local options, moduleOptions = nil, {}
29+
local function getOptions()
30+
if not options then
31+
options = {
32+
type = "group",
33+
name = L["SLDataText"],
34+
args = {
35+
general = {
36+
type = "group",
37+
name = L["GenSet"],
38+
guiInline = true,
39+
get = optGetter,
40+
set = optSetter,
41+
args = {
42+
locked = {
43+
type = "toggle",
44+
name = L["LockEle"],
45+
desc = L["LockEleDesc"],
46+
order = 100,
47+
},
48+
hideInCombat = {
49+
type = "toggle",
50+
name = L["HIC"],
51+
desc = L["HICDesc"],
52+
order = 200,
53+
},
54+
},
55+
},
56+
global = {
57+
type = "group",
58+
name = L["GblOpts"],
59+
get = optGetter,
60+
set = optSetter,
61+
order = 1,
62+
args = {
63+
gblFontHeader = {
64+
type = "header",
65+
name = L["GblFontSet"],
66+
order = 50,
67+
},
68+
gFont = {
69+
type = "select",
70+
name = L["GblFont"],
71+
desc = L["GblFontDesc"],
72+
values = media:List("font"),
73+
get = function()
74+
for k, v in pairs(media:List("font")) do
75+
if SLDataText.db.profile.gFont == v then
76+
return k
77+
end
78+
end
79+
end,
80+
set = function(_, font)
81+
local list = media:List("font")
82+
SLDataText.db.profile.gFont = list[font]
83+
SLDataText:Refresh()
84+
end,
85+
width = "double",
86+
order = 100,
87+
},
88+
gFontSize = {
89+
type = "range",
90+
name = L["GblFontSize"],
91+
desc = L["GblFontSizeDesc"],
92+
min = 6, max = 36, step = 1,
93+
order = 200,
94+
},
95+
fontOutline = {
96+
type = "toggle",
97+
name = L["GblFontOut"],
98+
desc = L["GblFontOutDesc"],
99+
order = 250,
100+
},
101+
gColor = {
102+
type = "input",
103+
name = L["GblClr"],
104+
desc = L["GblClrDesc"],
105+
disabled = function()
106+
local isTrue
107+
if ( SLDataText.db.profile.gColorClass ) then isTrue = true else isTrue = false end
108+
return isTrue
109+
end,
110+
order = 300,
111+
},
112+
gColorClass = {
113+
type = "toggle",
114+
name = L["GblClClr"],
115+
desc = L["GblClClrDesc"],
116+
order = 350,
117+
},
118+
mIHdr = {
119+
type = "header",
120+
name = L["MoreInfo"],
121+
order = 1000,
122+
},
123+
moreInfo = {
124+
type = "description",
125+
name = L["MoreInfoDesc"],
126+
order = 1100,
127+
},
128+
},
129+
},
130+
},
131+
}
132+
for key, val in pairs(moduleOptions) do
133+
options.args[key] = (type(val) == "function") and val() or val
134+
end
135+
end
136+
137+
return options
138+
end
139+
140+
function SLDataText:BuildConfig()
141+
LibStub("AceConfigRegistry-3.0"):RegisterOptionsTable("SLDataText", getOptions)
142+
makeSlashCmd(L["/sldt"], L["/sldatatext"])
143+
self:RegisterModuleOptions("Profiles", LibStub("AceDBOptions-3.0"):GetOptionsTable(self.db))
144+
end
145+
146+
function SLDataText:RegisterModuleOptions(name, optionTbl)
147+
moduleOptions[name] = optionTbl
148+
end

0 commit comments

Comments
 (0)