From 55bd1edf6d22717524857b25748a6d5625aa5e19 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Thu, 24 Jan 2019 17:06:17 +0800 Subject: [PATCH] replaceText in drawToolbox --- libs/ui.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/ui.js b/libs/ui.js index d569b42b..dca509c2 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -2044,7 +2044,7 @@ ui.prototype.drawToolbox = function(index) { var text = item.text||"该道具暂无描述。"; try { // 检查能否eval - text = eval(text); + text = core.replaceText(text); } catch (e) {} var lines = core.splitLines('ui', text, 406, '17px '+globalFont); @@ -2195,6 +2195,9 @@ ui.prototype.drawEquipbox = function(index) { core.fillText('ui', equip.name + "(" + equipString + ")", 10, 32, '#FFD700', "bold 20px "+globalFont) var text = equip.text||"该装备暂无描述。"; + try { + text = core.replaceText(text); + } catch (e) {} var lines = core.splitLines('ui', text, 406, '17px '+globalFont); core.fillText('ui', lines[0], 10, 62, '#FFFFFF', '17px '+globalFont);