mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: danmaku
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:PiliPalaX/utils/extension.dart';
|
||||
import 'package:canvas_danmaku/canvas_danmaku.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -100,18 +101,20 @@ class _PlDanmakuState extends State<PlDanmaku> {
|
||||
_plDanmakuController.getCurrentDanmaku(currentPosition);
|
||||
|
||||
if (playerController.showDanmaku &&
|
||||
_controller != null &&
|
||||
playerController.playerStatus.status.value == PlayerStatus.playing &&
|
||||
currentDanmakuList != null &&
|
||||
_controller != null) {
|
||||
Color? defaultColor =
|
||||
playerController.blockTypes.contains(6) ? Colors.white : null;
|
||||
|
||||
playerController.isBuffering.value.not &&
|
||||
currentDanmakuList != null) {
|
||||
for (DanmakuElem e in currentDanmakuList) {
|
||||
_controller!.addDanmaku(DanmakuContentItem(
|
||||
e.content,
|
||||
color: defaultColor ?? DmUtils.decimalToColor(e.color),
|
||||
type: DmUtils.getPosition(e.mode),
|
||||
));
|
||||
_controller!.addDanmaku(
|
||||
DanmakuContentItem(
|
||||
e.content,
|
||||
color: playerController.blockTypes.contains(6)
|
||||
? Colors.white
|
||||
: DmUtils.decimalToColor(e.color),
|
||||
type: DmUtils.getPosition(e.mode),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,10 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import 'rich_node_panel.dart';
|
||||
|
||||
// ignore: must_be_immutable
|
||||
class Content extends StatelessWidget {
|
||||
dynamic item;
|
||||
String? source;
|
||||
Content({
|
||||
final dynamic item;
|
||||
final String? source;
|
||||
const Content({
|
||||
super.key,
|
||||
this.item,
|
||||
this.source,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// ignore: file_names
|
||||
import 'package:PiliPalaX/utils/extension.dart';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -87,7 +87,7 @@ class _FontSizeSelectPageState extends State<FontSizeSelectPage> {
|
||||
divisions: list.length - 1,
|
||||
secondaryTrackValue: 1,
|
||||
onChanged: (double val) {
|
||||
currentSize = double.parse(val.toStringAsFixed(2));
|
||||
currentSize = val.toPrecision(2);
|
||||
setState(() {});
|
||||
},
|
||||
),
|
||||
|
||||
@@ -389,7 +389,6 @@ class VideoIntroController extends GetxController
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore: avoid_print
|
||||
debugPrint(e.toString());
|
||||
}
|
||||
SmartDialog.showLoading(msg: '请求中');
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// ignore_for_file: library_private_types_in_public_api
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ExpandedSection extends StatefulWidget {
|
||||
@@ -17,7 +15,7 @@ class ExpandedSection extends StatefulWidget {
|
||||
});
|
||||
|
||||
@override
|
||||
_ExpandedSectionState createState() => _ExpandedSectionState();
|
||||
State<ExpandedSection> createState() => _ExpandedSectionState();
|
||||
}
|
||||
|
||||
class _ExpandedSectionState extends State<ExpandedSection>
|
||||
|
||||
@@ -1491,8 +1491,7 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
value: danmakuLineHeight,
|
||||
label: '$danmakuLineHeight',
|
||||
onChanged: (double val) {
|
||||
danmakuLineHeight =
|
||||
double.parse(val.toStringAsFixed(1));
|
||||
danmakuLineHeight = val.toPrecision(1);
|
||||
widget.controller!.danmakuLineHeight =
|
||||
danmakuLineHeight;
|
||||
widget.controller?.putDanmakuSettings();
|
||||
|
||||
Reference in New Issue
Block a user