@@ -75,7 +75,7 @@ local function GetOptions()
7575 name = " Class Color Override" ,
7676 desc = " Use Class Colors for Point Displays." ,
7777 get = function () return db .classcolor .enabled end ,
78- set = function (info , value )
78+ set = function (info , value )
7979 db .classcolor .enabled = value
8080 cPointDisplay :UpdatePoints (" ENABLE" )
8181 end ,
@@ -215,7 +215,7 @@ local function GetOptions()
215215 min = 0 , max = 1 , step = 0.05 ,
216216 isPercent = true ,
217217 get = function (info ) return db .classcolor .spark .max end ,
218- set = function (info , value )
218+ set = function (info , value )
219219 db .classcolor .spark .max = value
220220 cPointDisplay :GetClassColors ()
221221 cPointDisplay :UpdatePoints (" ENABLE" )
@@ -231,15 +231,15 @@ local function GetOptions()
231231 },
232232 }
233233 end
234-
234+
235235 -- Create Copy All table
236236 local CopyAllFromTable = {}
237237 local CopyAllFromTableShort = {}
238238 local cnt = 1
239239 for ic ,vc in pairs (Types ) do
240240 for it ,vt in ipairs (Types [ic ].points ) do
241- local tid = Types [ic ].points [it ].id
242-
241+ local tid = Types [ic ].points [it ].id
242+
243243 tinsert (CopyAllFromTable , cnt )
244244 tinsert (CopyAllFromTableShort , cnt )
245245 CopyAllFromTable [cnt ] = {
@@ -249,23 +249,23 @@ local function GetOptions()
249249 typenum = it ,
250250 }
251251 CopyAllFromTableShort [cnt ] = Types [ic ].points [it ].name
252-
252+
253253 cnt = cnt + 1
254- end
254+ end
255255 end
256-
256+
257257 local ClassOpts , TypeOpts , BarOpts , TrinketOpts = {}, {}, {}, {}
258258 local Opts_ClassOrderCnt = 40
259259 local Opts_TypeOrderCnt = 10
260-
260+
261261 for ic ,vc in pairs (Types ) do
262262 local ClassID = Types [ic ].name
263-
263+
264264 wipe (TypeOpts )
265265 for it ,vt in ipairs (Types [ic ].points ) do
266- local tid = Types [ic ].points [it ].id
266+ local tid = Types [ic ].points [it ].id
267267 local TypeDesc = Types [ic ].points [it ].name
268-
268+
269269 TypeOpts [tid ] = {
270270 type = " group" ,
271271 name = TypeDesc ,
@@ -282,7 +282,7 @@ local function GetOptions()
282282 name = " Enabled" ,
283283 desc = string.format (" Enable/Disable the %s display." , TypeDesc ),
284284 get = function () return db [ic ].types [tid ].enabled end ,
285- set = function (info , value )
285+ set = function (info , value )
286286 db [ic ].types [tid ].enabled = value
287287 db [ic ].types [tid ].configmode .enabled = false
288288 if not value then
@@ -330,7 +330,7 @@ local function GetOptions()
330330 type = " toggle" ,
331331 name = " Configuration Mode" ,
332332 get = function (info ) return db [ic ].types [tid ].configmode .enabled end ,
333- set = function (info , value )
333+ set = function (info , value )
334334 db [ic ].types [tid ].configmode .enabled = value
335335 cPointDisplay :UpdatePoints (" ENABLE" )
336336 end ,
@@ -341,15 +341,15 @@ local function GetOptions()
341341 name = " Config Mode point count" ,
342342 min = 0 , max = Types [ic ].points [it ].barcount , step = 1 ,
343343 get = function (info ) return db [ic ].types [tid ].configmode .count end ,
344- set = function (info , value )
344+ set = function (info , value )
345345 db [ic ].types [tid ].configmode .count = value
346346 cPointDisplay :UpdatePoints (" ENABLE" )
347347 end ,
348348 disabled = function () if db [ic ].types [tid ].configmode .enabled and db [ic ].types [tid ].enabled then return false else return true end end ,
349349 order = 20 ,
350350 },
351351 },
352- },
352+ },
353353 general = {
354354 name = " General Settings" ,
355355 type = " group" ,
@@ -368,32 +368,33 @@ local function GetOptions()
368368 desc = " Note: A UI reload (/reload ui) is required to make the default UI display visible again if you have it hidden." ,
369369 width = " full" ,
370370 get = function (info ) return db [ic ].types [tid ].general .hideui end ,
371- set = function (info , value )
371+ set = function (info , value )
372372 db [ic ].types [tid ].general .hideui = value
373373 cPointDisplay :HideUIElements ()
374374 end ,
375375 order = 10 ,
376- disabled = function () if (tid == " cp" or tid == " hp" or tid == " ss" or tid == " ac" ) then return false else return true end end ,
376+ disabled = function () if (tid == " cp" or tid == " hp" or tid == " ss" or tid == " ac" or tid == " c5 " ) then return false else return true end end ,
377377 },
378378 showatzero = {
379379 type = " toggle" ,
380380 name = " Show at 0 points/stacks" ,
381381 desc = " Keep the bar visible even when there are no points/stacks." ,
382382 width = " full" ,
383383 get = function (info ) return db [ic ].types [tid ].general .showatzero end ,
384- set = function (info , value )
384+ set = function (info , value )
385385 db [ic ].types [tid ].general .showatzero = value
386386 cPointDisplay :UpdatePoints (" ENABLE" )
387387 end ,
388388 order = 10 ,
389+ disabled = function () if (tid == " c6" or tid == " c5" ) then return true else return false end end ,
389390 },
390391 hideempty = {
391392 type = " toggle" ,
392393 name = " Hide unused points/stacks" ,
393394 desc = " Only show used the number of points/stacks you have. IE. If you have 4 Combo Points, the 5th Combo Point bar will remain hidden." ,
394395 width = " full" ,
395396 get = function (info ) return db [ic ].types [tid ].general .hideempty end ,
396- set = function (info , value )
397+ set = function (info , value )
397398 db [ic ].types [tid ].general .hideempty = value
398399 cPointDisplay :UpdatePoints (" ENABLE" )
399400 end ,
@@ -411,7 +412,7 @@ local function GetOptions()
411412 desc = " Hide when in a Vehicle." ,
412413 width = " full" ,
413414 get = function (info ) return db [ic ].types [tid ].general .hidein .vehicle end ,
414- set = function (info , value )
415+ set = function (info , value )
415416 db [ic ].types [tid ].general .hidein .vehicle = value
416417 cPointDisplay :UpdatePoints (" ENABLE" )
417418 end ,
@@ -446,7 +447,7 @@ local function GetOptions()
446447 desc = string.format (" Orientate the %s display vertically." , TypeDesc ),
447448 width = " full" ,
448449 get = function (info ) return db [ic ].types [tid ].general .direction .vertical end ,
449- set = function (info , value )
450+ set = function (info , value )
450451 db [ic ].types [tid ].general .direction .vertical = value
451452 cPointDisplay :UpdatePosition ()
452453 end ,
@@ -458,14 +459,14 @@ local function GetOptions()
458459 desc = string.format (" Reverse the orientation of the %s display." , TypeDesc ),
459460 width = " full" ,
460461 get = function (info ) return db [ic ].types [tid ].general .direction .reverse end ,
461- set = function (info , value )
462+ set = function (info , value )
462463 db [ic ].types [tid ].general .direction .reverse = value
463464 cPointDisplay :UpdatePosition ()
464465 end ,
465466 order = 20 ,
466467 },
467468 },
468- },
469+ },
469470 },
470471 },
471472 },
@@ -509,7 +510,7 @@ local function GetOptions()
509510 anchorto = {
510511 type = " select" ,
511512 name = " Anchor To" ,
512- get = function (info )
513+ get = function (info )
513514 for k ,v in pairs (table_AnchorPoints ) do
514515 if v == db [ic ].types [tid ].position .anchorto then return k end
515516 end
@@ -526,7 +527,7 @@ local function GetOptions()
526527 anchorfrom = {
527528 type = " select" ,
528529 name = " Anchor From" ,
529- get = function (info )
530+ get = function (info )
530531 for k ,v in pairs (table_AnchorPoints ) do
531532 if v == db [ic ].types [tid ].position .anchorfrom then return k end
532533 end
@@ -563,7 +564,7 @@ local function GetOptions()
563564 strata = {
564565 type = " select" ,
565566 name = " Strata" ,
566- get = function (info )
567+ get = function (info )
567568 for k ,v in pairs (table_Strata ) do
568569 if v == db [ic ].types [tid ].position .framelevel .strata then return k end
569570 end
@@ -582,7 +583,7 @@ local function GetOptions()
582583 name = " Frame Level" ,
583584 min = 1 , max = 50 , step = 1 ,
584585 get = function (info ) return db [ic ].types [tid ].position .framelevel .level end ,
585- set = function (info , value )
586+ set = function (info , value )
586587 db [ic ].types [tid ].position .framelevel .level = value
587588 cPointDisplay :UpdatePosition ()
588589 end ,
@@ -597,7 +598,7 @@ local function GetOptions()
597598 type = " group" ,
598599 childGroups = " tab" ,
599600 order = 90 ,
600- disabled = function () if db [ic ].types [tid ].enabled then return false else return true end end ,
601+ disabled = function () if db [ic ].types [tid ].enabled then return false else return true end end ,
601602 args = {
602603 },
603604 },
@@ -646,7 +647,7 @@ local function GetOptions()
646647 cPointDisplay :UpdatePosition ()
647648 end ,
648649 },
649- },
650+ },
650651 },
651652 background = {
652653 name = " Background" ,
@@ -713,7 +714,7 @@ local function GetOptions()
713714 name = " Inset" ,
714715 min = - 32 , max = 32 , step = 1 ,
715716 get = function (info ) return db [ic ].types [tid ].bgpanel .border .inset end ,
716- set = function (info , value )
717+ set = function (info , value )
717718 db [ic ].types [tid ].bgpanel .border .inset = value
718719 cPointDisplay :UpdateBGPanelTextures ()
719720 cPointDisplay :UpdatePosition ()
@@ -770,7 +771,7 @@ local function GetOptions()
770771 name = " Enabled" ,
771772 desc = " Enable/Disable combat fading for this Point Display type." ,
772773 get = function () return db [ic ].types [tid ].combatfader .enabled end ,
773- set = function (info , value )
774+ set = function (info , value )
774775 db [ic ].types [tid ].combatfader .enabled = value
775776 cPointDisplay :UpdateCombatFader ()
776777 end ,
@@ -830,14 +831,14 @@ local function GetOptions()
830831 },
831832 },
832833 }
833-
834+
834835 -- Bar options
835836 local CopyBarFromTable = {}
836837 for i = 1 , Types [ic ].points [it ].barcount do
837838 tinsert (CopyBarFromTable , i )
838839 CopyBarFromTable [i ] = string.format (" %s %s" , " Bar" , i )
839840 end
840-
841+
841842 wipe (BarOpts )
842843 for i = 1 , Types [ic ].points [it ].barcount do
843844 local BarID = string.format (" %s%s" , " bar" , i )
@@ -901,7 +902,7 @@ local function GetOptions()
901902 cPointDisplay :UpdatePoints (" ENABLE" )
902903 end ,
903904 },
904- },
905+ },
905906 },
906907 position = {
907908 name = " Position" ,
@@ -1093,7 +1094,7 @@ local function GetOptions()
10931094 name = " Inset" ,
10941095 min = - 32 , max = 32 , step = 1 ,
10951096 get = function (info ) return db [ic ].types [tid ].bars [i ].border .empty .inset end ,
1096- set = function (info , value )
1097+ set = function (info , value )
10971098 db [ic ].types [tid ].bars [i ].border .empty .inset = value
10981099 cPointDisplay :UpdatePoints (" ENABLE" )
10991100 end ,
@@ -1151,7 +1152,7 @@ local function GetOptions()
11511152 name = " Inset" ,
11521153 min = - 32 , max = 32 , step = 1 ,
11531154 get = function (info ) return db [ic ].types [tid ].bars [i ].border .full .inset end ,
1154- set = function (info , value )
1155+ set = function (info , value )
11551156 db [ic ].types [tid ].bars [i ].border .full .inset = value
11561157 cPointDisplay :UpdatePoints (" ENABLE" )
11571158 end ,
@@ -1293,7 +1294,7 @@ local function GetOptions()
12931294 cPointDisplay :UpdatePosition ()
12941295 end ,
12951296 },
1296- },
1297+ },
12971298 },
12981299 bg = {
12991300 type = " group" ,
@@ -1357,21 +1358,21 @@ local function GetOptions()
13571358 },
13581359 },
13591360 },
1360- },
1361+ },
13611362 },
13621363 },
13631364 },
13641365 };
13651366 end
1366-
1367+
13671368 -- Fill out new Types table with it's Bars
13681369 for key , val in pairs (BarOpts ) do
13691370 TypeOpts [tid ].args .bars .args [key ] = (type (val ) == " function" ) and val () or val
13701371 end
1371-
1372+
13721373 Opts_TypeOrderCnt = Opts_TypeOrderCnt + 10 ;
13731374 end
1374-
1375+
13751376 -- Create new Class table
13761377 ClassOpts [ic ] = {
13771378 name = ClassID ,
@@ -1383,10 +1384,10 @@ local function GetOptions()
13831384 for key , val in pairs (TypeOpts ) do
13841385 ClassOpts [ic ].args [key ] = (type (val ) == " function" ) and val () or val
13851386 end
1386-
1387+
13871388 Opts_ClassOrderCnt = Opts_ClassOrderCnt + 10 ;
13881389 end
1389-
1390+
13901391 -- Fill out Options table with all Classes
13911392 for key , val in pairs (ClassOpts ) do
13921393 options .args [key ] = (type (val ) == " function" ) and val () or val
@@ -1435,7 +1436,7 @@ function cPointDisplay:CopyAllSettings(FromTable, ToTable, FromIC, ToIC, FromTID
14351436 ToTable [i ] = FromTable [i ]
14361437 end
14371438 end
1438-
1439+
14391440 -- Erase any excess Point Bar info
14401441 if Types [FromIC ].points [FromNum ].barcount > Types [ToIC ].points [ToNum ].barcount then
14411442 local FromCount = Types [FromIC ].points [FromNum ].barcount + 1
@@ -1444,11 +1445,11 @@ function cPointDisplay:CopyAllSettings(FromTable, ToTable, FromIC, ToIC, FromTID
14441445 db [ToIC ].types [ToTID ].bars [i ] = nil
14451446 end
14461447 end
1447-
1448+
14481449 -- Disable config mode
14491450 db [ToIC ].types [ToTID ].configmode .enabled = false
14501451 db [ToIC ].types [ToTID ].configmode .count = 2
1451-
1452+
14521453 return true
14531454end
14541455
@@ -1507,7 +1508,7 @@ local function GetIntOptions()
15071508 openoptions = {
15081509 type = " execute" ,
15091510 name = " Open config..." ,
1510- func = function ()
1511+ func = function ()
15111512 cPointDisplay :OpenOptions ()
15121513 end ,
15131514 order = 20 ,
@@ -1535,21 +1536,21 @@ function cPointDisplay:SetUpInitialOptions()
15351536 -- Chat commands
15361537 self :RegisterChatCommand (" cpd" , " ChatCommand" )
15371538 self :RegisterChatCommand (" cPointDisplay" , " ChatCommand" )
1538-
1539+
15391540 -- Interface panel options
15401541 LibStub (" AceConfig-3.0" ):RegisterOptionsTable (" cPointDisplay-Int" , GetIntOptions )
15411542 self .optionsFrame = LibStub (" AceConfigDialog-3.0" ):AddToBlizOptions (" cPointDisplay-Int" , " cPointDisplay" )
15421543end
15431544
15441545function cPointDisplay :SetUpOptions ()
15451546 db = self .db .profile
1546-
1547+
15471548 -- Primary options
15481549 GetOptions ()
1549-
1550+
15501551 options .args .profiles = LibStub (" AceDBOptions-3.0" ):GetOptionsTable (self .db )
15511552 options .args .profiles .order = 10000
1552-
1553+
15531554 LibStub (" AceConfig-3.0" ):RegisterOptionsTable (" cPointDisplay" , options )
15541555 LibStub (" AceConfigDialog-3.0" ):SetDefaultSize (" cPointDisplay" , 800 , 600 )
15551556end
0 commit comments