From 560de42bd2e4002b4ac210c635a5faafbd453e33 Mon Sep 17 00:00:00 2001 From: Natsumi Date: Mon, 29 Sep 2025 09:30:00 +1300 Subject: [PATCH] Instance names in VR wrist feed, replace emojis --- src/shared/utils/base/ui.js | 2 +- src/stores/instance.js | 6 +- src/stores/sharedFeed.js | 20 +++++ src/vr/Vr.vue | 132 ++++++++++++++++++++----------- src/vr/components/VrLocation.vue | 13 ++- 5 files changed, 123 insertions(+), 50 deletions(-) diff --git a/src/shared/utils/base/ui.js b/src/shared/utils/base/ui.js index d2546c0e..bc79ddf1 100644 --- a/src/shared/utils/base/ui.js +++ b/src/shared/utils/base/ui.js @@ -32,7 +32,7 @@ function changeAppThemeStyle(themeMode) { const themeConfig = THEME_CONFIG[themeMode]; if (!themeConfig) { console.error('Invalid theme mode:', themeMode); - themeMode = 'light'; + themeMode = systemIsDarkMode() ? 'dark' : 'light'; } let filePathPrefix = 'file://vrcx/'; diff --git a/src/stores/instance.js b/src/stores/instance.js index b29feacd..049265b8 100644 --- a/src/stores/instance.js +++ b/src/stores/instance.js @@ -17,7 +17,8 @@ import { getWorldName, hasGroupPermission, isRealInstance, - parseLocation + parseLocation, + replaceBioSymbols } from '../shared/utils'; import { useFriendStore } from './friend'; import { useGroupStore } from './group'; @@ -390,6 +391,9 @@ export const useInstanceStore = defineStore('Instance', () => { ref.$disabledContentSettings.push(setting); } } + if (ref.displayName) { + ref.displayName = replaceBioSymbols(ref.displayName); + } if ( userStore.userDialog.visible && userStore.userDialog.ref.$location.tag === ref.id diff --git a/src/stores/sharedFeed.js b/src/stores/sharedFeed.js index c26b0d14..eab22b2d 100644 --- a/src/stores/sharedFeed.js +++ b/src/stores/sharedFeed.js @@ -216,6 +216,26 @@ export const useSharedFeedStore = defineStore('SharedFeed', () => { return 0; }); wristFeed.splice(16); + // temp fix, tack on instance names in the worst way possible + for (let feedEntry of wristFeed) { + if (feedEntry.location) { + const instanceRef = instanceStore.cachedInstances.get( + feedEntry.location + ); + if (instanceRef?.displayName) { + feedEntry.instanceDisplayName = instanceRef.displayName; + } + } + // invites + if (feedEntry.details?.worldId) { + const instanceRef = instanceStore.cachedInstances.get( + feedEntry.details.worldId + ); + if (instanceRef?.displayName) { + feedEntry.instanceDisplayName = instanceRef.displayName; + } + } + } AppApi.ExecuteVrFeedFunction( 'wristFeedUpdate', JSON.stringify(wristFeed) diff --git a/src/vr/Vr.vue b/src/vr/Vr.vue index 18bcfa0e..38eca356 100644 --- a/src/vr/Vr.vue +++ b/src/vr/Vr.vue @@ -23,6 +23,7 @@ :location="feed.location" :hint="feed.worldName" :grouphint="feed.groupName" + :instancedisplayname="feed.instanceDisplayName" style="margin-left: 5px"> @@ -54,6 +55,7 @@ :location="feed.location" :hint="feed.worldName" :grouphint="feed.groupName" + :instancedisplayname="feed.instanceDisplayName" style="margin-left: 5px"> @@ -86,7 +88,7 @@
{{ formatDate(feed.created_at) }} - ▶️ + {{ formatDate(feed.created_at) }} - ◀️ + {{ formatDate(feed.created_at) }} - ▶️ - + + +
@@ -131,7 +134,8 @@ + :grouphint="feed.groupName" + :instancedisplayname="feed.instanceDisplayName"> @@ -142,7 +146,7 @@
{{ formatDate(feed.created_at) }} - 🎵 + {{ formatDate(feed.created_at) }} - 📨 + + + :hint="feed.details.worldName" + :instancedisplayname="feed.instanceDisplayName">
@@ -180,7 +186,8 @@
{{ formatDate(feed.created_at) }} - 📩 + +
@@ -192,7 +199,8 @@
{{ formatDate(feed.created_at) }} - 💬 + +
@@ -204,7 +212,8 @@
{{ formatDate(feed.created_at) }} - 💬 + +
@@ -216,7 +225,8 @@
{{ formatDate(feed.created_at) }} - 💚 + +
@@ -227,7 +237,8 @@
{{ formatDate(feed.created_at) }} - 💖 + +
@@ -238,7 +249,8 @@
{{ formatDate(feed.created_at) }} - 💔 + +
@@ -249,8 +261,9 @@
{{ formatDate(feed.created_at) }} - 📃 - + + +
@@ -262,13 +275,14 @@
{{ formatDate(feed.created_at) }} - 🤝 + {{ feed.previousTrustLevel }} {{ feed.trustLevel }}
-
@@ -279,7 +293,7 @@
- + -->
{{ formatDate(feed.created_at) }} - 🏷️ + +
@@ -299,7 +314,8 @@
{{ formatDate(feed.created_at) }} - 🏷️ + +
@@ -310,7 +326,8 @@
{{ formatDate(feed.created_at) }} - 🏷️ + +
@@ -321,7 +338,8 @@
{{ formatDate(feed.created_at) }} - 🏷️ + +
@@ -332,7 +350,8 @@
{{ formatDate(feed.created_at) }} - 🏷️ + +
@@ -343,7 +362,8 @@
{{ formatDate(feed.created_at) }} - 🏷️ + +
@@ -354,7 +374,8 @@
{{ formatDate(feed.created_at) }} - 📨 + +
@@ -365,7 +386,8 @@
{{ formatDate(feed.created_at) }} - 📫 + +
@@ -377,7 +399,7 @@ {{ formatDate(feed.created_at) }} - + @@ -399,7 +423,7 @@
{{ formatDate(feed.created_at) }} - 🧍 + {{ formatDate(feed.created_at) }} - 💬 + {{ formatDate(feed.created_at) }} - 🛑 + +
@@ -446,7 +471,7 @@
{{ formatDate(feed.created_at) }} - 🟠 + {{ formatDate(feed.created_at) }} - ▶️ 🚫 + +
@@ -473,7 +499,9 @@
{{ formatDate(feed.created_at) }} - ◀️ 🚫 + +
@@ -484,7 +512,8 @@
{{ formatDate(feed.created_at) }} - ▶️ 🔇 + +
@@ -495,7 +524,9 @@
{{ formatDate(feed.created_at) }} - ◀️ 🔇 + +
@@ -506,7 +537,7 @@
{{ formatDate(feed.created_at) }} - 🚫 + {{ formatDate(feed.created_at) }} - ⭕ + {{ formatDate(feed.created_at) }} - 🔇 + {{ formatDate(feed.created_at) }} - 🎤 + + :grouphint="feed.groupName" + :instancedisplayname="feed.instanceDisplayName">
@@ -615,7 +648,8 @@ + :grouphint="feed.groupName" + :instancedisplayname="feed.instanceDisplayName"> @@ -691,7 +725,8 @@ + :grouphint="feed.groupName" + :instancedisplayname="feed.instanceDisplayName"> @@ -726,7 +761,8 @@ has invited you to + :hint="feed.details.worldName" + :instancedisplayname="feed.instanceDisplayName"> @@ -2023,4 +2059,8 @@ .ml-5 { margin-left: 5px; } + + .mr-5 { + margin-right: 5px; + } diff --git a/src/vr/components/VrLocation.vue b/src/vr/components/VrLocation.vue index 4868611c..e6eb14cb 100644 --- a/src/vr/components/VrLocation.vue +++ b/src/vr/components/VrLocation.vue @@ -26,6 +26,10 @@ grouphint: { type: String, default: '' + }, + instancedisplayname: { + type: String, + default: '' } }); @@ -38,6 +42,11 @@ text.value = props.location; const L = parseLocation(props.location); + let instanceName = L.instanceName; + if (props.instancedisplayname) { + instanceName = props.instancedisplayname; + } + if (L.isOffline) { text.value = 'Offline'; } else if (L.isPrivate) { @@ -46,13 +55,13 @@ text.value = 'Traveling'; } else if (typeof props.hint === 'string' && props.hint !== '') { if (L.instanceId) { - text.value = `${props.hint} #${L.instanceName} ${L.accessTypeName}`; + text.value = `${props.hint} #${instanceName} ${L.accessTypeName}`; } else { text.value = props.hint; } } else if (L.worldId) { if (L.instanceId) { - text.value = ` #${L.instanceName} ${L.accessTypeName}`; + text.value = ` #${instanceName} ${L.accessTypeName}`; } else { text.value = props.location; }