/
config.lua
1464 lines (1380 loc) · 57.5 KB
/
config.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
local function whitelist_init()
if BFWC_Filter_SavedConfigs.whitelist then
return
end
BFWC_Filter_SavedConfigs.whitelist = { }
end
local function is_exists(tbl,key)
for _,k in ipairs(tbl) do
if k == key then
return true
end
end
return false
end
local function blacklist_init()
if BFWC_Filter_SavedConfigs_G.blacklist then
return
end
BFWC_Filter_SavedConfigs_G.blacklist = {
'一组','/组','邮寄','U寄','大量','带价','代价','位面','老板','支付',
'VX','免费','ZFB','收G','无限收','大米','小米','G收','全区服','内销',
'G团'
}
end
local bf_channels={}
local function dungeons_init()
BFWC_Filter_SavedConfigs.dungeons = {}
if bfwf_player.level and bfwf_player.level>0 and BFWC_Filter_SavedConfigs.auto_filter_by_level then
local lv = bfwf_player.level
for _,d in ipairs(bfwf_dungeons) do
if lv>=d.lmin and lv<= d.lmax then
BFWC_Filter_SavedConfigs.dungeons[d.name] = true
else
BFWC_Filter_SavedConfigs.dungeons[d.name] = false
end
end
end
end
local reset_width = false
local reset_height = false
local function reset_configs_character()
reset_width = true
reset_height = true
BFWC_Filter_SavedConfigs = {
saved = true,
enable = true,
interval = 10,
dlg_width = 900,
dlg_height = 600,
hide_enter_leave = true,
auto_filter_by_level = true,
filter_request_to_join = true,
autojoin_bigfoot = true,
minimap = { hide = false},
player = {},
dungeons = {},
white_to_chatframe_color={a=1,r=0.937,g=0.138,b=0.883},
blacklist_enable = true,
remain_unchanged_msg = false
}
BFWC_Filter_SavedConfigs.white_to_chatframe = true
BFWC_Filter_SavedConfigs.white_to_chatframe_color={a=1,r=0.702,g=0.941,b=0.906,hex='ffb3f0e7'}
dungeons_init()
whitelist_init()
end
StaticPopupDialogs['BFWC_CONFIRM'] = {
text = '',
button1 = '是',
button2 = '取消',
timeout = 0,
showAlert = true,
whileDead = true,
preferredIndex = STATICPOPUP_NUMDIALOGS,
OnAccept = function(self)
end
}
StaticPopupDialogs['BFWC_MSGBOX'] = {
text = '',
button1 = '好的'
}
function bfwf_msgbox(msg)
StaticPopupDialogs['BFWC_MSGBOX'].text = msg
local dlg = StaticPopup_Show('BFWC_MSGBOX')
if dlg then
--不设置成tooltip,会被设置窗口遮挡
dlg:SetFrameStrata("TOOLTIP")
end
end
function bfwf_confirm(msg,yes,no,func)
StaticPopupDialogs['BFWC_CONFIRM'].text = msg
if yes and yes:len()>0 then
StaticPopupDialogs['BFWC_CONFIRM'].button1 = yes
else
StaticPopupDialogs['BFWC_CONFIRM'].button1 = '是'
end
if no and no:len()>0 then
StaticPopupDialogs['BFWC_CONFIRM'].button2 = no
else
StaticPopupDialogs['BFWC_CONFIRM'].button2 = '取消'
end
StaticPopupDialogs['BFWC_CONFIRM'].OnAccept = func
local dlg = StaticPopup_Show('BFWC_CONFIRM',"","")
if dlg then
--不设置成tooltip,会被设置窗口遮挡
dlg:SetFrameStrata("TOOLTIP")
end
end
local send_msg_time = {
}
local classes = {
['ROGUE']={'盗贼','盗贼','盗贼'},
['SHAMAN']={'萨满','奶萨','萨满'},
['PRIEST']={'牧师','奶牧','牧师'},
['WARLOCK']={'术士','术士','术士'},
['MAGE']={'法师','法师','法师'},
['HUNTER']={'猎人','猎人','猎人'},
['DRUID']={'德鲁伊','奶德','熊T'},
['PALADIN']={'骑士','奶骑','骑士T'},
['WARRIOR']={'战士','战士','战士T'},
}
function bfwf_myinfo(d1,d2)
local info = ''
local level = UnitLevel("player")
if level and level<60 then
info = info .. level .. '级'
end
local class = classes[bfwf_player.class]
if bfwf_player.classes == 1 then
info = info .. class[1]
return info
end
--local d1 = BFWC_Filter_SavedConfigs.player[bfwf_g_data.myid].first_duty
if d1=='T' then
info = info .. class[3]
elseif d1=='N' then
info = info .. class[2]
else
info = info .. class[1]
end
--local d2 = BFWC_Filter_SavedConfigs.player[bfwf_g_data.myid].second_duty
if not d2 or d2=='X' or d2==d1 then
return info
end
if d2=='D' then
info = info .. ',也可以DPS'
elseif d2=='N' then
info = info .. ',也可以奶'
elseif d2=='T' then
info = info .. ',也可以T'
end
return info
end
local last_select_team_leader
local last_whisper = {}
local function whisper_level_duty()
if not last_select_team_leader then
return
end
local d1 = BFWC_Filter_SavedConfigs.player[bfwf_g_data.myid].first_duty
local d2 = BFWC_Filter_SavedConfigs.player[bfwf_g_data.myid].second_duty
if bfwf_player.classes == 1 then
d1 = 'D'
end
if not d1 then
d1 = 'D'
--bfwf_msgbox('先选择你的职责')
--return
end
local dt = GetTime()-(last_whisper[last_select_team_leader.id] or 0)
if dt < 60 then
bfwf_msgbox('您刚给Ta发过申请,等会再发吧!')
return
end
local info = bfwf_myinfo(d1,d2)
if BFWC_Filter_SavedConfigs.addition_msg and string.len(BFWC_Filter_SavedConfigs.addition_msg)>0 then
info = info .. ',' .. BFWC_Filter_SavedConfigs.addition_msg
end
local msg = '是否将您的信息\n|cffff7eff' .. info .. '|r\n发送给 |cffbb9e75' .. last_select_team_leader.name .. '|r ?'
bfwf_confirm(msg,nil,nil,function ()
SendChatMessage(info,"WHISPER", nil,last_select_team_leader.name)
last_whisper[last_select_team_leader.id] = GetTime()
end)
end
local function hex_color(r,g,b,a)
local hex = string.format('%x',math.floor(255*a))
hex = hex .. string.format('%x',math.floor(255*r))
hex = hex .. string.format('%x',math.floor(255*g))
hex = hex .. string.format('%x',math.floor(255*b))
return hex
end
local debug_data = {}
local creating_team = false
-- https://www.wowace.com/projects/ace3/pages/ace-config-3-0-options-tables
local config_options = {
type = 'group',
name = '组队频道信息过滤器',
args = {
desc = {
type = 'group',
name = '说明',
order = 1,
args ={
desc1 = {
type = 'description',
name = '|cffbb9e75从v1.0.5开始,为了避免重复造轮子,插件功能以【组队助手】为主,\n\n信息过滤仅作为辅助功能\n\n' ..
'黑名单的信息会从【大脚世界频道】和【寻求组队】这两个频道过滤掉。\n\n' ..
'白名单信息(包括选中的副本)会从这两个频道提取到【找队伍】的列表里\n\n' ..
'玩家如果需要频道信息过滤功能,可以用其他频道信息过滤插件。|r\n\n' ..
'副本关键词及建议等级不一定准确,欢迎到\n\nhttps://github.com/guoyongshi/BFFilter 或者NGA(maliangys)给我反馈。\n\n' ..
'|cffffd100当前版本:'.. (GetAddOnMetadata('BFFilter','Version') or '??') .. '|r',
order = 1,
},
}
},
bfchannels={
type = 'group',
name = '大脚世界频道[|cffaa0000重要|r]',
order = 1.1,
args = {
desc= {
type = 'description',
name = '|cffffd100说明:本插件依赖于大脚世界频道,不加入大脚世界频道,本插件是无法正常工作的。\n\n' ..
'但不同的服务器,使用的大脚世界频道不太一样,有的是大脚世界频道,有的是大脚世界频道1,有的是大脚世界频道2。。。,或者同时使用多个\n\n' ..
'如果本插件无法自动加入大脚世界频道,请使用下面的宏手动加入\n' ..
'/加入 大脚世界频道\n' ..
'/加入 大脚世界频道1\n' ..
'/加入 大脚世界频道2\n' ..
'/加入 大脚世界频道3\n' ..
'/加入 大脚世界频道4\n' ..
'/加入 大脚世界频道5\n' ..
'或者用下面的按钮尝试加入所有频道|r',
order = 1
},
join={
type = 'execute',
name = '加入大脚世界频道|/加入 大脚世界频道\n/加入 大脚世界频道1\n/加入 大脚世界频道2\n/加入 大脚世界频道3\n/加入 大脚世界频道4\n/加入 大脚世界频道5\n',
order = 2,
func = function()
end,
dialogControl = 'MacroButton'
},
sp1={
type='description',
name='|cff000001|r',
order = 3,
width = 'full',
},
desc1={
type='description',
name='选择一个聊天窗口显示大脚世界频道信息(可选),\n也可以右键点击聊天窗口,选“设置”,再选“通用频道”,手动勾选大脚世界频道\n' ..
'如果必要,可以单独建立一个聊天窗口专门显示大脚世界频道信息',
order = 4,
width = 'full',
},
chatframe = {
type = 'select',
name = '聊天窗口',
order = 4.1,
width = 2,
values = function()
local arr = {}
for i=1,NUM_CHAT_WINDOWS do
local name,_=GetChatWindowInfo(i)
if name and string.len(name)>0 then
table.insert(arr,name)
end
end
return arr
end,
get = function()
for i=1,NUM_CHAT_WINDOWS do
local name,_=GetChatWindowInfo(i)
if name and name == BFWC_Filter_SavedConfigs.bigfoot_chatframe_name then
return i
end
end
end,
set = function(info,val)
local name,_=GetChatWindowInfo(val)
BFWC_Filter_SavedConfigs.bigfoot_chatframe_name=name
end,
},
addto={
type='execute',
name='绑定',
order = 4.2,
width = 'half',
disabled = function()
if not BFWC_Filter_SavedConfigs.bigfoot_chatframe_name then
return true
end
for i=1,NUM_CHAT_WINDOWS do
local name,_=GetChatWindowInfo(i)
if name == BFWC_Filter_SavedConfigs.bigfoot_chatframe_name then
return false
end
end
return true
end,
func=function()
local idx
for i=1,NUM_CHAT_WINDOWS do
local name,_=GetChatWindowInfo(i)
if name and name == BFWC_Filter_SavedConfigs.bigfoot_chatframe_name then
idx = i
end
end
if not idx then
return
end
local chatframe = _G['ChatFrame'..idx]
if not chatframe then
return
end
ChatFrame_AddChannel(chatframe, '大脚世界频道')
ChatFrame_AddChannel(chatframe, '大脚世界频道1')
ChatFrame_AddChannel(chatframe, '大脚世界频道2')
ChatFrame_AddChannel(chatframe, '大脚世界频道3')
ChatFrame_AddChannel(chatframe, '大脚世界频道4')
ChatFrame_AddChannel(chatframe, '大脚世界频道5')
end
},
sp2={
type='description',
name='|cff000002|r',
order = 5,
width = 'full',
},
autojoin = {
type = 'toggle',
name = '自动加入大脚世界频道(建议)',
order = 6,
width = 'full',
get = function(info)
return BFWC_Filter_SavedConfigs.autojoin_bigfoot
end,
set = function(info, val)
BFWC_Filter_SavedConfigs.autojoin_bigfoot = val
if val then
bfwf_update_ui = true
end
end
},
}
},
common = {
type = 'group',
name = '通用设置',
order = 1.2,
args = {
reset = {
type = 'execute',
name = '恢复默认设置',
order = 1,
func = function()
reset_configs_character()
BFWC_Filter_SavedConfigs_G.blacklist = nil
blacklist_init()
end
},
enable = {
type = 'toggle',
name = '启用过滤器',
order = 7,
width = 'full',
get = function(info)
return BFWC_Filter_SavedConfigs.enable
end,
set = function(info, val)
BFWC_Filter_SavedConfigs.enable = val
bfwf_update_icon()
end
},
enterleave = {
type = 'toggle',
name = '不显示进入/离开频道信息',
order = 8,
width = 'full',
get = function(info)
return BFWC_Filter_SavedConfigs.hide_enter_leave
end,
set = function(info, val)
BFWC_Filter_SavedConfigs.hide_enter_leave = val
end,
disabled = function(info)
return not BFWC_Filter_SavedConfigs.enable
end
},
minimap = {
type = 'toggle',
name = '显示小地图按钮',
order = 9,
width = 'full',
set = function(info, val)
BFWC_Filter_SavedConfigs.minimap.hide = not val
if val then
LibStub("LibDBIcon-1.0"):Show(BFF_ADDON_NAME)
else
LibStub("LibDBIcon-1.0"):Hide(BFF_ADDON_NAME)
end
end,
get = function(info)
return not BFWC_Filter_SavedConfigs.minimap.hide
end
},
draghdl = {
type = 'toggle',
name = '显示全局可拖拽按钮(在一些整合UI里,小地图按钮不好找,可以用这个)\n',
order = 9.1,
width = 'full',
get = function() return BFWC_Filter_SavedConfigs.show_drag_handle end,
set = function(info,val)
BFWC_Filter_SavedConfigs.show_drag_handle = val
if val then
bfwf_show_drag_handle()
else
bfwf_hide_drag_handle()
end
end
},
interval = {
type = 'range',
name = '刷屏过滤(同一个人,间隔小于设定秒数的发言将被过滤掉)',
desc = '同一个人,间隔小于设定秒数的发言将被过滤掉',
min = 0,
max = 60,
step = 1,
width = 'full',
order = 10,
get = function(info)
return BFWC_Filter_SavedConfigs.interval
end,
set = function(info, val)
BFWC_Filter_SavedConfigs.interval = val
end,
disabled = function(info)
return not BFWC_Filter_SavedConfigs.enable
end
},
reducemsg = {
type = 'toggle',
name = '|cffffd100重复符号、词、句裁减|r',
desc = '|cffffd100比如:ZUL 4=1T++++++++++MMMMMMMMMMM压缩成ZUL 4=1T++MM|r',
descStyle = 'inline',
order = 10.1,
width = 'full',
get = function() return not BFWC_Filter_SavedConfigs.remain_unchanged_msg end,
set = function(info,val)
BFWC_Filter_SavedConfigs.remain_unchanged_msg=not val
end
},
whiteonly = {
type = 'toggle',
name = '|cffffd100只显示包含白名单关键词的信息|r',
desc = '|cffff0000危险:本选项会过滤掉所有白名单以外信息。这将导致大量信息被过滤!\n如果你不是明确明白该选项的用途,请不要勾选!|r',
descStyle = 'inline',
order = 11,
width = 'full',
get = function() return BFWC_Filter_SavedConfigs.whiteonly end,
set = function(info,val) BFWC_Filter_SavedConfigs.whiteonly=val end
},
classcolor = {
type = 'toggle',
name = '使用职业颜色',
order = 11.1,
width = 'full',
get = function()
local v,_ = GetCVarInfo('chatClassColorOverride')
if v == '0' then
return true
end
return false
end,
set = function(info,val)
if val then
BFWC_Filter_SavedConfigs.use_class_color = true
SetCVar("chatClassColorOverride", "0")
else
BFWC_Filter_SavedConfigs.use_class_color = false
SetCVar("chatClassColorOverride", "1")
end
end
},
blacklist_to_all_channel = {
type = 'toggle',
name = '黑名单过滤所有通用频道以及“说”、“大喊”',
desc = '(不含小队、团队、公会、私聊)',
descStyle='inline',
width = 'full',
order = 16,
get = function()
return BFWC_Filter_SavedConfigs.blacklist_to_all_channel~=false
end,
set = function(info,val)
BFWC_Filter_SavedConfigs.blacklist_to_all_channel = val
end
}
}
},
blacklist = {
type = 'group',
name = '黑名单',
order = 2,
width = 0.5,
disabled = function(info)
return not BFWC_Filter_SavedConfigs.enable
end,
args = {
enable = {
type = 'toggle',
name = '启用黑名单',
order = 1,
disabled = false,
get = function(info) return BFWC_Filter_SavedConfigs.blacklist_enable end,
set = function(info, val) BFWC_Filter_SavedConfigs.blacklist_enable = val end
},
editor = {
type = 'input',
name = '自定义关键词(用英文逗号分隔,不要回车)',
multiline = true,
usage = '关键词之间用英文逗号分隔,不要回车',
width = 'full',
order = 2,
disabled = function() return not BFWC_Filter_SavedConfigs.blacklist_enable end,
get = function()
return table.concat(BFWC_Filter_SavedConfigs_G.blacklist,',')
end,
set = function(info,val)
BFWC_Filter_SavedConfigs_G.blacklist = bfwf_split_str(val)
end
}
}
},
whitelist = {
type = 'group',
name = '白名单',
order = 3,
width = 0.5,
disabled = function(info)
return not BFWC_Filter_SavedConfigs.enable
end,
args = {
desc1 = {
type = 'description',
name = '|cffffd100提示:|r\n 白名单关键词匹配通过的信息将作为组队信息提取到【|cffffd100找队伍|r】里\n',
order = 1
},
editor = {
type = 'input',
name = '自定义组队信息关键词(用英文逗号分隔,不要回车)',
multiline = true,
usage = '关键词之间用英文逗号分隔,不要回车',
width = 'full',
order = 2,
disabled = function() return not BFWC_Filter_SavedConfigs.enable end,
get = function()
return table.concat(BFWC_Filter_SavedConfigs.whitelist or {},',')
end,
set = function(info,val)
BFWC_Filter_SavedConfigs.whitelist = bfwf_split_str(val) or {}
end
},
unsel_as_black = {
type = 'toggle',
name = '|cffee0e00未勾选的副本当成黑名单|r|cffffee00(如果您不明白该选项的用途,不要勾选)|r',
order = 2.1,
width = 'full',
get = function() return BFWC_Filter_SavedConfigs.not_sel_dungeons_as_blacklist end,
set = function(info,val)
BFWC_Filter_SavedConfigs.not_sel_dungeons_as_blacklist = val
end
},
autosel = {
type = 'toggle',
name = '根据我的等级自动过滤组队信息!|cffffee00(建议您手动勾选副本,更精确)|r',
disabled = function() return not BFWC_Filter_SavedConfigs.enable end,
get = function(info) return BFWC_Filter_SavedConfigs.auto_filter_by_level end,
set = function(info,val)
BFWC_Filter_SavedConfigs.auto_filter_by_level = val
bfwf_update_dungeons_filter()
end,
width = 'full',
order = 3,
},
addtochatframe = {
type = 'toggle',
name = '白名单过滤出来的信息添加到指定聊天窗口',
order = 3.1,
width = 'full',
get = function() return BFWC_Filter_SavedConfigs.white_to_chatframe end,
set = function(info,val) BFWC_Filter_SavedConfigs.white_to_chatframe=val end
},
chatframe = {
type = 'select',
name = '聊天窗口',
order = 3.2,
values = function()
local arr = {}
for i=1,NUM_CHAT_WINDOWS do
local name,_=GetChatWindowInfo(i)
if name and string.len(name)>0 then
arr[''..i] = name
end
end
return arr
end,
get = function()
return BFWC_Filter_SavedConfigs.white_to_chatframe_num
end,
set = function(info,val)
BFWC_Filter_SavedConfigs.white_to_chatframe_num=val
end,
disabled = function() return not BFWC_Filter_SavedConfigs.white_to_chatframe end
},
chatcolor = {
type = 'color',
name = '文字颜色',
order = 3.3,
width=0.75,
hasAlpha = true,
disabled = function() return BFWC_Filter_SavedConfigs.use_class_color_for_text end,
get = function()
local r,g,b,a
r = BFWC_Filter_SavedConfigs.white_to_chatframe_color.r or 1
g = BFWC_Filter_SavedConfigs.white_to_chatframe_color.g or 1
b = BFWC_Filter_SavedConfigs.white_to_chatframe_color.b or 1
a = BFWC_Filter_SavedConfigs.white_to_chatframe_color.a or 1
return r,g,b,a
end,
set = function(info,r,g,b,a)
r = r or 1
g = g or 1
b = b or 1
a = a or 1
BFWC_Filter_SavedConfigs.white_to_chatframe_color = {
r=r,g=g,b=b,a=a,hex = hex_color(r,g,b,a)
}
end
},
txcolor = {
type = 'toggle',
name = '文字用职业颜色',
order = 3.4,
get = function() return BFWC_Filter_SavedConfigs.use_class_color_for_text end,
set = function(info,val) BFWC_Filter_SavedConfigs.use_class_color_for_text=val end
},
flash = {
type = 'toggle',
name = '新信息提醒',
order = 3.5,
get = function() return BFWC_Filter_SavedConfigs.new_msg_flash end,
set = function(info,val) BFWC_Filter_SavedConfigs.new_msg_flash=val end
},
desc2 = {
type = 'description',
name = '\n手动选择关心的副本组队信息\n|cffffee00中括号内文字是预设的关键字,如果不能满足需求可在上方编辑框自行添加白名单关键词。|r',
order = 4,
width = 'full'
}
}
},
teamlog1 = {
type = 'group',
name = '找队伍',
order = 4,
width = 'full',
args = {
desc1 = {
order = 1,
type = 'description',
name = '最近的组队喊话记录',
width = 1
},
beg = {
type = 'toggle',
order = 1.1,
name = '过滤|cffbb9e75求组|r信息',
get = function() return BFWC_Filter_SavedConfigs.filter_request_to_join end,
set = function(info,val)
BFWC_Filter_SavedConfigs.filter_request_to_join = val
end
},
desc2 = {
order = 1.2,
type = 'description',
name = '|cffff0000您还没加入大脚世界频道,请在“通用设置”里先加入,大部分组队信息都在该频道|r',
hidden=function() return bfwf_big_foot_world_channel_joined end,
width = 'full'
},
history = {
type = 'select',
name = '最近的喊话组队记录',
order = 2,
width = 'full',
dialogControl = 'ListBox',
values = function ()
local arr = {}
for _,m in ipairs(bfwf_chat_team_log) do
local dt = GetTime()-m.time
if dt < 180 then
local tlcolor = bfwf_player_color[m.name]
if not tlcolor then
tlcolor = '|cff11d72a'
end
local text = '[|cff3ee157' .. bfwf_format_time(dt)
text = text .. '|r ' .. tlcolor .. m.name .. '|r ] '
text = text .. '|cffb3f0e7' .. m.text ..'|r'
--arr[#arr+1] = { text = text,id = m.playerid}
arr[#arr+1] = {text = text,id = m.playerid,name=m.fullname,time=m.time}
end
end
return arr
end,
width = 'full',
set = function(info,val)
last_select_team_leader = val
end,
get = function(info)
if last_select_team_leader and (GetTime()-last_select_team_leader.time)>180 then
last_select_team_leader = nil
return nil
end
return last_select_team_leader
end
},
desc3 = {
order = 3,
type = 'group',
name = '将我的等级、职责密给队长',
inline = true,
width = 'full',
args = {
first = {
type = 'select',
name = '主责',
order = 1,
width = 'half',
values = function ()
if bfwf_player.classes==1 then
return {['D']='DPS'}
end
if bfwf_player.classes==2 then
if bfwf_player.class == 'WARRIOR' then
return {['D']='DPS',['T']='坦克'}
end
return {['D']='DPS',['N']='奶'}
end
return {['D']='DPS',['T']='坦克',['N']='奶'}
end,
get = function(info)
if bfwf_player.classes==1 then
return 'D'
end
if not bfwf_g_data.myid or not BFWC_Filter_SavedConfigs.player[bfwf_g_data.myid] then
return 'D'
end
return BFWC_Filter_SavedConfigs.player[bfwf_g_data.myid].first_duty or 'D'
end,
set = function(info,val)
if not bfwf_g_data.myid or not BFWC_Filter_SavedConfigs.player[bfwf_g_data.myid] then
return
end
BFWC_Filter_SavedConfigs.player[bfwf_g_data.myid].first_duty = val
end,
disabled = function() return bfwf_player.classes==1 end
},
second = {
type = 'select',
name = '次责',
order = 2,
width = 'half',
values = function ()
if bfwf_player.classes==1 then
return {['X']='无',['D']='DPS'}
end
if bfwf_player.classes==2 then
if bfwf_player.class == 'WARRIOR' then
return {['X']='无',['D']='DPS',['T']='坦克'}
end
return {['X']='无',['D']='DPS',['N']='奶'}
end
return {['X']='无',['D']='DPS',['T']='坦克',['N']='奶'}
end,
get = function(info)
if bfwf_player.classes==1 then
return '无'
end
if not bfwf_g_data.myid or not BFWC_Filter_SavedConfigs.player[bfwf_g_data.myid] then
return
end
return BFWC_Filter_SavedConfigs.player[bfwf_g_data.myid].second_duty
end,
set = function(info,val)
if not bfwf_g_data.myid or not BFWC_Filter_SavedConfigs.player[bfwf_g_data.myid] then
return
end
BFWC_Filter_SavedConfigs.player[bfwf_g_data.myid].second_duty = val
end,
disabled = function() return bfwf_player.classes==1 end
},
addition = {
type = 'input',
name = '附加信息',
order = 3,
width = 1.5,
get = function(info) return BFWC_Filter_SavedConfigs.addition_msg or '' end,
set = function(info,val) BFWC_Filter_SavedConfigs.addition_msg = val or '' end
},
send = {
type = 'execute',
name = '发送',
order = 4,
width = 'half',
disabled = function(info) return not last_select_team_leader end,
func = whisper_level_duty
}
}
}
}
},
orgteam = {
type = 'group',
name = '组队',
order = 10,
width = 'full',
args = {
desc1 = {
type = 'description',
name = '发布信息,招募队员(信息自动发布到[|cffcc7832|Hchannel:大脚世界频道|h大脚世界频道|h|r])\n',
order = 1,
width = 'full'
},
chns={
type='select',
name='选择信息发布频道',
order=1.1,
values=function()
bf_channels={}
local _,name,_=GetChannelName('大脚世界频道')
if name then
table.insert(bf_channels,name)
end
for i=1,5 do
local _,name,_=GetChannelName('大脚世界频道'..i)
if name then
table.insert(bf_channels,name)
end
end
return bf_channels
end,
get=function(info)
for i,name in ipairs(bf_channels) do
if name and name == BFWC_Filter_SavedConfigs.send_msg_channel then
return i
end
end
end,
set=function(info,val)
if val<=#bf_channels then
BFWC_Filter_SavedConfigs.send_msg_channel=bf_channels[val]
end
end
},
sp1={
type = 'description',
name = '|cff000001|r',
order = 1.2,
width = 'full'
},
task={
type = 'select',
name = '选择副本',
style = 'dropdown',
order = 2,
values = function()
local arr = {'自定义','任务队'}
for _,d in ipairs(bfwf_dungeons) do
local pos,_=string.find(d.name,'%(')
if pos then
table.insert(arr,'|cff0099ff' .. string.sub(d.name,1,pos-1) .. '|r')
else
table.insert(arr,'|cff0099ff' .. d.name .. '|r')
end
end
return arr
end,
get = function()
if not BFWC_Filter_SavedConfigs.last_orgteam then
BFWC_Filter_SavedConfigs.last_orgteam = 1
end
return BFWC_Filter_SavedConfigs.last_orgteam
end,
set = function(info,val)
BFWC_Filter_SavedConfigs.last_orgteam = val
end
},
note={
type = 'input',
name = '备注、说明(限制30字,文明组队,不要带一长串符号)',
multiline = 3,
width = 'full',
order = 3,
get = function()
return BFWC_Filter_SavedConfigs.last_orgteam_note or ''
end,
set = function(info,val)
local ws=bff_msg_split(val or '')
if #ws>30 then
BFWC_Filter_SavedConfigs.last_orgteam_note = table.concat(ws,'',1,30)
else
BFWC_Filter_SavedConfigs.last_orgteam_note = val or ''
end
end
},
space={
type = 'range',
name = '信息发送间隔',
min = 15,
max = 120,
step = 1,
width = 'full',
order = 3.1,
get = function(info)
return BFWC_Filter_SavedConfigs.interval_orgteam or 15
end,
set = function(info, val)
BFWC_Filter_SavedConfigs.interval_orgteam = val
end,
},
msg={
type = 'description',
name = function()
local msg = '自动发送的信息:\n |cffffc0c0'
msg = msg .. bfwf_make_team_create_msg(true) .. '|r\n'
return msg