-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathoptions.lua
664 lines (620 loc) · 20.5 KB
/
options.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
local addon, ns = ...
local addonLabel = addon;
local C, L, I = ns.LC.color, ns.L, ns.I;
local setmetatable,type,rawget,tostring=setmetatable,type,rawget,tostring;
local ipairs,pairs,wipe,strsplit,tremove=ipairs,pairs,wipe,strsplit,tremove;
local dbDefaults,db = {
profile = {
GeneralOptions = {
suffixColour = true,
showHints = true,
iconset = "NONE",
iconcolor = {1,1,1,1},
goldColor = "white",
goldCoins = true,
usePrefix = false,
maxTooltipHeight = 60,
scm = false,
ttModifierKey1 = "NONE",
ttModifierKey2 = "NONE",
goldHide = "0",
goldHideZero = true,
separateThousands = true,
showAddOnLoaded = true,
chatCommands = true
}
}
};
ns.showCharsFrom_Values = { -- used in xp.lua to display current mode in tooltip
["1"] = ns.realm,
["2"] = L["Connected realms"],
["3"] = L["Current language"],
["4"] = L["All realms"]
};
local goldHideValues = {
["0"]=ADDON_DISABLED,
["1"]=L["HideMoneyCopper"],
["2"]=L["HideMoneySilver"],
["3"]=L["HideMoneyZeros"],
["4"]=L["ShowHighestOnly"]
};
local delimiterBBValues
do
local t = LOCALE_TEXT_LABEL or "Text"
delimiterBBValues = {
[", "] = t..", "..t,
[" / "] = t.." / "..t,
[" || "] = t.." || "..t,
[" \\ "] = t.." \\ "..t,
}
end
local nsProfileMT
--@do-not-package@
do
nsProfileMT = {
__newindex = function(t,k,v)
local s = rawget(t,"section");
if s and db and db.profile[s] then
db.profile[s][k] = v;
elseif ns.profileSilenceFIXME then
ns.profileSilenceFIXME=false;
else
ns:debug("Options","<FIXME:nsProfileMT:MissingSection>",tostring(s),tostring(k));
end
end,
__index = function(t,k)
local s = rawget(t,"section");
if s and db and db.profile[s] then
local v = db.profile[s][k];
if v~=nil then
return v;
elseif ns.profileSilenceFIXME then
ns.profileSilenceFIXME=false;
else
ns:debug("Options","<FIXME:nsProfileMT:NilValue>",tostring(s),tostring(k));
end
elseif ns.profileSilenceFIXME then
ns.profileSilenceFIXME=false;
else
ns:debug("Options","<FIXME:nsProfileMT:MissingSectionOrDB>",tostring(s),tostring(k));
end
end
};
ns.profileSilenceFIXME = false;
ns.profile = {GeneralOptions=setmetatable({section="GeneralOptions"},nsProfileMT)};
end
--@end-do-not-package@
-- some values tables and functions
local ttModifierValues = {NONE = L["ModKeyDefault"]};
for i,v in pairs(ns.tooltipModifiers) do ttModifierValues[i] = L["ModKey"..v.l]; end
local function calcDataSize(info,obj)
if info then
local key = info[#info];
return "~"..ns.FormatLargeNumber(true,calcDataSize(nil,Broker_Everything_CharacterDB[key])).."B";
end
local obj_t = type(obj);
if obj_t=="table" then
local sum = 0;
for k,v in pairs(obj) do
if type(k)=="string" then
sum = sum + 40 + strlen(k);
else
sum = sum + 16;
end
sum = sum + calcDataSize(nil,v);
end
return sum + 40;
elseif obj_t=="boolean" then
return 2;
elseif obj_t=="number" then
return (floor(obj/2147483647)+1)*8;
end
return strlen(tostring(obj));
end
local function getIconSets()
local t = {NONE=NONE}
local l = ns.LSM:List((addon.."_Iconsets"):lower())
if type(l)=="table" then
for i,v in pairs(l) do
t[v] = v
end
end
return t
end
local function toggleAllModules(info)
local state = info[#info];
if not (state=="enable" or state=="disable" or state=="default") then
return;
end
for modName,modObject in pairs(ns.modules) do
if not modObject.isHiddenModule then
local newValue
if state=="enable" and db.profile[modName].enabled==false then
newValue = true;
elseif state=="disable" and db.profile[modName].enabled==true then
newValue = false;
elseif state=="default" and db.profile[modName].enabled~=ns.modules[modName].config_defaults.enabled then
newValue = ns.modules[modName].config_defaults.enabled;
end
if newValue~=nil then
db.profile[modName].enabled = newValue;
if newValue then
ns.moduleInit(modName);
end
end
end
end
end
-- option set/get function
local function opt(info,value,...)
if not db then return end
-- section = GeneralOptions or module names
local key,section,isModEnable = info[#info],info[#info-2],(info[#info-1]=="modEnable");
if #info>=5 then
local modOptDepth = nil;
for i=#info, 1, -1 do
if info[i]=="modOptions" then
modOptDepth = i+1;
break;
end
end
if modOptDepth~=nil then
section = info[modOptDepth];
end
end
if value~=nil then
if isModEnable then
--@do-not-package@
ns:debug("Options","<ToggleModuleEnableState>",key,type(db.profile),type(db.profile[key]));
--@end-do-not-package@
db.profile[key].enabled = value;
if value then
-- init module
ns.moduleInit(key);
end
elseif key=="minimap" then
db.profile[section][key].hide = not value;
ns.updateMinimapButton(section);
else
if ... then value={value,...}; end -- color table
db.profile[section][key]=value;
if section=="GeneralOptions" then
for modName,mod in pairs(ns.modules)do
if mod.isEnabled and mod.onevent then
mod.onevent(mod.eventFrame,"BE_UPDATE_CFG",key);
end
end
if key=="iconcolor" then
ns.updateIcons(true,"color");
elseif key=="iconset" then
ns.updateIcons(true,"icon");
end
elseif ns.modules[section].onevent then
ns.modules[section].onevent(ns.modules[section].eventFrame,"BE_UPDATE_CFG",key);
--@do-not-package@
else
ns:debug("Options","<FIXME:opt:MissingEventFunction>",section);
--@end-do-not-package@
end
end
end
if isModEnable then
return (db and key and db.profile and db.profile[key] and db.profile[key].enabled);
elseif key=="minimap" then
return not db.profile[section][key].hide;
else
if type(db.profile[section][key])=="table" then
return unpack(db.profile[section][key]);
end
--@do-not-package@
if db.profile[section][key]==nil then
local x = debugstack();
ns:debug("Options","<FIXME:opt:NilOptions>",tostring(section),tostring(key),tostring(key):len(),x);
end
--@end-do-not-package@
return db.profile[section][key];
end
end
ns.option=opt; -- used in shared.lua (EasyMenu wrapper)
local options = {
type = "group",
name = addon,
get=opt, set=opt,
childGroups = "tab",
args = {
GeneralOptions = {
type = "group", order = 1,
name = GENERAL,
args = {
misc = {
type = "group", order = 1, inline = true,
name = C("ff00aaff",AUCTION_SUBCATEGORY_OTHER),
args = {
showAddOnLoaded = { type="toggle",order=1,name=L["AddOnLoaded"],desc=L["AddOnLoadedDesc"].."|n|n|cff44ff44"..L["AddOnLoadedDescAlt"].."|r" },
suffixColour = { type="toggle",order=2,name=L["SuffixColor"],desc=L["SuffixColorDesc"] },
usePrefix = { type="toggle",order=3,name=L["Prefix"],desc=L["PrefixDesc"] },
chatCommands = { type="toggle",order=4,name=L["ChatCommands"],desc=L["ChatCommandsDesc"] },
}
},
gold = {
type = "group", order = 2, inline = true,
name = C("ff00aaff",BONUS_ROLL_REWARD_MONEY),
args = {
goldColor = {type="select",order=1,name=L["GoldColor"],desc=L["GoldColorDesc"],values={_none=ADDON_DISABLED,color=L["GoldColorCoin"],white=L["GoldColorWhite"]} },
goldCoins = {type="toggle",order=2,name=L["GoldCoins"],desc=L["GoldCoinsDesc"]},
separateThousands = {type="toggle",order=3,name=L["DigitGroup"],desc=L["DigitGroupDesc"]},
goldHide = {type="select",order=4,name=L["HideMoney"],desc=L["HideMoneyDescEverywhere"], width = "double", values= goldHideValues },
goldHideZero = {type="toggle",order=5,name=L["HideMoneyZero"],desc=L["HideMoneyZeroDesc"], hidden=function() return ns.profile.GeneralOptions.goldHide~="0" end},
}
},
tooltip = {
type = "group", order = 3, inline = true,
name = C("ff00aaff",L["Tooltip"]),
args = {
scm = {type="toggle",order=1,name=L["OptSCM"],desc=L["OptSCMDesc"]},
showHints = {type="toggle",order=2,name=L["OptTTHints"],desc=L["OptTTHintsDesc"]},
maxTooltipHeight = {type="range", order=3,name=L["TTMaxHeight"],desc=L["TTMaxHeightDesc"],min=10, max=90},
ttModifierKey1 = {type="select",order=4,name=L["TTShowMod"],desc=L["TTShowModDesc"],values=ttModifierValues,width="double"},
ttModifierKey2 = {type="select",order=5,name=L["TTMouse"],desc=L["TTMouseDesc"],values=ttModifierValues,width="double"},
}
},
icons = {
type = "group", order = 4, inline = true,
name = C("ff00aaff",L["Icons"]),
args = {
iconcolor = {type="color", order=1,name=L["IconColor"],desc=L["IconColorDesc"]},
iconset = {type="select",order=2,name=L["IconSets"],desc=L["IconSetsDesc"],values=getIconSets(),width="double"},
iconsetinfo = {
type = "description", order = 3, fontSize = "medium",
name = C("dkyellow",L["IconSetsInfo"])
},
iconsetlink = {
type = "input", order = 4, width = "full",
name = "",
get = function() return "http://www.wowinterface.com/downloads/info22790.html"; end,
set = function() end
}
}
},
}
},
modEnable = {
type = "group", order = 2,
name = L["ModsToggle"],
desc = L["ModsToggleDesc"],
childGroups = "tab",
args = {
info = {
type = "group", order = 0, inline = true,
name = "",
args = {
desc = { type="description", order=0, fontSize="medium", width="double", name=C("orange",L["ModsToggleInfo"]) },
reload = { type="execute", order=1, name=L["ReloadUI"], func=C_UI.Reload },
enable = { type="execute", order=2, name=ENABLE_ALL_ADDONS, func=toggleAllModules },
disable = { type="execute", order=3, name=DISABLE_ALL_ADDONS, func=toggleAllModules },
default = { type="execute", order=4, name=DEFAULT, func=toggleAllModules }
}
},
}
},
modOptions = { -- dummy group
type = "group", order = 3,
name = L["Modules"],
desc = L["ModulesDesc"],
childGroups="tree",
args = {},
},
chars = {
type = "group", order = 4, --fontSize="normal",
name = L["OptCharData"],
desc = L["OptCharDataDesc"],
childGroups="tab",
args = {
infoheader = { type = "description", order=1, name=C("dkyellow",L["OptCharInfoHeader"]), fontSize="medium" },
info1_2 = {
type = "description", order= 2,
name = C("ltgreen",L["OptCharInfo1"]) .. "\n" .. L["OptCharInfo1Desc"].. "\n\n" ..
C("ltgreen",L["OptCharInfo2"]) .. "\n" .. L["OptCharInfo2Desc"] .."\n "
},
info3 = { type="description", order=6, name=C("ltgreen",L["OptCharInfo3"]), width="normal"},
delete = {
type = "execute", order=7, width="double",
name = L["OptCharDelAll"], desc = L["OptCharDelAllDesc"]
},
list = {
type = "group", order=8,
name = L["OptCharList"],
childGroups="tab",
args = {
}
}
}
},
-- profiles = {}, -- created by AceDBOptions
}
}
ns.sharedOptions = {
shortNumbers = { type="toggle", name=L["ShortNum"], desc=L["ShortNumDesc"]},
showAllFactions = { type="toggle", name=L["AllFactions"], desc=L["AllFactionsDesc"]},
showRealmNames = { type="toggle", name=L["RealmNames"], desc=L["RealmNamesDesc"]},
showChars = { type="toggle", name=L["ShowChars"], desc=L["ShowCharsDesc"], customDescFormat="ShowCharsDesc-%s" }, -- TODO: translation ShowCharsDesc
showCharsFrom = { type="select", name=L["CharsFrom"], desc=L["CharsFromDesc"], values=ns.showCharsFrom_Values },
goldHideBB = { type="select", name=L["HideMoney"], desc=L["HideMoneyDescBrokerButton"], width = "double", values = goldHideValues },
goldHideTT = { type="select", name=L["HideMoney"], desc=L["HideMoneyDescTooltip"], width = "double", values = goldHideValues },
delimiterBB = { type="select", name=L["DelimiterBB"], desc=L["DelimiterBBDesc"], values = delimiterBBValues },
}
local sharedDefaults = {
shortNumbers = true,
showChars = true,
showAllFactions = true,
showRealmNames = true,
showCharsFrom = "2",
minimap = {hide=false}
}
local coords=nil;
local function Icon(info)
local key=info[#info];
if key=="modOptions" then return end
local icon = I[key..(ns.modules[key].icon_suffix or "")];
coords = icon.coords or {.1,.9,.1,.9};
return icon.iconfile;
end
function ns.getModOptionTable(modName)
if modName and options.args.modOptions.args[modName] then
return options.args.modOptions.args[modName].args;
end
return {};
end
local function IconCoords(info)
if info[#info]=="modOptions" then return end
return coords;
end
local function optionWalker(modName,group,lst)
for k, v in pairs(lst)do
local tV,customModDesc = type(v);
if tV=="table" and #v>0 then
-- short table {<order[number|bool]>, <customModDesc>}
customModDesc,v,tV = v[2],v[1],type(v[1]);
end
if tV=="number" or tV=="boolean" then
if ns.sharedOptions[k] then
local shared = CopyTable(ns.sharedOptions[k]);
if tV=="number" then
shared.order = v;
end
if customModDesc then
local LStr = "";
if customModDesc==true then
customModDesc = modName;
end
if shared.customDescFormat then
LStr = L[shared.customDescFormat:format(customModDesc)];
shared.customDescFormat = nil;
else
LStr = L[customModDesc];
end
if LStr~="" then
shared.desc = LStr;
end
end
lst[k] = shared;
dbDefaults.profile[modName][k] = sharedDefaults[k];
else
lst[k]=nil;
end
elseif tV=="table" then
if v.type=="separator" then
v.type = "description";
v.name = " ";
end
if v.type=="slider" or v.type=="desc" then
--@do-not-package@
ns:debug("Options","<FIXME:optionWalker:BadType>",k,modName);
--@end-do-not-package@
lst[k]=nil;
end
if (v.default or v.inMenuInvisible or v.text or v.isSubMenu or v.alpha or v.tooltip or v.label or v.format or v.rep or v.minText or v.maxText)~=nil then
--@do-not-package@
ns:debug("Options","<FIXME:optionWalker:BadKey>",k,modName);
--@end-do-not-package@
lst[k]=nil;
end
end
end
if group=="broker" then
lst.minimap = {
type = "toggle", order = 0,
name = L["OptMinimap"], desc=L["OptMinimapDesc"]
}
end
end
local function ModName(info)
local key=info[#info];
if not ns.profile[key].enabled then
return C("gray",L[key]);
end
return L[key];
end
local function ModDesc(info)
local key=info[#info];
if not ns.profile[key].enabled then
return C("red","("..ADDON_DISABLED..")").."\n"..C("gray",L["ModDesc-"..key]);
end
return L["ModDesc-"..key];
end
function ns.Options_RegisterDefaults() -- re-registration for dbDefaults after 'db = LibStub("AceDB-3.0"):New("Broker_Everything_AceDB",dbDefaults,true);'
db:RegisterDefaults(dbDefaults);
end
function ns.Options_RegisterModule(modName)
local mod,modOptions = ns.modules[modName],{};
-- defaults
if nsProfileMT then -- namespace profile metatable for debugging; not present in normal release versions. ;-)
ns.profile[modName] = setmetatable({section=modName},nsProfileMT);
end
--@do-not-package@
if not mod.config_defaults then
ns:debug("Options","<FIXME:MissingModConfigDefault>",modName);
elseif mod.config_defaults.enabled==nil then
ns:debug("Options","<FIXME:MissingModEnableState>",modName);
end
--@end-do-not-package@
-- normal defaults
dbDefaults.profile[modName] = mod.config_defaults or {enabled=false};
if not mod.isHiddenModule then
if dbDefaults.profile[modName].minimap==nil then
dbDefaults.profile[modName].minimap = {hide=false};
end
-- add toggle to ModToggleTab
options.args.modEnable.args[modName] = {type="toggle",name=L[modName],desc=L["ModDesc-"..modName]};
-- add shared option defaults
if type(mod.options)=="function" then
modOptions = mod.options();
for _,group in pairs(modOptions)do
for key,value in pairs(group)do
if sharedDefaults[key]~=nil and dbDefaults.profile[modName][key]==nil then
dbDefaults.profile[modName][key] = sharedDefaults[key];
end
end
end
end
-- add own tree entry per module
options.args.modOptions.args[modName] = {
type = "group",
name = ModName, desc = ModDesc,
icon = Icon, iconCoords = IconCoords, -- currently ace ignore IconCoords
args = {
}
}
if mod.clickOptions then
ns.ClickOpts.createOptions(modName,modOptions);
end
local hasBrokerOpts = false;
for k in pairs(modOptions)do
if k:find("^broker") then
hasBrokerOpts = true;
break;
end
end
if not hasBrokerOpts then
modOptions.broker = {};
end
for k, v in pairs(modOptions)do
local name, order = v.name, v.order;
v.name,v.order = nil,nil;
if k:find("^broker") then
name = name or L["Broker"];
order = order or 1;
elseif k:find("^tooltip") then
name = name or L["Tooltip"];
order = order or 2;
elseif k:find("^misc") then
name = name or AUCTION_SUBCATEGORY_OTHER;
order = order or 98;
elseif k:find("^ClickOpts") then
name = name or L["ClickOptions"];
order = 99;
end
optionWalker(modName,k,v);
options.args.modOptions.args[modName].args[k] = {
type="group", name=C("ff00aaff",name), order=order, inline=true, args=v
}
end
end
end
local function buildCharDataOptions()
wipe(options.args.chars.args.list.args);
local lst = options.args.chars.args.list.args;
-- Broker_Everything_CharacterDB
-- Broker_Everything_CharacterDB.order
for order,name_realm in ipairs(Broker_Everything_CharacterDB.order)do
if Broker_Everything_CharacterDB[name_realm] then
local charName, realm = strsplit("%-",name_realm,2);
local label,hasError = "",false
if Broker_Everything_CharacterDB[name_realm].class and charName and realm then
label = C(Broker_Everything_CharacterDB[name_realm].class or "ffff0000",charName or "error").."\n"..C("gray",realm or "error");
else
label = C("ffff0000",charName) .. "\n" .. C("gray",realm);
hasError = true;
end
lst[name_realm] = {
type = "group", order = order, inline=true,
name = "",
args = {
label = {
type = "description", order=1, width="normal", fontSize = "medium",
name = label,
},
[name_realm] = {
type = "description", order = 2, width = "half",
name = calcDataSize,
},
up = {type="execute", order=3, width="half", name=L["Up"], desc=label, disabled=(order==1) },
down = {type="execute", order=4, width="half", name=L["Down"], desc=label, disabled=(order==#Broker_Everything_CharacterDB.order) },
del = {type="execute", order=5, width="half", name=DELETE, desc=label, disabled=(name_realm==ns.player.name_realm) },
error = {type = "description", order=6, fontSize = "medium", name = C("red",L["CharDataError"].." "..name_realm).."\n"..L["CharDataErrorTODO"], hidden=not hasError },
}
}
end
end
end
function options.args.chars.func(info) -- function for buttons 'Up', 'Down' and 'Delete' for single character and 'Delete all'
local key,char = info[#info],info[#info-1];
if key=="up" or key=="down" then
local cur
for i,v in ipairs(Broker_Everything_CharacterDB.order)do
if char==v then
cur = i;
break;
end
end
if key=="up" then
Broker_Everything_CharacterDB.order[cur],Broker_Everything_CharacterDB.order[cur-1] = Broker_Everything_CharacterDB.order[cur-1],Broker_Everything_CharacterDB.order[cur];
else -- down
Broker_Everything_CharacterDB.order[cur],Broker_Everything_CharacterDB.order[cur+1] = Broker_Everything_CharacterDB.order[cur+1],Broker_Everything_CharacterDB.order[cur];
end
buildCharDataOptions();
elseif key=="del" then -- delete single character
Broker_Everything_CharacterDB[char] = nil;
for i,v in ipairs(Broker_Everything_CharacterDB.order)do
if char==v then
tremove(Broker_Everything_CharacterDB.order,i);
break;
end
end
buildCharDataOptions();
elseif key=="delete" then -- delete all
Broker_Everything_CharacterDB = {};
C_UI.Reload();
end
end
function ns.RegisterOptions()
if Broker_Everything_AceDB==nil then
Broker_Everything_AceDB = {};
end
buildCharDataOptions();
db = LibStub("AceDB-3.0"):New("Broker_Everything_AceDB",dbDefaults,true);
if not nsProfileMT then
ns.profile = db.profile;
end
options.args.profiles = LibStub("AceDBOptions-3.0"):GetOptionsTable(db);
options.args.profiles.order=-1;
LibStub("AceConfig-3.0"):RegisterOptionsTable(addonLabel, options);
local opts = LibStub("AceConfigDialog-3.0"):AddToBlizOptions(addonLabel);
LibStub("HizurosSharedTools").BlizzOptions_ExpandOnShow(opts);
LibStub("HizurosSharedTools").AddCredit(addon);
local goldColor = ns.profile.GeneralOptions.goldColor;
if type(goldColor)~="string" then
ns.profile.GeneralOptions.goldColor = goldColor and "color" or "white";
end
end
function ns.ToggleBlizzOptionPanel()
Settings.OpenToCategory(addon)
end
if AddonCompartmentFrame then
AddonCompartmentFrame:RegisterAddon({
icon = 892831,
text = addon,
notCheckable = true,
func = ns.ToggleBlizzOptionPanel
})
end