From e098d279642fc8242e81ebdf867b83c04fd0a9a4 Mon Sep 17 00:00:00 2001 From: firebingo Date: Sat, 29 Dec 2018 11:44:34 -0700 Subject: [PATCH] Fix player not falling back to utage text if translation file didnt exist at all. --- Js/Player.js | 10 +++++----- Js/Translations | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Js/Player.js b/Js/Player.js index 5f24332..57236a3 100644 --- a/Js/Player.js +++ b/Js/Player.js @@ -585,13 +585,13 @@ class Player { this.lerpTargets.push({type: 'alpha', object: sprite, curTime: 0, time: 300, finalV: 1, initV: 0}); this.lerpTargets.push({type: 'alpha', object: sprite, curTime: -(this.waitTime+500), time: 300, finalV: 0, initV: 1, post: "destroy"}); } catch (error) { } - let text = cur.English ? (utage.translations[cur.English] || cur.Text) : cur.Text; + let text = cur.English ? (utage.translations ? (utage.translations[cur.English] || cur.Text) : cur.Text) : cur.Text; this.text.titleText(true, text); break; } case "divaeffect": { this.waitTime = Number(cur.Arg5) * 1000; - let text = cur.English ? (utage.translations[cur.English] || cur.Text) : cur.Text; + let text = cur.English ? (utage.translations ? (utage.translations[cur.English] || cur.Text) : cur.Text) : cur.Text; this.text.divaText(true, text); break; } @@ -1197,8 +1197,8 @@ class Player { this.audio.stopSound(this.playingVoice); } if(!cur.Command && cur.Arg1 && cur.Text) { - //If its chracter off screen text - let text = cur.English ? (utage.translations[cur.English] || cur.Text) : cur.Text; + //If its character off screen text + let text = cur.English ? (utage.translations ? (utage.translations[cur.English] || cur.Text) : cur.Text) : cur.Text; text = commonFunctions.convertUtageTextTags(text); if(cur.Arg2 && cur.Arg2.toLowerCase() === "") { this.text.characterName(true, utage.charTranslations[cur.Arg1] || cur.Arg1); @@ -1236,7 +1236,7 @@ class Player { this.manualNext = true; //Sometimes they don't give a Arg1 for the text. } else if(!cur.Command && cur.Arg2.toLowerCase() === "" && cur.Text) { - let text = cur.English ? (utage.translations[cur.English] || cur.Text) : cur.Text; + let text = cur.English ? (utage.translations ? (utage.translations[cur.English] || cur.Text) : cur.Text) : cur.Text; this.text.characterName(true, ""); this.text.dialogText(true, commonFunctions.convertUtageTextTags(text)); this.manualNext = true; diff --git a/Js/Translations b/Js/Translations index 533c483..dc15df9 160000 --- a/Js/Translations +++ b/Js/Translations @@ -1 +1 @@ -Subproject commit 533c48371ed01ed7265b6b5f052d1b2c3fce940f +Subproject commit dc15df970a33c34dd53654fb77ce775ee9e3f051