mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-08 11:26:56 +08:00
feat: 新增消息队列设置功能,优化自动操作体验
- 在 ClientAutoAction.vue 中新增消息队列设置标签页,允许用户配置弹幕和私信发送间隔。 - 更新多个组件以支持新的设置选项,提升用户交互体验。 - 在 useBiliFunction 中实现队列处理逻辑,确保消息按设定间隔发送。 - 优化 CheckInSettings 组件,整合 AutoActionEditor 以简化配置管理。
This commit is contained in:
@@ -15,6 +15,10 @@ export type VTsuruClientSettings = {
|
||||
enableNotification: boolean;
|
||||
notificationSettings: NotificationSettings;
|
||||
|
||||
// 消息队列间隔设置
|
||||
danmakuInterval: number;
|
||||
pmInterval: number;
|
||||
|
||||
dev_disableDanmakuClient: boolean;
|
||||
};
|
||||
|
||||
@@ -32,6 +36,10 @@ export const useSettings = defineStore('settings', () => {
|
||||
enableTypes: ['question-box', 'danmaku', 'message-failed'],
|
||||
},
|
||||
|
||||
// 默认间隔为2秒
|
||||
danmakuInterval: 2000,
|
||||
pmInterval: 2000,
|
||||
|
||||
dev_disableDanmakuClient: false,
|
||||
};
|
||||
const settings = ref<VTsuruClientSettings>(Object.assign({}, defaultSettings));
|
||||
@@ -40,6 +48,9 @@ export const useSettings = defineStore('settings', () => {
|
||||
settings.value = (await store.get()) || Object.assign({}, defaultSettings);
|
||||
settings.value.notificationSettings ??= defaultSettings.notificationSettings;
|
||||
settings.value.notificationSettings.enableTypes ??= [ 'question-box', 'danmaku', 'message-failed' ];
|
||||
// 初始化消息队列间隔设置
|
||||
settings.value.danmakuInterval ??= defaultSettings.danmakuInterval;
|
||||
settings.value.pmInterval ??= defaultSettings.pmInterval;
|
||||
}
|
||||
async function save() {
|
||||
await store.set(settings.value);
|
||||
|
||||
Reference in New Issue
Block a user