-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathConfig.lua
1255 lines (1214 loc) · 33 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
local GatherMate = LibStub("AceAddon-3.0"):GetAddon("GatherMate2")
local Config = GatherMate:NewModule("Config","AceEvent-3.0")
local L = LibStub("AceLocale-3.0"):GetLocale("GatherMate2", false)
-- Databroker support
local DataBroker = LibStub:GetLibrary("LibDataBroker-1.1",true)
local SaveBindings = SaveBindings or AttemptToSaveBindings
--[[
Code here for configuring the mod, and making the minimap button
]]
-- Setup keybinds (these need to be global strings to show up properly in ESC -> Key Bindings)
BINDING_HEADER_GatherMate2 = "GatherMate2"
BINDING_NAME_TOGGLE_GATHERMATE2_MINIMAPICONS = L["Keybind to toggle Minimap Icons"]
BINDING_NAME_TOGGLE_GATHERMATE2_MAINMAPICONS = L["Keybind to toggle Worldmap Icons"]
-- A helper function for keybindings
local KeybindHelper = {}
do
local t = {}
function KeybindHelper:MakeKeyBindingTable(...)
for k in pairs(t) do t[k] = nil end
for i = 1, select("#", ...) do
local key = select(i, ...)
if key ~= "" then
tinsert(t, key)
end
end
return t
end
end
local prof_options = {
always = L["Always show"],
with_profession = L["Only with profession"],
active = L["Only while tracking"],
never = L["Never show"],
}
local prof_options2 = { -- For Gas, which doesn't have tracking as a skill
always = L["Always show"],
with_profession = L["Only with profession"],
never = L["Never show"],
}
local prof_options3 = {
always = L["Always show"],
active = L["Only while tracking"],
never = L["Never show"],
}
local prof_options4 = { -- For Archaeology, which doesn't have tracking as a skill
always = L["Always show"],
active = L["Only with digsite"],
with_profession = L["Only with profession"],
never = L["Never show"],
}
local db
local imported = {}
-- setup the options, we need to reference GatherMate for this
local function get(k) return db[k.arg] end
local function set(k, v) db[k.arg] = v; Config:UpdateConfig(); end
local generalOptions = {
type = "group",
get = function(k) return db.show[k.arg] end,
set = function(k, v) db.show[k.arg] = v; Config:UpdateConfig(); end,
args = {
desc = {
order = 0,
type = "description",
name = L["Selected databases are shown on both the World Map and Minimap."],
},
showMinerals = {
order = 1,
name = L["Show Mining Nodes"],
desc = L["Toggle showing mining nodes."],
type = "select",
values = prof_options,
arg = "Mining"
},
showHerbs = {
order = 2,
name = L["Show Herbalism Nodes"],
desc = L["Toggle showing herbalism nodes."],
type = "select",
values = prof_options,
arg = "Herb Gathering"
},
showFishes = {
order = 3,
name = L["Show Fishing Nodes"],
desc = L["Toggle showing fishing nodes."],
type = "select",
values = prof_options,
arg = "Fishing"
},
showGases = {
order = 4,
name = L["Show Gas Clouds"],
desc = L["Toggle showing gas clouds."],
type = "select",
values = prof_options2,
arg = "Extract Gas",
},
showTreasure = {
order = 5,
name = L["Show Treasure Nodes"],
desc = L["Toggle showing treasure nodes."],
type = "select",
values = prof_options3,
arg = "Treasure"
},
showArchaeology = {
order = 6,
name = L["Show Archaeology Nodes"],
desc = L["Toggle showing archaeology nodes."],
type = "select",
values = prof_options4,
arg = "Archaeology",
},
showTimber = {
order = 7,
name = L["Show Timber Nodes"],
desc = L["Toggle showing timber nodes."],
type = "select",
values = prof_options3,
arg = "Logging",
},
},
}
local minimapOptions = {
type = "group",
get = get,
set = set,
args = {
desc = {
order = 0,
type = "description",
name = L["Control various aspects of node icons on both the World Map and Minimap."],
},
showWorldMapIcons = {
order = 1,
name = L["Show World Map Icons"],
desc = L["Toggle showing World Map icons."],
type = "toggle",
arg = "showWorldMap",
width = "full",
},
worldMapIconsInteractive = {
order = 1.5,
name = L["World Map Icons Clickable"],
desc = L["Toggle if World Map icons are clickable (to remove them or generate way points)."],
type = "toggle",
arg = "worldMapIconsInteractive",
width = "full",
disabled = function() return not db.showWorldMap end,
},
showMinimapIcons = {
order = 2,
name = L["Show Minimap Icons"],
desc = L["Toggle showing Minimap icons."],
type = "toggle",
arg = "showMinimap",
width = "full",
},
minimapTooltips = {
order = 3,
name = L["Minimap Icon Tooltips"],
desc = L["Toggle showing Minimap icon tooltips."],
type = "toggle",
arg = "minimapTooltips",
width = "full",
disabled = function() return not db.showMinimap end,
},
minimapNodeRange = {
order = 4,
type = "toggle",
name = L["Show Nodes on Minimap Border"],
desc = L["Shows more Nodes that are currently out of range on the minimap's border."],
arg = "nodeRange",
width = "full",
disabled = function() return not db.showMinimap end,
},
togglekey = {
order = 5,
name = L["Keybind to toggle Minimap Icons"],
desc = L["Keybind to toggle Minimap Icons"],
type = "keybinding",
width = "full",
get = function(info)
return table.concat(KeybindHelper:MakeKeyBindingTable(GetBindingKey("TOGGLE_GATHERMATE2_MINIMAPICONS")), ", ")
end,
set = function(info, key)
if key == "" then
local t = KeybindHelper:MakeKeyBindingTable(GetBindingKey("TOGGLE_GATHERMATE2_MINIMAPICONS"))
for i = 1, #t do
SetBinding(t[i])
end
else
local oldAction = GetBindingAction(key)
local frame = LibStub("AceConfigDialog-3.0").OpenFrames["GatherMate"]
if frame then
if ( oldAction ~= "" and oldAction ~= "TOGGLE_GATHERMATE2_MINIMAPICONS" ) then
frame:SetStatusText(KEY_UNBOUND_ERROR:format(GetBindingText(oldAction, "BINDING_NAME_")))
else
frame:SetStatusText(KEY_BOUND)
end
end
SetBinding(key, "TOGGLE_GATHERMATE2_MINIMAPICONS")
end
SaveBindings(GetCurrentBindingSet())
end,
},
toggleWkey = {
order = 6,
name = L["Keybind to toggle Worldmap Icons"],
desc = L["Keybind to toggle Worldmap Icons"],
type = "keybinding",
width = "full",
get = function(info)
return table.concat(KeybindHelper:MakeKeyBindingTable(GetBindingKey("TOGGLE_GATHERMATE2_MAINMAPICONS")), ", ")
end,
set = function(info, key)
if key == "" then
local t = KeybindHelper:MakeKeyBindingTable(GetBindingKey("TOGGLE_GATHERMATE2_MAINMAPICONS"))
for i = 1, #t do
SetBinding(t[i])
end
else
local oldAction = GetBindingAction(key)
local frame = LibStub("AceConfigDialog-3.0").OpenFrames["GatherMate"]
if frame then
if ( oldAction ~= "" and oldAction ~= "TOGGLE_GATHERMATE2_MAINMAPICONS" ) then
frame:SetStatusText(KEY_UNBOUND_ERROR:format(GetBindingText(oldAction, "BINDING_NAME_")))
else
frame:SetStatusText(KEY_BOUND)
end
end
SetBinding(key, "TOGGLE_GATHERMATE2_MAINMAPICONS")
end
SaveBindings(GetCurrentBindingSet())
end,
},
iconScale = {
order = 10,
name = L["World Map Icon Scale"],
desc = L["Icon scaling, this lets you enlarge or shrink your icons on the World Map."],
type = "range",
min = 0.5, max = 5, step = 0.01,
arg = "scale",
},
miconScale = {
order = 11,
name = L["Minimap Icon Scale"],
desc = L["Icon scaling, this lets you enlarge or shrink your icons on the Minimap."],
type = "range",
min = 0.5, max = 5, step = 0.01,
arg = "miniscale",
},
iconAlpha = {
order = 12,
name = L["Icon Alpha"],
desc = L["Icon alpha value, this lets you change the transparency of the icons. Only applies on World Map."],
type = "range",
min = 0.1, max = 1, step = 0.05,
arg = "alpha",
},
tracking = {
order = 20,
name = L["Tracking Circle Color"],
desc = L["Color of the tracking circle."],
type = "group",
inline = true,
get = function(info)
local t = db.trackColors[info.arg]
return t.Red, t.Green, t.Blue, t.Alpha
end,
set = function(info, r, g, b, a)
local t = db.trackColors[info.arg]
t.Red = r
t.Green = g
t.Blue = b
t.Alpha = a
Config:UpdateConfig()
end,
args = {
trackingColorMine = {
order = 1,
name = L["Mineral Veins"],
desc = L["Color of the tracking circle."],
type = "color",
hasAlpha = true,
arg = "Mining",
},
trackingColorHerb = {
order = 2,
name = L["Herb Bushes"],
desc = L["Color of the tracking circle."],
type = "color",
hasAlpha = true,
arg = "Herb Gathering",
},
trackingColorFish = {
order = 3,
name = L["Fishing"],
desc = L["Color of the tracking circle."],
type = "color",
hasAlpha = true,
arg = "Fishing",
},
trackingColorGas = {
order = 4,
name = L["Gas Clouds"],
desc = L["Color of the tracking circle."],
type = "color",
hasAlpha = true,
arg = "Extract Gas",
},
trackingColorTreasure = {
order = 6,
name = L["Treasure"],
desc = L["Color of the tracking circle."],
type = "color",
hasAlpha = true,
arg = "Treasure",
},
trackingColorArchaelogy = {
order = 7,
name = L["Archaeology"],
desc = L["Color of the tracking circle."],
type = "color",
hasAlpha = true,
arg = "Archaeology",
},
space = {
order = 10,
name = "",
desc = "",
type = "description",
width = "full",
},
trackDistance = {
order = 15,
name = L["Tracking Distance"],
desc = L["The distance in yards to a node before it turns into a tracking circle"],
type = "range",
min = 50, max = 240, step = 5,
get = get,
set = set,
arg = "trackDistance",
},
trackShow = {
order = 20,
name = L["Show Tracking Circle"],
desc = L["Toggle showing the tracking circle."],
type = "select",
get = get,
set = set,
values = prof_options,
arg = "trackShow",
},
},
},
},
}
-- Setup some storage arrays by db to sort node names and zones alphabetically
local delocalizedZones = {}
local denormalizedNames = {}
local sortedFilter = setmetatable({}, {__index = function(t, k)
local new = {}
table.wipe(delocalizedZones)
if k == "zones" then
for index, zoneID in pairs(GatherMate.HBD:GetAllMapIDs()) do
local name = GatherMate:MapLocalize(zoneID)
new[name] = name
delocalizedZones[name] = zoneID
end
else
local expansion = GatherMate.nodeExpansion[k]
local map = GatherMate.nodeIDs[k]
for name in pairs(map) do
local idx = #new+1
new[idx] = name
denormalizedNames[name] = name
end
if expansion then
-- We only end up creating one function per tracked type anyway
table.sort(new, function(a, b)
local mA, mB = expansion[map[a]], expansion[map[b]]
if not mA or not mB or mA == mB then return map[a] > map[b]
else return mA > mB end
end)
else
table.sort(new)
end
end
rawset(t, k, new)
return new
end})
-- Setup some helper functions
local ConfigFilterHelper = {}
function ConfigFilterHelper:SelectAll(info)
local db = db.filter[info.arg]
local nids = GatherMate.nodeIDs[info.arg]
for k, v in pairs(nids) do
db[v] = true
end
Config:UpdateConfig()
end
function ConfigFilterHelper:SelectNone(info)
local db = db.filter[info.arg]
local nids = GatherMate.nodeIDs[info.arg]
for k, v in pairs(nids) do
db[v] = false
end
Config:UpdateConfig()
end
function ConfigFilterHelper:SetState(info, nodeIndex, state)
local nodeName = sortedFilter[info.arg][nodeIndex]
if nodeName:find("^%(%d+%)") then nodeName = nodeName:match("^%(%d+%) (.*)$") end
db.filter[info.arg][GatherMate.nodeIDs[info.arg][nodeName]] = state
Config:UpdateConfig()
end
function ConfigFilterHelper:GetState(info, nodeIndex)
local nodeName = sortedFilter[info.arg][nodeIndex]
if nodeName:find("^%(%d+%)") then nodeName = nodeName:match("^%(%d+%) (.*)$") end
return db.filter[info.arg][GatherMate.nodeIDs[info.arg][nodeName]]
end
local ImportHelper = {}
function ImportHelper:GetImportStyle(info,k)
return db["importers"][info.arg].Style
end
function ImportHelper:SetImportStyle(info,k,state)
db["importers"][info.arg].Style = k
end
function ImportHelper:GetImportDatabase(info,k)
return db["importers"][info.arg].Databases[k]
end
function ImportHelper:SetImportDatabase(info,k,state)
db["importers"][info.arg].Databases[k] = state
end
function ImportHelper:GetAutoImport(info, k)
return db["importers"][info.arg].autoImport
end
function ImportHelper:SetAutoImport(info,state)
db["importers"][info.arg].autoImport = state
end
function ImportHelper:GetBCOnly(info,k)
return db["importers"][info.arg].bcOnly
end
function ImportHelper:SetBCOnly(info,state)
db["importers"][info.arg].bcOnly = state
end
function ImportHelper:GetExpacOnly(info,k)
return db["importers"][info.arg].expacOnly
end
function ImportHelper:SetExpacOnly(info,state)
db["importers"][info.arg].expacOnly = state
end
function ImportHelper:GetExpac(info,k)
return db["importers"][info.arg].expac
end
function ImportHelper:SetExpac(info,state)
db["importers"][info.arg].expac = state
end
local filterOptions = {
type = "group",
name = L["Filters"],
order = 2,
get = get,
set = set,
childGroups = "tab",
handler = ConfigFilterHelper,
args = {
heading = {
order = 0,
type = "description",
name = L["Filter_Desc"],
width = "full",
},
},
}
filterOptions.args.herbs = {
type = "group",
name = L["Herbalism"],
desc = L["Select the herb nodes you wish to display."],
args = {
select_all = {
order = 1,
name = L["Select All"],
desc = L["Select all nodes"],
type = "execute",
func = "SelectAll",
arg = "Herb Gathering",
},
select_none = {
order = 2,
desc = L["Clear node selections"],
name = L["Select None"],
type = "execute",
func = "SelectNone",
arg = "Herb Gathering",
},
herblist = {
order = 3,
name = L["Herb Bushes"],
type = "multiselect",
values = sortedFilter["Herb Gathering"],
set = "SetState",
get = "GetState",
arg = "Herb Gathering",
},
},
}
filterOptions.args.mines = {
type = "group",
name = L["Mining"],
desc = L["Select the mining nodes you wish to display."],
args = {
select_all = {
order = 1,
name = L["Select All"],
desc = L["Select all nodes"],
type = "execute",
func = "SelectAll",
arg = "Mining",
},
select_none = {
order = 2,
desc = L["Clear node selections"],
name = L["Select None"],
type = "execute",
func = "SelectNone",
arg = "Mining",
},
minelist = {
order = 3,
name = L["Mineral Veins"],
type = "multiselect",
values = sortedFilter["Mining"],
set = "SetState",
get = "GetState",
arg = "Mining",
},
},
}
filterOptions.args.fish = {
type = "group",
name = L["Fishing"],
args = {
select_all = {
order = 1,
name = L["Select All"],
desc = L["Select all nodes"],
type = "execute",
func = "SelectAll",
arg = "Fishing",
},
select_none = {
order = 2,
desc = L["Clear node selections"],
name = L["Select None"],
type = "execute",
func = "SelectNone",
arg = "Fishing",
},
fishlist = {
order = 3,
name = L["Fishes"],
type = "multiselect",
desc = L["Select the fish nodes you wish to display."],
values = sortedFilter["Fishing"],
set = "SetState",
get = "GetState",
arg = "Fishing",
},
},
}
filterOptions.args.gas = {
type = "group",
name = L["Gas Clouds"],
args = {
select_all = {
order = 1,
name = L["Select All"],
desc = L["Select all nodes"],
type = "execute",
func = "SelectAll",
arg = "Extract Gas",
},
select_none = {
order = 2,
name = L["Select None"],
desc = L["Clear node selections"],
type = "execute",
func = "SelectNone",
arg = "Extract Gas",
},
gaslist = {
order = 3,
name = L["Gas Clouds"],
desc = L["Select the gas clouds you wish to display."],
type = "multiselect",
values = sortedFilter["Extract Gas"],
set = "SetState",
get = "GetState",
arg = "Extract Gas",
},
},
}
filterOptions.args.treasure = {
type = "group",
name = L["Treasure"],
args = {
select_all = {
order = 1,
name = L["Select All"],
desc = L["Select all nodes"],
type = "execute",
func = "SelectAll",
arg = "Treasure",
},
select_none = {
order = 2,
name = L["Select None"],
desc = L["Clear node selections"],
type = "execute",
func = "SelectNone",
arg = "Treasure",
},
treasurelist = {
order = 3,
name = L["Treasure"],
desc = L["Select the treasure you wish to display."],
type = "multiselect",
values = sortedFilter["Treasure"],
set = "SetState",
get = "GetState",
arg = "Treasure",
},
},
}
filterOptions.args.archaeology = {
type = "group",
name = L["Archaeology"],
args = {
select_all = {
order = 1,
name = L["Select All"],
desc = L["Select all nodes"],
type = "execute",
func = "SelectAll",
arg = "Archaeology",
},
select_none = {
order = 2,
name = L["Select None"],
desc = L["Clear node selections"],
type = "execute",
func = "SelectNone",
arg = "Archaeology",
},
diglist = {
order = 3,
name = L["Archaeology"],
desc = L["Select the archaeology nodes you wish to display."],
type = "multiselect",
values = sortedFilter["Archaeology"],
set = "SetState",
get = "GetState",
arg = "Archaeology",
},
},
}
local selectedDatabase, selectedNode, selectedZone = "Herb Gathering", 0, nil
-- Cleanup config tree
local maintenanceOptions = {
type = "group",
name = L["Database Maintenance"],
get = get,
set = set,
args = {
desc = {
order = 1,
type = "description",
name = L["Cleanup_Desc"],
},
cleanup = {
name = L["Cleanup Database"],
desc = L["Cleanup your database by removing duplicates. This takes a few moments, be patient."],
type = "execute",
handler = GatherMate,
func = "CleanupDB",
order = 5,
width = "full",
disabled = function() return GatherMate:IsCleanupRunning() end
},
cleanup_range = {
order = 10,
name = L["Cleanup radius"],
type = "group",
get = function(info)
return db.cleanupRange[info.arg]
end,
set = function(info, v)
db.cleanupRange[info.arg] = v
end,
args = {
desc = {
order = 0,
type = "description",
name = L["CLEANUP_RADIUS_DESC"],
},
Mine = {
order = 5,
name = L["Mineral Veins"],
desc = L["Cleanup radius"],
type = "range",
min = 0, max = 30, step = 1,
arg = "Mining",
},
Herb = {
order = 5,
name = L["Herb Bushes"],
desc = L["Cleanup radius"],
type = "range",
min = 0, max = 30, step = 1,
arg = "Herb Gathering",
},
Fish = {
order = 5,
name = L["Fishes"],
desc = L["Cleanup radius"],
type = "range",
min = 0, max = 30, step = 1,
arg = "Fishing",
},
Gas = {
order = 5,
name = L["Gas Clouds"],
desc = L["Cleanup radius"],
type = "range",
min = 0, max = 100, step = 1,
arg = "Extract Gas",
},
Treasure = {
order = 5,
name = L["Treasure"],
desc = L["Cleanup radius"],
type = "range",
min = 0, max = 30, step = 1,
arg = "Treasure",
},
Archaeology = {
order = 5,
name = L["Archaeology"],
desc = L["Cleanup radius"],
type = "range",
min = 0, max = 30, step = 1,
arg = "Archaeology",
}
},
},
deleteSelective = {
order = 20,
name = L["Delete Specific Nodes"],
type = "group",
args = {
desc = {
order = 0,
type = "description",
name = L["DELETE_SPECIFIC_DESC"],
},
selectDB = {
order = 30,
name = L["Select Database"],
desc = L["Select Database"],
type = "select",
values = {
["Fishing"] = L["Fishes"],
["Treasure"] = L["Treasure"],
["Herb Gathering"] = L["Herb Bushes"],
["Mining"] = L["Mineral Veins"],
["Extract Gas"] = L["Gas Clouds"],
["Archaeology"] = L["Archaeology"],
},
get = function() return selectedDatabase end,
set = function(k, v)
selectedDatabase = v
selectedNode = 0
end,
},
selectNode = {
order = 40,
name = L["Select Node"],
desc = L["Select Node"],
type = "select",
values = function()
return sortedFilter[selectedDatabase]
end,
get = function() return selectedNode end,
set = function(k, v) selectedNode = v end,
},
selectZone = {
order = 50,
name = L["Select Zone"],
desc = L["Select Zone"],
type = "select",
values = sortedFilter["zones"],
get = function() return selectedZone end,
set = function(k, v) selectedZone = v end,
},
delete = {
order = 60,
name = L["Delete"],
desc = L["Delete selected node from selected zone"],
type = "execute",
confirm = true,
confirmText = L["Are you sure you want to delete all of the selected node from the selected zone?"],
func = function()
if selectedZone and selectedNode ~= 0 then
local nodeName = sortedFilter[selectedDatabase][selectedNode]
nodeName = denormalizedNames[nodeName]
GatherMate:DeleteNodeFromZone(selectedDatabase, GatherMate.nodeIDs[selectedDatabase][nodeName], delocalizedZones[selectedZone])
end
end,
disabled = function()
return selectedNode == 0 or selectedZone == nil
end,
},
},
},
delete = {
order = 30,
name = L["Delete Entire Database"],
type = "group",
func = function(info)
GatherMate:ClearDB(info.arg)
end,
args = {
desc = {
order = 0,
type = "description",
name = L["DELETE_ENTIRE_DESC"],
},
Mine = {
order = 5,
name = L["Mineral Veins"],
desc = L["Delete Entire Database"],
type = "execute",
arg = "Mining",
confirm = true,
confirmText = L["Are you sure you want to delete all nodes from this database?"],
},
Herb = {
order = 5,
name = L["Herb Bushes"],
desc = L["Delete Entire Database"],
type = "execute",
arg = "Herb Gathering",
confirm = true,
confirmText = L["Are you sure you want to delete all nodes from this database?"],
},
Fish = {
order = 5,
name = L["Fishes"],
desc = L["Delete Entire Database"],
type = "execute",
arg = "Fishing",
confirm = true,
confirmText = L["Are you sure you want to delete all nodes from this database?"],
},
Gas = {
order = 5,
name = L["Gas Clouds"],
desc = L["Delete Entire Database"],
type = "execute",
arg = "Extract Gas",
confirm = true,
confirmText = L["Are you sure you want to delete all nodes from this database?"],
},
Treasure = {
order = 5,
name = L["Treasure"],
desc = L["Delete Entire Database"],
type = "execute",
arg = "Treasure",
confirm = true,
confirmText = L["Are you sure you want to delete all nodes from this database?"],
},
Archaeology = {
order = 5,
name = L["Archaeology"],
desc = L["Delete Entire Database"],
type = "execute",
arg = "Archaeology",
confirm = true,
confirmText = L["Are you sure you want to delete all nodes from this database?"],
},
},
},
dblocking = {
order = 11,
name = L["Database Locking"],
type = "group",
get = function(info)
return db.dbLocks[info.arg]
end,
set = function(info,v)
db.dbLocks[info.arg] = v
end,
args = {
desc = {
order = 0,
type = "description",
name = L["DATABASE_LOCKING_DESC"],
},
Mine = {
order = 5,
name = L["Mineral Veins"],
desc = L["Database locking"],
type = "toggle",
arg = "Mining",
},
Herb = {
order = 5,
name = L["Herb Bushes"],
desc = L["Database locking"],
type = "toggle",
arg = "Herb Gathering",
},
Fish = {
order = 5,
name = L["Fishes"],
desc = L["Database locking"],
type = "toggle",
arg = "Fishing",
},
Gas = {
order = 5,
name = L["Gas Clouds"],
desc = L["Database locking"],
type = "toggle",
arg = "Extract Gas",
},
Treasure = {
order = 5,
name = L["Treasure"],
desc = L["Database locking"],
type = "toggle",
arg = "Treasure",
},
Archaeology = {
order = 5,
name = L["Archaeology"],
desc = L["Database locking"],
type = "toggle",
arg = "Archaeology",
}
}
},
},
}
-- GatherMateData Import config tree
local importOptions = {
type = "group",
name = L["Import Data"],
order = 10,
args = {},
get = get,
set = set,
childGroups = "tab",
}
ImportHelper.db_options = {
["Merge"] = L["Merge"],
["Overwrite"] = L["Overwrite"]
}
ImportHelper.db_tables =
{
["Herbs"] = L["Herbalism"],
["Mines"] = L["Mining"],
["Gases"] = L["Gas Clouds"],
["Fish"] = L["Fishing"],
["Treasure"] = L["Treasure"],
["Archaeology"] = L["Archaeology"],
}
ImportHelper.expac_data = {