sakura fix for the off-center negotiation choices

This commit is contained in:
onms 2026-01-25 11:30:30 -06:00
parent 6815b0b91f
commit b021143005

View file

@ -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();