@@ -20,7 +20,9 @@ func main() {
20
20
var SelectLine int
21
21
KeyBordString := make (chan string , 1 )
22
22
23
- RoomId , GuardPrintColor , GiftPrintColor , GiftLinePrice , CommonPrintColor , Linekey := GetConfig ()
23
+ //IsOnlyGift := 0
24
+
25
+ RoomId , GuardPrintColor , GiftPrintColor , GiftLinePrice , CommonPrintColor , Linekey , IsOnlyGift := GetConfig ()
24
26
25
27
if len (RoomId ) < 1 || GuardPrintColor < 1 || GiftPrintColor < 1 || GiftLinePrice < 0.01 || CommonPrintColor < 1 || len (Linekey ) < 1 {
26
28
RoomId = "2233"
@@ -35,6 +37,8 @@ func main() {
35
37
if len (Linekey ) == 0 {
36
38
Linekey = "排队"
37
39
}
40
+ fmt .Println ("是否开启仅限礼物及舰长排队(开启后只有礼物用户及舰长会加入队列)输入1启用" )
41
+ _ , _ = fmt .Scanln (& IsOnlyGift )
38
42
fmt .Println ("自定义颜色编号" )
39
43
for i := 1 ; i < 7 ; i ++ {
40
44
ColorPrint ("这是测试字符" + " " + "编号" + strconv .Itoa (i ), i )
@@ -63,9 +67,9 @@ func main() {
63
67
fmt .Println ("请输入普通队列颜色[编号]" )
64
68
_ , _ = fmt .Scanln (& CommonPrintColor )
65
69
}
66
- fmt .Println ("请输入礼物队列触发价格(RMB),只有单次礼物大于此价格才会被加入 " )
70
+ fmt .Println ("请输入礼物队列触发价格(RMB),只有单次或累计礼物大于此价格才会被加入 " )
67
71
_ , _ = fmt .Scanln (& GiftLinePrice )
68
- if SetConfig (RoomId , GuardPrintColor , GiftPrintColor , GiftLinePrice , CommonPrintColor , Linekey ) {
72
+ if SetConfig (RoomId , GuardPrintColor , GiftPrintColor , GiftLinePrice , CommonPrintColor , Linekey , IsOnlyGift ) {
69
73
fmt .Println ("配置信息已保存,下次启动将自动读取" )
70
74
} else {
71
75
fmt .Println ("配置文件保存失败" )
@@ -151,12 +155,14 @@ func main() {
151
155
})
152
156
lineup .GuardLine = removeRepeatElement (lineup .GuardLine )
153
157
} else {
154
- lineup .CommonLine = append (lineup .CommonLine , & Line {
155
- Uid : danmaku .Sender .Uid ,
156
- UserName : danmaku .Sender .Uname ,
157
- PrintColor : CommonPrintColor ,
158
- })
159
- lineup .CommonLine = removeRepeatElement (lineup .CommonLine )
158
+ if IsOnlyGift != 1 {
159
+ lineup .CommonLine = append (lineup .CommonLine , & Line {
160
+ Uid : danmaku .Sender .Uid ,
161
+ UserName : danmaku .Sender .Uname ,
162
+ PrintColor : CommonPrintColor ,
163
+ })
164
+ lineup .CommonLine = removeRepeatElement (lineup .CommonLine )
165
+ }
160
166
}
161
167
SetLine (lineup )
162
168
0 commit comments