-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDcr_opt.lua
3777 lines (3229 loc) · 155 KB
/
Dcr_opt.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
--[[
This file is part of Decursive.
Decursive (v @project-version@) add-on for World of Warcraft UI
Copyright (C) 2006-2025 John Wellesz (Decursive AT 2072productions.com) ( http://www.2072productions.com/to/decursive.php )
Decursive is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Decursive is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Decursive. If not, see <https://www.gnu.org/licenses/>.
Decursive is inspired from the original "Decursive v1.9.4" by Patrick Bohnet (Quu).
The original "Decursive 1.9.4" is in public domain ( www.quutar.com )
Decursive is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY.
This file was last updated on @file-date-iso@
--]]
-------------------------------------------------------------------------------
local addonName, T = ...;
-- big ugly scary fatal error message display function {{{
if not T._FatalError then
-- the beautiful error popup : {{{ -
StaticPopupDialogs["DECURSIVE_ERROR_FRAME"] = {
text = "|cFFFF0000Decursive Error:|r\n%s",
button1 = "OK",
OnAccept = function()
return false;
end,
timeout = 0,
whileDead = 1,
hideOnEscape = 1,
showAlert = 1,
preferredIndex = 3,
}; -- }}}
T._FatalError = function (TheError) StaticPopup_Show ("DECURSIVE_ERROR_FRAME", TheError); end
end
-- }}}
if not T._LoadedFiles or not T._LoadedFiles["Dcr_utils.lua"] then
if not DecursiveInstallCorrupted then T._FatalError("Decursive installation is corrupted! (Dcr_utils.lua not loaded)"); end;
DecursiveInstallCorrupted = true;
return;
end
T._LoadedFiles["Dcr_opt.lua"] = false;
local D = T.Dcr;
local function RegisterClassLocals_Once() -- {{{
-- Make sure to never crash if some locals are missing (seen this happen on
-- Chinese clients when relying on LOCALIZED_CLASS_NAMES_MALE constant)
-- While that was probably caused by a badd-on redefining the constant,
-- it's best to stay on the safe side...
local localizedClasses = {};
D:tcopy(localizedClasses, LocalizedClassList and LocalizedClassList(false) or FillLocalizedClassList({}, false));
-- D.LC = setmetatable((FillLocalizedClassList or LocalizedClassList)(false), {__index = function(t,k) return k end});
D.LC = setmetatable(localizedClasses, {__index = function(t,k) return k end});
RegisterLocals_Once = nil;
end -- }}}
T._CatchAllErrors = "RegisterClassLocals_Once"; RegisterClassLocals_Once();
local L = D.L;
local LC = D.LC;
local DC = T._C;
T._CatchAllErrors = "LibDBIcon";
local icon = LibStub("LibDBIcon-1.0", true)
T._CatchAllErrors = false;
local pairs = _G.pairs;
local ipairs = _G.ipairs;
local type = _G.type;
local table = _G.table;
local str_format = _G.string.format;
local str_gsub = _G.string.gsub;
local str_sub = _G.string.sub;
local abs = _G.math.abs;
local GetNumRaidMembers = DC.GetNumRaidMembers;
local GetNumPartyMembers= _G.GetNumSubgroupMembers;
local InCombatLockdown = _G.InCombatLockdown;
local GetItemInfo = _G.C_Item and _G.C_Item.GetItemInfo or _G.GetItemInfo;
local GetSpellInfo = _G.C_Spell and _G.C_Spell.GetSpellInfo or _G.GetSpellInfo;
local GetSpellName = _G.C_Spell and _G.C_Spell.GetSpellName or function (spellId) return (GetSpellInfo(spellId)) end;
local GetSpellDescription = _G.C_Spell and _G.C_Spell.GetSpellDescription or _G.GetSpellDescription;
local GetSpecialization = _G.GetSpecialization or (GetActiveTalentGroup or function () return nil; end);
local GetAddOnMetadata = _G.C_AddOns and _G.C_AddOns.GetAddOnMetadata or _G.GetAddOnMetadata;
local _;
local tonumber = _G.tonumber;
local TN = function(string) return tonumber(string) or nil; end;
local C_Spell = C_Spell;
-- Default values for the option
function D:GetDefaultsSettings()
local DS = DC.DS;
local DSI = DC.DSI;
return {
-- default settings {{{
class = {
-- Curring order (1 is the most important, 7 the lesser...)
CureOrder = {
[DC.MAGIC] = 1,
[DC.CURSE] = 2,
[DC.POISON] = 3,
[DC.DISEASE] = 4,
[DC.ENEMYMAGIC] = 5,
[DC.CHARMED] = 6,
[DC.BLEED] = 7,
},
UserSpells = {
--Exemple / defaults
[T._C.DSI["SPELL_COUNTERSPELL"]] = {
Types = {DC.CHARMED},
Better = 10,
Pet = false,
Disabled = true,
IsDefault = true,
IsItem = false,
},
},
},
locale = {
BleedEffectsKeywords = D:GetDefaultBleedEffectsKeywords(),
},
global = {
SRTLerrors = {
["total"] = 0
-- "file:line" = {date, ...}
},
debug = false,
NonRelease = false,
TocExpiredDetection = false,
LastExpirationAlert = 0,
NewerVersionDetected = D.VersionTimeStamp,
NewerVersionName = false,
NewerVersionAlert = 0,
NewVersionsBugMeNot = false,
LastVersionAnnounce = 0,
LastUnpackagedAlert = 0,
-- the key to bind the macro to
MacroBind = false,
NoStartMessages = false,
MouseButtons = {
"*%s1", -- left mouse button
"*%s2", -- right mouse button
"ctrl-%s1",
"ctrl-%s2",
"shift-%s1",
"shift-%s2",
"shift-%s3",
"alt-%s1",
"alt-%s2",
"alt-%s3",
"*%s4",
"ctrl-%s4",
"shift-%s4",
"alt-%s4",
"*%s5",
"ctrl-%s5",
"shift-%s5",
"alt-%s5",
"*%s3", -- the last two entries are always target and focus
"ctrl-%s3",
},
BleedAutoDetection = true,
t_BleedEffectsIDCheck = {
[396007] = true, -- Vicious Peck
[396093] = true, -- Savage Leap
[193092] = true, -- Bloodletting Sweep
[375937] = true, -- Rending Strike
[376997] = true, -- Savage Peck
[381683] = true, -- Swift Stab
[388911] = true, -- Severing Slash
[371005] = true, -- arcane but dispellable with cauterizing flame
[384134] = true, -- Pierce
[394628] = true, -- Peck
[372860] = true, -- Searing Wounds
[393444] = true, -- Gushing Wound
[413131] = true, -- Whirling Dagger
[413136] = true, -- Whirling Dagger
},
-- The time between each MUF update
DebuffsFrameRefreshRate = 0.10,
-- The number of MUFs updated every DebuffsFrameRefreshRate
DebuffsFramePerUPdate = 10,
MFScanEverybodyTimer = 1,
MFScanEverybodyReport = false,
--@alpha@
-- MFScanEverybodyReport = true, -- UNdebuff is triggered very often, not sure when. No more need for reporting though.
--@end-alpha@
delayedDebuffOccurences = 0,
delayedUnDebuffOccurences = 0,
},
profile = {
-- this is the priority list of people to cure
PriorityList = { },
PriorityListClass = { },
PrioGUIDtoNAME = { },
-- this is the people to skip
SkipList = { },
SkipListClass = { },
SkipGUIDtoNAME = { },
-- The micro units debuffs frame
ShowDebuffsFrame = true,
-- Setting to hide the MUF handle (render it mouse-non-interactive)
HideMUFsHandle = false,
AutoHideMUFs = 1,
-- The maximum number of MUFs to be displayed
DebuffsFrameMaxCount = 80,
DebuffsFrameElemScale = 1,
DebuffsFrameElemAlpha = .35,
DebuffsFrameElemBorderShow = true,
DebuffsFrameElemBorderAlpha = .2,
DebuffsFrameElemTieTransparency = true,
DebuffsFramePerline = 10,
DebuffsFrameTieSpacing = true,
DebuffsFrameXSpacing = 3,
DebuffsFrameYSpacing = 3,
DebuffsFrameStickToRight = false,
DebuffsFrameShowHelp = true,
-- position x save
DebuffsFrameContainer_x = false,
-- position y save
DebuffsFrameContainer_y = false,
-- reverse MUFs disaplay
DebuffsFrameGrowToTop = false,
DebuffsFrameVerticalDisplay = false,
-- Center text displayed on MUFs, defaults to time left
CenterTextDisplay = '1_TLEFT',
-- this is wether or not to show the live-list
HideLiveList = false,
LiveListAlpha = 0.7,
LiveListScale = 1.0,
-- position of the "Decursive" main bar, the live-list is anchored to this bar.
MainBarX = false,
MainBarY = false,
-- This will turn on and off the sending of messages to the default chat frame
Print_ChatFrame = true,
-- this will send the messages to a custom frame that is moveable
Print_CustomFrame = true,
-- this will disable error messages
Print_Error = true,
-- should we scan pets
Scan_Pets = true,
-- should we ignore stealthed units? A useless option since a very long time.
Ingore_Stealthed = false,
Show_Stealthed_Status = true,
-- how many to show in the livelist
Amount_Of_Afflicted = 3,
-- The live-list will only display units in range of your curring spell
LV_OnlyInRange = true,
-- how many seconds to "black list" someone with a failed spell
CureBlacklist = 5.0,
-- how often to poll for afflictions in seconds (for the live-list only)
ScanTime = 0.3,
-- Are prio list members protected from blacklisting?
DoNot_Blacklist_Prio_List = false,
-- Play a sound when there is something to decurse
PlaySound = true,
-- The sound file to use
SoundFile = DC.AfflictionSound,
-- Hide the buttons
HideButtons = false,
-- Display text above in the custom frame
CustomeFrameInsertBottom = false,
-- Disable tooltips in affliction list
AfflictionTooltips = true,
-- Reverse LiveList Display
ReverseLiveDisplay = false,
-- Hide the "Decursive" bar
BarHidden = true,
-- if true then the live list will show only if the "Decursive" bar is shown
LiveListTied = false,
-- allow to changes the default output window
OutputWindow = "DEFAULT_CHAT_FRAME", -- ACEDB CRASHES if we set it directly
MiniMapIcon = {hide=true},
-- Display a warning if no key is mapped.
NoKeyWarn = false,
-- Disable macro creation
DisableMacroCreation = false,
-- Allow Decursive's macro editing
AllowMacroEdit = false,
-- Those are the different colors used for the MUFs main textures
MF_colors = {
[1] = { .8 , 0 , 0 , 1 }, -- red
[2] = { .3 , .3 , .8 , 1 }, -- blue
[3] = { .8 , .5 , .25 , 1 }, -- orange
[4] = { 1 , 0 , 1 , 1 }, -- purple
[5] = { 1 , 1 , 1 , 1 }, -- white for undefined
[6] = { 1 , 1 , 1 , 1 }, -- white for undefined
[7] = { 1 , 1 , 1 , 1 }, -- white for undefined
[DC.NORMAL] = { .0 , .3 , .1 , .9 }, -- dark green
[DC.BLACKLISTED] = { 0 , 0 , 0 , 1 }, -- black
[DC.ABSENT] = { .4 , .4 , .4 , .9 }, -- transparent grey
[DC.FAR] = { .4 , .1 , .4 , .85 }, -- transparent purple
[DC.STEALTHED] = { .4 , .6 , .4 , 1 }, -- pale green
[DC.CHARMED_STATUS] = { 0 , 1 , 0 , 1 }, -- full green
["COLORCHRONOS"] = { 0.6 , 0.1 , 0.2 , .6 }, -- medium red
},
TypeColors = {
[DC.MAGIC] = "FF1887DD",
[DC.ENEMYMAGIC] = "FF98F9FF",
[DC.CURSE] = "FFDD22DD",
[DC.POISON] = "FF22DD22",
[DC.DISEASE] = "FF995533",
[DC.CHARMED] = "FFFF0000",
[DC.BLEED] = "FFC0B0B0",
[DC.NOTYPE] = "FFAAAAAA",
},
-- Debuffs {{{
-- those debuffs prevent us from curing the unit
DebuffsToIgnore = {
[DS["Banish"]] = true,
[DS["Frost Trap Aura"]] = true,
},
-- thoses debuffs are in fact buffs...
BuffDebuff = {
[DS["DREAMLESSSLEEP"]] = true,
[DS["GDREAMLESSSLEEP"]] = true,
[(not DC.WOWC) and DS["MDREAMLESSSLEEP"] or "NONE"] = (not DC.WOWC) and true or nil,
[DS["DCR_LOC_MINDVISION"]] = true,
[(not DC.WOWC) and DS["Arcane Blast"] or "NONE"] = (not DC.WOWC) and true or nil,
},
DebuffAlwaysSkipList = {
},
DebuffsSkipList = {
[DS["ANCIENTHYSTERIA"]] =
DSI["ANCIENTHYSTERIA"],
[DS["CRIPLES"]] =
DSI["CRIPLES"],
[DS["DELUSIONOFJINDO"]] =
DSI["DELUSIONOFJINDO"],
[DS["DUSTCLOUD"]] =
DSI["DUSTCLOUD"],
[DS["IGNITE"]] =
DSI["IGNITE"],
[DS["MAGMASHAKLES"]] =
DSI["MAGMASHAKLES"],
[DS["DCR_LOC_SILENCE"]] =
DSI["DCR_LOC_SILENCE"],
[DS["SONICBURST"]] =
DSI["SONICBURST"],
[DS["TAINTEDMIND"]] =
DSI["TAINTEDMIND"],
[DS["WIDOWSEMBRACE"]] =
DSI["WIDOWSEMBRACE"],
},
skipByClass = {
["WARRIOR"] = {
[DS["ANCIENTHYSTERIA"]] = true,
[DS["IGNITE"]] = true,
[DS["TAINTEDMIND"]] = true,
[DS["WIDOWSEMBRACE"]] = true,
[DS["DELUSIONOFJINDO"]] = true,
},
["ROGUE"] = {
[DS["DCR_LOC_SILENCE"]] = true,
[DS["ANCIENTHYSTERIA"]] = true,
[DS["IGNITE"]] = true,
[DS["TAINTEDMIND"]] = true,
[DS["WIDOWSEMBRACE"]] = true,
[DS["SONICBURST"]] = true,
[DS["DELUSIONOFJINDO"]] = true,
},
["HUNTER"] = {
[DS["MAGMASHAKLES"]] = true,
[DS["DELUSIONOFJINDO"]] = true,
},
["MAGE"] = {
[DS["MAGMASHAKLES"]] = true,
[DS["CRIPLES"]] = true,
[DS["DUSTCLOUD"]] = true,
[DS["DELUSIONOFJINDO"]] = true,
},
["WARLOCK"] = {
[DS["CRIPLES"]] = true,
[DS["DUSTCLOUD"]] = true,
[DS["DELUSIONOFJINDO"]] = true,
},
["DRUID"] = {
[DS["CRIPLES"]] = true,
[DS["DUSTCLOUD"]] = true,
[DS["DELUSIONOFJINDO"]] = true,
},
["PALADIN"] = {
[DS["CRIPLES"]] = true,
[DS["DUSTCLOUD"]] = true,
[DS["DELUSIONOFJINDO"]] = true,
},
["PRIEST"] = {
[DS["CRIPLES"]] = true,
[DS["DUSTCLOUD"]] = true,
[DS["DELUSIONOFJINDO"]] = true,
},
["SHAMAN"] = {
[DS["CRIPLES"]] = true,
[DS["DUSTCLOUD"]] = true,
[DS["DELUSIONOFJINDO"]] = true,
},
["DEATHKNIGHT"] = {
},
["MONK"] = {
},
["DEMONHUNTER"] = {
},
["EVOKER"] = {
}
},
-- }}}
}
} -- }}}
end
local OptionsPostSetActions = { -- {{{
["debug"] = function(v) D.debug = v end,
["HideMUFsHandle"] = function(v) D.MFContainerHandle:EnableMouse(not v); D:Print(v and "MUFs handle disabled" or "MUFs handle enabled"); end,
["AfflictionTooltips"] = function(v) for id,lvitem in ipairs(D.LiveList.ExistingPerID) do lvitem.Frame:EnableMouse(v); end end,
["Amount_Of_Afflicted"] = function(v) D.LiveList:RestAllPosition(); end,
["ScanTime"] = function(v) D:ScheduleRepeatedCall("Dcr_LLupdate", D.LiveList.Update_Display, v, D.LiveList); D:Debug("LV scan delay changed:", v); end,
["ReverseLiveDisplay"] = function(v) D.LiveList:RestAllPosition(); end,
["LiveListScale"] = function(v) D:SetLLScale(v); end,
["AutoHideMUFs"] = function(v) D:AutoHideShowMUFs(); end,
["DebuffsFrameGrowToTop"] = function(v) D.MicroUnitF:SavePos(); D.MicroUnitF:ResetAllPositions (); end,
["DebuffsFrameStickToRight"] = function(v) D.MicroUnitF:SavePos(); D.MicroUnitF:ResetAllPositions (); end,
["DebuffsFrameVerticalDisplay"] = function(v) D.MicroUnitF:ResetAllPositions (); end,
["DebuffsFrameMaxCount"] = function(v) D.MicroUnitF.MaxUnit = v; D.MicroUnitF:Delayed_MFsDisplay_Update(); end, -- just the number of MUFs is changed MFsDisplay_Update() is enough
["DebuffsFramePerline"] = function(v) D.MicroUnitF:ResetAllPositions (); end,
["DebuffsFrameElemScale"] = function(v) D.MicroUnitF:SetScale(D.profile.DebuffsFrameElemScale); end,
["DebuffsFrameRefreshRate"] = function(v) D:ScheduleRepeatedCall("Dcr_MUFupdate", D.DebuffsFrame_Update, D.db.global.DebuffsFrameRefreshRate, D); D:Debug("MUFs refresh rate changed:", D.db.global.DebuffsFrameRefreshRate, v); end,
["MFScanEverybodyTimer"] = function(v)
if v > 0 then
D:ScheduleRepeatedCall("Dcr_ScanEverybody", D.ScanEveryBody, D.db.global.MFScanEverybodyTimer, D);
D:Debug("MUFs scan every body timer changed:", D.db.global.MFScanEverybodyTimer, v);
else
D:CancelDelayedCall("Dcr_ScanEverybody")
D:Debug("MUFs scan every body canceled", D.db.global.MFScanEverybodyTimer, v);
end
end,
["MFScanEverybodyReport"] = function(v)
if D.db.global.MFScanEverybodyTimer > 0 then
D:ScheduleRepeatedCall("Dcr_ScanEverybody", D.ScanEveryBody, D.db.global.MFScanEverybodyTimer, D);
end
D:Debug("MUFs scan every body reporting changed:", D.db.global.MFScanEverybodyReport, v);
end,
["Scan_Pets"] = function(v) D:GroupChanged ("opt CURE_PETS"); end,
["DisableMacroCreation"] = function(v) if v then D:SetMacroKey (nil); D:Debug("SetMacroKey (nil)"); end end,
} -- }}}
function D.GetHandler (info, value) -- {{{
local source = D.db.global;
if D.db.profile[info[#info]]~=nil then
source = D.db.profile;
elseif D.db.class[info[#info]]~=nil then
source = D.db.class;
end
return source[info[#info]];
end -- }}}
-- Used in Ace3 option table to get feedback when setting options through command line
function D.SetHandler (info, value) -- {{{
local target = D.db.global;
if D.db.profile[info[#info]]~=nil then
target = D.db.profile;
elseif D.db.class[info[#info]]~=nil then
target = D.db.class;
end
target[info[#info]] = value;
if OptionsPostSetActions[info[#info]] then
OptionsPostSetActions[info[#info]](value);
D:Debug("PostAction executed");
end
if info["uiType"] == "cmd" then
if value == true then
value = L["OPT_CMD_ENABLED"];
elseif value == false then
value = L["OPT_CMD_DISBLED"];
end
D:Print(D:ColorText(D:GetOPtionPath(info), "FF00DD00"), "=>", D:ColorText(value, "FF3399EE"));
end
end -- }}}
local CombatWarning = {
type = "description",
name = D:ColorText(L["OPT_OPTIONS_DISABLED_WHILE_IN_COMBAT"], "FFFF0000"),
order = 0,
disabled = false,
hidden = function() return not D.Status.Combat end,
};
local SpellAssignmentsTexts = {};
local CustomSpellMacroEditingAllowed = false;
local function GetStaticOptions ()
local function validateSpellInput(info, v) -- {{{
D:Debug("Validating spell id", v);
local error = function (m) D:ColorPrint(1, 0, 0, m); return m; end;
local isItem = nil;
local isPetAbility = nil;
-- We got a spell ID directly
if tonumber(v) then
v = tonumber(v);
-- test if it's valid
if not GetSpellName(v) and not (GetItemInfo(v)) then
return error(L["OPT_INPUT_SPELL_BAD_INPUT_ID"]);
end
isItem = not GetSpellName(v);
elseif D:GetSpellFromLink(v) then
-- We got a spell link!
v, isPetAbility = D:GetSpellFromLink(v);
elseif D:GetItemFromLink(v) then
-- We got a item link!
isItem = true;
v = D:GetItemFromLink(v);
elseif type(v) == 'string' and (D:GetSpellUsefulInfoIfKnown(v)) then -- not a number, not a spell link, then a spell name?
-- We got a spell name!
D:Debug(v, "is a spell name in our book:", D:GetSpellUsefulInfoIfKnown(v));
local id, isPet = D:GetSpellUsefulInfoIfKnown(v);
v = id;
isPetAbility = isPet;
elseif type(v) == 'string' and (GetItemInfo(v)) then
D:Debug(v, "is a item name:", GetItemInfo(v));
-- We got an item name!
isItem = true;
v = D:GetItemFromLink(select(2, GetItemInfo(v)));
else
return error(L["OPT_INPUT_SPELL_BAD_INPUT_NOT_SPELL"]);
end
if not isItem and v > 0xfffff then
v = bit.band(0xfffff, v);
end
-- avoid spellID/itemID collisions
if isItem then
v = -1 * v;
end
-- It's a deleted default spell
if D.classprofile.UserSpells[v] and not D.classprofile.UserSpells[v].Hidden then
D:Debug(v);
return error(L["OPT_INPUT_SPELL_BAD_INPUT_ALREADY_HERE"]);
end
-- The spell is part of the default set and the user doesn't want to change the macro
if DC.SpellsToUse[v] and not CustomSpellMacroEditingAllowed then
return error(L["OPT_INPUT_SPELL_BAD_INPUT_DEFAULT_SPELL"]);
end
return 0, v, isItem, isPetAbility;
end -- }}}
return {
-- {{{
type = "group",
name = D.name,
get = D.GetHandler,
set = D.SetHandler,
hidden = function () return not D:IsEnabled(); end,
disabled = function () return not D:IsEnabled(); end,
args = {
-- Command line only {{{
-- enable and disable
enable = {
type = 'toggle',
name = L["OPT_ENABLEDECURSIVE"],
hidden = function() return D:IsEnabled(); end,
disabled = function() return D:IsEnabled(); end,
set = function() D.Status.Enabled = D:Enable(); return D.Status.Enabled; end,
get = function() return D:IsEnabled(); end,
order = -2,
},
disable = {
type = 'toggle',
guiHidden = true,
disabled = function() return not D:IsEnabled(); end,
name = 'disable',
set = function() D.Status.Enabled = not D:Disable(); return not D.Status.Enabled; end,
get = function() return not D:IsEnabled(); end,
order = -3,
},
HideMUFsHandle = {
type = 'toggle',
name = L["OPT_HIDEMUFSHANDLE"],
desc = L["OPT_HIDEMUFSHANDLE_DESC"],
guiHidden = D.profile and not D.profile.HideMUFsHandle,
disabled = function() return not D:IsEnabled() or not D.profile.ShowDebuffsFrame and D.profile.AutoHideMUFs == 1; end,
get = function(info) return not D.MFContainerHandle:IsMouseEnabled(); end,
order = -4,
},
debug = {
type = "toggle",
guiHidden = not D.debug,
name = L["OPT_ENABLEDEBUG"],
desc = L["OPT_ENABLEDEBUG_DESC"],
order = -5,
},
-- Atticus Ross rules!
-- }}}
general = {
-- {{{
type = 'group',
name = L["OPT_GENERAL"],
order = 0,
icon = DC.IconON,
args = {
version = {
type = 'description',
name = D.version,
image = DC.IconON,
order = 0,
},
newVersion = {
type = 'description',
name = "|cFFEE0022" .. (L["NEW_VERSION_ALERT"]):format(D.db.global.NewerVersionName or "none", date("%Y-%m-%d", D.db.global.NewerVersionDetected)) .. "|r",
hidden = function() return not D.db.global.NewerVersionName end,
order = 2,
},
ShowDebuffsFrame = {
type = "toggle",
name = L["OPT_SHOWMFS"],
desc = L["OPT_SHOWMFS_DESC"],
set = function()
D:ShowHideDebuffsFrame ();
if D.profile.AutoHideMUFs ~= 1 then
D.profile.AutoHideMUFs = 1;
D:ColorPrint(1, 0, 0, L["OPT_AUTOHIDEMFS"] .. " -> " .. L["OPT_HIDEMFS_NEVER"]);
end
end,
disabled = function() return D.Status.Combat end,
order = 5,
},
AutoHideMUFs = {
type = "select",
style = "dropdown",
name = L["OPT_AUTOHIDEMFS"],
desc = L["OPT_AUTOHIDEMFS_DESC"] .. "\n\n" .. ("%s: %s\n%s: %s\n%s: %s\n%s: %s"):format(
D:ColorText(L["OPT_HIDEMFS_NEVER"], "FF88CCAA"), L["OPT_HIDEMFS_NEVER_DESC"]
, D:ColorText(L["OPT_HIDEMFS_SOLO"], "FF88CCAA"), L["OPT_HIDEMFS_SOLO_DESC"]
, D:ColorText(L["OPT_HIDEMFS_GROUP"], "FF88CCAA"), L["OPT_HIDEMFS_GROUP_DESC"]
, D:ColorText(L["OPT_HIDEMFS_RAID"], "FF88CCAA"), L["OPT_HIDEMFS_RAID_DESC"]),
values = {L["OPT_HIDEMFS_NEVER"], L["OPT_HIDEMFS_SOLO"], L["OPT_HIDEMFS_GROUP"], L["OPT_HIDEMFS_RAID"]},
order = 6,
},
HideLiveList = {
type = "toggle",
name = L["OPT_ENABLE_LIVELIST"],
desc = L["OPT_ENABLE_LIVELIST_DESC"],
set = function()
D:ShowHideLiveList()
if D.profile.HideLiveList and not D.profile.ShowDebuffsFrame or not D.Status.HasSpell then
D:SetIcon(DC.IconOFF);
else
D:SetIcon(DC.IconON);
end
end,
get = function () return not D.profile.HideLiveList end,
order = 7,
},
PlaySound = {
type = "toggle",
disabled = function() return D.profile.HideLiveList and not D.profile.ShowDebuffsFrame and D.profile.AutoHideMUFs == 1 or not D:IsEnabled(); end,
name = L["PLAY_SOUND"],
desc = L["OPT_PLAYSOUND_DESC"],
order = 10,
},
AfflictionTooltips = {
type = "toggle",
disabled = function() return D.profile.HideLiveList and not D.profile.ShowDebuffsFrame and D.profile.AutoHideMUFs == 1 or not D:IsEnabled(); end,
name = L["SHOW_TOOLTIP"],
desc = L["OPT_SHOWTOOLTIP_DESC"],
order = 20,
},
minimap = {
type = "toggle",
name = L["OPT_SHOWMINIMAPICON"],
desc = L["OPT_SHOWMINIMAPICON_DESC"],
get = function() return not D.profile.MiniMapIcon or not D.profile.MiniMapIcon.hide end,
set = function(info,v)
local hide = not v;
D.profile.MiniMapIcon.hide = hide;
if hide then
icon:Hide("Decursive");
else
icon:Show("Decursive");
end
end,
order = 30,
},
CureBlacklist = {
type = 'range',
name = L["BLACK_LENGTH"],
desc = L["OPT_BLACKLENTGH_DESC"],
min = 0,
max = 20,
step = 0.1,
order = 40,
},
SysOps = {
type = 'header',
name = "",
order = 50
},
TestItemDisplayed = {
type = "toggle",
name = L["OPT_CREATE_VIRTUAL_DEBUFF"],
desc = L["OPT_CREATE_VIRTUAL_DEBUFF_DESC"],
get = function() return D.LiveList.TestItemDisplayed end,
set = function()
if not D.LiveList.TestItemDisplayed then
D.LiveList:DisplayTestItem();
else
D.LiveList:HideTestItem();
end
end,
disabled = function() return D.profile.HideLiveList and not D.profile.ShowDebuffsFrame or not D.Status.HasSpell or not D.Status.Enabled end,
order = 60
},
NoStartMessages = {
type = "toggle",
name = L["OPT_NOSTARTMESSAGES"],
desc = L["OPT_NOSTARTMESSAGES_DESC"],
order = 70
},
NewerVersionAlerts ={
type = "toggle",
name = L["OPT_NEWVERSIONBUGMENOT"],
desc = L["OPT_NEWVERSIONBUGMENOT_DESC"],
get = function() return not D.db.global.NewVersionsBugMeNot end,
set = function(info,v)
D.db.global.NewVersionsBugMeNot = v == false and D.VersionTimeStamp or false;
end,
order = 75
},
report = {
type = "execute",
name = D:ColorText(L["DECURSIVE_DEBUG_REPORT_SHOW"], "FFFF0000"),
desc = L["DECURSIVE_DEBUG_REPORT_SHOW_DESC"],
func = function ()
LibStub("AceConfigDialog-3.0"):Close(D.name);
if GameTooltip:IsShown() then GameTooltip:Hide(); end
T._ShowDebugReport();
end,
hidden = function() return #T._DebugTextTable < 1 end,
order = 1000
},
GlorfindalMemorium = {
type = "execute",
name = D:ColorText(L["GLOR1"], "FF" .. D:GetClassHexColor( "WARRIOR" )),
desc = L["GLOR2"],
width = 'double',
func = function ()
-- {{{
LibStub("AceConfigDialog-3.0"):Close(D.name);
if GameTooltip:IsShown() then GameTooltip:Hide(); end
if not D.MemoriumFrame then
D.MemoriumFrame = CreateFrame("Frame", nil, UIParent);
local f = D.MemoriumFrame;
local w = 512; local h = 390;
f:SetFrameStrata("TOOLTIP");
f:EnableKeyboard(true);
f:SetScript("OnKeyUp", function (frame, event, arg1, arg2) D.MemoriumFrame:Hide(); end);
--[[
f:SetScript("OnShow",
function ()
-- I wanted to make the shadow to move over the marble very slowly as clouds
-- I tried to make it rotate but the way I found would only make it rotate around its origin (which is rarely useful)
-- so leaving it staedy for now... if someone got an idea, let me know.
D:ScheduleRepeatingEvent("Dcr_GlorMoveShadow",
function (f)
local cos, sin = math.cos, math.sin;
f.Shadow.Angle = f.Shadow.Angle + 1;
if f.Shadow.Angle == 360 then f.Shadow.Angle = 0; end
local angle = math.rad(f.Shadow.Angle);
D:SetCoords(f.Shadow, cos(angle), sin(angle), 0, -sin(angle), cos(angle), 0);
end
, 1/50, f);
end);
f:SetScript("OnHide", function() D:CancelDelayedCall("Dcr_GlorMoveShadow"); end)
--]]
f:SetWidth(w);
f:SetHeight(h);
f.tTL = f:CreateTexture(nil,"BACKGROUND")
f.tTL:SetTexture("Interface\\ItemTextFrame\\ItemText-Marble-TopLeft")
f.tTL:SetWidth(w - w / 5);
f.tTL:SetHeight(h - h / 3);
f.tTL:SetTexCoord(0, 1, 5/256, 1);
f.tTL:SetPoint("TOPLEFT", f, "TOPLEFT", 2, -10);
f.tTR = f:CreateTexture(nil,"BACKGROUND")
f.tTR:SetTexture("Interface\\ItemTextFrame\\ItemText-Marble-TopRight")
f.tTR:SetWidth(w / 5 - 3);
f.tTR:SetHeight(h - h / 3);
f.tTR:SetTexCoord(0, 1, 5/256, 1);
f.tTR:SetPoint("TOPLEFT", f.tTL, "TOPRIGHT", 0, 0);
f.tBL = f:CreateTexture(nil,"BACKGROUND")
f.tBL:SetTexture("Interface\\ItemTextFrame\\ItemText-Marble-BotLeft")
f.tBL:SetWidth(w - w / 5);
f.tBL:SetHeight(h / 3 - 20);
f.tBL:SetTexCoord(0,1,0, 408/512);
f.tBL:SetPoint("TOPLEFT", f.tTL, "BOTTOMLEFT", 0, 0);
f.tBR = f:CreateTexture(nil,"BACKGROUND")
f.tBR:SetTexture("Interface\\ItemTextFrame\\ItemText-Marble-BotRight")
f.tBR:SetWidth(w / 5 - 3);
f.tBR:SetHeight(h / 3 - 20);
f.tBR:SetTexCoord(0,1,0, 408/512);
f.tBR:SetPoint("TOPLEFT", f.tBL, "TOPRIGHT", 0, 0);
f.Shadow = f:CreateTexture(nil, "ARTWORK");
f.Shadow:SetTexture("Interface\\TabardFrame\\TabardFrameBackground")
f.Shadow:SetPoint("TOPLEFT", f, "TOPLEFT", 2, -9);
f.Shadow:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", -2, 9);
f.Shadow:SetAlpha(0.1);
---[[
f.fB = f:CreateTexture(nil,"OVERLAY")
f.fB:SetTexture("Interface\\AddOns\\Decursive\\Textures\\GoldBorder")
f.fB:SetTexCoord(5/512, 324/512, 6/512, 287/512);
f.fB:SetPoint("TOPLEFT", f, "TOPLEFT", 0, 0);
f.fB:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", 0, 0);
--]]
f.FSt = f:CreateFontString(nil,"OVERLAY", "MailTextFontNormal");
f.FSt:SetFont("Fonts\\MORPHEUS.TTF", 18 );
f.FSt:SetTextColor(0.18, 0.12, 0.06, 1);
f.FSt:SetPoint("TOPLEFT", f.tTL, "TOPLEFT", 5, -20);
f.FSt:SetPoint("TOPRIGHT", f.tTR, "TOPRIGHT", -5, -20);
f.FSt:SetJustifyH("CENTER");
f.FSt:SetText(L["GLOR3"]);
f.FSt:SetAlpha(0.80);
f.FSc = f:CreateFontString(nil,"OVERLAY", "MailTextFontNormal");
f.FSc:SetFont("Fonts\\MORPHEUS.TTF", 15 );
f.FSc:SetTextColor(0.18, 0.12, 0.06, 1);
f.FSc:SetHeight(h - 30 - 60);
f.FSc:SetPoint("TOP", f.FSt, "BOTTOM", 0, -28);
f.FSc:SetPoint("LEFT", f.tTL, "LEFT", 30, 0);
f.FSc:SetPoint("RIGHT", f.tTR, "RIGHT", -30, 0);
f.FSc:SetJustifyH("CENTER");
f.FSc:SetJustifyV("TOP");
f.FSc:SetSpacing(5);
f.FSc:SetText(L["GLOR4"]);
f.FSc:SetAlpha(0.80);
f.FSl = f:CreateFontString(nil,"OVERLAY", "MailTextFontNormal");
f.FSl:SetFont("Fonts\\MORPHEUS.TTF", 15 );
f.FSl:SetTextColor(0.18, 0.12, 0.06, 1);
f.FSl:SetJustifyH("LEFT");
f.FSl:SetJustifyV("BOTTOM");
f.FSl:SetPoint("BOTTOMLEFT", f, "BOTTOMLEFT", 30, 33);
f.FSl:SetAlpha(0.80);
f.FSl:SetText(L["GLOR5"]);
f:SetPoint("CENTER",0,0);
end
D.MemoriumFrame:Show();
--[[
In remembrance of Bertrand Sense
1969 - 2007
Friendship and affection can take their roots anywhere, those
who met Glorfindal in World of Warcraft knew a man of great
commitment and a charismatic leader.
He was in life as he was in game, selfless, generous, dedicated
to his friends and most of all, a passionate man.
He left us at the age of 38 leaving behind him not just
anonymous players in a virtual world, but a group of true
friends who will miss him forever.
He will always be remembered...