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) {
for (DanmakuElem e in currentDanmakuList) {
if (e.mode == 7) {
_controller!.addDanmaku(
SpecialDanmakuContentItem.fromList(
DmUtils.decimalToColor(e.color),
e.fontsize.toDouble(),
jsonDecode(e.content),
),
);
try {
_controller!.addDanmaku(
SpecialDanmakuContentItem.fromList(
DmUtils.decimalToColor(e.color),
e.fontsize.toDouble(),
jsonDecode(e.content.replaceAll('\n', '\\n')),
),
);
} catch (_) {}
} else {
_controller!.addDanmaku(
DanmakuContentItem(

View File

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