v2.5.1: fixed underscores in custom notes being used for highlighting

This commit is contained in:
Evan Debenham
2024-09-13 12:18:48 -04:00
parent 575ad36eca
commit 943222ca96
5 changed files with 13 additions and 2 deletions

View File

@@ -512,7 +512,8 @@ public class Item implements Bundlable {
note = Notes.findCustomRecord(getClass());
}
if (note != null){
return Messages.get(this, "custom_note", note.title()) + "\n\n" + desc();
//we swap underscore(0x5F) with low macron(0x2CD) here to avoid highlighting in the item window
return Messages.get(this, "custom_note", note.title().replace('_', 'ˍ')) + "\n\n" + desc();
}
}

View File

@@ -187,7 +187,8 @@ public class Ring extends KindofMisc {
} else if (Notes.findCustomRecord(customNoteID) == null) {
Notes.CustomRecord note = Notes.findCustomRecord(getClass());
if (note != null){
desc = Messages.get(this, "custom_note", note.title()) + "\n\n" + super.info();
//we swap underscore(0x5F) with low macron(0x2CD) here to avoid highlighting in the item window
desc = Messages.get(this, "custom_note", note.title().replace('_', 'ˍ')) + "\n\n" + super.info();
} else {
desc = super.info();
}

View File

@@ -328,6 +328,10 @@ public class CustomNoteButton extends IconButton {
resize(width, (int)delete.bottom());
}
@Override
protected boolean useHighlighting() {
return false;
}
}
private static void addNote(Notes.CustomRecord note, String promptTitle, String prompttext){

View File

@@ -49,6 +49,7 @@ public class WndTitledMessage extends Window {
add(titlebar);
RenderedTextBlock text = PixelScene.renderTextBlock( 6 );
if (!useHighlighting()) text.setHightlighting(false);
text.text( message, width );
text.setPos( titlebar.left(), titlebar.bottom() + 2*GAP );
add( text );
@@ -66,4 +67,8 @@ public class WndTitledMessage extends Window {
resize( width, (int)text.bottom() + 2 );
}
protected boolean useHighlighting(){
return true;
}
}