mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-18 06:13:52 +02:00
Bug fixes
This commit is contained in:
@@ -4217,8 +4217,9 @@ speechSynthesis.getVoices();
|
||||
if (ctx.created_at < bias) {
|
||||
break;
|
||||
}
|
||||
// (ctx.type === 'GPS' || ctx.type === 'Online') TODO: fix new friend triggering Online event
|
||||
if (
|
||||
(ctx.type === 'GPS' || ctx.type === 'Online') &&
|
||||
ctx.type === 'GPS' &&
|
||||
ctx.location === this.lastLocation.location
|
||||
) {
|
||||
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) {
|
||||
this.notificationTTSVoice = index;
|
||||
configRepository.setString(
|
||||
@@ -9991,7 +10007,7 @@ speechSynthesis.getVoices();
|
||||
if (voices.length === 0) {
|
||||
return;
|
||||
}
|
||||
var voiceName = voices[index < voices.length ? index : 0].name;
|
||||
var voiceName = voices[index].name;
|
||||
speechSynthesis.cancel();
|
||||
this.speak(voiceName);
|
||||
};
|
||||
@@ -9999,7 +10015,14 @@ speechSynthesis.getVoices();
|
||||
$app.methods.speak = function (text) {
|
||||
var tts = new SpeechSynthesisUtterance();
|
||||
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;
|
||||
speechSynthesis.speak(tts);
|
||||
};
|
||||
|
||||
@@ -1081,7 +1081,8 @@ class Database {
|
||||
|
||||
async getLastDateGameLogDatabase() {
|
||||
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) => {
|
||||
gamelogDatabase.unshift(dbRow[0]);
|
||||
}, 'SELECT created_at FROM gamelog_location ORDER BY id DESC LIMIT 1');
|
||||
|
||||
Reference in New Issue
Block a user