From b0211430058f611bd0072e8d79518afb3ff0e70e Mon Sep 17 00:00:00 2001 From: onms Date: Sun, 25 Jan 2026 11:30:30 -0600 Subject: [PATCH] sakura fix for the off-center negotiation choices --- www/js/plugins/JsScript12Set.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/www/js/plugins/JsScript12Set.js b/www/js/plugins/JsScript12Set.js index 81004c6..f53ba4f 100644 --- a/www/js/plugins/JsScript12Set.js +++ b/www/js/plugins/JsScript12Set.js @@ -147,14 +147,10 @@ Window_ChoiceList.prototype.itemRectForText = function(index) { var rect = this.itemRect(index); if ($gameSystem.vnChoices) { var txt = $gameMessage._choices[index]; -var icons = txt.match(/\\i\[/g) || txt.match(/\\I\[/g); -icons = icons ? icons.length * 36 : 0; -txt = this.convertEscapeCharacters(txt,index); -txt = txt.replace(/i\[\d*\]/g,""); -txt = txt.replace(/I\[\d*\]/g,""); -txt = txt.replace(/c\[\d*\]/g,""); -txt = txt.replace(/C\[\d*\]/g,""); -var txtSize = this.textWidth(txt) + icons; +// Use textWidthEx to measure the actual rendered width including escape codes +// Add the same prefix used in drawItem for accurate measurement +var fullText = SCol.Blk0 + txt; +var txtSize = this.textWidthEx(fullText); rect.x = (Galv.VNC.width - txtSize) / 2; } else { rect.x += this.textPadding();