mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 22:46:06 +02:00
Desktop notification multi switch
This commit is contained in:
+26
-2
@@ -5752,7 +5752,7 @@ speechSynthesis.getVoices();
|
|||||||
$app.data.hideOnPlayerJoined = configRepository.getBool('VRCX_hideOnPlayerJoined');
|
$app.data.hideOnPlayerJoined = configRepository.getBool('VRCX_hideOnPlayerJoined');
|
||||||
$app.data.hideDevicesFromFeed = configRepository.getBool('VRCX_hideDevicesFromFeed');
|
$app.data.hideDevicesFromFeed = configRepository.getBool('VRCX_hideDevicesFromFeed');
|
||||||
$app.data.overlayNotifications = configRepository.getBool('VRCX_overlayNotifications');
|
$app.data.overlayNotifications = configRepository.getBool('VRCX_overlayNotifications');
|
||||||
$app.data.desktopToast = configRepository.getBool('VRCX_desktopToast');
|
$app.data.desktopToast = configRepository.getString('VRCX_desktopToast');
|
||||||
$app.data.minimalFeed = configRepository.getBool('VRCX_minimalFeed');
|
$app.data.minimalFeed = configRepository.getBool('VRCX_minimalFeed');
|
||||||
$app.data.displayVRCPlusIconsAsAvatar = configRepository.getBool('displayVRCPlusIconsAsAvatar');
|
$app.data.displayVRCPlusIconsAsAvatar = configRepository.getBool('displayVRCPlusIconsAsAvatar');
|
||||||
$app.data.notificationTTS = configRepository.getBool('VRCX_notificationTTS');
|
$app.data.notificationTTS = configRepository.getBool('VRCX_notificationTTS');
|
||||||
@@ -5766,7 +5766,7 @@ speechSynthesis.getVoices();
|
|||||||
configRepository.setBool('VRCX_hideOnPlayerJoined', this.hideOnPlayerJoined);
|
configRepository.setBool('VRCX_hideOnPlayerJoined', this.hideOnPlayerJoined);
|
||||||
configRepository.setBool('VRCX_hideDevicesFromFeed', this.hideDevicesFromFeed);
|
configRepository.setBool('VRCX_hideDevicesFromFeed', this.hideDevicesFromFeed);
|
||||||
configRepository.setBool('VRCX_overlayNotifications', this.overlayNotifications);
|
configRepository.setBool('VRCX_overlayNotifications', this.overlayNotifications);
|
||||||
configRepository.setBool('VRCX_desktopToast', this.desktopToast);
|
configRepository.setString('VRCX_desktopToast', this.desktopToast);
|
||||||
configRepository.setBool('VRCX_minimalFeed', this.minimalFeed);
|
configRepository.setBool('VRCX_minimalFeed', this.minimalFeed);
|
||||||
configRepository.setBool('displayVRCPlusIconsAsAvatar', this.displayVRCPlusIconsAsAvatar);
|
configRepository.setBool('displayVRCPlusIconsAsAvatar', this.displayVRCPlusIconsAsAvatar);
|
||||||
this.updateVRConfigVars();
|
this.updateVRConfigVars();
|
||||||
@@ -5831,6 +5831,10 @@ speechSynthesis.getVoices();
|
|||||||
$app.data.notificationTTSVoice = '0';
|
$app.data.notificationTTSVoice = '0';
|
||||||
configRepository.setString('VRCX_notificationTTSVoice', $app.data.notificationTTSVoice);
|
configRepository.setString('VRCX_notificationTTSVoice', $app.data.notificationTTSVoice);
|
||||||
}
|
}
|
||||||
|
if (!configRepository.getString('VRCX_desktopToast')) {
|
||||||
|
$app.data.desktopToast = 'Never';
|
||||||
|
configRepository.setString('VRCX_desktopToast', $app.data.desktopToast);
|
||||||
|
}
|
||||||
if (!configRepository.getString('sharedFeedFilters')) {
|
if (!configRepository.getString('sharedFeedFilters')) {
|
||||||
var sharedFeedFilters = {
|
var sharedFeedFilters = {
|
||||||
noty: {},
|
noty: {},
|
||||||
@@ -5941,6 +5945,26 @@ speechSynthesis.getVoices();
|
|||||||
labels: [{ name: 'Off' }, { name: 'On' }]
|
labels: [{ name: 'Off' }, { name: 'On' }]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
$app.data.desktopToastToggleSwitchOption = {
|
||||||
|
layout: {
|
||||||
|
backgroundColor: 'white',
|
||||||
|
selectedBackgroundColor: '#409eff',
|
||||||
|
selectedColor: 'white',
|
||||||
|
color: '#409eff',
|
||||||
|
borderColor: '#409eff',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
fontFamily: '"Noto Sans JP", "Noto Sans KR", "Meiryo UI", "Malgun Gothic", "Segoe UI", "sans-serif"'
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
height: 1.5,
|
||||||
|
width: 22,
|
||||||
|
padding: 0.1,
|
||||||
|
fontSize: 0.75
|
||||||
|
},
|
||||||
|
items: {
|
||||||
|
labels: [{ name: 'Never' }, { name: 'Desktop Mode' }, { name: 'Game Closed' }, { name: 'Always' }]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
$app.methods.saveSharedFeedFilters = function () {
|
$app.methods.saveSharedFeedFilters = function () {
|
||||||
this.notyFeedFiltersDialog.visible = false;
|
this.notyFeedFiltersDialog.visible = false;
|
||||||
|
|||||||
+8
-6
@@ -573,20 +573,22 @@ html
|
|||||||
el-switch(v-model="hideDevicesFromFeed" :disabled="!openVR")
|
el-switch(v-model="hideDevicesFromFeed" :disabled="!openVR")
|
||||||
div.options-container-item
|
div.options-container-item
|
||||||
el-button(size="small" icon="el-icon-notebook-2" @click="showWristFeedFiltersDialog()" :disabled="!openVR") Wrist Feed Filters
|
el-button(size="small" icon="el-icon-notebook-2" @click="showWristFeedFiltersDialog()" :disabled="!openVR") Wrist Feed Filters
|
||||||
|
el-button(size="small" icon="el-icon-chat-square" @click="showNotyFeedFiltersDialog()" :disabled="!openVR") Notification Filters
|
||||||
br
|
br
|
||||||
span.sub-header Notification Options
|
span.sub-header VR Notifications
|
||||||
div.options-container-item
|
div.options-container-item
|
||||||
span.name Overlay Notifications
|
span.name Overlay Notifications
|
||||||
el-switch(v-model="overlayNotifications" :disabled="!openVR")
|
el-switch(v-model="overlayNotifications" :disabled="!openVR")
|
||||||
div.options-container-item
|
div.options-container-item
|
||||||
span.name Desktop Notifications
|
|
||||||
el-switch(v-model="desktopToast" :disabled="!openVR")
|
|
||||||
|
|
||||||
div.options-container-item
|
|
||||||
el-button(size="small" icon="el-icon-chat-square" @click="showNotyFeedFiltersDialog()" :disabled="!openVR") Notification Filters
|
|
||||||
el-button(size="small" icon="el-icon-time" @click="promptNotificationTimeout()" :disabled="!overlayNotifications || !openVR") Notification Timeout
|
el-button(size="small" icon="el-icon-time" @click="promptNotificationTimeout()" :disabled="!overlayNotifications || !openVR") Notification Timeout
|
||||||
el-button(size="small" icon="el-icon-rank" @click="showNotificationPositionDialog()" :disabled="!overlayNotifications || !openVR") Notification Position
|
el-button(size="small" icon="el-icon-rank" @click="showNotificationPositionDialog()" :disabled="!overlayNotifications || !openVR") Notification Position
|
||||||
br
|
br
|
||||||
|
span.sub-header Desktop Notifications
|
||||||
|
div.options-container-item
|
||||||
|
span.name When to display notifications:
|
||||||
|
br
|
||||||
|
toggle-switch(:options="desktopToastToggleSwitchOption" group="desktopToastToggleSwitchOption" v-model="desktopToast" class="toggle-switch" :disabled="!openVR")
|
||||||
|
br
|
||||||
span.sub-header TTS Options
|
span.sub-header TTS Options
|
||||||
div.options-container-item
|
div.options-container-item
|
||||||
span.name Notification TTS
|
span.name Notification TTS
|
||||||
|
|||||||
+7
-5
@@ -944,8 +944,8 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// disable notifications when busy or game isn't running
|
// disable notifications when busy
|
||||||
if ((this.currentUserStatus === 'busy') || (!this.isGameRunning)) {
|
if (this.currentUserStatus === 'busy') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var bias = new Date(Date.now() - 60000).toJSON();
|
var bias = new Date(Date.now() - 60000).toJSON();
|
||||||
@@ -955,7 +955,7 @@ speechSynthesis.getVoices();
|
|||||||
if (noty.created_at < bias) {
|
if (noty.created_at < bias) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ((this.config.overlayNotifications) && (!this.isGameNoVR)) {
|
if ((this.config.overlayNotifications) && (!this.isGameNoVR) && (this.isGameRunning)) {
|
||||||
var text = '';
|
var text = '';
|
||||||
switch (noty.type) {
|
switch (noty.type) {
|
||||||
case 'OnPlayerJoined':
|
case 'OnPlayerJoined':
|
||||||
@@ -1028,7 +1028,7 @@ speechSynthesis.getVoices();
|
|||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.config.notificationTTS) {
|
if ((this.config.notificationTTS) && (this.isGameRunning)) {
|
||||||
switch (noty.type) {
|
switch (noty.type) {
|
||||||
case 'OnPlayerJoined':
|
case 'OnPlayerJoined':
|
||||||
this.speak(`${noty.data} has joined`);
|
this.speak(`${noty.data} has joined`);
|
||||||
@@ -1091,7 +1091,9 @@ speechSynthesis.getVoices();
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((this.config.desktopToast) && (this.isGameNoVR)) {
|
if ((this.config.desktopToast === 'Always') ||
|
||||||
|
((this.config.desktopToast === 'Game Closed') && (!this.isGameRunning)) ||
|
||||||
|
((this.config.desktopToast === 'Desktop Mode') && (this.isGameNoVR) && (this.isGameRunning))) {
|
||||||
var imageURL = '';
|
var imageURL = '';
|
||||||
if (noty.userId) {
|
if (noty.userId) {
|
||||||
imageURL = await API.getCachedUser({
|
imageURL = await API.getCachedUser({
|
||||||
|
|||||||
Reference in New Issue
Block a user