Overlay notification opacity

This commit is contained in:
Natsumi
2025-06-20 18:39:40 +12:00
parent 84913a0ef6
commit 921070da71
7 changed files with 186 additions and 16 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ namespace VRCX
/// <param name="body">The content of the notification.</param> /// <param name="body">The content of the notification.</param>
/// <param name="timeout">[CURRENTLY UNUSED]The timeout of the notification.</param> /// <param name="timeout">[CURRENTLY UNUSED]The timeout of the notification.</param>
/// <param name="image">The image of the notification.</param> /// <param name="image">The image of the notification.</param>
public void OVRTNotification(bool hudNotification, bool wristNotification, string title, string body, int timeout, string image = "") public void OVRTNotification(bool hudNotification, bool wristNotification, string title, string body, int timeout, int opacity, string image = "")
{ {
List<OvrtMessage> messages = []; List<OvrtMessage> messages = [];
+3 -2
View File
@@ -13,7 +13,7 @@ namespace VRCX
/// <param name="content">The content of the notification.</param> /// <param name="content">The content of the notification.</param>
/// <param name="timeout">The duration of the notification in milliseconds.</param> /// <param name="timeout">The duration of the notification in milliseconds.</param>
/// <param name="image">The optional image to display in the notification.</param> /// <param name="image">The optional image to display in the notification.</param>
public void XSNotification(string title, string content, int timeout, string image = "") public void XSNotification(string title, string content, int timeout, int opacity, string image = "")
{ {
var broadcastSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); var broadcastSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
var endPoint = new IPEndPoint(IPAddress.Loopback, 42069); var endPoint = new IPEndPoint(IPAddress.Loopback, 42069);
@@ -43,7 +43,8 @@ namespace VRCX
timeout = timeout, timeout = timeout,
audioPath = string.Empty, audioPath = string.Empty,
useBase64Icon = useBase64Icon, useBase64Icon = useBase64Icon,
icon = icon icon = icon,
opacity = opacity / 100f
}; };
var byteBuffer = JsonSerializer.SerializeToUtf8Bytes(msg); var byteBuffer = JsonSerializer.SerializeToUtf8Bytes(msg);
+11 -1
View File
@@ -6156,6 +6156,10 @@ console.log(`isLinux: ${LINUX}`);
'VRCX_notificationTTSNickName', 'VRCX_notificationTTSNickName',
false false
); );
$app.data.notificationOpacity = await configRepository.getFloat(
'VRCX_notificationOpacity',
100
);
// It's not necessary to store it in configRepo because it's rarely used. // It's not necessary to store it in configRepo because it's rarely used.
$app.data.isTestTTSVisible = false; $app.data.isTestTTSVisible = false;
@@ -6523,6 +6527,11 @@ console.log(`isLinux: ${LINUX}`);
this.autoDeleteOldPrints this.autoDeleteOldPrints
); );
await configRepository.setInt(
'VRCX_notificationOpacity',
this.notificationOpacity
);
this.updateSharedFeed(true); this.updateSharedFeed(true);
this.updateVRConfigVars(); this.updateVRConfigVars();
this.updateVRLastLocation(); this.updateVRLastLocation();
@@ -7392,7 +7401,8 @@ console.log(`isLinux: ${LINUX}`);
backgroundEnabled: this.vrBackgroundEnabled, backgroundEnabled: this.vrBackgroundEnabled,
dtHour12: this.dtHour12, dtHour12: this.dtHour12,
pcUptimeOnFeed: this.pcUptimeOnFeed, pcUptimeOnFeed: this.pcUptimeOnFeed,
appLanguage: this.appLanguage appLanguage: this.appLanguage,
notificationOpacity: this.notificationOpacity
}; };
var json = JSON.stringify(VRConfigVars); var json = JSON.stringify(VRConfigVars);
AppApi.ExecuteVrFeedFunction('configUpdate', json); AppApi.ExecuteVrFeedFunction('configUpdate', json);
+140 -10
View File
@@ -579,6 +579,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has joined`, `${noty.displayName} has joined`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -587,6 +588,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has left`, `${noty.displayName} has left`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -595,6 +597,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} is joining`, `${noty.displayName} is joining`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -607,6 +610,7 @@ export default class extends baseClass {
noty.groupName noty.groupName
)}`, )}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -623,6 +627,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has logged in${locationName}`, `${noty.displayName} has logged in${locationName}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -631,6 +636,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has logged out`, `${noty.displayName} has logged out`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -639,6 +645,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} status is now ${noty.status} ${noty.statusDescription}`, `${noty.displayName} status is now ${noty.status} ${noty.statusDescription}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -652,6 +659,7 @@ export default class extends baseClass {
noty.details.worldName noty.details.worldName
)}${message}`, )}${message}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -660,6 +668,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.senderUsername} has requested an invite${message}`, `${noty.senderUsername} has requested an invite${message}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -668,6 +677,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.senderUsername} has responded to your invite${message}`, `${noty.senderUsername} has responded to your invite${message}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -676,6 +686,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.senderUsername} has responded to your invite request${message}`, `${noty.senderUsername} has responded to your invite request${message}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -684,6 +695,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.senderUsername} has sent you a friend request`, `${noty.senderUsername} has sent you a friend request`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -692,6 +704,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} is now your friend`, `${noty.displayName} is now your friend`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -700,6 +713,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} is no longer your friend`, `${noty.displayName} is no longer your friend`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -708,6 +722,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} trust level is now ${noty.trustLevel}`, `${noty.displayName} trust level is now ${noty.trustLevel}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -716,40 +731,90 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.previousDisplayName} changed their name to ${noty.displayName}`, `${noty.previousDisplayName} changed their name to ${noty.displayName}`,
timeout, timeout,
opacity,
image image
); );
break; break;
case 'boop': case 'boop':
AppApi.XSNotification('VRCX', noty.message, timeout, image); AppApi.XSNotification(
'VRCX',
noty.message,
timeout,
opacity,
image
);
break; break;
case 'groupChange': case 'groupChange':
AppApi.XSNotification( AppApi.XSNotification(
'VRCX', 'VRCX',
`${noty.senderUsername}: ${noty.message}`, `${noty.senderUsername}: ${noty.message}`,
timeout, timeout,
opacity,
image image
); );
break; break;
case 'group.announcement': case 'group.announcement':
AppApi.XSNotification('VRCX', noty.message, timeout, image); AppApi.XSNotification(
'VRCX',
noty.message,
timeout,
opacity,
image
);
break; break;
case 'group.informative': case 'group.informative':
AppApi.XSNotification('VRCX', noty.message, timeout, image); AppApi.XSNotification(
'VRCX',
noty.message,
timeout,
opacity,
image
);
break; break;
case 'group.invite': case 'group.invite':
AppApi.XSNotification('VRCX', noty.message, timeout, image); AppApi.XSNotification(
'VRCX',
noty.message,
timeout,
opacity,
image
);
break; break;
case 'group.joinRequest': case 'group.joinRequest':
AppApi.XSNotification('VRCX', noty.message, timeout, image); AppApi.XSNotification(
'VRCX',
noty.message,
timeout,
opacity,
image
);
break; break;
case 'group.transfer': case 'group.transfer':
AppApi.XSNotification('VRCX', noty.message, timeout, image); AppApi.XSNotification(
'VRCX',
noty.message,
timeout,
opacity,
image
);
break; break;
case 'group.queueReady': case 'group.queueReady':
AppApi.XSNotification('VRCX', noty.message, timeout, image); AppApi.XSNotification(
'VRCX',
noty.message,
timeout,
opacity,
image
);
break; break;
case 'instance.closed': case 'instance.closed':
AppApi.XSNotification('VRCX', noty.message, timeout, image); AppApi.XSNotification(
'VRCX',
noty.message,
timeout,
opacity,
image
);
break; break;
case 'PortalSpawn': case 'PortalSpawn':
if (noty.displayName) { if (noty.displayName) {
@@ -763,6 +828,7 @@ export default class extends baseClass {
noty.groupName noty.groupName
)}`, )}`,
timeout, timeout,
opacity,
image image
); );
} else { } else {
@@ -770,6 +836,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
'User has spawned a portal', 'User has spawned a portal',
timeout, timeout,
opacity,
image image
); );
} }
@@ -779,6 +846,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} changed into avatar ${noty.name}`, `${noty.displayName} changed into avatar ${noty.name}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -787,20 +855,34 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} said ${noty.text}`, `${noty.displayName} said ${noty.text}`,
timeout, timeout,
opacity,
image image
); );
break; break;
case 'Event': case 'Event':
AppApi.XSNotification('VRCX', noty.data, timeout, image); AppApi.XSNotification(
'VRCX',
noty.data,
timeout,
opacity,
image
);
break; break;
case 'External': case 'External':
AppApi.XSNotification('VRCX', noty.message, timeout, image); AppApi.XSNotification(
'VRCX',
noty.message,
timeout,
opacity,
image
);
break; break;
case 'VideoPlay': case 'VideoPlay':
AppApi.XSNotification( AppApi.XSNotification(
'VRCX', 'VRCX',
`Now playing: ${noty.notyName}`, `Now playing: ${noty.notyName}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -809,6 +891,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`Blocked user ${noty.displayName} has joined`, `Blocked user ${noty.displayName} has joined`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -817,6 +900,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`Blocked user ${noty.displayName} has left`, `Blocked user ${noty.displayName} has left`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -825,6 +909,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`Muted user ${noty.displayName} has joined`, `Muted user ${noty.displayName} has joined`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -833,6 +918,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`Muted user ${noty.displayName} has left`, `Muted user ${noty.displayName} has left`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -841,6 +927,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has blocked you`, `${noty.displayName} has blocked you`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -849,6 +936,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has unblocked you`, `${noty.displayName} has unblocked you`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -857,6 +945,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has muted you`, `${noty.displayName} has muted you`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -865,6 +954,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has unmuted you`, `${noty.displayName} has unmuted you`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -889,6 +979,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has joined`, `${noty.displayName} has joined`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -899,6 +990,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has left`, `${noty.displayName} has left`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -909,6 +1001,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} is joining`, `${noty.displayName} is joining`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -923,6 +1016,7 @@ export default class extends baseClass {
noty.groupName noty.groupName
)}`, )}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -941,6 +1035,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has logged in${locationName}`, `${noty.displayName} has logged in${locationName}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -951,6 +1046,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has logged out`, `${noty.displayName} has logged out`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -961,6 +1057,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} status is now ${noty.status} ${noty.statusDescription}`, `${noty.displayName} status is now ${noty.status} ${noty.statusDescription}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -976,6 +1073,7 @@ export default class extends baseClass {
noty.details.worldName noty.details.worldName
)}${message}`, )}${message}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -986,6 +1084,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.senderUsername} has requested an invite${message}`, `${noty.senderUsername} has requested an invite${message}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -996,6 +1095,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.senderUsername} has responded to your invite${message}`, `${noty.senderUsername} has responded to your invite${message}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1006,6 +1106,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.senderUsername} has responded to your invite request${message}`, `${noty.senderUsername} has responded to your invite request${message}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1016,6 +1117,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.senderUsername} has sent you a friend request`, `${noty.senderUsername} has sent you a friend request`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1026,6 +1128,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} is now your friend`, `${noty.displayName} is now your friend`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1036,6 +1139,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} is no longer your friend`, `${noty.displayName} is no longer your friend`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1046,6 +1150,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} trust level is now ${noty.trustLevel}`, `${noty.displayName} trust level is now ${noty.trustLevel}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1056,6 +1161,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.previousDisplayName} changed their name to ${noty.displayName}`, `${noty.previousDisplayName} changed their name to ${noty.displayName}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1066,6 +1172,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
noty.message, noty.message,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1076,6 +1183,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.senderUsername}: ${noty.message}`, `${noty.senderUsername}: ${noty.message}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1086,6 +1194,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
noty.message, noty.message,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1096,6 +1205,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
noty.message, noty.message,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1106,6 +1216,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
noty.message, noty.message,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1116,6 +1227,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
noty.message, noty.message,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1126,6 +1238,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
noty.message, noty.message,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1136,6 +1249,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
noty.message, noty.message,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1146,6 +1260,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
noty.message, noty.message,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1163,6 +1278,7 @@ export default class extends baseClass {
noty.groupName noty.groupName
)}`, )}`,
timeout, timeout,
opacity,
image image
); );
} else { } else {
@@ -1172,6 +1288,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
'User has spawned a portal', 'User has spawned a portal',
timeout, timeout,
opacity,
image image
); );
} }
@@ -1183,6 +1300,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} changed into avatar ${noty.name}`, `${noty.displayName} changed into avatar ${noty.name}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1193,6 +1311,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} said ${noty.text}`, `${noty.displayName} said ${noty.text}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1203,6 +1322,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
noty.data, noty.data,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1213,6 +1333,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
noty.message, noty.message,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1223,6 +1344,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`Now playing: ${noty.notyName}`, `Now playing: ${noty.notyName}`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1233,6 +1355,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`Blocked user ${noty.displayName} has joined`, `Blocked user ${noty.displayName} has joined`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1243,6 +1366,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`Blocked user ${noty.displayName} has left`, `Blocked user ${noty.displayName} has left`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1253,6 +1377,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`Muted user ${noty.displayName} has joined`, `Muted user ${noty.displayName} has joined`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1263,6 +1388,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`Muted user ${noty.displayName} has left`, `Muted user ${noty.displayName} has left`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1273,6 +1399,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has blocked you`, `${noty.displayName} has blocked you`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1283,6 +1410,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has unblocked you`, `${noty.displayName} has unblocked you`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1293,6 +1421,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has muted you`, `${noty.displayName} has muted you`,
timeout, timeout,
opacity,
image image
); );
break; break;
@@ -1303,6 +1432,7 @@ export default class extends baseClass {
'VRCX', 'VRCX',
`${noty.displayName} has unmuted you`, `${noty.displayName} has unmuted you`,
timeout, timeout,
opacity,
image image
); );
break; break;
+1
View File
@@ -453,6 +453,7 @@
"ovrtoolkit_hud_notifications": "OVR Toolkit HUD Notifications", "ovrtoolkit_hud_notifications": "OVR Toolkit HUD Notifications",
"ovrtoolkit_wrist_notifications": "OVR Toolkit Wrist Notifications", "ovrtoolkit_wrist_notifications": "OVR Toolkit Wrist Notifications",
"user_images": "User Images (slower)", "user_images": "User Images (slower)",
"notification_opacity": "Notification Opacity",
"notification_timeout": "Notification Timeout" "notification_timeout": "Notification Timeout"
}, },
"conditions": { "conditions": {
+11 -1
View File
@@ -579,9 +579,19 @@ mixin settingsTab
:value='ovrtWristNotifications' :value='ovrtWristNotifications'
@change='saveOpenVROption("VRCX_ovrtWristNotifications")') @change='saveOpenVROption("VRCX_ovrtWristNotifications")')
simple-switch( simple-switch(
:label='$t("view.settings.notifications.notifications.steamvr_notifications.user_images")' :label='$t("view.settings.notifications.notifications.steamvr_notifications.ovrtoolkit_wrist_notifications")'
:value='imageNotifications' :value='imageNotifications'
@change='saveOpenVROption("VRCX_imageNotifications")') @change='saveOpenVROption("VRCX_imageNotifications")')
.options-container-item
span.name(style='vertical-align: top; padding-top: 10px') {{ $t('view.settings.notifications.notifications.steamvr_notifications.notification_opacity') }}
el-slider(
v-model='notificationOpacity'
@input='saveOpenVROption("VRCX_notificationOpacity")'
:show-tooltip='false'
:min='0'
:max='100'
show-input
style='display: inline-block; width: 300px')
.options-container-item .options-container-item
el-button( el-button(
size='small' size='small'
+19 -1
View File
@@ -166,7 +166,8 @@ Vue.component('marquee-text', MarqueeText);
onlineForTimer: '', onlineForTimer: '',
wristFeed: [], wristFeed: [],
devices: [], devices: [],
deviceCount: 0 deviceCount: 0,
notificationOpacity: 100
}, },
computed: {}, computed: {},
methods: { methods: {
@@ -203,6 +204,10 @@ Vue.component('marquee-text', MarqueeText);
this.cpuUsageEnabled || this.pcUptimeEnabled this.cpuUsageEnabled || this.pcUptimeEnabled
); );
} }
if (this.config.notificationOpacity !== this.notificationOpacity) {
this.notificationOpacity = this.config.notificationOpacity;
this.setNotyOpacity(this.notificationOpacity);
}
}; };
$app.methods.updateOnlineFriendCount = function (count) { $app.methods.updateOnlineFriendCount = function (count) {
@@ -272,6 +277,19 @@ Vue.component('marquee-text', MarqueeText);
}); });
}; };
$app.methods.setNotyOpacity = function (value) {
var opacity = parseFloat(value / 100).toFixed(2);
let element = document.getElementById('noty-opacity');
if (!element) {
document.body.insertAdjacentHTML(
'beforeend',
`<style id="noty-opacity">.noty_layout { opacity: ${opacity}; }</style>`
);
element = document.getElementById('noty-opacity');
}
element.innerHTML = `.noty_layout { opacity: ${opacity}; }`;
};
$app.methods.updateStatsLoop = async function () { $app.methods.updateStatsLoop = async function () {
try { try {
this.currentTime = new Date() this.currentTime = new Date()