mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-14 01:04:16 +00:00
Handle paragraphs in notes properly.
This commit is contained in:
1 parent
847c78abfb
commit
880eed3e4f
2 files changed
+8
-6
No files matched your search
@@ -265,9 +265,7 @@ public class GuiLexicon extends GuiScreen {
|
||||
boolean unicode = fontRendererObj.getUnicodeFlag();
|
||||
fontRendererObj.setUnicodeFlag(true);
|
||||
|
||||
PageText.renderText(x + 5, y - 3, 92, 120, noteDisplay);
|
||||
|
||||
//fontRendererObj.drawSplitString(noteDisplay, x + 7, y + 7, 92, 0);
|
||||
PageText.renderText(x + 5, y - 3, 92, 120, 0, noteDisplay);
|
||||
fontRendererObj.setUnicodeFlag(unicode);
|
||||
}
|
||||
|
||||
@@ -534,7 +532,7 @@ public class GuiLexicon extends GuiScreen {
|
||||
note = "";
|
||||
else {
|
||||
if(note.endsWith("<br>"))
|
||||
note = note.substring(0, note.length() - 5);
|
||||
note = note.substring(0, note.length() - 4);
|
||||
else note = note.substring(0, note.length() - 1);
|
||||
}
|
||||
changed = true;
|
||||
|
||||
@@ -41,8 +41,12 @@ public class PageText extends LexiconPage {
|
||||
renderText(x, y, width, gui.getHeight(), getUnlocalizedName());
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void renderText(int x, int y, int width, int height, String unlocalizedText) {
|
||||
renderText(x, y, width, height, 10, unlocalizedText);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void renderText(int x, int y, int width, int height, int paragraphSize, String unlocalizedText) {
|
||||
x += 2;
|
||||
y += 10;
|
||||
width -= 4;
|
||||
@@ -108,7 +112,7 @@ public class PageText extends LexiconPage {
|
||||
xi += font.getStringWidth(s) + spacing + extra;
|
||||
}
|
||||
|
||||
y += 10;
|
||||
y += words.isEmpty() ? paragraphSize : 10;
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user