feat: custom show vip danmaku

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-13 10:11:29 +08:00
parent 4d4575aabd
commit c63a32bd47
4 changed files with 16 additions and 1 deletions

View File

@@ -113,7 +113,10 @@ class _PlDanmakuState extends State<PlDanmaku> {
? Colors.white
: DmUtils.decimalToColor(e.color),
type: DmUtils.getPosition(e.mode),
isColorful: e.colorful == DmColorfulType.VipGradualColor,
isColorful: playerController.showVipDanmaku &&
e.colorful == DmColorfulType.VipGradualColor
? true
: null,
),
);
}

View File

@@ -1747,6 +1747,13 @@ List<SettingsModel> get extraSettings => [
}
},
),
SettingsModel(
settingsType: SettingsType.sw1tch,
title: '显示会员彩色弹幕',
leading: Icon(MdiIcons.gradientHorizontal),
setKey: SettingBoxKey.showVipDanmaku,
defaultVal: true,
),
SettingsModel(
settingsType: SettingsType.sw1tch,
enableFeedback: true,

View File

@@ -274,6 +274,7 @@ class PlPlayerController {
late int subtitlePaddingH = GStorage.subtitlePaddingH;
late int subtitlePaddingB = GStorage.subtitlePaddingB;
late double subtitleBgOpaticy = GStorage.subtitleBgOpaticy;
late bool showVipDanmaku = GStorage.showVipDanmaku;
// 播放顺序相关
PlayRepeat playRepeat = PlayRepeat.pause;

View File

@@ -336,6 +336,9 @@ class GStorage {
static bool get savedRcmdTip =>
GStorage.setting.get(SettingBoxKey.savedRcmdTip, defaultValue: true);
static bool get showVipDanmaku =>
GStorage.setting.get(SettingBoxKey.showVipDanmaku, defaultValue: true);
static List<double> get dynamicDetailRatio => List<double>.from(setting
.get(SettingBoxKey.dynamicDetailRatio, defaultValue: [60.0, 40.0]));
@@ -554,6 +557,7 @@ class SettingBoxKey {
openInBrowser = 'openInBrowser',
refreshDragPercentage = 'refreshDragPercentage',
refreshDisplacement = 'refreshDisplacement',
showVipDanmaku = 'showVipDanmaku',
// Sponsor Block
enableSponsorBlock = 'enableSponsorBlock',