mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 22:33:50 +02:00
add customvr.js
This commit is contained in:
@@ -197,6 +197,7 @@ Vue.component('marquee-text', MarqueeText);
|
||||
currentTime: new Date().toJSON(),
|
||||
cpuUsage: 0,
|
||||
pcUptime: '',
|
||||
customInfo: '',
|
||||
config: {},
|
||||
onlineFriendCount: 0,
|
||||
nowPlaying: {
|
||||
@@ -230,6 +231,7 @@ Vue.component('marquee-text', MarqueeText);
|
||||
mounted() {
|
||||
workerTimers.setTimeout(() => AppApiVr.VrInit(), 1000);
|
||||
if (this.appType === '1') {
|
||||
this.refreshCustomScript();
|
||||
this.updateStatsLoop();
|
||||
}
|
||||
}
|
||||
@@ -403,6 +405,21 @@ Vue.component('marquee-text', MarqueeText);
|
||||
}
|
||||
};
|
||||
|
||||
$app.methods.refreshCustomScript = function () {
|
||||
if (document.contains(document.getElementById('vr-custom-script'))) {
|
||||
document.getElementById('vr-custom-script').remove();
|
||||
}
|
||||
AppApiVr.CustomVrScriptPath().then((customScript) => {
|
||||
var head = document.head;
|
||||
if (customScript) {
|
||||
var $vrCustomScript = document.createElement('script');
|
||||
$vrCustomScript.setAttribute('id', 'vr-custom-script');
|
||||
$vrCustomScript.src = `file://${customScript}?_=${Date.now()}`;
|
||||
head.appendChild($vrCustomScript);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$app.methods.updateStatsLoop = async function () {
|
||||
try {
|
||||
this.currentTime = new Date()
|
||||
|
||||
@@ -523,7 +523,7 @@ html
|
||||
br
|
||||
span(style="float:right") {{ currentTime }}
|
||||
span(v-if="config && !config.hideCpuUsageFromFeed" style="display:inline-block;margin-right:5px") {{ $t('vr.status.cpu') }} {{ cpuUsage }}%
|
||||
span(style="display:inline-block") {{ $t('vr.status.online') }} {{ onlineFriendCount }}
|
||||
span(style="display:inline-block") {{ $t('vr.status.online') }} {{ onlineFriendCount }} {{ customInfo }}
|
||||
template(v-else)
|
||||
svg(class="np-progress-circle")
|
||||
circle(class="np-progress-circle-stroke" cx="60" cy="60" stroke="white" r="30" fill="transparent" stroke-width="60")
|
||||
|
||||
Reference in New Issue
Block a user