mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
New instance self invite button + remember last used access type
This commit is contained in:
@@ -9724,6 +9724,36 @@ speechSynthesis.getVoices();
|
|||||||
D.instanceId = tags.join('');
|
D.instanceId = tags.join('');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.methods.selfInvite = function (location) {
|
||||||
|
var L = API.parseLocation(location);
|
||||||
|
if (L.isOffline ||
|
||||||
|
L.isPrivate ||
|
||||||
|
L.worldId === '') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
API.getCachedWorld({
|
||||||
|
worldId: L.worldId
|
||||||
|
}).then((args) => {
|
||||||
|
if (API.currentUser.status === 'busy') {
|
||||||
|
this.$message({
|
||||||
|
message: 'You can\'t invite yourself in \'Do Not Disturb\' mode',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
API.sendInvite({
|
||||||
|
instanceId: L.tag,
|
||||||
|
worldId: L.tag,
|
||||||
|
worldName: args.ref.name
|
||||||
|
}, API.currentUser.id).finally(() => {
|
||||||
|
this.$message({
|
||||||
|
message: 'Invite sent to yourself',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
var getLaunchURL = function (worldId, instanceId) {
|
var getLaunchURL = function (worldId, instanceId) {
|
||||||
if (instanceId) {
|
if (instanceId) {
|
||||||
return `https://vrchat.com/home/launch?worldId=${encodeURIComponent(worldId)}&instanceId=${encodeURIComponent(instanceId)}`;
|
return `https://vrchat.com/home/launch?worldId=${encodeURIComponent(worldId)}&instanceId=${encodeURIComponent(instanceId)}`;
|
||||||
@@ -9740,8 +9770,12 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
D.url = getLaunchURL(D.worldId, D.instanceId);
|
D.url = getLaunchURL(D.worldId, D.instanceId);
|
||||||
};
|
};
|
||||||
|
var saveAccessType = function () {
|
||||||
|
configRepository.setString('instanceDialogAccessType', this.newInstanceDialog.accessType);
|
||||||
|
};
|
||||||
$app.watch['newInstanceDialog.worldId'] = updateLocationURL;
|
$app.watch['newInstanceDialog.worldId'] = updateLocationURL;
|
||||||
$app.watch['newInstanceDialog.instanceId'] = updateLocationURL;
|
$app.watch['newInstanceDialog.instanceId'] = updateLocationURL;
|
||||||
|
$app.watch['newInstanceDialog.accessType'] = saveAccessType;
|
||||||
|
|
||||||
$app.methods.showNewInstanceDialog = function (tag) {
|
$app.methods.showNewInstanceDialog = function (tag) {
|
||||||
this.$nextTick(() => adjustDialogZ(this.$refs.newInstanceDialog.$el));
|
this.$nextTick(() => adjustDialogZ(this.$refs.newInstanceDialog.$el));
|
||||||
@@ -9754,6 +9788,9 @@ speechSynthesis.getVoices();
|
|||||||
var D = this.newInstanceDialog;
|
var D = this.newInstanceDialog;
|
||||||
D.worldId = L.worldId;
|
D.worldId = L.worldId;
|
||||||
D.accessType = 'public';
|
D.accessType = 'public';
|
||||||
|
if (configRepository.getString('instanceDialogAccessType') !== null) {
|
||||||
|
D.accessType = configRepository.getString('instanceDialogAccessType');
|
||||||
|
}
|
||||||
this.buildInstance();
|
this.buildInstance();
|
||||||
D.visible = true;
|
D.visible = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1547,6 +1547,7 @@ html
|
|||||||
el-button(size="small" @click="makeHome(newInstanceDialog.location)") Make Home
|
el-button(size="small" @click="makeHome(newInstanceDialog.location)") Make Home
|
||||||
el-button(size="small" @click="copyInstanceUrl(newInstanceDialog.url)") Copy URL
|
el-button(size="small" @click="copyInstanceUrl(newInstanceDialog.url)") Copy URL
|
||||||
el-button(size="small" @click="showInviteDialog(newInstanceDialog.location)") Invite
|
el-button(size="small" @click="showInviteDialog(newInstanceDialog.location)") Invite
|
||||||
|
el-button(size="small" @click="selfInvite(newInstanceDialog.location)") Self Invite
|
||||||
el-button(type="primary" size="small" @click="showLaunchDialog(newInstanceDialog.location)") Launch
|
el-button(type="primary" size="small" @click="showLaunchDialog(newInstanceDialog.location)") Launch
|
||||||
|
|
||||||
//- dialog: launch options
|
//- dialog: launch options
|
||||||
|
|||||||
Reference in New Issue
Block a user