Slight rework of translations system to add character name translations.
This commit is contained in:
parent
4e69b2388f
commit
d94dd77fb8
7 changed files with 275 additions and 40 deletions
14
Js/Player.js
14
Js/Player.js
|
@ -443,13 +443,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.currentTranslation[cur.English] || cur.Text) : cur.Text;
|
||||
let text = cur.English ? (utage.translations[cur.English] || cur.Text) : cur.Text;
|
||||
this.text.titleText(true, text);
|
||||
break;
|
||||
}
|
||||
case "divaeffect": {
|
||||
this.waitTime = Number(cur.Arg5) * 1000;
|
||||
let text = cur.English ? (utage.currentTranslation[cur.English] || cur.Text) : cur.Text;
|
||||
let text = cur.English ? (utage.translations[cur.English] || cur.Text) : cur.Text;
|
||||
this.text.divaText(true, text);
|
||||
break;
|
||||
}
|
||||
|
@ -933,10 +933,10 @@ class Player {
|
|||
}
|
||||
if(!cur.Command && cur.Arg1 && cur.Text) {
|
||||
//If its chracter off screen text
|
||||
let text = cur.English ? (utage.currentTranslation[cur.English] || cur.Text) : cur.Text;
|
||||
let text = cur.English ? (utage.translations[cur.English] || cur.Text) : cur.Text;
|
||||
text = commonFunctions.convertUtageTextTags(text);
|
||||
if(cur.Arg2 && cur.Arg2.toLowerCase() === "<off>") {
|
||||
this.text.characterName(true, cur.Arg1);
|
||||
this.text.characterName(true, utage.charTranslations[cur.Arg1] || cur.Arg1);
|
||||
this.text.dialogText(true, commonFunctions.convertUtageTextTags(text));
|
||||
} else {
|
||||
let charName = "";
|
||||
|
@ -946,7 +946,7 @@ class Player {
|
|||
for(let c of Object.keys(this.currentCharacters)) {
|
||||
if(!this.currentCharacters[c]) { continue; }
|
||||
if(this.currentCharacters[c].charName === cur.Arg1) {
|
||||
this.text.characterName(true, this.currentCharacters[c].character.NameText);
|
||||
this.text.characterName(true, utage.charTranslations[this.currentCharacters[c].character.NameText] || this.currentCharacters[c].character.NameText);
|
||||
this.text.dialogText(true, text);
|
||||
this.currentCharacters[c].sprite.tint = 0xFFFFFF;
|
||||
found = true;
|
||||
|
@ -959,14 +959,14 @@ class Player {
|
|||
}
|
||||
//If we didnt find the character just dump the text anyways with Arg1 as the name
|
||||
if(!found) {
|
||||
this.text.characterName(true, cur.Arg1);
|
||||
this.text.characterName(true, utage.charTranslations[cur.Arg1] || cur.Arg1);
|
||||
this.text.dialogText(true, text);
|
||||
}
|
||||
}
|
||||
this.manualNext = true;
|
||||
//Sometimes they don't give a Arg1 for the text.
|
||||
} else if(!cur.Command && cur.Arg2.toLowerCase() === "<off>" && cur.Text) {
|
||||
let text = cur.English ? (utage.currentTranslation[cur.English] || cur.Text) : cur.Text;
|
||||
let text = cur.English ? (utage.translations[cur.English] || cur.Text) : cur.Text;
|
||||
this.text.characterName(true, "");
|
||||
this.text.dialogText(true, commonFunctions.convertUtageTextTags(text));
|
||||
this.manualNext = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue