-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.lua
2003 lines (1923 loc) · 81.4 KB
/
Config.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
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---@class GT : AceAddon-3.0, AceEvent-3.0, AceConfigRegistry-3.0, AceConfigDialog-3.0
local GT = LibStub("AceAddon-3.0"):GetAddon("GatheringTracker")
local AceConfigRegistry = LibStub("AceConfigRegistry-3.0")
local AceConfigDialog = LibStub("AceConfigDialog-3.0")
local media = LibStub:GetLibrary("LibSharedMedia-3.0")
GT.media = media
-- Localize global functions
local ipairs = ipairs
local math = math
local max = max
local next = next
local pairs = pairs
local select = select
local string = string
local table = table
local time = time
local tonumber = tonumber
local tostring = tostring
local type = type
local unpack = unpack
GT.defaults = {
profile = {
General = {
fixSettings = 0,
enable = true,
unlock = false,
filtersButton = false,
buttonFade = false,
buttonAlpha = 0,
buttonDelay = 0.5,
xPos = 200,
yPos = -150,
relativePoint = "TOPLEFT",
iconWidth = 27,
iconHeight = 27,
textColor = { 1, 1, 1 },
textSize = 20,
textFont = "Fira Mono Medium",
totalColor = { 0.098, 1, 0.078 },
totalSize = 20,
totalFont = "Fira Mono Medium",
stacksOnIcon = false,
includeBank = false,
includeReagent = false,
includeWarband = false,
tsmPrice = 1,
ignoreAmount = 0,
perItemPrice = false,
debugOption = 0,
rarityBorder = true,
multiColumn = false,
numRows = 1,
instanceHide = false,
groupHide = false,
showDelve = false,
showFollower = false,
combatHide = false,
itemsPerHour = false,
goldPerHour = false,
collapseDisplay = false,
collapseTime = 2,
sessionItems = false,
sessionOnly = false,
itemTooltip = false,
alertsEnable = false,
},
Alerts = {
},
Filters = {
},
CustomFilters = "",
CustomFiltersTable = {
},
miniMap = {
enable = false,
},
},
}
local generalOptions = {
type = "group",
childGroups = "tab",
args = {
General = {
type = "group",
name = "General",
order = 1,
args = {
enable = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Enabled",
desc = "Uncheck to disable the addon, this will effectively turn off the addon.",
width = 1.70,
get = function() return GT.db.profile.General.enable end,
set = function(_, key)
GT:ToggleGatheringTracker()
end,
order = 1
},
unlock = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Unlock Frame",
width = 1.70,
get = function() return GT.db.profile.General.unlock end,
set = function(_, key)
GT.db.profile.General.unlock = key
GT:ToggleBaseLock(key)
end,
order = 2
},
miniMap = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Minimap Button",
desc = "Enable this to show the minimap button.\n" ..
"|cff8080ffLeft Click|r shows filters menu.\n" ..
"|cff8080ffRight Click|r opens the addon options.\n" ..
"|cff8080ffShift + Left Click|r resets Session Data.\n" ..
"|cff8080ffShift + Right-Click|r to reset Alert Triggers",
width = 1.70,
get = function() return GT.db.profile.miniMap.enable end,
set = function(_, key)
GT.db.profile.miniMap.enable = key
GT:MinimapHandler(key)
end,
order = 3
},
buttonHeader = {
type = "header",
name = "Filter Button",
order = 10
},
filtersButton = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Filters Button",
desc = "Left Click shows filters menu.\n" ..
"Right Click clears all filters.\n" ..
"Shift + Left Click resets Session Data.",
width = 1.70,
get = function() return GT.db.profile.General.filtersButton end,
set = function(_, key)
GT.db.profile.General.filtersButton = key
GT:FiltersButton()
end,
order = 11
},
buttonFade = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Fade Out",
desc = "When Enabled the Filter Button will fade out, but will show up again on mouse over.",
width = 1.70,
get = function() return GT.db.profile.General.buttonFade end,
set = function(_, key)
GT.db.profile.General.buttonFade = key
local alpha = GT.db.profile.General.buttonAlpha
if not key then
alpha = 100
end
GT:FiltersButtonFade(alpha)
end,
disabled = function()
if GT.db.profile.General.filtersButton then
return false
else
return true
end
end,
order = 12
},
buttonAlpha = {
type = "range",
dialogControl = "NW_Slider",
name = "Fade Out Alpha",
desc = "0% is not visible, 100% is fully visible.\nDefault is 0",
min = 0,
max = 100,
step = 1,
width = 1.40,
get = function() return GT.db.profile.General.buttonAlpha or 0 end,
set = function(_, key)
GT.db.profile.General.buttonAlpha = key
GT:FiltersButtonFade(key)
end,
disabled = function()
if GT.db.profile.General.filtersButton then
if GT.db.profile.General.buttonFade then
return false
else
return true
end
else
return true
end
end,
order = 13
},
spacer2 = {
type = "description",
name = " ",
width = 0.3,
order = 14
},
buttonDelay = {
type = "range",
dialogControl = "NW_Slider",
name = "Fade Out Delay",
desc = "This configures how long after the mouse leaves the button before it fades out.\n" ..
"Default is 0.5.",
min = 0,
max = 1,
step = 0.02,
width = 1.40,
get = function() return GT.db.profile.General.buttonDelay or 0 end,
set = function(_, key) GT.db.profile.General.buttonDelay = key end,
disabled = function()
if GT.db.profile.General.filtersButton then
if GT.db.profile.General.buttonFade then
return false
else
return true
end
else
return true
end
end,
order = 15
},
header1 = {
type = "header",
name = "Auto Hide Options",
order = 100
},
groupHide = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Hide in Group",
desc = "When selected the display will be hidden when you are in a group.\n" ..
"Delves and Follower Dungeons count as groups.",
width = 1.70,
get = function() return GT.db.profile.General.groupHide end,
set = function(_, key)
GT.db.profile.General.groupHide = key
GT:SetDisplayState()
end,
order = 110
},
instanceHide = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Hide in Instance Content",
desc = "When selected the display will be hidden in instance content.",
width = 1.70,
get = function() return GT.db.profile.General.instanceHide end,
set = function(_, key)
GT.db.profile.General.instanceHide = key
GT:SetDisplayState()
end,
order = 120
},
showDelve = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Show In Delves",
desc = "When selected the display will be shown in Delves regardless of how Hide in Instance Content and Hide in Group are configured.",
width = 1.70,
get = function() return GT.db.profile.General.showDelve end,
set = function(_, key)
GT.db.profile.General.showDelve = key
GT:SetDisplayState()
end,
disabled = function()
if GT.db.profile.General.instanceHide or GT.db.profile.General.groupHide then
return false
else
return true
end
end,
hidden = function()
if GT.gameVersion == "retail" then
return false
else
return true
end
end,
order = 120
},
showFollower = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Show in Follower Dungeons",
desc = "When selected the display will be shown in Follower Dungeons regardless of how Hide in Instance Content and Hide in Group are configured.",
width = 1.70,
get = function() return GT.db.profile.General.showFollower end,
set = function(_, key)
GT.db.profile.General.showFollower = key
GT:SetDisplayState()
end,
disabled = function()
if GT.db.profile.General.instanceHide or GT.db.profile.General.groupHide then
return false
else
return true
end
end,
hidden = function()
if GT.gameVersion == "retail" then
return false
else
return true
end
end,
order = 130
},
combatHide = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Hide in Combat",
desc = "When selected the display will be hidden when you enter combat.\n" ..
"This overrides the options for Show in Delves and Show in Follower Dungeons.",
width = 1.70,
get = function() return GT.db.profile.General.combatHide end,
set = function(_, key)
GT.db.profile.General.combatHide = key
if key then
GT:RegisterEvent("PLAYER_REGEN_DISABLED")
GT:RegisterEvent("PLAYER_REGEN_ENABLED")
end
end,
order = 140
},
header2 = {
type = "header",
name = "Collapse Display",
order = 200
},
collapseDisplay = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Collapse Display",
desc = "When selected the display will be collapsed to only display the total rows.",
width = 1.70,
get = function() return GT.db.profile.General.collapseDisplay end,
set = function(_, key)
GT.db.profile.General.collapseDisplay = key
GT:CollapseManager(key)
end,
order = 210
},
collapseTime = {
type = "range",
dialogControl = "NW_Slider",
name = "Collapse Delay",
desc = "This configures how long after the mouse leaves the display area before it clopases to the total rows.\nDefault is 2.",
min = 0,
max = 10,
step = 0.5,
width = 1.40,
get = function() return GT.db.profile.General.collapseTime or 2 end,
set = function(_, key) GT.db.profile.General.collapseTime = key end,
disabled = function()
if GT.db.profile.General.collapseDisplay then
return false
else
return true
end
end,
order = 215
},
header3 = {
type = "header",
name = "Other",
order = 300
},
allFiltered = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Display All Filtered Items",
desc =
"When selected all selected filtered items will be displayed, including those with 0 count.\n\n" ..
"Not recommended to be used with a large number of enabled filters as it will cause significant lag.\n\n" ..
"|cffff0000Automatically disables with over 500 filters selected.|r",
width = 1.70,
get = function() return GT.db.profile.General.allFiltered end,
set = function(_, key)
GT.db.profile.General.allFiltered = key
GT:InventoryUpdate("Toggle Display All", false)
end,
disabled = function()
if #GT.IDs > 500 then
return true
else
return false
end
end,
order = 320
},
itemTooltip = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Display Item Tooltip",
desc =
"When selected the item tooltip will be displayed when mousing over an items icon.\n\n" ..
"Interacts poorly with the Collapse Display option, not recommended to use both.",
width = 1.70,
get = function() return GT.db.profile.General.itemTooltip end,
set = function(_, key)
GT.db.profile.General.itemTooltip = key
GT:RebuildDisplay("Item Tooltip Option Changed")
end,
order = 321
},
},
},
LookandFeel = {
type = "group",
name = "Look and Feel",
order = 2,
args = {
header3 = {
type = "header",
name = "Display Options",
order = 200
},
tsmPrice = {
type = "select",
dialogControl = "NW_Dropdown",
name = "Price Source",
desc = "Select the desired price source, or none to disable price information.\n" ..
"|cffff0000Supported addon required.|r\n\n" ..
"Supports:\n" ..
"TradeSkillMaster\n" ..
"RECrystallize\n" ..
"Auctionator",
width = 1.70,
values = function()
local options = {}
options[0] = "None"
if not GT.priceSources then
return options
end
if GT.priceSources["TradeSkillMaster"] then
options[1] = "TSM - DBMarket"
options[2] = "TSM - DBMinBuyout"
options[3] = "TSM - DBHistorical"
options[4] = "TSM - DBRegionMinBuyoutAvg"
options[5] = "TSM - DBRegionMarketAvg"
options[6] = "TSM - DBRegionHistorical"
end
if GT.priceSources["RECrystallize"] then
options[10] = "RECrystallize"
end
if GT.priceSources["Auctionator"] then
options[20] = "Auctionator"
end
return options
end,
get = function() return GT.db.profile.General.tsmPrice end,
set = function(_, key)
GT.db.profile.General.tsmPrice = key
if GT.db.profile.General.tsmPrice == 0 then
GT.db.profile.General.perItemPrice = false
GT.db.profile.General.goldPerHour = false
end
GT:RebuildDisplay("TSM Price Source Option Changed")
end,
disabled = function()
if not GT.priceSources then
return true
else
return false
end
end,
order = 201
},
perItemPrice = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Display Per Item Price",
desc = "If selected the price for 1 of each item will be displayed.\n" ..
"Price Source is required for this option to be enabled.",
width = 1.70,
get = function() return GT.db.profile.General.perItemPrice end,
set = function(_, key)
GT.db.profile.General.perItemPrice = key
GT:RebuildDisplay("Display Per Item Price Changed")
end,
disabled = function()
if not GT.priceSources or GT.db.profile.General.tsmPrice == 0 then
return true
else
return false
end
end,
order = 202
},
ignoreAmount = {
type = "range",
dialogControl = "NW_Slider",
name = "Ignore Amount",
desc = "Use this option to ignore a specific amount, this value will be subtracted from the totals.",
min = 0,
max = 100,
step = 1,
width = 1.70,
get = function() return GT.db.profile.General.ignoreAmount or 0 end,
set = function(_, key)
GT.db.profile.General.ignoreAmount = key
GT:InventoryUpdate("Ignore Amount Changed", true)
end,
order = 203
},
includeBank = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Include Bank",
desc = "If selected displayed values will include items in your bank.",
width = 1.70,
get = function() return GT.db.profile.General.includeBank end,
set = function(_, key)
GT.db.profile.General.includeBank = key
GT:InventoryUpdate("Include Bank", true)
end,
order = 204
},
includeReagent = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Include Reagent Bank",
desc = "If selected displayed values will include items in your reagent bank.",
width = 1.70,
get = function() return GT.db.profile.General.includeReagent end,
set = function(_, key)
GT.db.profile.General.includeReagent = key
GT:InventoryUpdate("Include Reagent", true)
end,
hidden = function()
if GT.gameVersion == "retail" then
return false
else
return true
end
end,
order = 205
},
includeWarband = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Include Warband Bank",
desc = "If selected displayed values will include items in your Warband bank.",
width = 1.70,
get = function() return GT.db.profile.General.includeWarband end,
set = function(_, key)
GT.db.profile.General.includeWarband = key
GT:InventoryUpdate("Include Warband", true)
end,
hidden = function()
if GT.gameVersion == "retail" then
return false
else
return true
end
end,
order = 206
},
header2 = {
type = "header",
name = "Session Display Options",
order = 250
},
sessionItems = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Display Session Item Counts",
desc = "If selected session item counts will be displayed in the column to the right of the item count.\n" ..
"Price data (if enabled) is not displayed for session data.\n\n" ..
"|cffff0000Session data not displayed in group mode.|r",
width = 1.70,
get = function() return GT.db.profile.General.sessionItems end,
set = function(_, key)
GT.db.profile.General.sessionItems = key
if not key then
GT.db.profile.General.sessionOnly = false
end
GT:RebuildDisplay("Display Session Item Counts Changed")
end,
order = 251
},
sessionOnly = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Only Display Session Data",
desc = "If selected only the session data will be displayed and selected items will only display if collected during the session.\n" ..
"Price data (if enabled) is displayed for the session data.",
width = 1.70,
get = function() return GT.db.profile.General.sessionOnly end,
set = function(_, key)
GT.db.profile.General.sessionOnly = key
GT:RebuildDisplay("Only Display Session Data Changed")
end,
disabled = function()
if not GT.db.profile.General.sessionItems then
return true
else
return false
end
end,
order = 252
},
itemsPerHour = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Display Items Per Hour",
desc = "If selected an estimated items gathered per hour will be displayed.",
width = 1.70,
get = function() return GT.db.profile.General.itemsPerHour end,
set = function(_, key)
GT.db.profile.General.itemsPerHour = key
GT:RebuildDisplay("Items Per Hour Changed")
end,
order = 255
},
goldPerHour = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Display Gold Per Hour",
desc = "If selected an estimated gold per hour will be displayed based on the value of items gathered.\n" ..
"Price Source is required for this option to be enabled.",
width = 1.70,
get = function() return GT.db.profile.General.goldPerHour end,
set = function(_, key)
GT.db.profile.General.goldPerHour = key
GT:RebuildDisplay("Gold Per Hour Changed")
end,
disabled = function()
if not GT.priceSources or GT.db.profile.General.tsmPrice == 0 then
return true
else
return false
end
end,
order = 256
},
perHourReset = {
type = "execute",
name = "Reset Session Data",
desc = "Clicking this will reset the session data.",
width = 1.70,
func = function()
GT:ResetSession()
end,
disabled = function()
if GT.db.profile.General.itemsPerHour or GT.db.profile.General.goldPerHour or
GT.db.profile.General.sessionItems then
return false
else
return true
end
end,
order = 257
},
header4 = {
type = "header",
name = "Columns",
order = 300
},
multiColumn = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Multiple Columns",
desc = "Enables the display to use multiple columns.",
width = 1.70,
get = function() return GT.db.profile.General.multiColumn end,
set = function(_, key)
GT.db.profile.General.multiColumn = key
GT:AllignRows()
GT:AllignColumns()
end,
order = 301
},
numRows = {
type = "range",
dialogControl = "NW_Slider",
name = "Max Rows Per Column",
desc = "Set the maximum number of rows to be displayed per column.",
min = 1,
max = 50,
step = 1,
width = 1.70,
get = function() return GT.db.profile.General.numRows or 1 end,
set = function(_, key)
GT.db.profile.General.numRows = key
if not GT.db.profile.General.collapseDisplay then
GT:AllignRows()
GT:AllignColumns()
end
end,
disabled = function()
if not GT.db.profile.General.multiColumn then
return true
else
return false
end
end,
order = 302
},
header5 = {
type = "header",
name = "Icon",
order = 400
},
iconWidth = {
type = "range",
dialogControl = "NW_Slider",
name = "Icon Width",
min = 10,
max = 100,
step = 1,
width = 1.70,
get = function() return GT.db.profile.General.iconWidth or 1 end,
set = function(_, key)
GT.db.profile.General.iconWidth = key
for itemID, itemFrame in pairs(GT.Display.Frames) do
itemFrame.icon:SetWidth(GT.db.profile.General.iconWidth)
GT:SetDisplayFrameWidth()
end
end,
order = 401
},
iconHeight = {
type = "range",
dialogControl = "NW_Slider",
name = "Icon Height",
min = 10,
max = 100,
step = 1,
width = 1.70,
get = function() return GT.db.profile.General.iconHeight or 1 end,
set = function(_, key)
GT.db.profile.General.iconHeight = key
for itemID, itemFrame in pairs(GT.Display.Frames) do
itemFrame.icon:SetHeight(GT.db.profile.General.iconHeight)
local frameHeight = GT.db.profile.General.iconHeight + 3
if frameHeight < itemFrame.text[1]:GetStringHeight() then
itemFrame:SetHeight(itemFrame.text[1]:GetStringHeight() + 3)
else
itemFrame:SetHeight(frameHeight)
end
end
end,
order = 402
},
rarityBorder = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Show Rarity Border",
desc = "Will display a colored border based on item rarity.",
width = 1.70,
get = function() return GT.db.profile.General.rarityBorder end,
set = function(_, key)
GT.db.profile.General.rarityBorder = key
if key then
for itemID, itemFrame in pairs(GT.Display.Frames) do
if itemID > 2 and itemID < 9999999998 then
local iconRarity = C_Item.GetItemQualityByID(itemID)
GT:DisplayFrameRarity(itemFrame, iconRarity)
end
end
else
for itemID, itemFrame in pairs(GT.Display.Frames) do
if itemFrame.iconRarity then
itemFrame.iconRarity:SetVertexColor(1, 1, 1, 1)
GT.Pools.texturePool:Release(itemFrame.iconRarity)
itemFrame.iconRarity = nil
end
end
end
end,
order = 403
},
header6 = {
type = "header",
name = "Text",
order = 500
},
textColor = {
type = "color",
name = "Text Color",
hasAlpha = false,
get = function()
local c = GT.db.profile.General.textColor
return c[1], c[2], c[3] or 1, 1, 1
end,
set = function(_, r, g, b)
GT.db.profile.General.textColor = { r, g, b }
for itemID, itemFrame in pairs(GT.Display.Frames) do
if itemID < 9999999998 then
for textIndex, textFrame in ipairs(itemFrame.text) do
textFrame:SetVertexColor(unpack(GT.db.profile.General.textColor))
end
end
end
end,
order = 501
},
textSize = {
type = "range",
dialogControl = "NW_Slider",
name = "Text Size",
min = 10,
max = 70,
step = 1,
width = 1.20,
get = function() return GT.db.profile.General.textSize or 1 end,
set = function(_, key)
if key < GT.db.profile.General.textSize then
GT.Display.ColumnSize = {}
end
GT.db.profile.General.textSize = key
for itemID, itemFrame in pairs(GT.Display.Frames) do
if itemID < 9999999998 then
for textIndex, textFrame in ipairs(itemFrame.text) do
textFrame:SetFont(media:Fetch("font", GT.db.profile.General.textFont), GT.db.profile.General.textSize, "OUTLINE")
GT:CheckColumnSize(textIndex, textFrame, itemID)
end
local frameHeight = math.max(GT.db.profile.General.iconHeight, key)
itemFrame:SetHeight(frameHeight + 3)
else
for textIndex, textFrame in ipairs(itemFrame.text) do
GT:CheckColumnSize(textIndex, textFrame, itemID)
end
end
end
GT:AllignColumns()
end,
order = 502
},
textFont = {
type = "select",
dialogControl = 'NW_Font',
name = "Text Font",
width = 1.20,
values = media:HashTable("font"),
get = function() return GT.db.profile.General.textFont end,
set = function(_, key)
GT.db.profile.General.textFont = key
GT.Display.ColumnSize = {}
for itemID, itemFrame in pairs(GT.Display.Frames) do
if itemID < 9999999998 then
for textIndex, textFrame in ipairs(itemFrame.text) do
textFrame:SetFont(media:Fetch("font", GT.db.profile.General.textFont), GT.db.profile.General.textSize, "OUTLINE")
GT:CheckColumnSize(textIndex, textFrame, itemID)
end
else
for textIndex, textFrame in ipairs(itemFrame.text) do
GT:CheckColumnSize(textIndex, textFrame, itemID)
end
end
end
GT:AllignColumns()
end,
order = 503
},
totalColor = {
type = "color",
name = "Total Color",
hasAlpha = false,
get = function()
local c = GT.db.profile.General.totalColor
return c[1], c[2], c[3] or 1, 1, 1
end,
set = function(_, r, g, b)
GT.db.profile.General.totalColor = { r, g, b }
for itemID, itemFrame in pairs(GT.Display.Frames) do
if itemID >= 9999999998 then
for textIndex, textFrame in ipairs(itemFrame.text) do
textFrame:SetVertexColor(unpack(GT.db.profile.General.totalColor[1]))
end
end
end
end,
order = 504
},
totalSize = {
type = "range",
dialogControl = "NW_Slider",
name = "Total Size",
min = 10,
max = 70,
step = 1,
width = 1.20,
get = function() return GT.db.profile.General.totalSize or 1 end,
set = function(_, key)
if key < GT.db.profile.General.totalSize then
GT.Display.ColumnSize = {}
end
GT.db.profile.General.totalSize = key
for itemID, itemFrame in pairs(GT.Display.Frames) do
if itemID >= 9999999998 then
for textIndex, textFrame in ipairs(itemFrame.text) do
textFrame:SetFont(media:Fetch("font", GT.db.profile.General.totalFont), GT.db.profile.General.totalSize, "OUTLINE")
GT:CheckColumnSize(textIndex, textFrame, itemID)
end
local frameHeight = math.max(GT.db.profile.General.iconHeight, key)
itemFrame:SetHeight(frameHeight + 3)
else
for textIndex, textFrame in ipairs(itemFrame.text) do
GT:CheckColumnSize(textIndex, textFrame, itemID)
end
end
end
GT:AllignColumns()
end,
order = 505
},
totalFont = {
type = "select",
dialogControl = 'NW_Font',
name = "Total Font",
width = 1.20,
values = media:HashTable("font"),
get = function() return GT.db.profile.General.totalFont end,
set = function(_, key)
GT.db.profile.General.totalFont = key
GT.Display.ColumnSize = {}
for itemID, itemFrame in pairs(GT.Display.Frames) do
if itemID >= 9999999998 then
for textIndex, textFrame in ipairs(itemFrame.text) do
textFrame:SetFont(media:Fetch("font", GT.db.profile.General.totalFont), GT.db.profile.General.totalSize, "OUTLINE")
GT:CheckColumnSize(textIndex, textFrame, itemID)
end
else
for textIndex, textFrame in ipairs(itemFrame.text) do
GT:CheckColumnSize(textIndex, textFrame, itemID)
end
end
end
GT:AllignColumns()
end,
order = 506
},
},
},
Alerts = {
type = "group",
name = "Alerts",
childGroups = "tree",
order = 4,
args = {
alertsEnable = {
type = "toggle",
dialogControl = "NW_CheckBox",
name = "Enable Alerts",
desc = "Check to enable Alerts",
width = 1.7,
get = function() return GT.db.profile.General.alertsEnable end,
set = function(_, key)
GT.db.profile.General.alertsEnable = key
end,
order = 101,
},
addItem = {
type = "execute",
name = "Select Item for Alerts",
desc = "Click to select what item to enable for Alerts.",
width = 1.7,
func = function()
GT:GenerateAlertsMenu()
end,
disabled = function()
if GT.db.profile.General.alertsEnable then
return false
else
return true
end
end,
order = 102,
},
},
},
Debug = {
type = "group",
name = "Debug",
order = 5,
args = {
header5 = {
type = "header",
name = "Debug",
order = 10000