From f1c12f87ca4693e99b4042150574f943419f3ec7 Mon Sep 17 00:00:00 2001 From: Robert Chen Date: Sun, 1 Dec 2013 01:19:34 -0800 Subject: [PATCH] Actually replace placeholders --- js/dialogue.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/dialogue.js b/js/dialogue.js index 73d05d7..22f52be 100755 --- a/js/dialogue.js +++ b/js/dialogue.js @@ -101,7 +101,8 @@ function DialogUI( stage, gameState ){ that.endFunc = textSeq.endFunc || function(){}; - that.textContent.text=nextDialogue[1].replace(/\[GenderPronoun\]/g, gameState.pronoun ).replace(/\[Player\]/g, gameState.name ); + that.textContent.text=nextDialogue[1].replace(/\[GenderPronoun\]/g, gameState.pronoun ).replace(/\[Player\]/g, gameState.name || "Sam" ); + that.currentFace.y = 250; that.currentFace = peopleImg[nextDialogue[0]] || that.currentFace; that.autoAdvance = textSeq.autoAdvance; @@ -137,7 +138,7 @@ function DialogUI( stage, gameState ){ var nextDialogue = that.currDialogueSeq.next(); that.dialogMotionQueue.push(DIALOG_SHOWING); - that.textContent.text=nextDialogue[1]; + that.textContent.text=nextDialogue[1].replace(/\[GenderPronoun\]/g, gameState.pronoun ).replace(/\[Player\]/g, gameState.name || "Sam" ); if(DEBUG) console.log("showing face:" +nextDialogue[0] ); // swap out face immediately