Repository navigation
Expand file tree
/
Copy pathConfig.lua
More file actions
2199 lines (2122 loc) · 107 KB
/
Copy pathConfig.lua
File metadata and controls
2199 lines (2122 loc) · 107 KB
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
-- RskChatScanner Config
local addonName, addon = ...
local L = addon.L or {}
-- Initialize config
addon.Config = {}
local config = addon.Config
-- Libraries (with fallbacks for missing libraries)
local AceConfig = LibStub("AceConfig-3.0", true) or {}
local AceConfigDialog = LibStub("AceConfigDialog-3.0", true) or {}
local AceDB = LibStub("AceDB-3.0", true) or {}
local LSM = LibStub("LibSharedMedia-3.0", true) or {}
local LDB = LibStub("LibDataBroker-1.1", true) or {}
local LDBIcon = LibStub("LibDBIcon-1.0", true) or {}
-- Add fallback methods if libraries are missing
if not AceConfig.RegisterOptionsTable then
AceConfig.RegisterOptionsTable = function() end
end
if not AceConfigDialog.AddToBlizOptions then
AceConfigDialog.AddToBlizOptions = function() return {} end
end
if not AceConfigDialog.Open then
AceConfigDialog.Open = function() end
end
if not AceConfigDialog.Close then
AceConfigDialog.Close = function() end
end
if not AceDB.New then
AceDB.New = function() return {profile = {}} end
end
if not LDB.NewDataObject then
LDB.NewDataObject = function() return {} end
end
if not LDBIcon.Register then
LDBIcon.Register = function() end
end
if not LDBIcon.Show then
LDBIcon.Show = function() end
end
if not LDBIcon.Hide then
LDBIcon.Hide = function() end
end
-- Default settings
local defaults = {
profile = {
enabled = true,
minimap = {
hide = false,
},
filters = {
-- Pas de filtres par défaut, l'utilisateur doit créer les siens
},
settings = {
soundEnabled = true,
visualAlertEnabled = true,
ignoreOwnMessages = true, -- Ignore player's own messages by default
antiSpam = true, -- Detect duplicate messages within 5 seconds
notificationDuration = 10, -- Duration in seconds
maxNotifications = 50, -- Maximum number of bars shown at once
pauseInCombat = false, -- Pause scanning during combat
chatChannels = {
SAY = false,
YELL = false,
GUILD = true,
PARTY = false,
RAID = false,
CHANNEL = true, -- Trade, General, etc.
WHISPER = false,
}
},
appearance = {
barTexture = addon.Media.DefaultBarTexture,
font = addon.Media.DefaultFont,
fontSize = 12,
sound = addon.Media.DefaultSound,
barWidth = 200,
barHeight = 20,
barSpacing = 2,
barGrowDirection = "UP", -- UP, DOWN
barOpacity = 0.9, -- 0.0 to 1.0
fadeInDuration = 0.3, -- seconds
fadeOutDuration = 0.5, -- seconds
pauseOnHover = true, -- Pause fade-out when mouse is over the bar
barPosition = {
x = 0,
y = 0,
point = "CENTER",
relativePoint = "CENTER"
}
},
autoFlood = {
enabled = false,
messages = {
-- Default empty, user will add messages
},
rate = 60, -- seconds between messages (minimum 10)
currentIndex = 1, -- Current message index for rotation
},
history = {
enabled = true,
maxEntries = 100, -- Maximum number of history entries
entries = {} -- Will store: {timestamp, playerName, message, filterName, channel}
},
templates = {
-- Default empty, user will add templates
},
blacklist = {
players = {} -- Will store: {name, reason, timestamp, duration}
},
statistics = {
enabled = true,
filterMatches = {}, -- {filterName = {today = 0, week = 0, total = 0}}
lastReset = time(),
lastWeekReset = time()
}
}
}
-- Initialize database
function config:InitDB()
self.db = AceDB:New("ChatScannerPRO_DB", defaults)
return self.db
end
-- Create options table
function config:GetOptions()
local options = {
name = "ChatScanner PRO",
type = "group",
args = {
general = {
name = L["Settings"] or "Settings",
type = "group",
order = 1,
args = {
enabled = {
name = L["Enable"] or "Enable",
desc = L["Enable or disable the addon"] or "Enable or disable the addon",
type = "toggle",
width = "full",
order = 1,
get = function() return self.db.profile.enabled end,
set = function(_, value) self.db.profile.enabled = value end
},
minimap = {
name = L["Minimap Icon"] or "Minimap Icon",
desc = L["Show or hide the minimap icon"] or "Show or hide the minimap icon",
type = "toggle",
order = 2,
get = function() return not self.db.profile.minimap.hide end,
set = function(_, value)
self.db.profile.minimap.hide = not value
if value then
LDBIcon:Show(addonName)
else
LDBIcon:Hide(addonName)
end
end
},
soundEnabled = {
name = L["Enable Sounds"] or "Enable Sounds",
desc = L["Play sounds when matches are found"] or "Play sounds when matches are found",
type = "toggle",
order = 3,
get = function() return self.db.profile.settings.soundEnabled end,
set = function(_, value) self.db.profile.settings.soundEnabled = value end
},
visualAlertEnabled = {
name = L["Enable Visual Alerts"] or "Enable Visual Alerts",
desc = L["Show visual alerts when matches are found"] or "Show visual alerts when matches are found",
type = "toggle",
order = 4,
get = function() return self.db.profile.settings.visualAlertEnabled end,
set = function(_, value) self.db.profile.settings.visualAlertEnabled = value end
},
ignoreOwnMessages = {
name = L["Ignore Own Messages"] or "Ignore Own Messages",
desc = L["Don't trigger notifications for your own messages"] or "Don't trigger notifications for your own messages (recommended to avoid spam)",
type = "toggle",
order = 5,
get = function() return self.db.profile.settings.ignoreOwnMessages end,
set = function(_, value) self.db.profile.settings.ignoreOwnMessages = value end
},
antiSpam = {
name = L["Anti-Spam"] or "Anti-Spam Filter",
desc = L["Prevent duplicate notifications"] or "Ignore duplicate messages from the same player within 5 seconds (prevents spam across multiple channels)",
type = "toggle",
order = 5.5,
get = function() return self.db.profile.settings.antiSpam end,
set = function(_, value) self.db.profile.settings.antiSpam = value end
},
notificationDuration = {
name = L["Notification Duration"] or "Notification Duration",
desc = L["How long notifications stay on screen (seconds)"] or "How long notifications stay on screen (in seconds). Set to 120 for permanent until clicked.",
type = "range",
min = 3,
max = 120,
step = 1,
order = 6,
get = function() return self.db.profile.settings.notificationDuration end,
set = function(_, value) self.db.profile.settings.notificationDuration = value end
},
maxNotifications = {
name = L["Max Notifications"] or "Max Notifications",
desc = L["Maximum number of notification bars shown at once"] or "Maximum number of notification bars shown at once (they will stack vertically)",
type = "range",
min = 1,
max = 100,
step = 1,
order = 7,
get = function() return self.db.profile.settings.maxNotifications end,
set = function(_, value) self.db.profile.settings.maxNotifications = value end
},
pauseInCombat = {
name = L["Pause in Combat"] or "Pause in Combat",
desc = L["Pause scanning during combat"] or "Pause scanning during combat to avoid distractions",
type = "toggle",
order = 8,
get = function() return self.db.profile.settings.pauseInCombat end,
set = function(_, value) self.db.profile.settings.pauseInCombat = value end
},
showMinimap = {
name = L["Show Minimap Button"] or "Show Minimap Button",
desc = L["Show or hide the minimap button"] or "Show or hide the minimap button",
type = "toggle",
order = 9,
get = function() return not self.db.profile.minimap.hide end,
set = function(_, value)
self.db.profile.minimap.hide = not value
if addon.MinimapButton then
addon.MinimapButton:Toggle()
end
end
},
hideMenuButton = {
name = L["Hide Menu Button"] or "Hide Menu Button",
desc = L["Hide the center screen menu button"] or "Hide the menu button in the center of the screen (use /cs or minimap button instead)",
type = "toggle",
order = 10,
get = function() return self.db.profile.settings.hideMenuButton end,
set = function(_, value)
self.db.profile.settings.hideMenuButton = value
if addon.MenuButton then
addon.MenuButton:Toggle()
end
end
}
}
},
filters = {
name = L["Keyword Filters"] or "Keyword Filters",
type = "group",
order = 2,
args = {
collapseAll = {
name = L["Collapse All"] or "Collapse All",
desc = L["Collapse all filters"] or "Collapse all filters to see them at a glance",
type = "execute",
order = 0.5,
width = "normal",
func = function()
for _, filter in ipairs(self.db.profile.filters) do
filter.collapsed = true
end
self:UpdateFilterOptions()
end
},
newFilter = {
name = L["Add New Filter"] or "|cff00FF00+ Add New Filter|r",
desc = L["Add a new filter"] or "Add a new filter",
type = "execute",
order = 1,
width = "full",
func = function()
-- Check if there's already an unconfigured filter
for _, f in ipairs(self.db.profile.filters) do
if f.keywords == "" and not f.enabled then
print("|cffFF6B6BChatScanner PRO:|r You already have an unconfigured filter. Please configure it first!")
return
end
end
-- Find next available number for filter name
local filterNum = 1
local nameExists = true
while nameExists do
nameExists = false
for _, f in ipairs(self.db.profile.filters) do
if f.name == "New Filter #" .. filterNum then
nameExists = true
filterNum = filterNum + 1
break
end
end
end
-- Collapse all existing filters first
for _, f in ipairs(self.db.profile.filters) do
f.collapsed = true
end
-- Add new filter (expanded by default, but DISABLED until configured)
table.insert(self.db.profile.filters, {
name = "New Filter #" .. filterNum,
keywords = "",
enabled = false, -- Disabled by default until user configures it
category = "General",
color = {r = 1, g = 1, b = 1},
icon = "Interface\\Icons\\INV_Misc_Note_01", -- Default icon
collapsed = false
})
self:UpdateFilterOptions()
print("|cffFFD700ChatScanner PRO:|r New filter created. Configure it and enable it when ready!")
end
},
filterList = {
name = L["Filters"] or "Filters",
type = "group",
inline = true,
order = 2,
args = {} -- Will be populated dynamically
}
}
},
channels = {
name = L["Channels"] or "Channels",
type = "group",
order = 3,
args = {
description = {
name = "Enable the chat channels you want to monitor. For numbered channels (Trade, General, etc.), they will appear below after you join them.",
type = "description",
order = 0.5,
width = "full",
fontSize = "medium"
},
say = {
name = L["Say"] or "Say",
desc = L["Scan Say channel"] or "Scan Say channel",
type = "toggle",
order = 1,
get = function() return self.db.profile.settings.chatChannels.SAY end,
set = function(_, value)
self.db.profile.settings.chatChannels.SAY = value
if addon.core and addon.core.UpdateChatEventRegistrations then
addon.core:UpdateChatEventRegistrations()
end
end
},
yell = {
name = L["Yell"] or "Yell",
desc = L["Scan Yell channel"] or "Scan Yell channel",
type = "toggle",
order = 2,
get = function() return self.db.profile.settings.chatChannels.YELL end,
set = function(_, value)
self.db.profile.settings.chatChannels.YELL = value
if addon.core and addon.core.UpdateChatEventRegistrations then
addon.core:UpdateChatEventRegistrations()
end
end
},
guild = {
name = L["Guild"] or "Guild",
desc = L["Scan Guild channel"] or "Scan Guild channel",
type = "toggle",
order = 3,
get = function() return self.db.profile.settings.chatChannels.GUILD end,
set = function(_, value)
self.db.profile.settings.chatChannels.GUILD = value
if addon.core and addon.core.UpdateChatEventRegistrations then
addon.core:UpdateChatEventRegistrations()
end
end
},
party = {
name = L["Party"] or "Party",
desc = L["Scan Party channel"] or "Scan Party channel",
type = "toggle",
order = 4,
get = function() return self.db.profile.settings.chatChannels.PARTY end,
set = function(_, value)
self.db.profile.settings.chatChannels.PARTY = value
if addon.core and addon.core.UpdateChatEventRegistrations then
addon.core:UpdateChatEventRegistrations()
end
end
},
raid = {
name = L["Raid"] or "Raid",
desc = L["Scan Raid channel"] or "Scan Raid channel",
type = "toggle",
order = 5,
get = function() return self.db.profile.settings.chatChannels.RAID end,
set = function(_, value)
self.db.profile.settings.chatChannels.RAID = value
if addon.core and addon.core.UpdateChatEventRegistrations then
addon.core:UpdateChatEventRegistrations()
end
end
},
channel = {
name = L["Trade/General"] or "Trade/General",
desc = L["Scan Trade and General channels"] or "Scan Trade and General channels",
type = "toggle",
order = 6,
get = function() return self.db.profile.settings.chatChannels.CHANNEL end,
set = function(_, value)
self.db.profile.settings.chatChannels.CHANNEL = value
if addon.core and addon.core.UpdateChatEventRegistrations then
addon.core:UpdateChatEventRegistrations()
end
end
},
whisper = {
name = L["Whisper"] or "Whisper",
desc = L["Scan Whisper messages"] or "Scan Whisper messages",
type = "toggle",
order = 7,
get = function() return self.db.profile.settings.chatChannels.WHISPER end,
set = function(_, value)
self.db.profile.settings.chatChannels.WHISPER = value
if addon.core and addon.core.UpdateChatEventRegistrations then
addon.core:UpdateChatEventRegistrations()
end
end
},
spacer1 = {
name = "\n",
type = "description",
order = 8,
width = "full"
},
numberedChannelsHeader = {
name = "Numbered Channels (Trade, General, etc.)",
type = "header",
order = 9
},
numberedChannelsDesc = {
name = function()
-- Initialize specificChannels if it doesn't exist
if not self.db.profile.settings.chatChannels.specificChannels then
self.db.profile.settings.chatChannels.specificChannels = {}
end
-- Get all joined channels
local text = "|cff00FFFFJoined Channels:|r\n\n"
local hasChannels = false
for i = 1, 20 do -- WoW supports up to 20 channels
local id, name = GetChannelName(i)
if id and id > 0 and name then
hasChannels = true
local enabled = false
for _, num in ipairs(self.db.profile.settings.chatChannels.specificChannels) do
if num == id then
enabled = true
break
end
end
local status = enabled and "|cff00ff00✓|r" or "|cffFF0000✗|r"
text = text .. string.format("%s |cffFFD700%d.|r %s\n", status, id, name)
end
end
if not hasChannels then
text = text .. "|cffFF6B6BNo channels joined. Join Trade, General, etc. and they will appear here.|r"
end
return text
end,
type = "description",
order = 10,
width = "full",
fontSize = "medium"
},
toggleAllChannels = {
name = "Enable All Channels",
desc = "Enable or disable all numbered channels at once",
type = "execute",
order = 11,
func = function()
if not self.db.profile.settings.chatChannels.specificChannels then
self.db.profile.settings.chatChannels.specificChannels = {}
end
local channels = self.db.profile.settings.chatChannels.specificChannels
local allEnabled = true
-- Check if all are enabled
for i = 1, 20 do
local id, name = GetChannelName(i)
if id and id > 0 then
local found = false
for _, num in ipairs(channels) do
if num == id then
found = true
break
end
end
if not found then
allEnabled = false
break
end
end
end
-- Toggle
if allEnabled then
-- Disable all
self.db.profile.settings.chatChannels.specificChannels = {}
print("|cff00ff00ChatScanner PRO:|r All channels disabled")
else
-- Enable all
local newChannels = {}
for i = 1, 20 do
local id, name = GetChannelName(i)
if id and id > 0 then
table.insert(newChannels, id)
end
end
self.db.profile.settings.chatChannels.specificChannels = newChannels
print("|cff00ff00ChatScanner PRO:|r All channels enabled")
end
LibStub("AceConfigRegistry-3.0"):NotifyChange("ChatScanner")
end
}
}
},
appearance = {
name = L["Notifications"] or "Notifications",
type = "group",
order = 4,
args = {
barTexture = {
name = L["Bar Texture"] or "Bar Texture",
desc = L["Texture used for the bars"] or "Texture used for the bars",
type = "select",
dialogControl = "LSM30_Statusbar",
values = AceGUIWidgetLSMlists.statusbar,
order = 1,
get = function() return self.db.profile.appearance.barTexture end,
set = function(_, value) self.db.profile.appearance.barTexture = value end
},
font = {
name = L["Font"] or "Font",
desc = L["Font used for the bars"] or "Font used for the bars",
type = "select",
dialogControl = "LSM30_Font",
values = AceGUIWidgetLSMlists.font,
order = 2,
get = function() return self.db.profile.appearance.font end,
set = function(_, value) self.db.profile.appearance.font = value end
},
fontSize = {
name = L["Font Size"] or "Font Size",
desc = L["Size of the font"] or "Size of the font",
type = "range",
min = 8,
max = 20,
step = 1,
order = 3,
get = function() return self.db.profile.appearance.fontSize end,
set = function(_, value) self.db.profile.appearance.fontSize = value end
},
sound = {
name = L["Sound"] or "Sound",
desc = L["Sound played when a match is found"] or "Sound played when a match is found",
type = "select",
dialogControl = "LSM30_Sound",
values = AceGUIWidgetLSMlists.sound,
order = 4,
get = function() return self.db.profile.appearance.sound end,
set = function(_, value) self.db.profile.appearance.sound = value end
},
barWidth = {
name = L["Bar Width"] or "Bar Width",
desc = L["Width of the bars"] or "Width of the bars",
type = "range",
min = 100,
max = 400,
step = 10,
order = 5,
get = function() return self.db.profile.appearance.barWidth end,
set = function(_, value) self.db.profile.appearance.barWidth = value end
},
barHeight = {
name = L["Bar Height"] or "Bar Height",
desc = L["Height of the bars"] or "Height of the bars",
type = "range",
min = 10,
max = 40,
step = 1,
order = 6,
get = function() return self.db.profile.appearance.barHeight end,
set = function(_, value) self.db.profile.appearance.barHeight = value end
},
barSpacing = {
name = L["Bar Spacing"] or "Bar Spacing",
desc = L["Spacing between bars"] or "Spacing between bars",
type = "range",
min = 0,
max = 10,
step = 1,
order = 7,
get = function() return self.db.profile.appearance.barSpacing end,
set = function(_, value) self.db.profile.appearance.barSpacing = value end
},
barGrowDirection = {
name = L["Bar Grow Direction"] or "Bar Grow Direction",
desc = L["Direction in which bars grow"] or "Direction in which bars grow",
type = "select",
values = {
UP = L["Up"] or "Up",
DOWN = L["Down"] or "Down"
},
order = 8,
get = function() return self.db.profile.appearance.barGrowDirection end,
set = function(_, value) self.db.profile.appearance.barGrowDirection = value end
},
barOpacity = {
name = L["Bar Opacity"] or "Bar Opacity",
desc = L["Transparency of notification bars"] or "Transparency of notification bars (0 = invisible, 1 = opaque)",
type = "range",
min = 0.1,
max = 1.0,
step = 0.05,
order = 8.1,
get = function() return self.db.profile.appearance.barOpacity end,
set = function(_, value) self.db.profile.appearance.barOpacity = value end
},
fadeInDuration = {
name = L["Fade In Duration"] or "Fade In Duration",
desc = L["How long bars take to appear"] or "How long bars take to fade in (in seconds)",
type = "range",
min = 0.0,
max = 2.0,
step = 0.1,
order = 8.2,
get = function() return self.db.profile.appearance.fadeInDuration end,
set = function(_, value) self.db.profile.appearance.fadeInDuration = value end
},
fadeOutDuration = {
name = L["Fade Out Duration"] or "Fade Out Duration",
desc = L["How long bars take to disappear"] or "How long bars take to fade out (in seconds)",
type = "range",
min = 0.0,
max = 2.0,
step = 0.1,
order = 8.3,
get = function() return self.db.profile.appearance.fadeOutDuration end,
set = function(_, value) self.db.profile.appearance.fadeOutDuration = value end
},
pauseOnHover = {
name = L["Pause on Hover"] or "Pause on Hover",
desc = L["Pause fade-out when mouse is over the bar"] or "Pause fade-out timer when mouse is hovering over the notification bar",
type = "toggle",
order = 8.4,
get = function() return self.db.profile.appearance.pauseOnHover end,
set = function(_, value) self.db.profile.appearance.pauseOnHover = value end
},
spacer = {
name = "",
type = "description",
order = 9,
width = "full"
},
testNotification = {
name = L["Test Notification"] or "Test Notification",
desc = L["Show a test notification bar"] or "Show a test notification bar to preview your appearance settings",
type = "execute",
order = 10,
width = "full",
func = function()
if addon.core and addon.core.TestNotification then
addon.core:TestNotification()
else
print("Test notification not available")
end
end
},
unlockBars = {
name = L["Toggle Lock/Unlock"] or "Toggle Lock/Unlock Bars",
desc = L["Toggle lock/unlock bars position"] or "Toggle lock/unlock to move the notification bars position. A green anchor will appear that you can drag.",
type = "execute",
order = 11,
width = "full",
func = function()
if addon.core and addon.core.ToggleBarsLock then
addon.core:ToggleBarsLock()
else
print("Toggle lock not available")
end
end
}
}
},
autoFlood = {
name = L["Auto Messages"] or "Auto Messages",
type = "group",
order = 5,
args = {
collapseAll = {
name = L["Collapse All"] or "Collapse All",
desc = L["Collapse all messages"] or "Collapse all auto messages to see them at a glance",
type = "execute",
order = 0.5,
width = "normal",
func = function()
for _, msg in ipairs(self.db.profile.autoFlood.messages) do
msg.collapsed = true
end
self:UpdateAutoFloodOptions()
end
},
description = {
name = L["Auto Flood Description"] or "Automatically send messages at regular intervals. Create multiple messages that will rotate. Each message can have its own channel.",
type = "description",
order = 1,
width = "full",
fontSize = "medium"
},
variables = {
name = L["Available Variables"] or "|cff00FFFFAvailable Variables:|r\n" ..
"{name} - Your character name\n" ..
"{level} - Your level\n" ..
"{class} - Your class name\n" ..
"{coloredclass} - Your class name with color\n" ..
"{zone} - Current zone\n" ..
"{time} - Current game time\n" ..
"{guild} - Your guild name\n\n" ..
"|cffFFD700Example:|r WTS services! Whisper {name} - Level {level} {class}",
type = "description",
order = 2,
width = "full",
fontSize = "small"
},
spacer1 = {
name = "",
type = "description",
order = 3,
width = "full"
},
addMessage = {
name = L["Add New Message"] or "|cff00FF00+ Add New Message|r",
desc = L["Add a new message to the rotation"] or "Add a new message to the rotation",
type = "execute",
order = 4,
width = "full",
func = function()
-- Check if there's already an unconfigured message
for _, m in ipairs(self.db.profile.autoFlood.messages) do
if m.text == "Your message here" and not m.enabled then
print("|cffFF6B6BChatScanner PRO:|r You already have an unconfigured message. Please configure it first!")
return
end
end
table.insert(self.db.profile.autoFlood.messages, {
text = "Your message here",
channel = "say",
enabled = false -- Disabled by default until configured
})
self:UpdateAutoFloodOptions()
print("|cffFFD700ChatScanner PRO:|r New message created. Configure it and enable it when ready!")
end
},
messageList = {
name = "",
type = "group",
inline = true,
order = 5,
args = {} -- Will be populated dynamically with messages
},
spacer2 = {
name = "",
type = "description",
order = 6,
width = "full"
},
rate = {
name = L["Rate (seconds)"] or "Rate (seconds)",
desc = L["Time between messages"] or "Time in seconds between each message (minimum 10 seconds)",
type = "range",
min = 10,
max = 600,
step = 5,
order = 7,
get = function() return self.db.profile.autoFlood.rate end,
set = function(_, value) self.db.profile.autoFlood.rate = value end
},
spacer3 = {
name = "",
type = "description",
order = 8,
width = "full"
},
status = {
name = L["Status"] or "Status",
type = "description",
order = 9,
width = "full",
fontSize = "medium",
get = function()
if addon.AutoFlood and addon.AutoFlood.GetStatus then
return addon.AutoFlood:GetStatus()
end
return "AutoFlood module not loaded"
end
},
toggleFlood = {
name = function()
if addon.AutoFlood and addon.AutoFlood.IsActive and addon.AutoFlood:IsActive() then
return L["Stop AutoFlood"] or "STOP AutoFlood"
else
return L["Start AutoFlood"] or "START AutoFlood"
end
end,
desc = L["Toggle AutoFlood"] or "Start or stop the automatic message flooding",
type = "execute",
order = 10,
width = "full",
func = function()
if addon.AutoFlood and addon.AutoFlood.Toggle then
addon.AutoFlood:Toggle()
else
print("AutoFlood module not available")
end
end
}
}
},
history = {
name = L["Match History"] or "Match History",
type = "group",
order = 6,
args = {
description = {
name = L["History Description"] or "View all captured messages with timestamps. Use filters to search specific entries.",
type = "description",
order = 1,
width = "full",
fontSize = "medium"
},
statisticsHeader = {
name = L["Statistics"] or "Statistics",
type = "header",
order = 1.5
},
statistics = {
name = function()
local stats = self.db.profile.statistics
if not stats or not stats.filterMatches then
return "No statistics available"
end
local text = "|cff00FFFFFilter Statistics|r\n\n"
local totalToday = 0
local totalWeek = 0
local totalAll = 0
-- Calculate totals and find most active
local mostActive = {name = "None", count = 0}
for filterName, data in pairs(stats.filterMatches) do
totalToday = totalToday + (data.today or 0)
totalWeek = totalWeek + (data.week or 0)
totalAll = totalAll + (data.total or 0)
if (data.total or 0) > mostActive.count then
mostActive.name = filterName
mostActive.count = data.total or 0
end
end
text = text .. string.format("|cffFFD700Today:|r %d matches\n", totalToday)
text = text .. string.format("|cffFFD700This Week:|r %d matches\n", totalWeek)
text = text .. string.format("|cffFFD700All Time:|r %d matches\n\n", totalAll)
text = text .. string.format("|cffFFD700Most Active Filter:|r %s (%d matches)\n\n", mostActive.name, mostActive.count)
text = text .. "|cff00FFFFPer Filter:|r\n"
for filterName, data in pairs(stats.filterMatches) do
text = text .. string.format(" • %s: Today=%d, Week=%d, Total=%d\n",
filterName, data.today or 0, data.week or 0, data.total or 0)
end
return text
end,
type = "description",
order = 1.6,
width = "full",
fontSize = "medium"
},
resetStats = {
name = L["Reset Statistics"] or "|cffFF0000Reset Statistics|r",
desc = L["Reset all statistics"] or "Reset all statistics counters",
type = "execute",
order = 1.7,
confirm = function()
return "Are you sure you want to reset all statistics?"
end,
func = function()
self.db.profile.statistics.filterMatches = {}
self.db.profile.statistics.lastReset = time()
self.db.profile.statistics.lastWeekReset = time()
print("|cff00ff00ChatScanner PRO:|r Statistics reset")
end
},
spacer1 = {
name = "",
type = "description",
order = 2,
width = "full"
},
enabled = {
name = L["Enable History"] or "Enable History",
desc = L["Enable or disable history tracking"] or "Enable or disable history tracking",
type = "toggle",
order = 3,
get = function() return self.db.profile.history.enabled end,
set = function(_, value) self.db.profile.history.enabled = value end
},
maxEntries = {
name = L["Max Entries"] or "Max Entries",
desc = L["Maximum number of history entries"] or "Maximum number of history entries to keep",
type = "range",
min = 10,
max = 2000,
step = 10,
order = 4,
get = function() return self.db.profile.history.maxEntries end,
set = function(_, value) self.db.profile.history.maxEntries = value end
},
clearHistory = {
name = L["Clear History"] or "|cffFF0000Clear History|r",
desc = L["Clear all history entries"] or "Clear all history entries",
type = "execute",
order = 5,
confirm = function()
return "Are you sure you want to clear all history?"
end,
func = function()
self.db.profile.history.entries = {}
print("|cff00ff00ChatScanner PRO:|r History cleared")
LibStub("AceConfigRegistry-3.0"):NotifyChange("ChatScanner")
end
},
fixHistory = {
name = "Fix Corrupted Entries",
desc = "Remove history entries with missing data",
type = "execute",
order = 5.5,
func = function()
local entries = self.db.profile.history.entries
local removed = 0
for i = #entries, 1, -1 do
local entry = entries[i]
if not entry.playerName or not entry.message or not entry.filterName then
table.remove(entries, i)
removed = removed + 1
end
end
print("|cff00ff00ChatScanner PRO:|r Removed " .. removed .. " corrupted entries")
LibStub("AceConfigRegistry-3.0"):NotifyChange("ChatScanner")
end
},
spacer2 = {
name = "",
type = "description",
order = 6,
width = "full"
},
searchHeader = {
name = L["Search & Filter"] or "Search & Filter",
type = "header",
order = 7
},
searchPlayer = {
name = L["Search Player"] or "Search Player",
desc = L["Filter by player name"] or "Filter history by player name (leave empty for all)",
type = "input",
order = 8,
width = "full",
get = function() return self.db.profile.history.searchPlayer or "" end,
set = function(_, value) self.db.profile.history.searchPlayer = value end
},