mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-23 04:00:28 +08:00
feat: special danmaku by @My-Responsitories
Closes #91 Closes #219 Closes #394 Closes #602 Closes #613 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:PiliPlus/grpc/dm/v1/dm.pb.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
@@ -103,22 +104,32 @@ class _PlDanmakuState extends State<PlDanmaku> {
|
||||
_plDanmakuController.getCurrentDanmaku(currentPosition);
|
||||
if (currentDanmakuList != null) {
|
||||
for (DanmakuElem e in currentDanmakuList) {
|
||||
_controller!.addDanmaku(
|
||||
DanmakuContentItem(
|
||||
e.content,
|
||||
color: playerController.blockTypes.contains(6)
|
||||
? Colors.white
|
||||
: DmUtils.decimalToColor(e.color),
|
||||
type: DmUtils.getPosition(e.mode),
|
||||
isColorful: playerController.showVipDanmaku &&
|
||||
e.colorful == DmColorfulType.VipGradualColor
|
||||
? true
|
||||
: null,
|
||||
count: widget.playerController.mergeDanmaku && e.hasAttr()
|
||||
? e.attr
|
||||
: null,
|
||||
),
|
||||
);
|
||||
if (e.mode == 7) {
|
||||
_controller!.addDanmaku(
|
||||
SpecialDanmakuContentItem.fromList(
|
||||
DmUtils.decimalToColor(e.color),
|
||||
e.fontsize.toDouble(),
|
||||
jsonDecode(e.content),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
_controller!.addDanmaku(
|
||||
DanmakuContentItem(
|
||||
e.content,
|
||||
color: playerController.blockTypes.contains(6)
|
||||
? Colors.white
|
||||
: DmUtils.decimalToColor(e.color),
|
||||
type: DmUtils.getPosition(e.mode),
|
||||
isColorful: playerController.showVipDanmaku &&
|
||||
e.colorful == DmColorfulType.VipGradualColor
|
||||
? true
|
||||
: null,
|
||||
count: widget.playerController.mergeDanmaku && e.hasAttr()
|
||||
? e.attr
|
||||
: null,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user