mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
Direct access world URL
This commit is contained in:
@@ -7526,16 +7526,22 @@ speechSynthesis.getVoices();
|
|||||||
};
|
};
|
||||||
|
|
||||||
$app.methods.promptWorldDialog = function () {
|
$app.methods.promptWorldDialog = function () {
|
||||||
this.$prompt('Enter a World ID (UUID)', 'Direct Access', {
|
this.$prompt('Enter a World URL or ID (UUID)', 'Direct Access', {
|
||||||
distinguishCancelAndClose: true,
|
distinguishCancelAndClose: true,
|
||||||
confirmButtonText: 'OK',
|
confirmButtonText: 'OK',
|
||||||
cancelButtonText: 'Cancel',
|
cancelButtonText: 'Cancel',
|
||||||
inputPattern: /\S+/,
|
inputPattern: /\S+/,
|
||||||
inputErrorMessage: 'World ID is required',
|
inputErrorMessage: 'World URL/ID is required',
|
||||||
callback: (action, instance) => {
|
callback: (action, instance) => {
|
||||||
if (action === 'confirm' &&
|
if (action === 'confirm' &&
|
||||||
instance.inputValue) {
|
instance.inputValue) {
|
||||||
this.showWorldDialog(instance.inputValue);
|
var testUrl = instance.inputValue.substring(0, 15);
|
||||||
|
if (testUrl === 'https://vrchat.') {
|
||||||
|
var worldInstance = this.parseLocationUrl(instance.inputValue);
|
||||||
|
this.showWorldDialog(worldInstance);
|
||||||
|
} else {
|
||||||
|
this.showWorldDialog(instance.inputValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -9450,19 +9456,19 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
nonce = nonce.join('').substr(0, 64);
|
nonce = nonce.join('').substr(0, 64);
|
||||||
*/
|
*/
|
||||||
tags.push(`~nonce(${uuidv4()})`);
|
|
||||||
if (D.accessType === 'invite+') {
|
if (D.accessType === 'invite+') {
|
||||||
tags.push('~canRequestInvite');
|
tags.push('~canRequestInvite');
|
||||||
}
|
}
|
||||||
|
tags.push(`~nonce(${uuidv4()})`);
|
||||||
}
|
}
|
||||||
D.instanceId = tags.join('');
|
D.instanceId = tags.join('');
|
||||||
};
|
};
|
||||||
|
|
||||||
var getLaunchURL = function (worldId, instanceId) {
|
var getLaunchURL = function (worldId, instanceId) {
|
||||||
if (instanceId) {
|
if (instanceId) {
|
||||||
return `https://vrchat.net/launch?worldId=${encodeURIComponent(worldId)}&instanceId=${encodeURIComponent(instanceId)}`;
|
return `https://vrchat.com/home/launch?worldId=${encodeURIComponent(worldId)}&instanceId=${encodeURIComponent(instanceId)}`;
|
||||||
}
|
}
|
||||||
return `https://vrchat.net/launch?worldId=${encodeURIComponent(worldId)}`;
|
return `https://vrchat.com/home/launch?worldId=${encodeURIComponent(worldId)}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
var updateLocationURL = function () {
|
var updateLocationURL = function () {
|
||||||
@@ -11740,6 +11746,14 @@ speechSynthesis.getVoices();
|
|||||||
$app.downloadDialog.visible = false;
|
$app.downloadDialog.visible = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Parse location URL
|
||||||
|
$app.methods.parseLocationUrl = function (url) {
|
||||||
|
var urlParams = new URLSearchParams(url.search);
|
||||||
|
var worldId = urlParams.get('worldId');
|
||||||
|
var instanceId = urlParams.get('instanceId');
|
||||||
|
return `${worldId}:${instanceId}`;
|
||||||
|
};
|
||||||
|
|
||||||
$app = new Vue($app);
|
$app = new Vue($app);
|
||||||
window.$app = $app;
|
window.$app = $app;
|
||||||
}());
|
}());
|
||||||
|
|||||||
@@ -492,7 +492,7 @@ html
|
|||||||
div(style="margin-top:10px")
|
div(style="margin-top:10px")
|
||||||
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/Instance
|
||||||
el-button(size="small" @click="promptAddAvatarFavoriteDialog()") Avatar
|
el-button(size="small" @click="promptAddAvatarFavoriteDialog()") Avatar
|
||||||
div.options-container
|
div.options-container
|
||||||
span.header Invite Messages
|
span.header Invite Messages
|
||||||
|
|||||||
Reference in New Issue
Block a user