forked from kakaZzzz/AutoEquip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.lua
1411 lines (1111 loc) · 49.7 KB
/
settings.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 _, SELFAQ = ...
local debug = SELFAQ.debug
local clone = SELFAQ.clone
local diff = SELFAQ.diff
local L = SELFAQ.L
local GetItemLink = SELFAQ.GetItemLink
local player = SELFAQ.player
-- 设置菜单初始化
function SELFAQ.settingInit()
if SELFAQ.f ~= nil then
return
end
local top = CreateFrame("Frame", nil, UIParent)
local p = CreateFrame("ScrollFrame", nil, UIParent, "UIPanelScrollFrameTemplate")
local f = CreateFrame("Frame", nil, p)
local queueOption = CreateFrame("ScrollFrame", nil, UIParent, "UIPanelScrollFrameTemplate")
local queueFrame = CreateFrame("Frame", nil, queueOption)
local helpOption = CreateFrame("ScrollFrame", nil, UIParent, "UIPanelScrollFrameTemplate")
local helpFrame = CreateFrame("Frame", nil, helpOption)
SELFAQ.general = p
SELFAQ.top = top
SELFAQ.f = f
SELFAQ.queueOption = queueOption
SELFAQ.queueFrame = queueFrame
SELFAQ.helpOption = helpOption
SELFAQ.helpFrame = helpFrame
top.name = "AutoEquip"
p.name = L["General"]
p.parent = "AutoEquip"
queueOption.name = L["Usable Queue"]
queueOption.parent = "AutoEquip"
helpOption.name = L["Help"]
helpOption.parent = "AutoEquip"
SELFAQ.lastHeight = -475
SELFAQ.lastHeightQueue = -30
SELFAQ.lastHeightHelp = 30
-- 缓存主动饰品下拉框
f.dropdown = {}
-- 缓存常驻饰品下拉框
f.resident = {}
-- 缓存单选框
f.checkbox = {}
f.pveCheckbox = {}
f.pvpCheckbox = {}
f.raidCheckbox = {}
f.queue13 = {}
f.queue14 = {}
do
local t = f:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
t:SetText(L["AutoEquip "]..SELFAQ.version)
t:SetPoint("TOPLEFT", f, 25, -20)
end
do
local t = top:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
t:SetText(L["AutoEquip "]..SELFAQ.version)
t:SetPoint("TOPLEFT", top, 25, -20)
end
local
b = CreateFrame("Button", nil, top, "GameMenuButtonTemplate")
b:SetText(L["Expand Settings"])
b:SetWidth(140)
b:SetHeight(30)
b:SetPoint("TOPLEFT", top, 23, -60)
b:SetScript("OnClick", function(self)
InterfaceOptionsFrame_OpenToCategory(p);
InterfaceOptionsFrame_OpenToCategory(p);
end)
do
local t = top:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge")
t:SetText(L["Tutorial:"])
t:SetPoint("TOPLEFT", top, 25, -115)
end
do
local t = top:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["Press Ctrl+C to copy the link. Paste it into browser and open it."])
t:SetPoint("TOPLEFT", top, 25, -135)
end
do
local e = CreateFrame("EditBox", nil, top, "InputBoxTemplate")
e:SetFontObject("GameFontHighlight")
e:SetWidth(350)
e:SetHeight(60)
e:SetAutoFocus(false)
-- e:SetJustifyH("CENTER")
e:SetPoint("TOPLEFT", top, 30, -145)
e:SetText("https://www.bilibili.com/read/cv8152125")
e:SetCursorPosition(0)
end
-- 构建主动饰品组
function DropDown_Initialize(self,level)
level = level or 1;
if (level == 1) then
local slot_id = self.slot
for k, v in ipairs(AQSV.usableItems[slot_id]) do
local info = UIDropDownMenu_CreateInfo();
-- info.hasArrow = true; -- creates submenu
info.text = GetItemLink(v);
info.value = v
local index = self.index
local key = k
info.func = function( frame )
-- 选择的不是当前顺序的饰品
if index ~= key then
-- 交换数据table中两个饰品的顺序
local value = AQSV.usableItems[slot_id][key]
AQSV.usableItems[slot_id][key] = AQSV.usableItems[slot_id][index]
AQSV.usableItems[slot_id][index] = value
-- 根据新的数据table更新选中状态
for k,v in ipairs(AQSV.usableItems[slot_id]) do
UIDropDownMenu_SetSelectedValue(f.dropdown[slot_id][k], v, 0)
UIDropDownMenu_SetText(f.dropdown[slot_id][k], GetItemLink(v))
f.pveCheckbox[slot_id][k]:SetChecked(AQSV.pveTrinkets[v])
f.pvpCheckbox[slot_id][k]:SetChecked(AQSV.pvpTrinkets[v])
f.raidCheckbox[slot_id][k]:SetChecked(AQSV.raidTrinkets[v])
if slot_id == 13 then
f.queue13[k]:SetChecked(AQSV.queue13[v])
f.queue14[k]:SetChecked(AQSV.queue14[v])
end
end
end
end
UIDropDownMenu_AddButton(info, level);
end
end
end
-- 构建常驻饰品组
function Resident_Trinket_Initialize(self,level)
level = level or 1;
if (level == 1) then
local slot_id = self.slot
for k, v in ipairs(SELFAQ.items[slot_id]) do
local info = UIDropDownMenu_CreateInfo();
-- info.hasArrow = true; -- creates submenu
info.text = GetItemLink(v);
info.value = v
local index = self.index
local key = k
info.func = function( frame )
-- 选中现有饰品则无效
if v ~= AQSV.slotStatus[slot_id].backup then
UIDropDownMenu_SetSelectedValue(f.resident[slot_id], v, 0)
UIDropDownMenu_SetText(f.resident[slot_id], GetItemLink(v))
end
if slot_id == 13 or slot_id == 14 then
local one = AQSV.slotStatus[slot_id].backup
-- 如果跟另一个饰品一样,则更换
if v == AQSV.slotStatus[27 - slot_id].backup and v ~= 0 then
UIDropDownMenu_SetSelectedValue(f.resident[27-slot_id], one, 0)
UIDropDownMenu_SetText(f.resident[27-slot_id], GetItemLink(one))
AQSV.slotStatus[27 - slot_id].backup = one
end
end
AQSV.slotStatus[slot_id].backup = v
-- if v ~= AQSV.slot13 and v ~= AQSV.slot14 then
-- UIDropDownMenu_SetSelectedValue(f.resident[index], v, 0)
-- UIDropDownMenu_SetText(f.resident[index], GetItemLink(v))
-- -- 更新数据
-- AQSV["slot"..(12+index)] = v
-- end
end
UIDropDownMenu_AddButton(info, level);
end
end
end
-- 构建两个饰品组
function buildDropdownGroup(slot_id)
if not AQSV.usableItems[slot_id] then
return
end
local line = CreateFrame("Button", nil, queueFrame, "BackdropTemplate")
line:SetWidth(570)
line:SetHeight(1)
line:SetPoint("TOPLEFT", queueFrame, 25, SELFAQ.lastHeightQueue)
line:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background"});
line:SetBackdropColor(0.8,0.8,0.8,0.8);
SELFAQ.lastHeightQueue = SELFAQ.lastHeightQueue - 25
do
local t = queueFrame:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetFont(STANDARD_TEXT_FONT, 20)
if slot_id == 13 then
t:SetText(SELFAQ.color("FF4500", L["Trinkets"]))
else
t:SetText(SELFAQ.color("FF4500", SELFAQ.slotToName[slot_id]))
end
t:SetPoint("TOPLEFT", queueFrame, 25, SELFAQ.lastHeightQueue)
end
do
local t = queueFrame:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["Queue:"])
t:SetPoint("TOPLEFT", queueFrame, 284, SELFAQ.lastHeightQueue)
end
if slot_id == 13 then
do
local t = queueFrame:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["Trinket Slot:"])
t:SetPoint("TOPLEFT", queueFrame, 509, SELFAQ.lastHeightQueue)
end
end
local height = 0
f.dropdown[slot_id] = {}
f.pveCheckbox[slot_id] = {}
f.pvpCheckbox[slot_id] = {}
f.raidCheckbox[slot_id] = {}
-- 主动饰品
for k,v in ipairs(AQSV.usableItems[slot_id]) do
local dropdown = CreateFrame("Frame", nil, queueFrame, "UIDropDownMenuTemplate");
dropdown:SetPoint("TOPLEFT", 100, SELFAQ.lastHeightQueue + 5 - k*35)
-- 保存当前选项序号
dropdown.index = k
dropdown.slot = slot_id
-- 缓存到父框架中,供后续调用
f.dropdown[slot_id][k] = dropdown
local l = queueFrame:CreateFontString(nil, "ARTWORK", "GameFontNormal")
l:SetText(L["Usable "]..k)
l:SetPoint("TOPLEFT", queueFrame, 25, SELFAQ.lastHeightQueue - k*35)
-- 保存最后一个下拉框的位置
height = SELFAQ.lastHeightQueue - k*35
UIDropDownMenu_SetButtonWidth(dropdown, 130)
UIDropDownMenu_Initialize(dropdown, DropDown_Initialize)
UIDropDownMenu_SetSelectedValue(dropdown, v, 0)
UIDropDownMenu_SetText(dropdown, GetItemLink(v))
UIDropDownMenu_SetWidth(dropdown, 130)
UIDropDownMenu_JustifyText(dropdown, "LEFT")
-- 后面追加checkbox
do
local b = CreateFrame("CheckButton", nil, queueFrame, "UICheckButtonTemplate")
b:SetPoint("TOPLEFT", 280, SELFAQ.lastHeightQueue + 7 - k*35)
b:SetChecked(AQSV.pveTrinkets[v])
f.pveCheckbox[slot_id][k] = b
b.text = b:CreateFontString(nil, "OVERLAY", "GameFontNormal")
b.text:SetPoint("LEFT", b, "RIGHT", 0, 0)
b.text:SetText(L["Default"])
b.text:SetFont(STANDARD_TEXT_FONT, 12)
b:SetScript("OnClick", function()
local vaule = UIDropDownMenu_GetSelectedValue(dropdown)
AQSV.pveTrinkets[vaule] = not AQSV.pveTrinkets[vaule]
b:SetChecked(AQSV.pveTrinkets[vaule])
end)
end
do
local b = CreateFrame("CheckButton", nil, queueFrame, "UICheckButtonTemplate")
b:SetPoint("TOPLEFT", 365, SELFAQ.lastHeightQueue + 7 - k*35)
b:SetChecked(AQSV.raidTrinkets[v])
f.raidCheckbox[slot_id][k] = b
b.text = b:CreateFontString(nil, "OVERLAY", "GameFontNormal")
b.text:SetPoint("LEFT", b, "RIGHT", 0, 0)
b.text:SetText("Raid")
b.text:SetFont(STANDARD_TEXT_FONT, 12)
b.dtext = b:CreateFontString(nil, "OVERLAY", "GameFontNormal")
b.dtext:SetPoint("LEFT", b, "RIGHT", 0, 0)
b.dtext:SetText("Raid")
b.dtext:SetFont(STANDARD_TEXT_FONT, 12)
b.dtext:SetTextColor(0.5,0.5,0.5,0.7)
if AQSV.enableRaidQueue then
b:Enable()
b.dtext:Hide()
b.text:Show()
else
b:Disable()
b.dtext:Show()
b.text:Hide()
end
b:SetScript("OnClick", function()
local vaule = UIDropDownMenu_GetSelectedValue(dropdown)
AQSV.raidTrinkets[vaule] = not AQSV.raidTrinkets[vaule]
b:SetChecked(AQSV.raidTrinkets[vaule])
end)
end
do
local b = CreateFrame("CheckButton", nil, queueFrame, "UICheckButtonTemplate")
b:SetPoint("TOPLEFT", 435, SELFAQ.lastHeightQueue + 7 - k*35)
b:SetChecked(AQSV.pvpTrinkets[v])
f.pvpCheckbox[slot_id][k] = b
b.text = b:CreateFontString(nil, "OVERLAY", "GameFontNormal")
b.text:SetPoint("LEFT", b, "RIGHT", 0, 0)
b.text:SetText("PVP")
b.text:SetFont(STANDARD_TEXT_FONT, 12)
b:SetScript("OnClick", function()
local vaule = UIDropDownMenu_GetSelectedValue(dropdown)
AQSV.pvpTrinkets[vaule] = not AQSV.pvpTrinkets[vaule]
b:SetChecked(AQSV.pvpTrinkets[vaule])
end)
end
if slot_id == 13 then
do
local b = CreateFrame("CheckButton", nil, queueFrame, "UICheckButtonTemplate")
b:SetPoint("TOPLEFT", 505, SELFAQ.lastHeightQueue + 7 - k*35)
b:SetChecked(AQSV.queue13[v])
f.queue13[k] = b
b.text = b:CreateFontString(nil, "OVERLAY", "GameFontNormal")
b.text:SetPoint("LEFT", b, "RIGHT", 0, 0)
b.text:SetText("1")
b.text:SetFont(STANDARD_TEXT_FONT, 12)
b:SetScript("OnClick", function()
local vaule = UIDropDownMenu_GetSelectedValue(dropdown)
AQSV.queue13[vaule] = not AQSV.queue13[vaule]
b:SetChecked(AQSV.queue13[vaule])
end)
end
do
local b = CreateFrame("CheckButton", nil, queueFrame, "UICheckButtonTemplate")
b:SetPoint("TOPLEFT", 555, SELFAQ.lastHeightQueue + 7 - k*35)
b:SetChecked(AQSV.queue14[v])
f.queue14[k] = b
b.text = b:CreateFontString(nil, "OVERLAY", "GameFontNormal")
b.text:SetPoint("LEFT", b, "RIGHT", 0, 0)
b.text:SetText("2")
b.text:SetFont(STANDARD_TEXT_FONT, 12)
b:SetScript("OnClick", function()
local vaule = UIDropDownMenu_GetSelectedValue(dropdown)
AQSV.queue14[vaule] = not AQSV.queue14[vaule]
b:SetChecked(AQSV.queue14[vaule])
end)
end
end
end
-- 没有主动饰品的情况
if #AQSV.usableItems[slot_id] == 0 then
local l = queueFrame:CreateFontString(nil, "ARTWORK", "GameFontNormal")
l:SetText(L["<There is no suitable trinkets>"])
l:SetPoint("TOPLEFT", queueFrame, 25, SELFAQ.lastHeightQueue - 35)
height = SELFAQ.lastHeightQueue - 35
end
SELFAQ.lastHeightQueue = height
do
local t = queueFrame:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["Backup (Be equiped when usable items are all on CD):"] )
t:SetPoint("TOPLEFT", queueFrame, 25, SELFAQ.lastHeightQueue - 45)
end
local max = 1
if slot_id == 13 then
max = 2
end
for k=1, max do
f.resident[slot_id -1 +k] = {}
local dropdown = CreateFrame("Frame", nil, queueFrame, "UIDropDownMenuTemplate");
dropdown:SetPoint("TOPLEFT", 100, SELFAQ.lastHeightQueue-(40 + k*35))
dropdown.index = k
dropdown.slot = slot_id -1 +k
f.resident[dropdown.slot] = dropdown
local l = queueFrame:CreateFontString(nil, "ARTWORK", "GameFontNormal")
if dropdown.slot == 13 then
l:SetText(L["Priority "]..1)
elseif dropdown.slot == 14 then
l:SetText(L["Priority "]..2)
else
l:SetText(L["Priority "])
end
l:SetPoint("TOPLEFT", queueFrame, 25, SELFAQ.lastHeightQueue-(45 + k*35))
UIDropDownMenu_SetButtonWidth(dropdown, 130)
UIDropDownMenu_Initialize(dropdown, Resident_Trinket_Initialize)
local seleted = AQSV.slotStatus[dropdown.slot].backup
UIDropDownMenu_SetSelectedValue(dropdown, seleted, 0)
UIDropDownMenu_SetText(dropdown, GetItemLink(seleted))
UIDropDownMenu_SetWidth(dropdown, 130)
UIDropDownMenu_JustifyText(dropdown, "LEFT")
-- 固定模式选项
if dropdown.slot == 13 then
do
local b = CreateFrame("CheckButton", nil, queueFrame, "UICheckButtonTemplate")
b:SetPoint("TOPLEFT", 280, SELFAQ.lastHeightQueue -(38 + k*35))
b:SetChecked(AQSV.enableFixedPosition)
b.text = b:CreateFontString(nil, "OVERLAY", "GameFontNormal")
b.text:SetPoint("LEFT", b, "RIGHT", 0, 0)
b.text:SetText(L["Fixed position: Priority 1 = Slot 1, Priority 2 = Slot 2"])
b.text:SetFont(STANDARD_TEXT_FONT, 12)
b:SetScript("OnClick", function()
AQSV.enableFixedPosition = not AQSV.enableFixedPosition
end)
end
end
height = SELFAQ.lastHeightQueue-(45 + k*35)
end
-- naxx
if slot_id == 13 then
height = height - 43
do
local t = queueFrame:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["NAXX / Argent Dawn Trinket:"] )
t:SetPoint("TOPLEFT", queueFrame, 25, height)
end
if SELFAQ.undeadTrinket == 0 then
do
local l = queueFrame:CreateFontString(nil, "ARTWORK", "GameFontNormal")
l:SetText(L["<There is no suitable trinkets>"])
l:SetPoint("TOPLEFT", queueFrame, 25, height - 35)
end
height = height - 35
else
do
function Undead_Init(self,level)
level = level or 1;
if (level == 1) then
for i=1,2 do
local number = i
local info = UIDropDownMenu_CreateInfo();
info.text = L["Priority "]..number
info.value = number
info.func = function( frame )
current = number
UIDropDownMenu_SetSelectedValue(queueFrame.undeadDropdown, number, 0)
UIDropDownMenu_SetText(queueFrame.undeadDropdown, L["Priority "]..number)
-- 更新页面中的数据
AQSV.undeadPosition = number
end
UIDropDownMenu_AddButton(info, level)
end
end
end
local dropdown = CreateFrame("Frame", nil, queueFrame, "UIDropDownMenuTemplate")
dropdown:SetPoint("TOPLEFT", 6, height- 30)
queueFrame.undeadDropdown = dropdown
UIDropDownMenu_SetButtonWidth(dropdown, 70)
UIDropDownMenu_Initialize(dropdown, Undead_Init)
-- 默认显示第一套
UIDropDownMenu_SetSelectedValue(dropdown, AQSV.undeadPosition, 0)
UIDropDownMenu_SetText(dropdown, L["Priority "]..AQSV.undeadPosition)
UIDropDownMenu_SetWidth(dropdown, 70)
UIDropDownMenu_JustifyText(dropdown, "LEFT")
end
do
local l = queueFrame:CreateFontString(nil, "ARTWORK", "GameFontNormal")
l:SetText(L["Select the position to insert "]..GetItemLink(SELFAQ.undeadTrinket))
l:SetPoint("TOPLEFT", queueFrame, 120, height- 35)
end
-- 副本里
do
local b = CreateFrame("CheckButton", nil, queueFrame, "UICheckButtonTemplate")
b:SetPoint("TOPLEFT", queueFrame, 25, height - 65)
b:SetChecked(AQSV.enableInUndeadInstance)
b.text = b:CreateFontString(nil, "OVERLAY", "GameFontNormal")
b.text:SetPoint("LEFT", b, "RIGHT", 0, 0)
b.text:SetText(L["Enable in Naxxramas / Scholomance / Stratholme"])
b.text1 = b:CreateFontString(nil, "OVERLAY", "GameFontNormal")
b.text1:SetPoint("LEFT", b, "RIGHT", 0, -20)
b.text1:SetText(L["(Disable automatically when the target is not undead is NAXX)"])
b:SetScript("OnClick", function()
AQSV.enableInUndeadInstance = not AQSV.enableInUndeadInstance
b:SetChecked(AQSV.enableInUndeadInstance)
end)
end
-- 副本外
do
local b = CreateFrame("CheckButton", nil, queueFrame, "UICheckButtonTemplate")
b:SetPoint("TOPLEFT", queueFrame, 25, height - 110)
b:SetChecked(AQSV.enableTargetUndead)
b.text = b:CreateFontString(nil, "OVERLAY", "GameFontNormal")
b.text:SetPoint("LEFT", b, "RIGHT", 0, 0)
b.text:SetText(L["Enable when the target is undead out of instance"])
b:SetScript("OnClick", function()
AQSV.enableTargetUndead = not AQSV.enableTargetUndead
b:SetChecked(AQSV.enableTargetUndead)
end)
end
height = height - 120
end
end
SELFAQ.lastHeightQueue = height - 43
end
function buildCheckbox(text, key, pos, x)
local posX = 20
if x ~= nil then
posX = x
end
local b = CreateFrame("CheckButton", nil, f, "UICheckButtonTemplate")
b:SetPoint("TOPLEFT", f, posX, pos)
b:SetChecked(AQSV[key])
b.text = b:CreateFontString(nil, "OVERLAY", "GameFontNormal")
b.text:SetPoint("LEFT", b, "RIGHT", 0, 0)
b.text:SetText(text)
b:SetScript("OnClick", function()
AQSV[key] = not AQSV[key]
b:SetChecked(AQSV[key])
if key == "enableItemBar" then
-- 装备栏的开关
if not AQSV.enableItemBar then
SELFAQ.bar:Hide()
else
SELFAQ.bar:Show()
end
end
if key == "enableBuff" then
-- 装备栏的开关
if not AQSV.enableBuff then
SELFAQ.buff:Hide()
else
SELFAQ.buff:Show()
end
end
if key == "locked" then
SELFAQ.lockItemBar()
end
if key == "buffLocked" then
SELFAQ.lockBuff()
end
if key == "hideBackdrop" then
SELFAQ.hideBackdrop()
end
if key == "reverseCooldownUnit" then
SELFAQ.renderQuickButton()
end
if key == "hideQuickButton" then
SELFAQ.renderQuickButton()
end
if key == "hideTakeoffButton" then
SELFAQ.renderQuickButton()
end
if key == "quickButtonLocked" then
SELFAQ.renderQuickButton()
end
end)
f.checkbox[key] = b
end
function buildSlotCheckbox(text, key, pos, x)
local b = CreateFrame("CheckButton", nil, f, "UICheckButtonTemplate")
b:SetPoint("TOPLEFT", f, x, pos)
b:SetChecked(AQSV.enableItemBarSlot[key])
b.text = b:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
b.text:SetPoint("LEFT", b, "RIGHT", 0, 0)
b.text:SetText(text)
b:SetScript("OnClick", function()
AQSV.enableItemBarSlot[key] = not AQSV.enableItemBarSlot[key]
b:SetChecked(AQSV.enableItemBarSlot[key])
end)
f.checkbox[key] = b
end
function buildLine( y )
local line = CreateFrame("Button", nil, f, "BackdropTemplate")
line:SetWidth(10)
line:SetHeight(1)
line:SetPoint("TOPLEFT", f, 53, y)
line:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background"});
line:SetBackdropColor(0.8,0.8,0.8,0.8);
end
buildCheckbox(SELFAQ.color("FF4500", L["Enable AutoEquip function"]), "enable", -60)
buildCheckbox(SELFAQ.color("FF4500", L["Enable Equipment Bar"]), "enableItemBar", -85)
buildCheckbox(L["Lock frame"], "locked", -85, 190)
buildCheckbox(L["Hide black translucent border"], "hideBackdrop", -110, 190)
do
local t = f:CreateFontString(nil, "ARTWORK", "GameFontNormal")
t:SetText(L["Zoom"])
t:SetPoint("TOPLEFT", f, 320, -93-10)
end
do
local t = f:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["#Effective after ENTER"])
t:SetPoint("TOPLEFT", f, 430, -93-10)
end
do
local e = CreateFrame("EditBox", nil, f, "InputBoxTemplate")
e:SetFontObject("GameFontHighlight")
e:SetWidth(50)
e:SetHeight(40)
e:SetJustifyH("CENTER")
e:SetPoint("TOPLEFT", f, 370, -80-10)
e:SetAutoFocus(false)
e:SetText(AQSV.barZoom)
e:SetCursorPosition(0)
e:SetScript("OnEnterPressed", function(self)
self:ClearFocus()
local v = self:GetText()
v = tonumber(v)
if not v then
v = 1
end
self:SetText(v)
AQSV.barZoom = v
SELFAQ.bar:SetScale(AQSV.barZoom)
end)
end
local slotCheckbosHeight = -115-25
buildSlotCheckbox(L["MainHand"], 16, slotCheckbosHeight, 45)
buildSlotCheckbox(L["OffHand"], 17, slotCheckbosHeight, 155)
buildSlotCheckbox(L["Ranged"], 18, slotCheckbosHeight, 265)
buildSlotCheckbox(L["Head"], 1, slotCheckbosHeight, 375)
buildSlotCheckbox(L["Neck"], 2, slotCheckbosHeight, 485)
slotCheckbosHeight = -140-25
buildSlotCheckbox(L["Shoulder"], 3, slotCheckbosHeight, 45)
buildSlotCheckbox(L["Chest"], 5, slotCheckbosHeight, 155)
buildSlotCheckbox(L["Waist"], 6, slotCheckbosHeight, 265)
buildSlotCheckbox(L["Legs"], 7, slotCheckbosHeight, 375)
buildSlotCheckbox(L["Feet"], 8, slotCheckbosHeight, 485)
slotCheckbosHeight = -165-25
buildSlotCheckbox(L["Wrist"], 9, slotCheckbosHeight, 45)
buildSlotCheckbox(L["Hands"], 10, slotCheckbosHeight, 155)
buildSlotCheckbox(L["Finger "]..1, 11, slotCheckbosHeight, 265)
buildSlotCheckbox(L["Finger "]..2, 12, slotCheckbosHeight, 375)
buildSlotCheckbox(L["Back"], 15, slotCheckbosHeight, 485)
do
local t = f:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["#The above selections will take effect after reloading UI"])
t:SetPoint("TOPLEFT", f, 53, -200-25)
end
local otherHight = -330
buildCheckbox(SELFAQ.color("FF4500", L["Enable Buff Alert"]), "enableBuff", otherHight+15+25)
buildCheckbox(L["Lock frame"], "buffLocked", otherHight+15+25, 190)
do
local t = f:CreateFontString(nil, "ARTWORK", "GameFontNormal")
t:SetText(L["Zoom"])
t:SetPoint("TOPLEFT", f, 320, otherHight+7+25)
end
do
local t = f:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["#Effective after ENTER"])
t:SetPoint("TOPLEFT", f, 430, otherHight+7+25)
end
do
local e = CreateFrame("EditBox", nil, f, "InputBoxTemplate")
e:SetFontObject("GameFontHighlight")
e:SetWidth(50)
e:SetHeight(40)
e:SetJustifyH("CENTER")
e:SetPoint("TOPLEFT", f, 370, otherHight+20+25)
e:SetAutoFocus(false)
e:SetText(AQSV.buffZoom)
e:SetCursorPosition(0)
e:SetScript("OnEnterPressed", function(self)
self:ClearFocus()
local v = self:GetText()
v = tonumber(v)
if not v then
v = 1
end
self:SetText(v)
AQSV.buffZoom = v
SELFAQ.buff:SetScale(AQSV.buffZoom)
end)
end
otherHight = -265
buildCheckbox(SELFAQ.color("FF4500", L["Separate Quick Button and move it separately (Need reload UI)"]), "splitQuickButton", otherHight+25)
buildCheckbox(L["Lock frame"], "quickButtonLocked", otherHight)
do
local t = f:CreateFontString(nil, "ARTWORK", "GameFontNormal")
t:SetText(L["Zoom"])
t:SetPoint("TOPLEFT", f, 320-130, otherHight-8)
end
do
local t = f:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["#Effective after ENTER"])
t:SetPoint("TOPLEFT", f, 430-130, otherHight-8)
end
do
local e = CreateFrame("EditBox", nil, f, "InputBoxTemplate")
e:SetFontObject("GameFontHighlight")
e:SetWidth(50)
e:SetHeight(40)
e:SetJustifyH("CENTER")
e:SetPoint("TOPLEFT", f, 370-130, otherHight+5)
e:SetAutoFocus(false)
e:SetText(AQSV.quickButtonZoom)
e:SetCursorPosition(0)
e:SetScript("OnEnterPressed", function(self)
self:ClearFocus()
local v = self:GetText()
v = tonumber(v)
if not v then
v = 1
end
self:SetText(v)
AQSV.quickButtonZoom = v
if SELFAQ.quickButton.split then
SELFAQ.quickButton:SetScale(AQSV.quickButtonZoom)
end
end)
end
otherHight = -335
buildCheckbox(SELFAQ.color("FF4500", L["Enable Quick Equip on charactor panel (Need reload UI)"]), "enableQuickEquip", otherHight+20)
buildCheckbox(SELFAQ.color("FF4500", L["Enable Minimap Icon (Need reload UI)"]), "enableMinimapIcon", otherHight-5)
otherHight = otherHight - 45 - 15 -25
do
local t = f:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["AutoEquip Function:"])
t:SetPoint("TOPLEFT", f, 25, otherHight+30)
end
otherHight = otherHight+5
buildCheckbox(L["Automatic switch to PVP queue in Battleground"], "enableBattleground", otherHight)
buildCheckbox(L["Disable Slot 2"], "disableSlot14", otherHight-25)
buildCheckbox(L["Equip item by priority forcibly even if the item in slot is aviilable"], "forcePriority", otherHight-50)
otherHight = otherHight-100
do
local t = f:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["Auto Acceleration Function:"])
t:SetPoint("TOPLEFT", f, 25, otherHight)
end
otherHight = otherHight-25
buildCheckbox(SELFAQ.color("FF4500", L["enable_carrot"]), "enableCarrot", otherHight)
buildCheckbox(SELFAQ.color("FF4500", L["enable_swim"]), "enableSwim", otherHight-25)
buildLine(otherHight-60+3)
buildCheckbox(L["When |cffffffffYou|r target an |cFFFF0000enemy|r, takeoff acceleration items"], "pauseAccWhenTarget", otherHight-60)
buildCheckbox(L["When |cffffffffYou|r target a |cFF00FF00friend|r, takeoff acceleration items"], "pauseAccWhenTargetFriend", otherHight-60-25)
buildCheckbox(L["When |cffffffffRaid members|r target |cFFFF0000enemies|r, takeoff acceleration items"], "pauseAccWhenTargetMember", otherHight-85-25)
buildLine(otherHight-120+3-25)
buildCheckbox(L["When equipment bar is locked, Auto Acceleration function also takes effect"], "forceAcc", otherHight-120-25)
buildLine(otherHight-155+3-25)
buildCheckbox(L["In Instance and Battleground, enable Auto Acceleration function"], "enableAccInstance", otherHight-155-25)
otherHight = otherHight-180-45
do
local t = f:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["Equipment Bar:"])
t:SetPoint("TOPLEFT", f, 25, otherHight)
end
buildCheckbox(L["Item queue is displayed above the Equipment Bar"], "reverseCooldownUnit", otherHight-25)
buildCheckbox(L["In combat |cFF00FF00shift + left-click|r equipment button to display the item list"], "shiftLeftShowDropdown", otherHight-50)
buildLine(otherHight-85+3)
buildCheckbox(L["Hide tooltip when the mouse moves over the button"], "hideTooltip", otherHight-85)
buildCheckbox(L["Show simple tooltip (only item name)"], "simpleTooltip", otherHight-110)
buildCheckbox(L["Hide item level on the item list (Need reload UI)"], "hideItemLevel", otherHight-135)
buildLine(otherHight-145+2-25)
buildCheckbox(L["Click Left button to equip trinket 1, Right button trinket 2"], "enableLR", otherHight-145-25)
otherHight = otherHight-145-45-25
do
local t = f:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["More:"])
t:SetPoint("TOPLEFT", f, 25, otherHight)
end
buildCheckbox(L["Hide popup addon info at the top of screen"], "hidePopupInfo", otherHight-25)
buildCheckbox(L["Hide addon info in the chat box"], "hideChatInfo", otherHight-50)
buildLine(otherHight-85+3)
buildCheckbox(L["Hide quick buttons"], "hideQuickButton", otherHight-85)
buildCheckbox(L["Disable the takeoff quick button"], "hideTakeoffButton", otherHight-110)
otherHight = otherHight - 110
do
local t = f:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["#When the equippable items you carry have changed"])
t:SetPoint("TOPLEFT", f, 135, otherHight-45)
local b = CreateFrame("Button", nil, f, "GameMenuButtonTemplate")
b:SetText(L["Reload UI"])
b:SetWidth(100)
b:SetHeight(30)
b:SetPoint("TOPLEFT", f, 23, otherHight-35)
b:SetScript("OnClick", function(self)
C_UI.Reload()
end)
end
do
local t = queueFrame:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["Go to 'General' page and add the unidentified usable items manually"])
t:SetPoint("TOPLEFT", queueFrame, 25, SELFAQ.lastHeightQueue)
end
do
local t = queueFrame:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
t:SetText(L["Not only trinkets, any equippable usable item is acceptable"])
t:SetPoint("TOPLEFT", queueFrame, 25, SELFAQ.lastHeightQueue - 25)
end
do
local b = CreateFrame("CheckButton", nil, queueFrame, "UICheckButtonTemplate")
b:SetPoint("TOPLEFT", queueFrame, 20, SELFAQ.lastHeightQueue - 50)
b:SetChecked(AQSV.enableRaidQueue)
b.text = b:CreateFontString(nil, "OVERLAY", "GameFontNormal")
b.text:SetPoint("LEFT", b, "RIGHT", 0, 0)
b.text:SetText(L["Enable Raid checkbox / Automatic switch to Raid queue in Instance"])
b:SetScript("OnClick", function()
AQSV.enableRaidQueue = not AQSV.enableRaidQueue
b:SetChecked(AQSV.enableRaidQueue)
for k,v in pairs(f.raidCheckbox) do
for k1,v1 in pairs(v) do
if AQSV.enableRaidQueue then
v1:Enable()
v1.dtext:Hide()
v1.text:Show()
else
v1:Disable()
v1.dtext:Show()
v1.text:Hide()
end
end
end
end)
end
SELFAQ.lastHeightQueue = SELFAQ.lastHeightQueue - 95
SELFAQ.loopSlots(buildDropdownGroup)
SELFAQ.lastHeight = otherHight - 40