mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
fix dm block type
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -184,6 +184,7 @@ class _PlDanmakuState extends State<PlDanmaku> {
|
|||||||
hideTop: playerController.blockTypes.contains(5),
|
hideTop: playerController.blockTypes.contains(5),
|
||||||
hideScroll: playerController.blockTypes.contains(2),
|
hideScroll: playerController.blockTypes.contains(2),
|
||||||
hideBottom: playerController.blockTypes.contains(4),
|
hideBottom: playerController.blockTypes.contains(4),
|
||||||
|
hideSpecial: playerController.blockTypes.contains(7),
|
||||||
duration:
|
duration:
|
||||||
playerController.danmakuDuration /
|
playerController.danmakuDuration /
|
||||||
playerController.playbackSpeed,
|
playerController.playbackSpeed,
|
||||||
|
|||||||
@@ -214,8 +214,8 @@ mixin HeaderMixin<T extends StatefulWidget> on State<T> {
|
|||||||
void showSetDanmaku({bool isLive = false}) {
|
void showSetDanmaku({bool isLive = false}) {
|
||||||
// 屏蔽类型
|
// 屏蔽类型
|
||||||
const blockTypesList = [
|
const blockTypesList = [
|
||||||
(value: 5, label: '顶部'),
|
|
||||||
(value: 2, label: '滚动'),
|
(value: 2, label: '滚动'),
|
||||||
|
(value: 5, label: '顶部'),
|
||||||
(value: 4, label: '底部'),
|
(value: 4, label: '底部'),
|
||||||
(value: 6, label: '彩色'),
|
(value: 6, label: '彩色'),
|
||||||
(value: 7, label: '高级'),
|
(value: 7, label: '高级'),
|
||||||
@@ -370,6 +370,30 @@ mixin HeaderMixin<T extends StatefulWidget> on State<T> {
|
|||||||
setState(() {});
|
setState(() {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onUpdateBlockType(int blockType) {
|
||||||
|
if (blockTypes.contains(blockType)) {
|
||||||
|
blockTypes.remove(blockType);
|
||||||
|
} else {
|
||||||
|
blockTypes.add(blockType);
|
||||||
|
}
|
||||||
|
plPlayerController
|
||||||
|
..blockTypes = blockTypes
|
||||||
|
..blockColorful = blockTypes.contains(6)
|
||||||
|
..putDanmakuSettings();
|
||||||
|
setState(() {});
|
||||||
|
try {
|
||||||
|
danmakuController?.updateOption(
|
||||||
|
danmakuController.option.copyWith(
|
||||||
|
hideTop: blockTypes.contains(5),
|
||||||
|
hideBottom: blockTypes.contains(4),
|
||||||
|
hideScroll: blockTypes.contains(2),
|
||||||
|
hideSpecial: blockTypes.contains(7),
|
||||||
|
// 添加或修改其他需要修改的选项属性
|
||||||
|
),
|
||||||
|
);
|
||||||
|
} catch (_) {}
|
||||||
|
}
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
child: Material(
|
child: Material(
|
||||||
@@ -436,40 +460,20 @@ mixin HeaderMixin<T extends StatefulWidget> on State<T> {
|
|||||||
const Text('按类型屏蔽'),
|
const Text('按类型屏蔽'),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.only(top: 12),
|
padding: const EdgeInsets.only(top: 12),
|
||||||
child: Row(
|
child: SingleChildScrollView(
|
||||||
children: [
|
scrollDirection: Axis.horizontal,
|
||||||
for (final (value: value, label: label)
|
child: Row(
|
||||||
in blockTypesList) ...[
|
spacing: 10,
|
||||||
ActionRowLineItem(
|
children: blockTypesList
|
||||||
onTap: () {
|
.map(
|
||||||
if (blockTypes.contains(value)) {
|
(e) => ActionRowLineItem(
|
||||||
blockTypes.remove(value);
|
onTap: () => onUpdateBlockType(e.value),
|
||||||
} else {
|
text: e.label,
|
||||||
blockTypes.add(value);
|
selectStatus: blockTypes.contains(e.value),
|
||||||
}
|
),
|
||||||
plPlayerController
|
)
|
||||||
..blockTypes = blockTypes
|
.toList(),
|
||||||
..blockColorful = blockTypes.contains(6)
|
),
|
||||||
..putDanmakuSettings();
|
|
||||||
setState(() {});
|
|
||||||
try {
|
|
||||||
danmakuController?.updateOption(
|
|
||||||
danmakuController.option.copyWith(
|
|
||||||
hideTop: blockTypes.contains(5),
|
|
||||||
hideBottom: blockTypes.contains(4),
|
|
||||||
hideScroll: blockTypes.contains(2),
|
|
||||||
hideSpecial: blockTypes.contains(7),
|
|
||||||
// 添加或修改其他需要修改的选项属性
|
|
||||||
),
|
|
||||||
);
|
|
||||||
} catch (_) {}
|
|
||||||
},
|
|
||||||
text: label,
|
|
||||||
selectStatus: blockTypes.contains(value),
|
|
||||||
),
|
|
||||||
const SizedBox(width: 10),
|
|
||||||
],
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SetSwitchItem(
|
SetSwitchItem(
|
||||||
|
|||||||
Reference in New Issue
Block a user