mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-06 18:36:55 +08:00
fix uface again
This commit is contained in:
@@ -42,7 +42,7 @@ import {
|
||||
NPopconfirm,
|
||||
} from 'naive-ui'
|
||||
import { computed, ref } from 'vue'
|
||||
import PointOrderManage from './PointOrderManage.vue'
|
||||
import PointOrderManage from '../PointOrderManage.vue'
|
||||
|
||||
const message = useMessage()
|
||||
const accountInfo = useAccount()
|
||||
|
||||
@@ -326,37 +326,11 @@ async function updateStatus(queueData: ResponseQueueModel, status: QueueStatus)
|
||||
})
|
||||
}
|
||||
|
||||
function onGetDanmaku(danmaku: DanmakuInfo) {
|
||||
add({
|
||||
msg: danmaku.msg,
|
||||
type: EventDataTypes.Message,
|
||||
time: danmaku.timestamp,
|
||||
uid: danmaku.uid,
|
||||
name: danmaku.uname,
|
||||
avatar: danmaku.uface,
|
||||
fans_medal_level: danmaku.fans_medal_level,
|
||||
fans_medal_name: danmaku.fans_medal_name,
|
||||
fans_medal_wearing_status: danmaku.fans_medal_wearing_status,
|
||||
guard_level: danmaku.guard_level,
|
||||
num: 1,
|
||||
price: 0,
|
||||
} as EventModel)
|
||||
function onGetDanmaku(danmaku: EventModel) {
|
||||
add(danmaku)
|
||||
}
|
||||
function onGetGift(danmaku: GiftInfo) {
|
||||
add({
|
||||
msg: danmaku.gift_name,
|
||||
type: EventDataTypes.Gift,
|
||||
time: danmaku.timestamp,
|
||||
uid: danmaku.uid,
|
||||
name: danmaku.uname,
|
||||
fans_medal_level: danmaku.fans_medal_level,
|
||||
fans_medal_name: danmaku.fans_medal_name,
|
||||
fans_medal_wearing_status: danmaku.fans_medal_wearing_status,
|
||||
guard_level: danmaku.guard_level,
|
||||
avatar: danmaku.uface,
|
||||
num: 1,
|
||||
price: (danmaku.gift_num * danmaku.price) / 1000,
|
||||
} as EventModel)
|
||||
function onGetGift(danmaku: EventModel) {
|
||||
add(danmaku)
|
||||
}
|
||||
function checkMessage(eventData: EventModel) {
|
||||
if (!configCanEdit.value && queue.value.find((q) => q.user?.uid == eventData.uid)) {
|
||||
@@ -714,8 +688,8 @@ onMounted(() => {
|
||||
if (accountInfo.value) {
|
||||
settings.value = accountInfo.value.settings.queue
|
||||
}
|
||||
props.client.on('danmaku', onGetDanmaku)
|
||||
props.client.on('gift', onGetGift)
|
||||
props.client.onEvent('danmaku', onGetDanmaku)
|
||||
props.client.onEvent('gift', onGetGift)
|
||||
init()
|
||||
})
|
||||
onActivated(() => {
|
||||
@@ -738,8 +712,8 @@ onDeactivated(() => {
|
||||
dispose()
|
||||
})
|
||||
onUnmounted(() => {
|
||||
props.client.off('danmaku', onGetDanmaku)
|
||||
props.client.off('gift', onGetGift)
|
||||
props.client.offEvent('danmaku', onGetDanmaku)
|
||||
props.client.offEvent('gift', onGetGift)
|
||||
dispose()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -467,7 +467,7 @@ function test(type: EventDataTypes) {
|
||||
fans_medal_name: '',
|
||||
fans_medal_wearing_status: false,
|
||||
emoji: undefined,
|
||||
avatar: '',
|
||||
uface: '',
|
||||
})
|
||||
break
|
||||
case EventDataTypes.SC:
|
||||
@@ -484,7 +484,7 @@ function test(type: EventDataTypes) {
|
||||
fans_medal_name: '',
|
||||
fans_medal_wearing_status: false,
|
||||
emoji: undefined,
|
||||
avatar: '',
|
||||
uface: '',
|
||||
})
|
||||
break
|
||||
case EventDataTypes.Guard:
|
||||
@@ -501,7 +501,7 @@ function test(type: EventDataTypes) {
|
||||
fans_medal_name: '',
|
||||
fans_medal_wearing_status: false,
|
||||
emoji: undefined,
|
||||
avatar: '',
|
||||
uface: '',
|
||||
})
|
||||
break
|
||||
case EventDataTypes.Gift:
|
||||
@@ -518,7 +518,7 @@ function test(type: EventDataTypes) {
|
||||
fans_medal_name: '',
|
||||
fans_medal_wearing_status: false,
|
||||
emoji: undefined,
|
||||
avatar: '',
|
||||
uface: '',
|
||||
})
|
||||
break
|
||||
}
|
||||
|
||||
@@ -319,40 +319,14 @@ async function updateSongStatus(song: SongRequestInfo, status: SongRequestStatus
|
||||
})
|
||||
}
|
||||
|
||||
function onGetDanmaku(danmaku: DanmakuInfo) {
|
||||
function onGetDanmaku(danmaku: EventModel) {
|
||||
if (checkMessage(danmaku.msg)) {
|
||||
addSong({
|
||||
msg: danmaku.msg,
|
||||
type: EventDataTypes.Message,
|
||||
time: danmaku.timestamp,
|
||||
uid: danmaku.uid,
|
||||
name: danmaku.uname,
|
||||
avatar: danmaku.uface,
|
||||
fans_medal_level: danmaku.fans_medal_level,
|
||||
fans_medal_name: danmaku.fans_medal_name,
|
||||
fans_medal_wearing_status: danmaku.fans_medal_wearing_status,
|
||||
guard_level: danmaku.guard_level,
|
||||
num: 1,
|
||||
price: 0,
|
||||
} as EventModel)
|
||||
addSong(danmaku)
|
||||
}
|
||||
}
|
||||
function onGetSC(danmaku: SCInfo) {
|
||||
if (settings.value.allowSC && checkMessage(danmaku.message)) {
|
||||
addSong({
|
||||
msg: danmaku.message,
|
||||
type: EventDataTypes.SC,
|
||||
time: danmaku.timestamp,
|
||||
uid: danmaku.uid,
|
||||
name: danmaku.uname,
|
||||
fans_medal_level: danmaku.fans_medal_level,
|
||||
fans_medal_name: danmaku.fans_medal_name,
|
||||
fans_medal_wearing_status: danmaku.fans_medal_wearing_status,
|
||||
guard_level: danmaku.guard_level,
|
||||
avatar: danmaku.uface,
|
||||
num: 1,
|
||||
price: danmaku.rmb,
|
||||
} as EventModel)
|
||||
function onGetSC(danmaku: EventModel) {
|
||||
if (settings.value.allowSC && checkMessage(danmaku.msg)) {
|
||||
addSong(danmaku)
|
||||
}
|
||||
}
|
||||
function checkMessage(msg: string) {
|
||||
@@ -698,8 +672,8 @@ onMounted(() => {
|
||||
if (accountInfo.value) {
|
||||
settings.value = accountInfo.value.settings.songRequest
|
||||
}
|
||||
props.client.on('danmaku', onGetDanmaku)
|
||||
props.client.on('sc', onGetSC)
|
||||
props.client.onEvent('danmaku', onGetDanmaku)
|
||||
props.client.onEvent('sc', onGetSC)
|
||||
init()
|
||||
})
|
||||
onActivated(() => {
|
||||
@@ -722,8 +696,8 @@ onDeactivated(() => {
|
||||
dispose()
|
||||
})
|
||||
onUnmounted(() => {
|
||||
props.client.off('danmaku', onGetDanmaku)
|
||||
props.client.off('sc', onGetSC)
|
||||
props.client.offEvent('danmaku', onGetDanmaku)
|
||||
props.client.offEvent('sc', onGetSC)
|
||||
dispose()
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user