try to load full-width names

global stinx
This commit is contained in:
gloriousbreak 2020-08-11 11:52:45 -04:00
parent afd850fbca
commit 389b80666c
Signed by: gloriousbreak
GPG key ID: 44D7E1DE4E23D6F2
3 changed files with 8 additions and 3 deletions

View file

@ -975,7 +975,8 @@ class Player {
if(cur.Character) {
nameToUse = cur.Arg1;
}
this.text.characterName(true, this.utage.charTranslations[nameToUse] || nameToUse);
nameFullWidth = nameToUse.replace(/[A-Za-z0-9]/g, function(s) {return String.fromCharCode(s.charCodeAt(0) + 0xFEE0);});
this.text.characterName(true, this.utage.charTranslations[nameToUse] || this.utage.charTranslations[nameFullWidth] || nameToUse);
this.text.dialogText(true, text);
//restoreTint is set from a colorTo command.
//We want to maintain the tint change from colorTo during speaking still.