add newline support

This commit is contained in:
dazedanon 2025-11-18 11:27:34 -06:00
parent deb837b23e
commit ccc5e79768
2 changed files with 13 additions and 4 deletions

View file

@ -1379,7 +1379,7 @@
"code": 655,
"indent": 0,
"parameters": [
"テキスト-Her weak spots are \\C[27]deep inside her pussy, her ears, and her neck\\C[0], but she doesn't realize it herself."
"テキスト-Her weak spots are \\C[27]deep inside her pussy, her ears, and her neck\\C[0],<br>but she doesn't realize it herself."
]
},
{
@ -2820,7 +2820,7 @@
"code": 655,
"indent": 0,
"parameters": [
"テキスト-Weak points are \\C[27]anal, armpits, and soles\\C[0]. If tickled there, she almost cums."
"テキスト-Weak points are \\C[27]anal, armpits, and soles\\C[0].<br>If tickled there, she almost cums."
]
},
{
@ -4254,7 +4254,7 @@
"code": 655,
"indent": 0,
"parameters": [
"テキスト-Weak points are \\C[27]nipples, spine, and inside the mouth\\C[0]. She has absolutely no sexual experience."
"テキスト-Weak points are \\C[27]nipples, spine, and inside the mouth\\C[0].<br>She has absolutely no sexual experience."
]
},
{

View file

@ -397,6 +397,14 @@ Window_EroStatus.prototype.refresh = function() {
}
});
// Split text by newlines (\n or <br>)
var lines = text.replace(/<br>/gi, '\n').split('\n');
var lineHeight = (Number(obj["サイズ"]) || $gameSystem.mainFontSize()-8) + 4;
for(var lineIndex = 0; lineIndex < lines.length; lineIndex++){
var text = lines[lineIndex];
var yOffset = lineIndex * lineHeight;
this.contents.context.font = this.contents._makeFontNameText();
this.contents.fontSize = Number(obj["サイズ"]) || $gameSystem.mainFontSize()-8;
this.resetTextColor();
@ -468,7 +476,7 @@ Window_EroStatus.prototype.refresh = function() {
}else if(obj["上下"] == "下"){
top = maxH - this.contents.fontSize;
}
this.drawText(strAry[i], Number(obj.x)+left, Number(obj.y)+top, wAry[i], this.contents.fontSize, "right");
this.drawText(strAry[i], Number(obj.x)+left, Number(obj.y)+top+yOffset, wAry[i], this.contents.fontSize, "right");
left += wAry[i];
switch(fAry[i].type){
case 'C':
@ -489,6 +497,7 @@ Window_EroStatus.prototype.refresh = function() {
this.resetTextColor();
this.contents.fontSize = $gameSystem.mainFontSize()-8;
this._CBR_drawn = true;
} // Close the lineIndex for loop
}
};
//window.drawTextだとlineHeightが36に固定されちゃうので変える