mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 22:46:06 +02:00
Favorite avatar by UUID
This commit is contained in:
+40
-1
@@ -2585,6 +2585,12 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
API.$on('FAVORITE:ADD', function (args) {
|
||||||
|
if ((args.params.type === 'avatar') && (!API.cachedAvatars.has(args.params.favoriteId))) {
|
||||||
|
this.refreshFavoriteAvatars(args.params.tags);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
API.$on('FAVORITE:DELETE', function (args) {
|
API.$on('FAVORITE:DELETE', function (args) {
|
||||||
var ref = this.cachedFavoritesByObjectId.get(args.params.objectId);
|
var ref = this.cachedFavoritesByObjectId.get(args.params.objectId);
|
||||||
if (typeof ref === 'undefined') {
|
if (typeof ref === 'undefined') {
|
||||||
@@ -2742,6 +2748,15 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
API.refreshFavoriteAvatars = function (tag) {
|
||||||
|
var params = {
|
||||||
|
n: 100,
|
||||||
|
offset: 0,
|
||||||
|
tag
|
||||||
|
};
|
||||||
|
this.getFavoriteAvatars(params);
|
||||||
|
};
|
||||||
|
|
||||||
API.refreshFavoriteItems = function () {
|
API.refreshFavoriteItems = function () {
|
||||||
var types = {
|
var types = {
|
||||||
'world': [0, 'getFavoriteWorlds'],
|
'world': [0, 'getFavoriteWorlds'],
|
||||||
@@ -2770,7 +2785,7 @@ speechSynthesis.getVoices();
|
|||||||
fn,
|
fn,
|
||||||
N,
|
N,
|
||||||
params: {
|
params: {
|
||||||
n: 50,
|
n: 100,
|
||||||
offset: 0,
|
offset: 0,
|
||||||
tag
|
tag
|
||||||
}
|
}
|
||||||
@@ -7415,6 +7430,22 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.methods.promptAddAvatarFavoriteDialog = function () {
|
||||||
|
this.$prompt('Enter a Avatar ID (UUID)', 'Avatar Favorite', {
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
confirmButtonText: 'OK',
|
||||||
|
cancelButtonText: 'Cancel',
|
||||||
|
inputPattern: /\S+/,
|
||||||
|
inputErrorMessage: 'Avatar ID is required',
|
||||||
|
callback: (action, instance) => {
|
||||||
|
if (action === 'confirm' &&
|
||||||
|
instance.inputValue) {
|
||||||
|
this.showFavoriteDialog('avatar', instance.inputValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// App: Dialog
|
// App: Dialog
|
||||||
|
|
||||||
var adjustDialogZ = (el) => {
|
var adjustDialogZ = (el) => {
|
||||||
@@ -8785,6 +8816,14 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.methods.addFavoriteAvatar = function (ref, group) {
|
||||||
|
API.addFavorite({
|
||||||
|
type: 'avatar',
|
||||||
|
favoriteId: ref.id,
|
||||||
|
tags: group.name
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
$app.methods.showFavoriteDialog = function (type, objectId) {
|
$app.methods.showFavoriteDialog = function (type, objectId) {
|
||||||
this.$nextTick(() => adjustDialogZ(this.$refs.favoriteDialog.$el));
|
this.$nextTick(() => adjustDialogZ(this.$refs.favoriteDialog.$el));
|
||||||
var D = this.favoriteDialog;
|
var D = this.favoriteDialog;
|
||||||
|
|||||||
+1
-1
@@ -449,7 +449,7 @@ html
|
|||||||
el-button-group
|
el-button-group
|
||||||
el-button(size="small" @click="promptUserDialog()") User
|
el-button(size="small" @click="promptUserDialog()") User
|
||||||
el-button(size="small" @click="promptWorldDialog()") World
|
el-button(size="small" @click="promptWorldDialog()") World
|
||||||
el-button(size="small" @click="promptAvatarDialog()") Avatar
|
el-button(size="small" @click="promptAddAvatarFavoriteDialog()") Avatar
|
||||||
div.options-container
|
div.options-container
|
||||||
span.header Invite Messages
|
span.header Invite Messages
|
||||||
el-tooltip(placement="top")
|
el-tooltip(placement="top")
|
||||||
|
|||||||
Reference in New Issue
Block a user