From a1f467576f1b5139552face0e7d0422fcefed3ac Mon Sep 17 00:00:00 2001 From: Kevin Ramharak Date: Mon, 1 Jan 2018 16:31:41 +0100 Subject: [PATCH 1/3] Remove tabs and newlines from displaying in holo fixes #12 --- mar/phaser/mar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mar/phaser/mar.js b/mar/phaser/mar.js index 872acce..9ded2d5 100644 --- a/mar/phaser/mar.js +++ b/mar/phaser/mar.js @@ -344,7 +344,7 @@ function updateGameObject(object, responseObj) { } else if (responseObj.holoMode === 2) { //String - object.hologram = game.make.text(0, 32, responseObj.holoStr, { + object.hologram = game.make.text(0, 32, responseObj.holoStr.replace(/\n|\t/, ''), { fontSize: 27, fill: color ? color : colorScheme.hologramFill, stroke: colorScheme.hologramStroke, From 353c8161ae178cd41549f5528784641b4102ffcd Mon Sep 17 00:00:00 2001 From: Kevin Ramharak Date: Mon, 1 Jan 2018 16:35:49 +0100 Subject: [PATCH 2/3] actually implement the fix forgot `[` around character classes `]` fixes #12 --- mar/phaser/mar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mar/phaser/mar.js b/mar/phaser/mar.js index 9ded2d5..ecd89a6 100644 --- a/mar/phaser/mar.js +++ b/mar/phaser/mar.js @@ -344,7 +344,7 @@ function updateGameObject(object, responseObj) { } else if (responseObj.holoMode === 2) { //String - object.hologram = game.make.text(0, 32, responseObj.holoStr.replace(/\n|\t/, ''), { + object.hologram = game.make.text(0, 32, responseObj.holoStr.replace(/[\n|\t]/, ''), { fontSize: 27, fill: color ? color : colorScheme.hologramFill, stroke: colorScheme.hologramStroke, From 7435b6178da76c8ac96806b2d5954fa243289599 Mon Sep 17 00:00:00 2001 From: Kevin Ramharak Date: Mon, 1 Jan 2018 16:53:29 +0100 Subject: [PATCH 3/3] added global flag to regexp finally fixes #12... --- mar/phaser/mar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mar/phaser/mar.js b/mar/phaser/mar.js index ecd89a6..81cdefa 100644 --- a/mar/phaser/mar.js +++ b/mar/phaser/mar.js @@ -344,7 +344,7 @@ function updateGameObject(object, responseObj) { } else if (responseObj.holoMode === 2) { //String - object.hologram = game.make.text(0, 32, responseObj.holoStr.replace(/[\n|\t]/, ''), { + object.hologram = game.make.text(0, 32, responseObj.holoStr.replace(/[\n|\t]/g, ''), { fontSize: 27, fill: color ? color : colorScheme.hologramFill, stroke: colorScheme.hologramStroke,