diff --git a/Dotnet/ImageCache.cs b/Dotnet/ImageCache.cs index 492e0d26..5385fc29 100644 --- a/Dotnet/ImageCache.cs +++ b/Dotnet/ImageCache.cs @@ -41,8 +41,8 @@ namespace VRCX cookieString += $"{cookie.Name}={cookie.Value};"; } - webClient.Headers.Add(HttpRequestHeader.Cookie, cookieString); - webClient.Headers.Add("user-agent", Program.Version); + webClient.Headers[HttpRequestHeader.Cookie] = cookieString; + webClient.Headers[HttpRequestHeader.UserAgent] = Program.Version; webClient.DownloadFile(url, fileLocation); int cacheSize = Directory.GetDirectories(cacheLocation).Length; diff --git a/html/src/app.js b/html/src/app.js index 02adcd89..2e098478 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -8097,6 +8097,56 @@ speechSynthesis.getVoices(); $app.data.sortFriendsGroup2 = false; $app.data.sortFriendsGroup3 = false; + $app.methods.saveFriendsGroupStates = async function () { + await configRepository.setBool( + 'VRCX_isFriendsGroupMe', + this.isFriendsGroupMe + ); + await configRepository.setBool( + 'VRCX_isFriendsGroupFavorites', + this.isFriendsGroup0 + ); + await configRepository.setBool( + 'VRCX_isFriendsGroupOnline', + this.isFriendsGroup1 + ); + await configRepository.setBool( + 'VRCX_isFriendsGroupActive', + this.isFriendsGroup2 + ); + await configRepository.setBool( + 'VRCX_isFriendsGroupOffline', + this.isFriendsGroup3 + ); + }; + + $app.methods.loadFriendsGroupStates = async function () { + this.isFriendsGroupMe = await configRepository.getBool( + 'VRCX_isFriendsGroupMe', + true + ); + this.isFriendsGroup0 = await configRepository.getBool( + 'VRCX_isFriendsGroupFavorites', + true + ); + this.isFriendsGroup1 = await configRepository.getBool( + 'VRCX_isFriendsGroupOnline', + true + ); + this.isFriendsGroup2 = await configRepository.getBool( + 'VRCX_isFriendsGroupActive', + true + ); + this.isFriendsGroup3 = await configRepository.getBool( + 'VRCX_isFriendsGroupOffline', + false + ); + }; + + API.$on('LOGIN', function () { + $app.loadFriendsGroupStates(); + }); + $app.methods.fetchActiveFriend = function (userId) { this.pendingActiveFriends.add(userId); // FIXME: handle error @@ -14369,6 +14419,10 @@ speechSynthesis.getVoices(); 'VRCX_hideTooltips', false ); + $app.data.hideNicknames = await configRepository.getBool( + 'VRCX_hideNicknames', + false + ); $app.data.notificationTTS = await configRepository.getString( 'VRCX_notificationTTS', 'Never' @@ -14551,6 +14605,10 @@ speechSynthesis.getVoices(); this.displayVRCPlusIconsAsAvatar ); await configRepository.setBool('VRCX_hideTooltips', this.hideTooltips); + await configRepository.setBool( + 'VRCX_hideNicknames', + this.hideNicknames + ); await configRepository.setBool( 'VRCX_autoSweepVRChatCache', this.autoSweepVRChatCache diff --git a/html/src/index.pug b/html/src/index.pug index 484d73fd..27958f93 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -113,7 +113,7 @@ html template(#label) span {{ $t('side_panel.friends') }} ({{ onlineFriendCount }}/{{ friends.size }}) .x-friend-list(style="padding:10px 5px") - .x-friend-group.x-link(@click="isFriendsGroupMe = !isFriendsGroupMe" style="padding:0px 0px 5px") + .x-friend-group.x-link(@click="isFriendsGroupMe = !isFriendsGroupMe; saveFriendsGroupStates()" style="padding:0px 0px 5px") i.el-icon-arrow-right(:class="{ rotate: isFriendsGroupMe }") span(style="margin-left:5px") {{ $t('side_panel.me') }} div(v-show="isFriendsGroupMe") @@ -125,7 +125,7 @@ html location.extra(v-if="isGameRunning && !gameLogDisabled" :location="lastLocation.location" :traveling="lastLocationDestination" :link="false") location.extra(v-else-if="isRealInstance(API.currentUser.$locationTag) || isRealInstance(API.currentUser.$travelingToLocation)" :location="API.currentUser.$locationTag" :traveling="API.currentUser.$travelingToLocation" :link="false") span.extra(v-else v-text="API.currentUser.statusDescription") - .x-friend-group.x-link(@click="isFriendsGroup0 = !isFriendsGroup0" v-show="friendsGroup0.length") + .x-friend-group.x-link(@click="isFriendsGroup0 = !isFriendsGroup0; saveFriendsGroupStates()" v-show="friendsGroup0.length") i.el-icon-arrow-right(:class="{ rotate: isFriendsGroup0 }") span(style="margin-left:5px") {{ $t('side_panel.favorite') }} ― {{ friendsGroup0.length }} div(v-show="isFriendsGroup0") @@ -134,14 +134,14 @@ html .avatar(:class="userStatusClass(friend.ref, friend.pendingOffline)") img(v-lazy="userImage(friend.ref)") .detail - span.name(v-if="!hideUserMemos && friend.$nickName" :style="{'color':friend.ref.$userColour}") {{ friend.ref.displayName }} ({{ friend.$nickName }}) + span.name(v-if="!hideNicknames && friend.$nickName" :style="{'color':friend.ref.$userColour}") {{ friend.ref.displayName }} ({{ friend.$nickName }}) span.name(v-else v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span.extra(v-if="friend.pendingOffline") #[i.el-icon-warning-outline] {{ $t('side_panel.pending_offline') }} location.extra(v-else :location="friend.ref.location" :traveling="friend.ref.travelingToLocation" :link="false") template(v-else) span(v-text="friend.name || friend.id") el-button(type="text" icon="el-icon-close" size="mini" @click.stop="confirmDeleteFriend(friend.id)" style="margin-left:5px") - .x-friend-group.x-link(@click="isFriendsGroup1 = !isFriendsGroup1" v-show="friendsGroup1.length") + .x-friend-group.x-link(@click="isFriendsGroup1 = !isFriendsGroup1; saveFriendsGroupStates()" v-show="friendsGroup1.length") i.el-icon-arrow-right(:class="{ rotate: isFriendsGroup1 }") span(style="margin-left:5px") {{ $t('side_panel.online') }} ― {{ friendsGroup1.length }} div(v-show="isFriendsGroup1") @@ -150,14 +150,14 @@ html .avatar(:class="userStatusClass(friend.ref, friend.pendingOffline)") img(v-lazy="userImage(friend.ref)") .detail - span.name(v-if="!hideUserMemos && friend.$nickName" :style="{'color':friend.ref.$userColour}") {{ friend.ref.displayName }} ({{ friend.$nickName }}) + span.name(v-if="!hideNicknames && friend.$nickName" :style="{'color':friend.ref.$userColour}") {{ friend.ref.displayName }} ({{ friend.$nickName }}) span.name(v-else v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span.extra(v-if="friend.pendingOffline") #[i.el-icon-warning-outline] {{ $t('side_panel.pending_offline') }} location.extra(v-else :location="friend.ref.location" :traveling="friend.ref.travelingToLocation" :link="false") template(v-else) span(v-text="friend.name || friend.id") el-button(type="text" icon="el-icon-close" size="mini" @click.stop="confirmDeleteFriend(friend.id)" style="margin-left:5px") - .x-friend-group.x-link(@click="isFriendsGroup2 = !isFriendsGroup2" v-show="friendsGroup2.length") + .x-friend-group.x-link(@click="isFriendsGroup2 = !isFriendsGroup2; saveFriendsGroupStates()" v-show="friendsGroup2.length") i.el-icon-arrow-right(:class="{ rotate: isFriendsGroup2 }") span(style="margin-left:5px") {{ $t('side_panel.active') }} ― {{ friendsGroup2.length }} div(v-show="isFriendsGroup2") @@ -166,13 +166,13 @@ html .avatar img(v-lazy="userImage(friend.ref)") .detail - span.name(v-if="!hideUserMemos && friend.$nickName" :style="{'color':friend.ref.$userColour}") {{ friend.ref.displayName }} ({{ friend.$nickName }}) + span.name(v-if="!hideNicknames && friend.$nickName" :style="{'color':friend.ref.$userColour}") {{ friend.ref.displayName }} ({{ friend.$nickName }}) span.name(v-else v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span.extra(v-text="friend.ref.statusDescription" :link="false") template(v-else) span(v-text="friend.name || friend.id") el-button(type="text" icon="el-icon-close" size="mini" @click.stop="confirmDeleteFriend(friend.id)" style="margin-left:5px") - .x-friend-group.x-link(@click="isFriendsGroup3 = !isFriendsGroup3" v-show="friendsGroup3.length") + .x-friend-group.x-link(@click="isFriendsGroup3 = !isFriendsGroup3; saveFriendsGroupStates()" v-show="friendsGroup3.length") i.el-icon-arrow-right(:class="{ rotate: isFriendsGroup3 }") span(style="margin-left:5px") {{ $t('side_panel.offline') }} ― {{ friendsGroup3.length }} div(v-show="isFriendsGroup3") @@ -181,7 +181,7 @@ html .avatar img(v-lazy="userImage(friend.ref)") .detail - span.name(v-if="!hideUserMemos && friend.$nickName" :style="{'color':friend.ref.$userColour}") {{ friend.ref.displayName }} ({{ friend.$nickName }}) + span.name(v-if="!hideNicknames && friend.$nickName" :style="{'color':friend.ref.$userColour}") {{ friend.ref.displayName }} ({{ friend.$nickName }}) span.name(v-else v-text="friend.ref.displayName" :style="{'color':friend.ref.$userColour}") span.extra(v-text="friend.ref.statusDescription") template(v-else) diff --git a/html/src/localization/en/en.json b/html/src/localization/en/en.json index 69122a3b..e608adb2 100644 --- a/html/src/localization/en/en.json +++ b/html/src/localization/en/en.json @@ -251,6 +251,7 @@ "theme_mode_material3": "Material 3", "vrcplus_profile_icons": "VRCPlus Profile Icons", "disable_tooltips": "Disable Tooltips", + "disable_nicknames": "Disable Memo Nicknames", "sort_favorite_by": "Sort Favorites by", "sort_favorite_by_name": "name", "sort_favorite_by_date": "date", diff --git a/html/src/mixins/tabs/settings.pug b/html/src/mixins/tabs/settings.pug index 8eed4827..217237cf 100644 --- a/html/src/mixins/tabs/settings.pug +++ b/html/src/mixins/tabs/settings.pug @@ -136,6 +136,9 @@ mixin settingsTab() div.options-container-item span.name {{ $t('view.settings.appearance.appearance.vrcplus_profile_icons') }} el-switch(v-model="displayVRCPlusIconsAsAvatar" @change="saveOpenVROption") + div.options-container-item + span.name {{ $t('view.settings.appearance.appearance.disable_nicknames') }} + el-switch(v-model="hideNicknames" @change="saveOpenVROption") div.options-container-item span.name {{ $t('view.settings.appearance.appearance.disable_tooltips') }} el-switch(v-model="hideTooltips" @change="saveOpenVROption")