mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Bug fixes
This commit is contained in:
+26
-3
@@ -4217,8 +4217,9 @@ speechSynthesis.getVoices();
|
|||||||
if (ctx.created_at < bias) {
|
if (ctx.created_at < bias) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// (ctx.type === 'GPS' || ctx.type === 'Online') TODO: fix new friend triggering Online event
|
||||||
if (
|
if (
|
||||||
(ctx.type === 'GPS' || ctx.type === 'Online') &&
|
ctx.type === 'GPS' &&
|
||||||
ctx.location === this.lastLocation.location
|
ctx.location === this.lastLocation.location
|
||||||
) {
|
) {
|
||||||
if (joiningMap[ctx.displayName]) {
|
if (joiningMap[ctx.displayName]) {
|
||||||
@@ -9981,6 +9982,21 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.methods.getTTSVoiceName = function () {
|
||||||
|
var voices = speechSynthesis.getVoices();
|
||||||
|
if (voices.length === 0) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
if (this.notificationTTSVoice >= voices.length) {
|
||||||
|
this.notificationTTSVoice = 0;
|
||||||
|
configRepository.setString(
|
||||||
|
'VRCX_notificationTTSVoice',
|
||||||
|
this.notificationTTSVoice
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return voices[this.notificationTTSVoice].name;
|
||||||
|
};
|
||||||
|
|
||||||
$app.methods.changeTTSVoice = function (index) {
|
$app.methods.changeTTSVoice = function (index) {
|
||||||
this.notificationTTSVoice = index;
|
this.notificationTTSVoice = index;
|
||||||
configRepository.setString(
|
configRepository.setString(
|
||||||
@@ -9991,7 +10007,7 @@ speechSynthesis.getVoices();
|
|||||||
if (voices.length === 0) {
|
if (voices.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var voiceName = voices[index < voices.length ? index : 0].name;
|
var voiceName = voices[index].name;
|
||||||
speechSynthesis.cancel();
|
speechSynthesis.cancel();
|
||||||
this.speak(voiceName);
|
this.speak(voiceName);
|
||||||
};
|
};
|
||||||
@@ -9999,7 +10015,14 @@ speechSynthesis.getVoices();
|
|||||||
$app.methods.speak = function (text) {
|
$app.methods.speak = function (text) {
|
||||||
var tts = new SpeechSynthesisUtterance();
|
var tts = new SpeechSynthesisUtterance();
|
||||||
var voices = speechSynthesis.getVoices();
|
var voices = speechSynthesis.getVoices();
|
||||||
tts.voice = voices[this.notificationTTSVoice];
|
if (voices.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var index = 0;
|
||||||
|
if (this.notificationTTSVoice < voices.length) {
|
||||||
|
index = this.notificationTTSVoice;
|
||||||
|
}
|
||||||
|
tts.voice = voices[index];
|
||||||
tts.text = text;
|
tts.text = text;
|
||||||
speechSynthesis.speak(tts);
|
speechSynthesis.speak(tts);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1081,7 +1081,8 @@ class Database {
|
|||||||
|
|
||||||
async getLastDateGameLogDatabase() {
|
async getLastDateGameLogDatabase() {
|
||||||
var gamelogDatabase = [];
|
var gamelogDatabase = [];
|
||||||
var date = '1970-01-01';
|
// var date = '1970-01-01';
|
||||||
|
var date = new Date(Date.now() - 86400000).toJSON(); // 24 hours
|
||||||
await sqliteService.execute((dbRow) => {
|
await sqliteService.execute((dbRow) => {
|
||||||
gamelogDatabase.unshift(dbRow[0]);
|
gamelogDatabase.unshift(dbRow[0]);
|
||||||
}, 'SELECT created_at FROM gamelog_location ORDER BY id DESC LIMIT 1');
|
}, 'SELECT created_at FROM gamelog_location ORDER BY id DESC LIMIT 1');
|
||||||
|
|||||||
Reference in New Issue
Block a user