mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-06 06:46:04 +02:00
VRDancing Discord RPC
This commit is contained in:
+87
-31
@@ -7977,6 +7977,8 @@ speechSynthesis.getVoices();
|
|||||||
var type = gameLog.data.substr(0, gameLog.data.indexOf(' '));
|
var type = gameLog.data.substr(0, gameLog.data.indexOf(' '));
|
||||||
if (type === 'VideoPlay(PyPyDance)') {
|
if (type === 'VideoPlay(PyPyDance)') {
|
||||||
this.addGameLogPyPyDance(gameLog, location);
|
this.addGameLogPyPyDance(gameLog, location);
|
||||||
|
} else if (type === 'VideoPlay(VRDancing)') {
|
||||||
|
this.addGameLogVRDancing(gameLog, location);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case 'photon-event':
|
case 'photon-event':
|
||||||
@@ -8718,11 +8720,7 @@ speechSynthesis.getVoices();
|
|||||||
data.EventType === 'UdonSyncRunProgramAsRPC' &&
|
data.EventType === 'UdonSyncRunProgramAsRPC' &&
|
||||||
data.Data[0] === 'Beep'
|
data.Data[0] === 'Beep'
|
||||||
) {
|
) {
|
||||||
var L = API.parseLocation(this.lastLocation.location);
|
if (!this.isDanceWorld(this.lastLocation.location)) {
|
||||||
if (
|
|
||||||
L.worldId !==
|
|
||||||
'wrld_f20326da-f1ac-45fc-a062-609723b097b1'
|
|
||||||
) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var text = 'Beep';
|
var text = 'Beep';
|
||||||
@@ -9026,12 +9024,8 @@ speechSynthesis.getVoices();
|
|||||||
if (typeof gameLog.videoPos !== 'undefined') {
|
if (typeof gameLog.videoPos !== 'undefined') {
|
||||||
videoPos = gameLog.videoPos;
|
videoPos = gameLog.videoPos;
|
||||||
}
|
}
|
||||||
var L = API.parseLocation(location);
|
if (!this.isDanceWorld(location) || gameLog.videoId === 'YouTube') {
|
||||||
if (
|
// skip PyPyDance and VRDancing videos
|
||||||
L.worldId !== 'wrld_f20326da-f1ac-45fc-a062-609723b097b1' ||
|
|
||||||
gameLog.videoId === 'YouTube'
|
|
||||||
) {
|
|
||||||
// skip PyPyDance videos
|
|
||||||
try {
|
try {
|
||||||
var url = new URL(videoUrl);
|
var url = new URL(videoUrl);
|
||||||
var id1 = url.pathname;
|
var id1 = url.pathname;
|
||||||
@@ -9095,18 +9089,9 @@ speechSynthesis.getVoices();
|
|||||||
text2 = text2.substr(text2.indexOf(':') + 2);
|
text2 = text2.substr(text2.indexOf(':') + 2);
|
||||||
}
|
}
|
||||||
var videoName = text2.slice(0, -1);
|
var videoName = text2.slice(0, -1);
|
||||||
var userId = '';
|
|
||||||
if (displayName === 'Random') {
|
if (displayName === 'Random') {
|
||||||
displayName = '';
|
displayName = '';
|
||||||
}
|
}
|
||||||
if (displayName) {
|
|
||||||
for (var ref of API.cachedUsers.values()) {
|
|
||||||
if (ref.displayName === displayName) {
|
|
||||||
userId = ref.id;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (videoUrl === this.nowPlaying.url) {
|
if (videoUrl === this.nowPlaying.url) {
|
||||||
var entry = {
|
var entry = {
|
||||||
created_at: gameLog.dt,
|
created_at: gameLog.dt,
|
||||||
@@ -9117,6 +9102,74 @@ speechSynthesis.getVoices();
|
|||||||
this.setNowPlaying(entry);
|
this.setNowPlaying(entry);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
var userId = '';
|
||||||
|
if (displayName) {
|
||||||
|
for (var ref of API.cachedUsers.values()) {
|
||||||
|
if (ref.displayName === displayName) {
|
||||||
|
userId = ref.id;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (videoId === 'YouTube') {
|
||||||
|
var entry = {
|
||||||
|
dt: gameLog.dt,
|
||||||
|
videoUrl,
|
||||||
|
displayName,
|
||||||
|
videoPos,
|
||||||
|
videoId
|
||||||
|
};
|
||||||
|
this.addGameLogVideo(entry, location, userId);
|
||||||
|
} else {
|
||||||
|
var entry = {
|
||||||
|
created_at: gameLog.dt,
|
||||||
|
type: 'VideoPlay',
|
||||||
|
videoUrl,
|
||||||
|
videoId,
|
||||||
|
videoName,
|
||||||
|
videoLength,
|
||||||
|
location,
|
||||||
|
displayName,
|
||||||
|
userId,
|
||||||
|
videoPos
|
||||||
|
};
|
||||||
|
this.setNowPlaying(entry);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$app.methods.addGameLogVRDancing = function (gameLog, location) {
|
||||||
|
var data =
|
||||||
|
/VideoPlay\(VRDancing\) "(.+?)",([\d.]+),([\d.]+),([\d.]+),"(.+?)","(.+?)"/g.exec(
|
||||||
|
gameLog.data
|
||||||
|
);
|
||||||
|
var videoUrl = data[1];
|
||||||
|
var videoPos = Number(data[2]);
|
||||||
|
var videoLength = Number(data[3]);
|
||||||
|
var videoId = Number(data[4]);
|
||||||
|
var displayName = data[5];
|
||||||
|
var videoName = data[6];
|
||||||
|
if (videoId === -1) {
|
||||||
|
videoId = 'YouTube';
|
||||||
|
}
|
||||||
|
if (videoUrl === this.nowPlaying.url) {
|
||||||
|
var entry = {
|
||||||
|
created_at: gameLog.dt,
|
||||||
|
videoUrl,
|
||||||
|
videoLength,
|
||||||
|
videoPos
|
||||||
|
};
|
||||||
|
this.setNowPlaying(entry);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var userId = '';
|
||||||
|
if (displayName) {
|
||||||
|
for (var ref of API.cachedUsers.values()) {
|
||||||
|
if (ref.displayName === displayName) {
|
||||||
|
userId = ref.id;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (videoId === 'YouTube') {
|
if (videoId === 'YouTube') {
|
||||||
var entry = {
|
var entry = {
|
||||||
dt: gameLog.dt,
|
dt: gameLog.dt,
|
||||||
@@ -9409,11 +9462,7 @@ speechSynthesis.getVoices();
|
|||||||
buttonText = '';
|
buttonText = '';
|
||||||
buttonUrl = '';
|
buttonUrl = '';
|
||||||
}
|
}
|
||||||
if (
|
if (!hidePrivate && this.isDanceWorld(L.tag)) {
|
||||||
(!hidePrivate &&
|
|
||||||
L.worldId === 'wrld_f20326da-f1ac-45fc-a062-609723b097b1') ||
|
|
||||||
L.worldId === 'wrld_42377cf1-c54f-45ed-8996-5875b0573a83'
|
|
||||||
) {
|
|
||||||
// dance world rpc
|
// dance world rpc
|
||||||
if (L.worldId === 'wrld_f20326da-f1ac-45fc-a062-609723b097b1') {
|
if (L.worldId === 'wrld_f20326da-f1ac-45fc-a062-609723b097b1') {
|
||||||
appId = '784094509008551956';
|
appId = '784094509008551956';
|
||||||
@@ -11215,17 +11264,24 @@ speechSynthesis.getVoices();
|
|||||||
AppApi.ExecuteVrOverlayFunction('configUpdate', json);
|
AppApi.ExecuteVrOverlayFunction('configUpdate', json);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.methods.isDanceWorld = function (location) {
|
||||||
|
var danceWorlds = [
|
||||||
|
'wrld_f20326da-f1ac-45fc-a062-609723b097b1',
|
||||||
|
'wrld_42377cf1-c54f-45ed-8996-5875b0573a83'
|
||||||
|
];
|
||||||
|
var L = API.parseLocation(location);
|
||||||
|
if (danceWorlds.includes(L.worldId)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
$app.methods.updateVRLastLocation = function () {
|
$app.methods.updateVRLastLocation = function () {
|
||||||
var progressPie = false;
|
var progressPie = false;
|
||||||
if (this.progressPie) {
|
if (this.progressPie) {
|
||||||
progressPie = true;
|
progressPie = true;
|
||||||
if (this.progressPieFilter) {
|
if (this.progressPieFilter) {
|
||||||
var L = API.parseLocation(this.lastLocation.location);
|
if (!this.isDanceWorld(this.lastLocation.location)) {
|
||||||
var danceWorlds = [
|
|
||||||
'wrld_f20326da-f1ac-45fc-a062-609723b097b1',
|
|
||||||
'wrld_42377cf1-c54f-45ed-8996-5875b0573a83'
|
|
||||||
];
|
|
||||||
if (!danceWorlds.includes(L.worldId)) {
|
|
||||||
progressPie = false;
|
progressPie = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1543,7 +1543,7 @@ html
|
|||||||
span \#{{ room.$location.instanceName }} {{ room.$location.accessType }}
|
span \#{{ room.$location.instanceName }} {{ room.$location.accessType }}
|
||||||
span.famfamfam-flags(v-if="room.$location.region === 'eu'" class="europeanunion" style="display:inline-block;margin-left:5px")
|
span.famfamfam-flags(v-if="room.$location.region === 'eu'" class="europeanunion" style="display:inline-block;margin-left:5px")
|
||||||
span.famfamfam-flags(v-else-if="room.$location.region === 'jp'" class="jp" style="display:inline-block;margin-left:5px")
|
span.famfamfam-flags(v-else-if="room.$location.region === 'jp'" class="jp" style="display:inline-block;margin-left:5px")
|
||||||
span.flag-icon-use(v-else-if="currentInstanceLocation.region === 'use'" style="display:inline-block;margin-left:5px")
|
span.flag-icon-use(v-else-if="room.$location.region === 'use'" style="display:inline-block;margin-left:5px")
|
||||||
span.flag-icon-usw(v-else style="display:inline-block;margin-left:5px")
|
span.flag-icon-usw(v-else style="display:inline-block;margin-left:5px")
|
||||||
el-tooltip(placement="top" content="Invite yourself" :disabled="hideTooltips")
|
el-tooltip(placement="top" content="Invite yourself" :disabled="hideTooltips")
|
||||||
invite-yourself(:location="room.$location.tag" style="margin-left:5px")
|
invite-yourself(:location="room.$location.tag" style="margin-left:5px")
|
||||||
|
|||||||
Reference in New Issue
Block a user