This commit is contained in:
Natsumi
2023-01-21 13:01:55 +13:00
parent b92a7f6751
commit 0ba78b9155
7 changed files with 111 additions and 54 deletions

11
.vscode/settings.json vendored
View File

@@ -1,5 +1,10 @@
{ {
"i18n-ally.localesPaths": ["html/src/localization/strings"], "i18n-ally.localesPaths": ["html/src/localization/strings"],
"i18n-ally.keystyle": "nested", "i18n-ally.keystyle": "nested",
"i18n-ally.sourceLanguage": "en" "i18n-ally.sourceLanguage": "en",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
} }

View File

@@ -255,7 +255,7 @@ namespace VRCX
return ImageCache.GetImage(url, fileId, version); return ImageCache.GetImage(url, fileId, version);
} }
public void DesktopNotification(string BoldText, string Text, string Image) public void DesktopNotification(string BoldText, string Text = "", string Image = "")
{ {
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastImageAndText02); XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastImageAndText02);
XmlNodeList stringElements = toastXml.GetElementsByTagName("text"); XmlNodeList stringElements = toastXml.GetElementsByTagName("text");
@@ -288,7 +288,7 @@ namespace VRCX
public string sourceApp { get; set; } public string sourceApp { get; set; }
} }
public void XSNotification(string Title, string Content, int Timeout, string Image) public void XSNotification(string Title, string Content, int Timeout, string Image = "")
{ {
bool UseBase64Icon; bool UseBase64Icon;
string Icon; string Icon;

View File

@@ -826,9 +826,9 @@ speechSynthesis.getVoices();
template: template:
"<span><span @click=\"showWorldDialog\" :class=\"{ 'x-link': link && this.location !== 'private' && this.location !== 'offline'}\">" + "<span><span @click=\"showWorldDialog\" :class=\"{ 'x-link': link && this.location !== 'private' && this.location !== 'offline'}\">" +
'<i v-if="isTraveling" class="el-icon el-icon-loading" style="display:inline-block;margin-right:5px"></i>' + '<i v-if="isTraveling" class="el-icon el-icon-loading" style="display:inline-block;margin-right:5px"></i>' +
'<span style="margin-right:5px">{{ text }}</span></span>' + '<span>{{ text }}</span></span>' +
'<span v-if="groupName" @click="showGroupDialog" class="x-link" style="margin-right:5px">({{ groupName }})</span>' + '<span v-if="groupName" @click="showGroupDialog" class="x-link">({{ groupName }})</span>' +
'<span class="flags" :class="region" style="display:inline-block"></span>' + '<span class="flags" :class="region" style="display:inline-block;margin-left:5px"></span>' +
'<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>', '<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>',
props: { props: {
location: String, location: String,
@@ -955,9 +955,9 @@ speechSynthesis.getVoices();
template: template:
'<span><span @click="showLaunchDialog" class="x-link">' + '<span><span @click="showLaunchDialog" class="x-link">' +
'<i v-if="isUnlocked" class="el-icon el-icon-unlock" style="display:inline-block;margin-right:5px"></i>' + '<i v-if="isUnlocked" class="el-icon el-icon-unlock" style="display:inline-block;margin-right:5px"></i>' +
'<span style="margin-right:5px"> #{{ instanceName }} {{ accessType }}</span></span>' + '<span> #{{ instanceName }} {{ accessType }}</span></span>' +
'<span v-if="groupName" @click="showGroupDialog" class="x-link" style="margin-right:5px">({{ groupName }})</span>' + '<span v-if="groupName" @click="showGroupDialog" class="x-link">({{ groupName }})</span>' +
'<span class="flags" :class="region" style="display:inline-block"></span>' + '<span class="flags" :class="region" style="display:inline-block;margin-left:5px"></span>' +
'<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>', '<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>',
props: { props: {
locationobject: Object, locationobject: Object,
@@ -1009,9 +1009,11 @@ speechSynthesis.getVoices();
this.groupName = this.grouphint; this.groupName = this.grouphint;
} else if (this.locationobject.groupId) { } else if (this.locationobject.groupId) {
this.groupName = this.locationobject.groupId; this.groupName = this.locationobject.groupId;
$app.getGroupName(this.location).then((groupName) => { $app.getGroupName(this.locationobject.groupId).then(
this.groupName = groupName; (groupName) => {
}); this.groupName = groupName;
}
);
} }
}, },
showLaunchDialog() { showLaunchDialog() {
@@ -1188,14 +1190,19 @@ speechSynthesis.getVoices();
args.ref = this.applyCurrentUser(json); args.ref = this.applyCurrentUser(json);
var location = ''; var location = '';
var travelingToLocation = ''; var travelingToLocation = '';
if (json.presence?.world && $app.isRealInstance(json.presence.world)) { if (json.presence?.world) {
location = `${json.presence.world}:${json.presence.instance}`; if ($app.isRealInstance(json.presence.world)) {
location = `${json.presence.world}:${json.presence.instance}`;
} else {
location = json.presence.world;
}
} }
if ( if (json.presence?.travelingToWorld) {
json.presence?.travelingToWorld && if ($app.isRealInstance(json.presence.travelingToWorld)) {
$app.isRealInstance(json.presence.travelingToWorld) travelingToLocation = `${json.presence.travelingToWorld}:${json.presence.travelingToInstance}`;
) { } else {
travelingToLocation = `${json.presence.travelingToWorld}:${json.presence.travelingToInstance}`; travelingToLocation = json.presence.travelingToWorld;
}
} }
this.applyUser({ this.applyUser({
id: json.id, id: json.id,
@@ -1892,6 +1899,24 @@ speechSynthesis.getVoices();
}); });
}; };
/*
params: {
userId: string
}
*/
API.getUserFeedback = function (params) {
return this.call(`users/${params.userId}/feedback`, {
method: 'GET'
}).then((json) => {
var args = {
json,
params
};
this.$emit('USER:FEEDBACK', args);
return args;
});
};
// API: World // API: World
API.cachedWorlds = new Map(); API.cachedWorlds = new Map();
@@ -3785,7 +3810,11 @@ speechSynthesis.getVoices();
return; return;
} }
this.isFavoriteLoading = true; this.isFavoriteLoading = true;
await this.getFavoriteLimits(); try {
await this.getFavoriteLimits();
} catch (err) {
console.error(err);
}
this.expireFavorites(); this.expireFavorites();
this.bulk({ this.bulk({
fn: 'getFavorites', fn: 'getFavorites',
@@ -7760,10 +7789,9 @@ speechSynthesis.getVoices();
var groupName = ''; var groupName = '';
var groupId = data; var groupId = data;
if (!data.startsWith('grp_')) { if (!data.startsWith('grp_')) {
var L = API.parseLocation(location); var L = API.parseLocation(data);
if (L.groupId) { groupId = L.groupId;
groupId = L.groupId; if (!L.groupId) {
} else {
return ''; return '';
} }
} }
@@ -9489,7 +9517,7 @@ speechSynthesis.getVoices();
if (!this.photonLobbyWatcherLoop) { if (!this.photonLobbyWatcherLoop) {
return; return;
} }
if (this.photonLobbyCurrent.size <= 1) { if (this.photonLobbyCurrent.size === 0) {
this.photonLobbyWatcherLoopStop(); this.photonLobbyWatcherLoopStop();
return; return;
} }
@@ -10466,8 +10494,12 @@ speechSynthesis.getVoices();
type: 'ChangeStatus', type: 'ChangeStatus',
status: photonUser.status, status: photonUser.status,
previousStatus: ref.status, previousStatus: ref.status,
statusDescription: photonUser.statusDescription, statusDescription: this.replaceBioSymbols(
previousStatusDescription: ref.statusDescription, photonUser.statusDescription
),
previousStatusDescription: this.replaceBioSymbols(
ref.statusDescription
),
created_at: Date.parse(gameLogDate) created_at: Date.parse(gameLogDate)
}); });
} }
@@ -10479,6 +10511,8 @@ speechSynthesis.getVoices();
return; return;
} }
var avatar = user.avatarDict; var avatar = user.avatarDict;
avatar.name = this.replaceBioSymbols(avatar.name);
avatar.description = this.replaceBioSymbols(avatar.description);
var platform = ''; var platform = '';
if (user.last_platform === 'android') { if (user.last_platform === 'android') {
platform = 'Quest'; platform = 'Quest';
@@ -10613,6 +10647,8 @@ speechSynthesis.getVoices();
oldAvatarId !== avatar.id && oldAvatarId !== avatar.id &&
photonId !== this.photonLobbyCurrentUser photonId !== this.photonLobbyCurrentUser
) { ) {
avatar.name = this.replaceBioSymbols(avatar.name);
avatar.description = this.replaceBioSymbols(avatar.description);
this.checkVRChatCache(avatar).then((cacheInfo) => { this.checkVRChatCache(avatar).then((cacheInfo) => {
var inCache = false; var inCache = false;
if (cacheInfo[0] > 0) { if (cacheInfo[0] > 0) {
@@ -10662,7 +10698,7 @@ speechSynthesis.getVoices();
} }
var {groupOnNameplate} = this.photonLobbyJointime.get(photonId); var {groupOnNameplate} = this.photonLobbyJointime.get(photonId);
if ( if (
groupOnNameplate && typeof groupOnNameplate !== 'undefined' &&
groupOnNameplate !== groupId && groupOnNameplate !== groupId &&
photonId !== this.photonLobbyCurrentUser photonId !== this.photonLobbyCurrentUser
) { ) {
@@ -11412,11 +11448,6 @@ speechSynthesis.getVoices();
this.showUserDialog(ref.userId); this.showUserDialog(ref.userId);
return; return;
} }
if (ref.displayName === 'FA-18E Super Hornet') {
// :eyes:
this.showUserDialog('usr_5cd9007b-1802-45fe-92e2-0b6617639344');
return;
}
if (!ref.displayName || ref.displayName.substring(0, 3) === 'ID:') { if (!ref.displayName || ref.displayName.substring(0, 3) === 'ID:') {
return; return;
} }
@@ -12683,6 +12714,7 @@ speechSynthesis.getVoices();
$app.data.configTreeData = []; $app.data.configTreeData = [];
$app.data.currentUserTreeData = []; $app.data.currentUserTreeData = [];
$app.data.currentUserFeedbackData = [];
$app.data.pastDisplayNameTable = { $app.data.pastDisplayNameTable = {
data: [], data: [],
tableProps: { tableProps: {
@@ -19768,7 +19800,7 @@ speechSynthesis.getVoices();
var name = ref.displayName; var name = ref.displayName;
if (ref.statusDescription) { if (ref.statusDescription) {
var statusRegex = var statusRegex =
/(?:^|\n*)(?:(?:[^\n:]|\|)*(?::|˸|discord)[\t\v\f\r]*)?([^\n]*(#|)(?: )?\d{4})/gi.exec( /(?:^|\n*)(?:(?:[^\n:])*(?::|˸|discord)[\t\v\f\r]*)?([^\n]*(#|)(?: )?\d{4})/gi.exec(
ref.statusDescription ref.statusDescription
); );
if (statusRegex) { if (statusRegex) {
@@ -19777,7 +19809,7 @@ speechSynthesis.getVoices();
} }
if (!discord && ref.bio) { if (!discord && ref.bio) {
var bioRegex = var bioRegex =
/(?:^|\n*)(?:(?:[^\n:]|\|)*(?::|˸|discord)[\t\v\f\r]*)?([^\n]*(#|)(?: )?\d{4})/gi.exec( /(?:^|\n*)(?:(?:[^\n:])*(?::|˸|discord)[\t\v\f\r]*)?([^\n]*(#|)(?: )?\d{4})/gi.exec(
ref.bio ref.bio
); );
if (bioRegex) { if (bioRegex) {
@@ -21842,11 +21874,9 @@ speechSynthesis.getVoices();
$app.methods.isRealInstance = function (instanceId) { $app.methods.isRealInstance = function (instanceId) {
switch (instanceId) { switch (instanceId) {
case 'offline': case 'offline':
return false;
case 'private': case 'private':
return false;
case 'traveling': case 'traveling':
return false; case 'local':
case '': case '':
return false; return false;
} }
@@ -24567,6 +24597,16 @@ speechSynthesis.getVoices();
this.updateVRConfigVars(); this.updateVRConfigVars();
}; };
API.$on('USER:FEEDBACK', function (args) {
if (args.params.userId === this.currentUser.id) {
$app.currentUserFeedbackData = buildTreeData(args.json);
}
});
$app.methods.getCurrentUserFeedback = function () {
return API.getUserFeedback({userId: API.currentUser.id});
};
$app = new Vue($app); $app = new Vue($app);
window.$app = $app; window.$app = $app;
})(); })();

View File

@@ -856,7 +856,7 @@ html
el-button(type="text" icon="el-icon-delete" size="mini" style="margin-left:5px" @click="deleteNotificationLog(scope.row)") el-button(type="text" icon="el-icon-delete" size="mini" style="margin-left:5px" @click="deleteNotificationLog(scope.row)")
//- profile //- profile
.x-container(v-show="$refs.menu && $refs.menu.activeIndex === 'profile'") .x-container(v-show="$refs.menu && $refs.menu.activeIndex === 'profile'" v-if="$refs.menu && $refs.menu.activeIndex === 'profile'")
div.options-container(style="margin-top:0") div.options-container(style="margin-top:0")
span.header {{ $t('view.profile.profile.header') }} span.header {{ $t('view.profile.profile.header') }}
.x-friend-list(style="margin-top:10px") .x-friend-list(style="margin-top:10px")
@@ -994,6 +994,17 @@ html
span span
span(v-text="scope.data.key" style="font-weight:bold;margin-right:5px") span(v-text="scope.data.key" style="font-weight:bold;margin-right:5px")
span(v-if="!scope.data.children" v-text="scope.data.value") span(v-if="!scope.data.children" v-text="scope.data.value")
div.options-container
span.header {{ $t('view.profile.feedback') }}
el-tooltip(placement="top" :content="$t('view.profile.refresh_tooltip')" :disabled="hideTooltips")
el-button(type="default" @click="getCurrentUserFeedback()" size="mini" icon="el-icon-refresh" circle style="margin-left:5px")
el-tooltip(placement="top" :content="$t('view.profile.clear_results_tooltip')" :disabled="hideTooltips")
el-button(type="default" @click="currentUserFeedbackData = []" size="mini" icon="el-icon-delete" circle style="margin-left:5px")
el-tree(v-if="currentUserFeedbackData.length > 0" :data="currentUserFeedbackData" style="margin-top:10px;font-size:12px")
template(#default="scope")
span
span(v-text="scope.data.key" style="font-weight:bold;margin-right:5px")
span(v-if="!scope.data.children" v-text="scope.data.value")
//- friends list //- friends list
.x-container(v-show="$refs.menu && $refs.menu.activeIndex === 'friendsList'" v-if="$refs.menu && $refs.menu.activeIndex === 'friendsList'") .x-container(v-show="$refs.menu && $refs.menu.activeIndex === 'friendsList'" v-if="$refs.menu && $refs.menu.activeIndex === 'friendsList'")
@@ -2722,7 +2733,7 @@ html
el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="VRCXUpdateDialog" :visible.sync="VRCXUpdateDialog.visible" :title="$t('dialog.vrcx_updater.header')" width="400px") el-dialog.x-dialog(:before-close="beforeDialogClose" @mousedown.native="dialogMouseDown" @mouseup.native="dialogMouseUp" ref="VRCXUpdateDialog" :visible.sync="VRCXUpdateDialog.visible" :title="$t('dialog.vrcx_updater.header')" width="400px")
div(v-loading="checkingForVRCXUpdate" style="margin-top:15px") div(v-loading="checkingForVRCXUpdate" style="margin-top:15px")
div(v-if="VRCXUpdateDialog.updatePending" style="margin-bottom:15px") div(v-if="VRCXUpdateDialog.updatePending" style="margin-bottom:15px")
span(v-text="pendingVRCXUpdate") span(v-text="pendingVRCXInstall")
br br
span {{ $t('dialog.vrcx_updater.ready_for_update') }} span {{ $t('dialog.vrcx_updater.ready_for_update') }}
el-select(v-model="branch" @change="loadBranchVersions" style="display:inline-block;width:150px;margin-right:15px") el-select(v-model="branch" @change="loadBranchVersions" style="display:inline-block;width:150px;margin-right:15px")
@@ -2732,7 +2743,7 @@ html
div(v-if="!VRCXUpdateDialog.updatePending && VRCXUpdateDialog.release === appVersion" style="margin-top:15px") div(v-if="!VRCXUpdateDialog.updatePending && VRCXUpdateDialog.release === appVersion" style="margin-top:15px")
span {{ $t('dialog.vrcx_updater.latest_version') }} span {{ $t('dialog.vrcx_updater.latest_version') }}
template(#footer) template(#footer)
el-button(v-if="(VRCXUpdateDialog.updatePending && VRCXUpdateDialog.release !== pendingVRCXUpdate) || VRCXUpdateDialog.release !== appVersion" type="primary" size="small" @click="installVRCXUpdate") {{ $t('dialog.vrcx_updater.download') }} el-button(v-if="(VRCXUpdateDialog.updatePending && VRCXUpdateDialog.release !== pendingVRCXInstall) || VRCXUpdateDialog.release !== appVersion" type="primary" size="small" @click="installVRCXUpdate") {{ $t('dialog.vrcx_updater.download') }}
el-button(v-if="VRCXUpdateDialog.updatePending" type="primary" size="small" @click="restartVRCX") {{ $t('dialog.vrcx_updater.install') }} el-button(v-if="VRCXUpdateDialog.updatePending" type="primary" size="small" @click="restartVRCX") {{ $t('dialog.vrcx_updater.install') }}
//- dialog: launch //- dialog: launch

View File

@@ -163,6 +163,7 @@
"past_display_names": "Past Display Names", "past_display_names": "Past Display Names",
"config_json": "Config JSON", "config_json": "Config JSON",
"current_user_json": "Current User JSON", "current_user_json": "Current User JSON",
"feedback": "Feedback",
"refresh_tooltip": "Refresh", "refresh_tooltip": "Refresh",
"clear_results_tooltip": "Clear results" "clear_results_tooltip": "Clear results"
}, },
@@ -202,9 +203,9 @@
}, },
"legal_notice": { "legal_notice": {
"header": "Legal Notice", "header": "Legal Notice",
"info": "VRCX is an assistant application for provide information about manage friendship. this application uses unofficial VRChat API (VRCSDK).", "info": "VRCX is an assistant application for VRChat that provides information about and managing friendship. This application makes use of the unofficial VRChat API SDK.",
"disclaimer1": "VRCX isn't endorsed by VRChat and doesn't reflect the views or opinions of VRChat or anyone officially involved in producing or managing VRChat. VRChat is trademark of VRChat Inc. VRChat © VRChat Inc.", "disclaimer1": "VRCX isn't endorsed by VRChat and doesn't reflect the views or opinions of VRChat or anyone officially involved in producing or managing VRChat. VRChat is trademark of VRChat Inc. VRChat © VRChat Inc.",
"disclaimer2": "pypy or Natsumi aren't responsible for any problems caused by VRCX. Use at your own risk!", "disclaimer2": "pypy & Natsumi are not responsible for any problems caused by VRCX. Use at your own risk!",
"open_source_software_notice": "Open Source Software Notice" "open_source_software_notice": "Open Source Software Notice"
} }
}, },

View File

@@ -90,9 +90,9 @@ Vue.component('marquee-text', MarqueeText);
Vue.component('location', { Vue.component('location', {
template: template:
'<span><span style="margin-right:5px">{{ text }}</span>' + '<span><span>{{ text }}</span>' +
'<span v-if="groupName" style="margin-right:5px">({{ groupName }})</span>' + '<span v-if="groupName">({{ groupName }})</span>' +
'<span class="flags" :class="region" style="display:inline-block;margin-bottom:2px"></span>' + '<span class="flags" :class="region" style="display:inline-block;margin-bottom:2px;margin-left:5px"></span>' +
'<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>', '<i v-if="strict" class="el-icon el-icon-lock" style="display:inline-block;margin-left:5px"></i></span>',
props: { props: {
location: String, location: String,

View File

@@ -488,12 +488,12 @@ html
span(v-else-if="feed.avatar.releaseStatus === 'private'" style="margin-left:10px;color:#e6a23c") (Private) span(v-else-if="feed.avatar.releaseStatus === 'private'" style="margin-left:10px;color:#e6a23c") (Private)
template(v-else-if="feed.type === 'ChangeStatus'") template(v-else-if="feed.type === 'ChangeStatus'")
span(style="margin-left:10px;color:#a3a3a3") ChangeStatus span(style="margin-left:10px;color:#a3a3a3") ChangeStatus
template(v-if="feed.status !== feed.previousStatus") span(v-if="feed.status !== feed.previousStatus")
i.x-user-status(:class="statusClass(feed.previousStatus)" style="margin-left:10px;width:20px;height:20px") i.x-user-status(:class="statusClass(feed.previousStatus)" style="margin-left:10px;width:20px;height:20px")
span span
i.el-icon-right i.el-icon-right
i.x-user-status(:class="statusClass(feed.status)" style="width:20px;height:20px") i.x-user-status(:class="statusClass(feed.status)" style="width:20px;height:20px")
span(v-if="feed.statusDescription !== feed.previousStatusDescription" v-text="feed.statusDescription" style="margin-left:10px") span(v-if="feed.statusDescription !== feed.previousStatusDescription" v-text="feed.statusDescription" style="margin-left:10px")
template(v-else-if="feed.type === 'ChangeGroup'") template(v-else-if="feed.type === 'ChangeGroup'")
span(style="margin-left:10px;color:#a3a3a3") ChangeGroup span(style="margin-left:10px;color:#a3a3a3") ChangeGroup
span(v-text="feed.groupName" style="margin-left:10px") span(v-text="feed.groupName" style="margin-left:10px")