-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOptions.lua
More file actions
1315 lines (1152 loc) · 54.2 KB
/
Copy pathOptions.lua
File metadata and controls
1315 lines (1152 loc) · 54.2 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
local addonName = ...
local BC = _G[addonName]
local L = _G[addonName .. 'Locale']
local isZh = GetLocale() == 'zhCN' or GetLocale() == 'zhTW'
local option = CreateFrame('Frame', addonName .. 'Option')
local category = Settings.RegisterCanvasLayoutCategory(option, addonName)
Settings.RegisterAddOnCategory(category)
-- 命令行
SlashCmdList[addonName] = function(msg)
if option[msg] then
Settings.OpenToCategory(option[msg].ID)
else
Settings.OpenToCategory(category.ID)
end
end
_G['SLASH_' .. addonName .. '1'] = '/bc'
-- 标题
function option:title(parent, text)
parent.title = parent:CreateFontString(nil, 'ARTWORK', 'GameFontNormalLarge')
parent.title:SetPoint('TOPLEFT', 16, -16)
parent.title:SetText(text)
end
-- 选项卡
option.list = BC.isClassic
and {
'player',
'pet',
'pettarget',
'target',
'targettarget',
'party',
'partypet',
'partytarget',
}
or {
'player',
'pet',
'pettarget',
'target',
'targettarget',
'focus',
'focustarget',
'party',
'partypet',
'partytarget',
}
for index, name in pairs(option.list) do
option[name] = CreateFrame('Frame', option:GetName() .. name:gsub('^%l', string.upper))
Settings.RegisterCanvasLayoutSubcategory(category, option[name], L[name])
option[name].ID = category.ID + index
option:title(option[name], L[name]:gsub('[├├─└─]', ''))
end
-- 暴雪变量修改
hooksecurefunc('SetCVar', function(name, value)
if name == 'alwaysCompareItems' then -- 启用装备对比
option.alwaysCompareItems:SetChecked(tostring(value) == '1')
elseif name == 'threatShowNumeric' then -- 显示威胁百分比
option.target.showThreat:SetChecked(tostring(value) == '1')
BC:setDB('target', 'showThreat', tostring(value) == '1')
elseif name == 'showTargetOfTarget' then -- 目标的目标
option.targettarget.hideFrame:SetChecked(tostring(value) == '0')
option.targettarget.hideFrame:Click()
elseif name == 'showPartyPets' then -- 队友宠物
option.partypet.hideFrame:SetChecked(tostring(value) == '0')
option.partypet.hideFrame:Click()
end
end)
local vertical = -31 -- 竖直间隔
local horizontal = 322 -- 水平间隔
-- 数值样式
function option:valueStyleList(...)
local list = {}
for _, i in pairs({ ... }) do
list[i] = L.valueStyleList[i]
end
list[10] = L.valueStyleList[10] -- 都不显示
return list
end
-- 战斗警告
function option:combatAlert(func)
if InCombatLockdown() then
if type(func) == 'function' then func() end
RaidNotice_AddMessage(RaidWarningFrame, '', { r = 1, g = 0, b = 0 })
RaidNotice_AddMessage(RaidWarningFrame, L['cantSaveInCombat'], { r = 1, g = 0, b = 0 })
return true
end
end
-- 勾选
function option:check(key, name, relative, offsetX, offsetY, text, click)
local parent = key == 'global' and self or self[key]
parent[name] = CreateFrame('CheckButton', parent:GetName() .. name:gsub('^%l', string.upper), parent, 'ChatConfigCheckButtonTemplate')
parent[name]:SetPoint('TOPLEFT', relative and parent[relative] or parent, offsetX or 0, offsetY or vertical)
_G[parent[name]:GetName() .. 'Text']:SetText(L[text or name])
parent[name].Click = type(click) == 'function' and click or function(self)
BC:setDB(key, name, self:GetChecked())
end
parent[name]:SetScript('OnClick', parent[name].Click)
hooksecurefunc(parent[name], 'SetEnabled', function(self, value)
if value then
_G[self:GetName() .. 'Text']:SetTextColor(1, 1, 1)
else
_G[self:GetName() .. 'Text']:SetTextColor(0.5, 0.5, 0.5)
end
end)
end
-- 拖动
function option:slider(key, name, relative, offsetX, offsetY, widht, height, lowText, highText, valueMin, valueMax, valueStep, change)
local parent = key == 'global' and self or self[key]
parent[name] =
CreateFrame('Slider', parent:GetName() .. name:gsub('^%l', string.upper), parent, 'BackdropTemplate, OptionsSliderTemplate')
parent[name]:SetPoint('TOPLEFT', relative and parent[relative] or parent, offsetX or 0, offsetY or vertical)
parent[name]:SetSize(widht or 180, height or 16)
parent[name].Low:SetText(lowText)
parent[name].High:SetText(highText)
parent[name]:SetMinMaxValues(valueMin, valueMax)
parent[name]:SetValueStep(valueStep)
parent[name]:SetBackdrop({
bgFile = 'Interface\\Buttons\\UI-SliderBar-Background',
edgeFile = 'Interface\\Buttons\\UI-SliderBar-Border',
tile = true,
tileSize = 8,
edgeSize = 8,
insets = { left = 3, right = 3, top = 6, bottom = 6 },
})
parent[name].Text =
parent:CreateFontString(parent:GetName() .. name:gsub('^%l', string.upper) .. 'Text', 'ARTWORK', 'GameFontNormalSmall')
parent[name].Text:SetPoint('CENTER', parent[name], 0, 16)
if type(change) == 'function' then parent[name]:SetScript('OnValueChanged', change) end
hooksecurefunc(parent[name], 'SetEnabled', function(self, value)
if value then
self.Text:SetTextColor(1, 0.82, 0)
self.Low:SetTextColor(1, 1, 1)
self.High:SetTextColor(1, 1, 1)
else
self.Text:SetTextColor(0.5, 0.5, 0.5)
self.Low:SetTextColor(0.5, 0.5, 0.5)
self.High:SetTextColor(0.5, 0.5, 0.5)
end
end)
end
-- 下拉菜单选项初始化
function option:downMenuInit(down, key, name, menus, width)
local text = _G[down:GetName() .. 'Text']
local function setFont(value)
if text and type(value) == 'string' and value:lower():match('%.ttf$') then text:SetFont(value, select(2, text:GetFont())) end
end
UIDropDownMenu_Initialize(down, function()
local sorted = {}
for i in pairs(menus) do
table.insert(sorted, i)
end
table.sort(sorted, function(a, b)
return a < b
end)
for _, i in ipairs(sorted) do
local info = UIDropDownMenu_CreateInfo()
local menu = menus[i]
if type(menu) == 'table' then
info.text = menu.text
info.value = menu.value
else
info.text = menu
info.value = i
end
info.func = function(self)
BC:setDB(key, name, self.value)
UIDropDownMenu_SetSelectedID(down, self:GetID())
setFont(self.value)
end
UIDropDownMenu_AddButton(info)
end
end)
UIDropDownMenu_SetSelectedValue(down, BC:getDB(key, name))
setFont(BC:getDB(key, name))
UIDropDownMenu_SetWidth(down, width and width or (isZh and 120 or 200))
end
-- 下拉菜单
function option:downMenu(key, name, menus, relative, offsetX, offsetY, width, show)
local parent = key == 'global' and self or self[key]
parent[name] = parent:CreateFontString(parent:GetName() .. name:gsub('^%l', string.upper), 'ARTWORK', 'GameFontNormalSmall')
parent[name]:SetPoint('TOPLEFT', relative and parent[relative] or parent, 'TOPLEFT', offsetX or 0, offsetY or vertical - 24)
parent[name]:SetText(L[name])
-- 下拉选择
parent[name .. 'Down'] = CreateFrame('Frame', parent[name]:GetName() .. 'Down', parent, 'UIDropDownMenuTemplate')
parent[name .. 'Down']:SetPoint('TOPLEFT', parent[name], -18, -16)
parent[name].OnShow = function(self)
local down = _G[self:GetName() .. 'Down']
if type(show) == 'function' then
show(down, key, name, menus)
else
option:downMenuInit(down, key, name, menus)
end
UIDropDownMenu_SetWidth(down, width and width or (isZh and 120 or 200))
end
parent[name].SetEnabled = function(self, enabled)
UIDropDownMenu_SetDropDownEnabled(_G[self:GetName() .. 'Down'], enabled)
if enabled then
self:SetTextColor(1, 0.82, 0)
else
self:SetTextColor(0.5, 0.5, 0.5)
end
end
end
-- 按钮
function option:button(key, name, relative, offsetX, offsetY, width, click)
local parent = key == 'global' and self or self[key]
parent[name] = CreateFrame('Button', parent:GetName() .. name:gsub('^%l', string.upper), parent, 'UIPanelButtonTemplate')
parent[name]:SetPoint('TOPLEFT', relative and parent[relative] or parent, offsetX or 0, offsetY or 0)
parent[name]:SetSize(width or 150, 25)
_G[parent[name]:GetName() .. 'Text']:SetText(L[name])
if type(click) == 'function' then parent[name]:SetScript('OnClick', click) end
end
-- 初始设置
function option:init()
self.dark:SetChecked(BC:getDB('global', 'dark')) -- 暗黑风格
self.newClassIcon:SetChecked(BC:getDB('global', 'newClassIcon')) -- 新风格职业图标
self.healthBarColor:SetChecked(BC:getDB('global', 'healthBarColor')) -- 体力条颜色按生命值变化
self.nameClassColor:SetChecked(BC:getDB('global', 'nameClassColor')) -- 名字颜色职业色(玩家)
-- 数值单位
local carry = BC:getDB('global', 'carry')
local carryCheck = carry == 1 or carry == 2
self.carry:SetChecked(carryCheck)
if isZh then
self.carrySlider:SetEnabled(carryCheck)
self.carrySlider:SetValue(carryCheck and carry or carry - 2)
else
self.carrySlider:Hide()
end
self.nameFont:OnShow() -- 名字字体
self.valueFont:OnShow() -- 数值字体
self.fontFlags:OnShow() -- 字体轮廓
self.config:OnShow() -- 选择配置
self.dragSystemFarmes:SetChecked(BC:getDB('global', 'dragSystemFarmes')) -- 自由拖动系统框体
self.incomingHeals:SetChecked(BC:getDB('global', 'incomingHeals')) -- 显示预配治疗
self.alwaysCompareItems:SetChecked(GetCVar('alwaysCompareItems') == '1') -- 启用装备对比
self.autoTab:SetChecked(BC:getDB('global', 'autoTab')) -- PVP自动TAB选择玩家
-- 切换天赋后装备天赋名套装
self.player.autoTalentEquip:SetChecked(BC:getDB('player', 'autoTalentEquip'))
self.player.autoTalentEquip:SetEnabled(BC:getDB('player', 'miniIcon'))
self.player.equipmentIcon:SetChecked(BC:getDB('player', 'equipmentIcon')) -- 显示装备小图标
self.player.hidePartyNumber:SetChecked(BC:getDB('player', 'hidePartyNumber')) -- 在团队中隐藏小队编号
-- 显示自定义德鲁伊法力条
if BC.class == 'DRUID' then
self.player.druidBar:SetChecked(BC:getDB('player', 'druidBar'))
else
self.player.druidBar:SetChecked(false)
self.player.druidBar:SetEnabled(false)
end
self.player.border:OnShow() -- 边框
self.player.portrait:OnShow() -- 头像
self.party.raidShowParty:SetChecked(BC:getDB('party', 'raidShowParty')) -- 团队显示小队框体
self.party.showLevel:SetChecked(BC:getDB('party', 'showLevel')) -- 显示等级
self.party.showCastBar:SetChecked(BC:getDB('party', 'showCastBar')) -- 显示施法条
for _, key in pairs(option.list) do
-- 隐藏框体
local hideFrame = self[key].hideFrame
if hideFrame then
hideFrame:SetChecked(BC:getDB(key, 'hideFrame'))
hideFrame:Click()
end
if self[key].portraitCombat then self[key].portraitCombat:SetChecked(BC:getDB(key, 'portraitCombat')) end -- 头像显示战斗信息
if self[key].combatFlash then self[key].combatFlash:SetChecked(BC:getDB(key, 'combatFlash')) end -- 战斗状态边框红光
if self[key].showThreat then self[key].showThreat:SetChecked(BC:getDB(key, 'showThreat')) end -- 显示威胁百分比
if self[key].portraitClass then self[key].portraitClass:SetChecked(BC:getDB(key, 'portrait') == 1) end -- 头像显示职业图标(玩家)
if self[key].miniIcon then self[key].miniIcon:SetChecked(BC:getDB(key, 'miniIcon')) end -- 显示小图标(职业/种类)
if self[key].outRange then self[key].outRange:SetChecked(BC:getDB(key, 'outRange')) end -- 超出范围半透明
if self[key].healthBarClass then self[key].healthBarClass:SetChecked(BC:getDB(key, 'healthBarClass')) end -- 体力条职业色(玩家)
if self[key].statusBarClass then self[key].statusBarClass:SetChecked(BC:getDB(key, 'statusBarClass')) end -- 状态栏背景职业色(玩家)
if self[key].statusBarAlpha then self[key].statusBarAlpha:SetValue(BC:getDB(key, 'statusBarAlpha')) end -- 状态栏透明度
if self[key].nameFontSize then self[key].nameFontSize:SetValue(BC:getDB(key, 'nameFontSize')) end -- 名字字体大小
if self[key].valueFontSize then self[key].valueFontSize:SetValue(BC:getDB(key, 'valueFontSize')) end -- 数值字体大小
if self[key].valueStyleDown then self[key].valueStyle:OnShow() end -- 数值样式
-- 隐藏名字
local hideName = self[key].hideName
if hideName then
hideName:SetChecked(BC:getDB(key, 'hideName'))
hideName:Click()
end
if self[key].drag then self[key].drag:SetChecked(BC:getDB(key, 'drag')) end -- 排战斗中按住Shift拖动
-- 锚定玩家框体
local anchor = self[key].anchor
local scale = self[key].scale -- 框体缩放
if anchor then
anchor:SetChecked(BC:getDB(key, 'anchor') == 'PlayerFrame')
if scale then scale:SetEnabled(BC:getDB(key, 'anchor') ~= 'PlayerFrame') end -- 框体缩放
end
if scale then scale:SetValue(BC:getDB(key, 'scale')) end -- 框体缩放
-- 只显示我施放的Buff/Debuff倒计时(OmniCC)
local hasOmniCC = type(OmniCC) == 'table'
if self[key].selfCooldown then
self[key].selfCooldown:SetChecked(hasOmniCC and BC:getDB(key, 'selfCooldown'))
self[key].selfCooldown:SetEnabled(hasOmniCC)
end
-- 只显示可以驱散的Buff/Debuff倒计时(OmniCC)
if self[key].dispelCooldown then
self[key].dispelCooldown:SetChecked(hasOmniCC and BC:getDB(key, 'dispelCooldown'))
self[key].dispelCooldown:SetEnabled(hasOmniCC)
end
if self[key].dispelStealable then self[key].dispelStealable:SetChecked(BC:getDB(key, 'dispelStealable')) end -- 高亮显示可以驱散的Buff/Debuff
if self[key].auraSize and BC:getDB(key, 'auraSize') then self[key].auraSize:SetValue(BC:getDB(key, 'auraSize')) end -- Buff/Debuff大小
if self[key].auraPercent and BC:getDB(key, 'auraPercent') then self[key].auraPercent:SetValue(BC:getDB(key, 'auraPercent')) end -- 其他人施放Buff/Debuff百分比
if self[key].auraRows and BC:getDB(key, 'auraRows') then self[key].auraRows:SetValue(BC:getDB(key, 'auraRows')) end -- 一行Buff/Debuff数量
if self[key].auraX and BC:getDB(key, 'auraX') then self[key].auraX:SetValue(BC:getDB(key, 'auraX')) end -- Buff/Debuf X轴位置
if self[key].auraY and BC:getDB(key, 'auraY') then self[key].auraY:SetValue(BC:getDB(key, 'auraY')) end -- Buff/Debuff Y轴位置
end
end
option:RegisterEvent('PLAYER_ENTERING_WORLD')
option:SetScript('OnEvent', function(self, event)
if event == 'PLAYER_ENTERING_WORLD' then self:init() end
end)
--[[ 全局设置 开始 ]]
option:title(option, addonName .. ' v' .. C_AddOns.GetAddOnMetadata(addonName, 'Version'))
option.info = option:CreateFontString(option:GetName() .. 'Info', 'ARTWORK', 'SystemFont_Small')
option.info:SetPoint('TOPLEFT', 17, vertical - 6)
option.info:SetTextColor(0.7, 0.7, 0.7)
option.info:SetText(L.info)
option:check('global', 'dark', 'title', -1, vertical - 8) -- 使用暗黑材质
option:check('global', 'newClassIcon', 'dark') -- 使用新职业图标
option:check('global', 'healthBarColor', 'newClassIcon') -- 体力条颜色按生命值变化
option:check('global', 'nameClassColor', 'healthBarColor') -- 名字颜色职业色(玩家)
-- 数值单位
option:check('global', 'carry', 'nameClassColor', nil, nil, nil, function(self)
local slider = option.carrySlider
if slider:IsShown() then
BC:setDB('global', 'carry', (self:GetChecked() and 0 or 2) + slider:GetValue())
option.carrySlider:SetEnabled(self:GetChecked())
else
BC:setDB('global', 'carry', self:GetChecked() and 2 or 0)
end
end)
option:slider('global', 'carrySlider', 'carry', 180, -4, 72, nil, L.carryK, L.carryW, 1, 2, 1, function(self, value)
value = (option.carry:GetChecked() and 0 or 2) + value
if value ~= BC:getDB('global', 'carry') then BC:setDB('global', 'carry', value) end
self:SetObeyStepOnDrag(true)
end)
option:downMenu('global', 'nameFont', L.fontList, 'carry', 3, vertical - 4) -- 名字字体
option:downMenu('global', 'valueFont', L.fontList, 'nameFont') -- 数值字体
option:downMenu('global', 'fontFlags', L.fontFlagsList, 'valueFont') -- 字体轮廓
-- 选择配置
option:downMenu(
'global',
'config',
{
[1] = {
text = L.public,
value = 'Public',
},
[2] = {
text = UnitClass('player'),
value = BC.class,
},
[3] = {
text = BC.charKey,
value = BC.charKey,
},
},
nil,
horizontal + 2,
-18,
180,
function(down, key, name, menus, width)
UIDropDownMenu_Initialize(down, function()
for i in pairs(menus) do
local info = UIDropDownMenu_CreateInfo()
info.text = menus[i].text
info.value = menus[i].value
info.func = function(self)
if option:combatAlert() then return end
BC:setDB('config', self.value)
UIDropDownMenu_SetSelectedID(down, self:GetID())
option:init()
end
UIDropDownMenu_AddButton(info)
end
end)
UIDropDownMenu_SetSelectedValue(down, BC:getDB('config'))
end
)
-- 重置
option:button('global', 'reset', 'configDown', 218, -0.5, 60, function()
if option:combatAlert() then return end
BC:comfing(L.confirmResetDefault, function()
SetCVar('alwaysCompareItems', '1')
BC:setDB('reset')
option:init()
end)
end)
option:check('global', 'dragSystemFarmes', nil, horizontal, vertical - 39) -- 自由拖动系统框体
option:check('global', 'incomingHeals', 'dragSystemFarmes') -- 显示预治疗
-- 启用装备对比
option:check('global', 'alwaysCompareItems', 'incomingHeals', nil, nil, nil, function(self)
SetCVar('alwaysCompareItems', self:GetChecked() and '1' or '0')
end)
option:check('global', 'autoTab', 'alwaysCompareItems') -- PVP自动TAB选择玩家
--[[ 全局设置 结束 ]]
--[[ 玩家设置 开始 ]]
option:check('player', 'portraitCombat', nil, 13, vertical - 8) -- 头像显示战斗信息
option:check('player', 'combatFlash', 'portraitCombat') -- 战斗状态边框红光
-- 显示天赋小图标(点击切换天赋)
option:check('player', 'miniIcon', 'combatFlash', nil, nil, 'talentIcon', function(self)
BC:setDB('player', 'miniIcon', self:GetChecked())
option.player.autoTalentEquip:SetEnabled(self:GetChecked())
end)
option:check('player', 'autoTalentEquip', 'miniIcon', 12, vertical + 4) -- 切换天赋后装备套装
option.player.autoTalentEquip:SetScale(0.9)
option:check('player', 'equipmentIcon', 'miniIcon', nil, vertical - 18) -- 显示装备小图标
option:check('player', 'hidePartyNumber', 'equipmentIcon') -- 在团队中隐藏小队编号
-- 显示自定义德鲁伊法力条
option:check('player', 'druidBar', 'hidePartyNumber')
option:check('player', 'healthBarClass', 'druidBar') -- 体力条职业色(玩家)
option:check('player', 'statusBarClass', 'healthBarClass') -- 状态栏背景职业色(玩家)
-- 名字字体大小
option:slider('player', 'nameFontSize', 'statusBarClass', 5, vertical - 16, nil, nil, 8, 18, 8, 18, 1, function(self, value)
value = floor(value + 0.5)
if value ~= BC:getDB('player', 'nameFontSize') then BC:setDB('player', 'nameFontSize', value) end
self.Text:SetText(L.nameFontSize .. ': ' .. value)
end)
-- 数值字体大小
option:slider('player', 'valueFontSize', 'nameFontSize', 0, vertical - 20, nil, nil, 8, 18, 8, 18, 1, function(self, value)
value = floor(value + 0.5)
if value ~= BC:getDB('player', 'valueFontSize') then BC:setDB('player', 'valueFontSize', value) end
self.Text:SetText(L.valueFontSize .. ': ' .. value)
end)
option:downMenu('player', 'valueStyle', L.valueStyleList, 'valueFontSize', -1, vertical - 8, 170) -- 数值样式
-- 恢复左上角位置
option:button('player', 'pointTargetLeftTop', nil, horizontal + 2, -20, nil, function()
if option:combatAlert() then return end
BC:setDB('player', 'relative', 'TOPLEFT')
BC:setDB('player', 'offsetX', -19)
BC:setDB('player', 'offsetY', -4)
BC:setDB('target', 'relative', 'TOPLEFT')
if BC:getDB('target', 'anchor') then
BC:setDB('target', 'offsetX', 299)
BC:setDB('target', 'offsetY', 3.5)
else
BC:setDB('target', 'offsetX', 280)
BC:setDB('target', 'offsetY', -0.5)
end
option.player.scale:SetValue(1)
option.target.scale:SetValue(1)
end)
-- 恢复水平居中位置
option:button('player', 'pointTargetCenter', 'pointTargetLeftTop', 154, 0, nil, function()
if option:combatAlert() then return end
BC:setDB('player', 'relative', 'CENTER')
BC:setDB('player', 'offsetX', -223)
BC:setDB('player', 'offsetY', -98)
if BC:getDB('target', 'anchor') then
BC:setDB('target', 'relative', 'TOPLEFT')
BC:setDB('target', 'offsetX', 446)
BC:setDB('target', 'offsetY', 0)
else
BC:setDB('target', 'relative', 'CENTER')
BC:setDB('target', 'offsetX', 223)
BC:setDB('target', 'offsetY', -98)
end
option.player.scale:SetValue(1)
option.target.scale:SetValue(1)
end)
option:check('player', 'drag', 'pointTargetLeftTop', -2, vertical - 4) -- 非战斗中按住Shift左击拖动
-- 框体缩放
option:slider('player', 'scale', 'drag', 4, vertical - 16, nil, nil, '50%', '150%', 0.5, 1.5, 0.05, function(self, value)
if option:combatAlert(function()
self:SetValue(BC:getDB('player', 'scale'))
end) then return end
value = floor(value * 100 + 0.5)
self.Text:SetText(L.scale .. ': ' .. value .. '%')
value = value / 100
if value ~= BC:getDB('player', 'scale') then BC:setDB('player', 'scale', value) end
if BC:getDB('target', 'anchor') then option.target.scale:SetValue(value) end
if not BC.isClassic and BC:getDB('focus', 'anchor') then option.focus.scale:SetValue(value) end
end)
option:downMenu('player', 'border', L.borderList, 'scale', -1, vertical - 8) -- 边框
option:downMenu('player', 'portrait', L.portraitList, 'border') -- 头像
--[[ 玩家设置 结束 ]]
--[[ 宠物设置 开始 ]]
option:check('pet', 'portraitCombat', nil, 13, vertical - 8) -- 头像显示战斗信息
-- 隐藏名字
option:check('pet', 'hideName', 'portraitCombat', nil, nil, nil, function(self, button)
if button then BC:setDB('pet', 'hideName', self:GetChecked()) end
if option.pet.nameFontSize then option.pet.nameFontSize:SetEnabled(not self:GetChecked()) end
end)
-- 名字字体大小
option:slider('pet', 'nameFontSize', 'hideName', 5, vertical - 16, nil, nil, 6, 16, 6, 16, 1, function(self, value)
value = floor(value + 0.5)
if value ~= BC:getDB('pet', 'nameFontSize') then BC:setDB('pet', 'nameFontSize', value) end
self.Text:SetText(L.nameFontSize .. ': ' .. value)
end)
-- 数值字体大小
option:slider('pet', 'valueFontSize', 'nameFontSize', 0, vertical - 20, nil, nil, 6, 16, 6, 16, 1, function(self, value)
value = floor(value + 0.5)
if value ~= BC:getDB('pet', 'valueFontSize') then BC:setDB('pet', 'valueFontSize', value) end
self.Text:SetText(L.valueFontSize .. ': ' .. value)
end)
option:downMenu('pet', 'valueStyle', option:valueStyleList(1, 2, 3, 4), 'valueFontSize', -1, vertical - 8, 170) -- 数值样式
-- 恢复默认位置
option:button('pet', 'pointDefault', nil, horizontal + 2, -20, nil, function()
if option:combatAlert() then return end
BC:setDB('pet', 'point', nil)
BC:setDB('pet', 'relative', nil)
BC:setDB('pet', 'offsetX', nil)
BC:setDB('pet', 'offsetY', nil)
end)
option:check('pet', 'drag', 'pointDefault', -2, vertical - 4) -- 非战斗中按住Shift左击拖动
--[[ 宠物设置 结束 ]]
--[[ 宠物的目标设置 开始 ]]
-- 隐藏框体
option:check('pettarget', 'hideFrame', nil, 13, vertical - 8, nil, function(self, button)
if option:combatAlert(function()
self:SetChecked(BC:getDB('pettarget', 'hideFrame'))
end) then return end
local enabled = self:GetChecked()
if button then BC:setDB('pettarget', 'hideFrame', enabled) end
enabled = not enabled
option.pettarget.portraitClass:SetEnabled(enabled)
option.pettarget.healthBarClass:SetEnabled(enabled)
option.pettarget.outRange:SetEnabled(enabled)
option.pettarget.hideName:SetEnabled(enabled)
option.pettarget.nameFontSize:SetEnabled(enabled and not BC:getDB('pettarget', 'hideName'))
option.pettarget.valueFontSize:SetEnabled(enabled)
option.pettarget.valueStyle:SetEnabled(enabled)
end)
-- 头像显示职业图标(玩家)
option:check('pettarget', 'portraitClass', 'hideFrame', nil, nil, nil, function(self)
BC:setDB('pettarget', 'portrait', self:GetChecked() and 1 or 0)
end)
option:check('pettarget', 'healthBarClass', 'portraitClass') -- 体力条职业色(玩家)
option:check('pettarget', 'outRange', 'healthBarClass') -- 超出范围半透明
-- 隐藏名字
option:check('pettarget', 'hideName', 'outRange', nil, nil, nil, function(self, button)
if button then BC:setDB('pettarget', 'hideName', self:GetChecked()) end
if option.pettarget.nameFontSize then option.pettarget.nameFontSize:SetEnabled(not self:GetChecked()) end
end)
-- 名字字体大小
option:slider('pettarget', 'nameFontSize', 'hideName', 5, vertical - 16, nil, nil, 6, 16, 6, 16, 1, function(self, value)
value = floor(value + 0.5)
if value ~= BC:getDB('pettarget', 'nameFontSize') then BC:setDB('pettarget', 'nameFontSize', value) end
self.Text:SetText(L.nameFontSize .. ': ' .. value)
end)
-- 数值字体大小
option:slider('pettarget', 'valueFontSize', 'nameFontSize', 0, vertical - 20, nil, nil, 6, 16, 6, 16, 1, function(self, value)
value = floor(value + 0.5)
if value ~= BC:getDB('pettarget', 'valueFontSize') then BC:setDB('pettarget', 'valueFontSize', value) end
self.Text:SetText(L.valueFontSize .. ': ' .. value)
end)
option:downMenu('pettarget', 'valueStyle', option:valueStyleList(2, 3, 5, 7, 8), 'valueFontSize', -1, vertical - 8, 170) -- 数值样式
--[[ 宠物的目标设置 结束 ]]
--[[ 目标设置 开始 ]]
option:check('target', 'portraitCombat', nil, 13, vertical - 8) -- 头像显示战斗信息
option:check('target', 'combatFlash', 'portraitCombat') -- 战斗状态边框红光
option:check('target', 'showThreat', 'combatFlash') -- 显示威胁百分比
-- 头像显示职业图标(玩家)
option:check('target', 'portraitClass', 'showThreat', nil, nil, nil, function(self)
BC:setDB('target', 'portrait', self:GetChecked() and 1 or 0)
end)
option:check('target', 'miniIcon', 'portraitClass') -- 显示职业小图标(玩家)/NPC种类小图标
option:check('target', 'healthBarClass', 'miniIcon') -- 体力条职业色(玩家)
option:check('target', 'statusBarClass', 'healthBarClass') -- 状态栏背景职业色(玩家)
-- 状态栏透明度
option:slider('target', 'statusBarAlpha', 'statusBarClass', 5, vertical - 16, nil, nil, '0', '1', 0, 1, 0.05, function(self, value)
value = floor(value * 20) / 20
if value ~= BC:getDB('target', 'statusBarAlpha') then BC:setDB('target', 'statusBarAlpha', value) end
self.Text:SetText(L.statusBarAlpha .. ': ' .. value)
end)
-- 名字字体大小
option:slider('target', 'nameFontSize', 'statusBarAlpha', 0, vertical - 20, nil, nil, 8, 18, 8, 18, 1, function(self, value)
value = floor(value + 0.5)
if value ~= BC:getDB('target', 'nameFontSize') then BC:setDB('target', 'nameFontSize', value) end
self.Text:SetText(L.nameFontSize .. ': ' .. value)
end)
-- 数值字体大小
option:slider('target', 'valueFontSize', 'nameFontSize', 0, vertical - 20, nil, nil, 8, 18, 8, 18, 1, function(self, value)
value = floor(value + 0.5)
if value ~= BC:getDB('target', 'valueFontSize') then BC:setDB('target', 'valueFontSize', value) end
self.Text:SetText(L.valueFontSize .. ': ' .. value)
end)
option:downMenu('target', 'valueStyle', L.valueStyleList, 'valueFontSize', -1, vertical - 8, 170) -- 数值样式
-- 和玩家框体水平对齐
option:button('target', 'pointPlayerAlignment', nil, horizontal + 2, -20, 160, function()
if option:combatAlert() then return end
if BC:getDB('target', 'anchor') then
BC:setDB('target', 'offsetY', 3.5)
else
local relative = BC:getDB('player', 'relative')
local offsetX
if string.match(relative, 'LEFT') then
offsetX = TargetFrame:GetLeft()
elseif string.match(relative, 'RIGHT') then
offsetX = TargetFrame:GetRight() - UIParent:GetWidth()
else
offsetX = TargetFrame:GetLeft() - (UIParent:GetWidth() - TargetFrame:GetWidth()) / 2
end
BC:setDB('target', 'relative', relative)
BC:setDB('target', 'offsetX', floor(offsetX * 10 + 0.5) / 10)
BC:setDB('target', 'offsetY', BC:getDB('player', 'offsetY') + 3.5)
end
end)
-- 和玩家框体水平居中
option:button('target', 'pointPlayerCenter', 'pointPlayerAlignment', 164, 0, 160, function()
if option:combatAlert() then return end
local relative
if BC:getDB('target', 'anchor') then
relative = PlayerFrame:GetPoint()
if string.match(relative, 'TOP') then
relative = 'TOPLEFT'
elseif string.match(relative, 'BOTTOM') then
relative = 'BOTTOMLEFT'
else
relative = 'LEFT'
end
BC:setDB('player', 'relative', relative)
local scale = BC:getDB('player', 'scale')
BC:setDB(
'player',
'offsetX',
floor(UIParent:GetWidth() - BC:getDB('target', 'offsetX') * scale - TargetFrame:GetWidth() * scale + 0.5) / scale / 2
)
BC:setDB('target', 'offsetY', 3.5)
else
relative = BC:getDB('player', 'relative')
if string.match(relative, 'TOP') then
relative = 'TOP'
elseif string.match(relative, 'BOTTOM') then
relative = 'BOTTOM'
else
relative = 'CENTER'
end
local offsetX = floor(PlayerFrame:GetLeft() / 2 - TargetFrame:GetLeft() / 2 + 0.5)
BC:setDB('player', 'relative', relative)
BC:setDB('player', 'offsetX', offsetX)
BC:setDB('target', 'relative', relative)
BC:setDB('target', 'offsetX', -offsetX)
BC:setDB('target', 'offsetY', BC:getDB('player', 'offsetY') + 3.5)
end
end)
option:check('target', 'drag', 'pointPlayerAlignment', -2, vertical - 4) -- 非战斗中按住Shift左击拖动
-- 锚定玩家框体
option:check('target', 'anchor', 'drag', nil, nil, nil, function(self)
option.player.scale:SetValue(1)
BC:setDB('player', 'scale', 1)
option.target.scale:SetValue(1)
BC:setDB('target', 'scale', 1)
local offsetX, offsetY
if self:GetChecked() then
offsetX = TargetFrame:GetLeft() - PlayerFrame:GetLeft()
offsetY = TargetFrame:GetTop() - PlayerFrame:GetTop()
option.target.scale:SetEnabled(false)
BC:setDB('target', 'anchor', 'PlayerFrame')
else
offsetX = TargetFrame:GetLeft()
offsetY = TargetFrame:GetTop() - UIParent:GetHeight()
option.target.scale:SetEnabled(true)
BC:setDB('target', 'anchor', nil)
end
BC:setDB('target', 'relative', 'TOPLEFT')
BC:setDB('target', 'offsetX', floor(offsetX * 10 + 0.5) / 10)
BC:setDB('target', 'offsetY', floor(offsetY * 10 + 0.5) / 10)
end)
-- 框体缩放
option:slider('target', 'scale', 'anchor', 5, vertical - 16, nil, nil, '50%', '150%', 0.5, 1.5, 0.05, function(self, value)
if option:combatAlert(function()
self:SetValue(BC:getDB('target', 'scale'))
end) then return end
value = floor(value * 100 + 0.5)
self.Text:SetText(L.scale .. ': ' .. value .. '%')
value = value / 100
if value ~= BC:getDB('target', 'scale') then BC:setDB('target', 'scale', value) end
end)
option:check('target', 'selfCooldown', 'scale', -4, vertical - 8) -- 只显示我施放的Buff/Debuff倒计时(OmniCC)
option:check('target', 'dispelCooldown', 'selfCooldown') -- 只显示可以驱散的Buff/Debuff倒计时(OmniCC)
option:check('target', 'dispelStealable', 'dispelCooldown') -- 高亮显示可以驱散的Buff/Debuff
-- Buff/Debuff大小
option:slider('target', 'auraSize', 'dispelStealable', 4, vertical - 20, 250, nil, 12, 64, 12, 64, 1, function(self, value)
value = floor(value)
self.Text:SetText(L.auraSize .. ': ' .. value)
if value ~= BC:getDB('target', 'auraSize') then BC:setDB('target', 'auraSize', value) end
end)
-- 其他人施放Buff/Debuff百分比
option:slider('target', 'auraPercent', 'auraSize', 4, vertical - 20, 250, nil, '50%', '100%', 0.5, 1, 0.05, function(self, value)
value = floor(value * 100 + 0.5)
self.Text:SetText(L.auraPercent .. ': ' .. value .. '%')
value = value / 100
if value ~= BC:getDB('target', 'auraPercent') then BC:setDB('target', 'auraPercent', value) end
end)
-- 一行Buff/Debuff数量
option:slider('target', 'auraRows', 'auraPercent', 0, vertical - 20, nil, nil, 1, 32, 1, 32, 1, function(self, value)
value = floor(value)
self.Text:SetText(L.auraRows .. ': ' .. value)
if value ~= BC:getDB('target', 'auraRows') then BC:setDB('target', 'auraRows', value) end
end)
-- Buff/Debuf起始X轴位置
option:slider('target', 'auraX', 'auraRows', 0, vertical - 20, nil, nil, -256, 256, -256, 256, 1, function(self, value)
value = floor(value)
self.Text:SetText(L.auraX .. ': ' .. value)
if value ~= BC:getDB('target', 'auraX') then BC:setDB('target', 'auraX', value) end
end)
-- Buff/Debuf起始Y轴位置
option:slider('target', 'auraY', 'auraX', 0, vertical - 20, nil, nil, -256, 256, -256, 256, 1, function(self, value)
value = floor(value)
self.Text:SetText(L.auraY .. ': ' .. value)
if value ~= BC:getDB('target', 'auraY') then BC:setDB('target', 'auraY', value) end
end)
--[[ 目标设置 结束 ]]
--[[ 目标的目标设置 开始 ]]
-- 隐藏框体
option:check('targettarget', 'hideFrame', nil, 13, vertical - 8, nil, function(self, button)
if option:combatAlert(function()
self:SetChecked(BC:getDB('targettarget', 'hideFrame'))
end) then return end
local enabled = self:GetChecked()
if button then BC:setDB('targettarget', 'hideFrame', enabled) end
enabled = not enabled
option.targettarget.portraitClass:SetEnabled(enabled)
option.targettarget.healthBarClass:SetEnabled(enabled)
option.targettarget.outRange:SetEnabled(enabled)
option.targettarget.hideName:SetEnabled(enabled)
option.targettarget.nameFontSize:SetEnabled(enabled and not BC:getDB('targettarget', 'hideName'))
option.targettarget.valueFontSize:SetEnabled(enabled)
option.targettarget.valueStyle:SetEnabled(enabled)
option.targettarget.pointDefault:SetEnabled(enabled)
option.targettarget.drag:SetEnabled(enabled)
end)
-- 头像显示职业图标(玩家)
option:check('targettarget', 'portraitClass', 'hideFrame', nil, nil, nil, function(self)
BC:setDB('targettarget', 'portrait', self:GetChecked() and 1 or 0)
end)
option:check('targettarget', 'healthBarClass', 'portraitClass') -- 体力条职业色(玩家)
option:check('targettarget', 'outRange', 'healthBarClass') -- 超出范围半透明
-- 隐藏名字
option:check('targettarget', 'hideName', 'outRange', nil, nil, nil, function(self, button)
if button then BC:setDB('targettarget', 'hideName', self:GetChecked()) end
if option.targettarget.nameFontSize then option.targettarget.nameFontSize:SetEnabled(not self:GetChecked()) end
end)
-- 名字字体大小
option:slider('targettarget', 'nameFontSize', 'hideName', 5, vertical - 16, nil, nil, 6, 16, 6, 16, 1, function(self, value)
value = floor(value + 0.5)
self.Text:SetText(L.nameFontSize .. ': ' .. value)
if value ~= BC:getDB('targettarget', 'nameFontSize') then BC:setDB('targettarget', 'nameFontSize', value) end
end)
-- 数值字体大小
option:slider('targettarget', 'valueFontSize', 'nameFontSize', 0, vertical - 20, nil, nil, 6, 16, 6, 16, 1, function(self, value)
value = floor(value + 0.5)
self.Text:SetText(L.valueFontSize .. ': ' .. value)
if value ~= BC:getDB('targettarget', 'valueFontSize') then BC:setDB('targettarget', 'valueFontSize', value) end
end)
option:downMenu('targettarget', 'valueStyle', option:valueStyleList(2, 3, 7, 8), 'valueFontSize', -1, vertical - 8, 170) -- 数值样式
-- 恢复默认位置
option:button('targettarget', 'pointDefault', nil, horizontal + 2, -20, nil, function()
if option:combatAlert() then return end
BC:setDB('targettarget', 'point', nil)
BC:setDB('targettarget', 'relative', nil)
BC:setDB('targettarget', 'offsetX', nil)
BC:setDB('targettarget', 'offsetY', nil)
end)
option:check('targettarget', 'drag', 'pointDefault', -2, vertical - 4) -- 非战斗中按住Shift左击拖动
--[[ 目标的目标设置 结束 ]]
if not BC.isClassic then
--[[ 焦点设置 开始 ]]
option:check('focus', 'portraitCombat', nil, 13, vertical - 8) -- 头像显示战斗信息
option:check('focus', 'combatFlash', 'portraitCombat') -- 战斗状态边框红光
option:check('focus', 'showThreat', 'combatFlash') -- 显示威胁百分比
-- 头像显示职业图标(玩家)
option:check('focus', 'portraitClass', 'showThreat', nil, nil, nil, function(self)
BC:setDB('focus', 'portrait', self:GetChecked() and 1 or 0)
end)
option:check('focus', 'miniIcon', 'portraitClass') -- 显示职业小图标(玩家)/NPC种类小图标
option:check('focus', 'healthBarClass', 'miniIcon') -- 体力条职业色(玩家)
option:check('focus', 'statusBarClass', 'healthBarClass') -- 状态栏背景职业色(玩家)
-- 状态栏透明度
option:slider('focus', 'statusBarAlpha', 'statusBarClass', 5, vertical - 16, nil, nil, '0', '1', 0, 1, 0.05, function(self, value)
value = floor(value * 20) / 20
if value ~= BC:getDB('focus', 'statusBarAlpha') then BC:setDB('focus', 'statusBarAlpha', value) end
self.Text:SetText(L.statusBarAlpha .. ': ' .. value)
end)
-- 名字字体大小
option:slider('focus', 'nameFontSize', 'statusBarAlpha', 0, vertical - 20, nil, nil, 8, 18, 8, 18, 1, function(self, value)
value = floor(value + 0.5)
if value ~= BC:getDB('focus', 'nameFontSize') then BC:setDB('focus', 'nameFontSize', value) end
self.Text:SetText(L.nameFontSize .. ': ' .. value)
end)
-- 数值字体大小
option:slider('focus', 'valueFontSize', 'nameFontSize', 0, vertical - 20, nil, nil, 8, 18, 8, 18, 1, function(self, value)
value = floor(value + 0.5)
if value ~= BC:getDB('focus', 'valueFontSize') then BC:setDB('focus', 'valueFontSize', value) end
self.Text:SetText(L.valueFontSize .. ': ' .. value)
end)
option:downMenu('focus', 'valueStyle', L.valueStyleList, 'valueFontSize', -1, vertical - 8, 170) -- 数值样式
-- 和玩家框体水平对齐
option:button('focus', 'pointPlayerAlignment', nil, horizontal + 2, -20, 160, function()
if option:combatAlert() then return end
if BC:getDB('focus', 'anchor') then
BC:setDB('focus', 'offsetY', 3.5)
else
local relative = BC:getDB('player', 'relative')
local offsetX
if string.match(relative, 'LEFT') then
offsetX = FocusFrame:GetLeft()
elseif string.match(relative, 'RIGHT') then
offsetX = FocusFrame:GetRight() - UIParent:GetWidth()
else
offsetX = FocusFrame:GetLeft() - (UIParent:GetWidth() - FocusFrame:GetWidth()) / 2
end
BC:setDB('focus', 'relative', relative)
BC:setDB('focus', 'offsetX', floor(offsetX * 10 + 0.5) / 10)
BC:setDB('focus', 'offsetY', BC:getDB('player', 'offsetY') + 3.5)
end
end)
-- 和玩家框体垂直对齐
option:button('focus', 'pointPlayerVertical', 'pointPlayerAlignment', 164, 0, 160, function()
if option:combatAlert() then return end
if BC:getDB('focus', 'anchor') then
BC:setDB('focus', 'offsetX', 24)
else
local relative = BC:getDB('player', 'relative')
local offsetY
if string.match(relative, 'TOP') then
offsetY = FocusFrame:GetTop() - UIParent:GetHeight()
elseif string.match(relative, 'BOTTOM') then
offsetY = FocusFrame:GetBottom()
else
offsetY = FocusFrame:GetTop() - (UIParent:GetHeight() + FocusFrame:GetHeight()) / 2
end
BC:setDB('focus', 'relative', relative)
BC:setDB('focus', 'offsetX', BC:getDB('player', 'offsetX') + 24)
BC:setDB('focus', 'offsetY', floor(offsetY * 10 + 0.5) / 10)
end
end)
option:check('focus', 'drag', 'pointPlayerAlignment', -2, vertical - 4) -- 非战斗中按住Shift左击拖动
-- 锚定玩家框体
option:check('focus', 'anchor', 'drag', nil, nil, nil, function(self)
option.player.scale:SetValue(1)
BC:setDB('player', 'scale', 1)
option.focus.scale:SetValue(1)
BC:setDB('focus', 'scale', 1)
local offsetX, offsetY
if self:GetChecked() then
offsetX = FocusFrame:GetLeft() - PlayerFrame:GetLeft()
offsetY = FocusFrame:GetTop() - PlayerFrame:GetTop()
option.focus.scale:SetEnabled(false)
BC:setDB('focus', 'anchor', 'PlayerFrame')
else
offsetX = FocusFrame:GetLeft()
offsetY = FocusFrame:GetTop() - UIParent:GetHeight()
option.focus.scale:SetEnabled(true)
BC:setDB('focus', 'anchor', nil)
end
BC:setDB('focus', 'relative', 'TOPLEFT')
BC:setDB('focus', 'offsetX', floor(offsetX * 10 + 0.5) / 10)
BC:setDB('focus', 'offsetY', floor(offsetY * 10 + 0.5) / 10)
end)
-- 框体缩放
option:slider('focus', 'scale', 'anchor', 5, vertical - 16, nil, nil, '50%', '150%', 0.5, 1.5, 0.05, function(self, value)
if option:combatAlert(function()
self:SetValue(BC:getDB('focus', 'scale'))
end) then return end
value = floor(value * 100 + 0.5)
self.Text:SetText(L.scale .. ': ' .. value .. '%')
value = value / 100
if value ~= BC:getDB('focus', 'scale') then BC:setDB('focus', 'scale', value) end
end)
option:check('focus', 'selfCooldown', 'scale', -4, vertical - 8) -- 只显示我施放的Buff/Debuff倒计时(OmniCC)
option:check('focus', 'dispelCooldown', 'selfCooldown') -- 只显示可以驱散的Buff/Debuff倒计时(OmniCC)
option:check('focus', 'dispelStealable', 'dispelCooldown') -- 高亮显示可以驱散的Buff/Debuff
-- 自己施放的Buff/Debuff大小
option:slider('focus', 'auraSize', 'dispelStealable', 4, vertical - 20, 250, nil, 12, 64, 12, 64, 1, function(self, value)
value = floor(value)
self.Text:SetText(L.auraSize .. ': ' .. value)
if value ~= BC:getDB('focus', 'auraSize') then BC:setDB('focus', 'auraSize', value) end
end)
-- 其他人施放Buff/Debuff百分比
option:slider('focus', 'auraPercent', 'auraSize', 4, vertical - 20, 250, nil, '50%', '100%', 0.5, 1, 0.05, function(self, value)
value = floor(value * 100 + 0.5)
self.Text:SetText(L.auraPercent .. ': ' .. value .. '%')
value = value / 100
if value ~= BC:getDB('focus', 'auraPercent') then BC:setDB('focus', 'auraPercent', value) end
end)
-- 一行Buff/Debuff数量
option:slider('focus', 'auraRows', 'auraPercent', 0, vertical - 20, nil, nil, 1, 32, 1, 32, 1, function(self, value)
value = floor(value)
self.Text:SetText(L.auraRows .. ': ' .. value)
if value ~= BC:getDB('focus', 'auraRows') then BC:setDB('focus', 'auraRows', value) end