fix: add special dm

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-05 20:28:44 +08:00
parent f90f759667
commit fcf3348371
2 changed files with 10 additions and 8 deletions

View File

@@ -105,13 +105,15 @@ class _PlDanmakuState extends State<PlDanmaku> {
if (currentDanmakuList != null) { if (currentDanmakuList != null) {
for (DanmakuElem e in currentDanmakuList) { for (DanmakuElem e in currentDanmakuList) {
if (e.mode == 7) { if (e.mode == 7) {
try {
_controller!.addDanmaku( _controller!.addDanmaku(
SpecialDanmakuContentItem.fromList( SpecialDanmakuContentItem.fromList(
DmUtils.decimalToColor(e.color), DmUtils.decimalToColor(e.color),
e.fontsize.toDouble(), e.fontsize.toDouble(),
jsonDecode(e.content), jsonDecode(e.content.replaceAll('\n', '\\n')),
), ),
); );
} catch (_) {}
} else { } else {
_controller!.addDanmaku( _controller!.addDanmaku(
DanmakuContentItem( DanmakuContentItem(

View File

@@ -252,7 +252,7 @@ packages:
description: description:
path: "." path: "."
ref: main ref: main
resolved-ref: "233f3e2581cbe2dd4867effbd0c512ef6b340599" resolved-ref: a9c804a0d1fc8f408c833a159b1395ecb8a55215
url: "https://github.com/bggRGjQaUbCoE/canvas_danmaku.git" url: "https://github.com/bggRGjQaUbCoE/canvas_danmaku.git"
source: git source: git
version: "0.2.6" version: "0.2.6"