mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-19 19:49:41 +00:00
Add support for non default colors to the text rendering for the book.
This commit is contained in:
1 parent
484acd8d25
commit
add938780f
2 files changed
+6
-2
No files matched your search
@@ -11,6 +11,8 @@ public class TextData {
|
||||
|
||||
public String text;
|
||||
public String color = "black";
|
||||
public int rgbColor = 0;
|
||||
public boolean useOldColor = true;
|
||||
public boolean bold = false;
|
||||
public boolean italic = false;
|
||||
public boolean underlined = false;
|
||||
|
||||
@@ -73,7 +73,9 @@ public class TextDataRenderer {
|
||||
|
||||
String modifiers = "";
|
||||
|
||||
modifiers += TextFormatting.getValueByName(item.color);
|
||||
if(item.useOldColor) {
|
||||
modifiers += TextFormatting.getValueByName(item.color);
|
||||
}
|
||||
|
||||
if (item.bold) {
|
||||
modifiers += TextFormatting.BOLD;
|
||||
@@ -107,7 +109,7 @@ public class TextDataRenderer {
|
||||
}
|
||||
|
||||
String s = split[i];
|
||||
drawScaledString(matrixStack, fr, modifiers + s, atX, atY, 0, item.dropshadow, item.scale);
|
||||
drawScaledString(matrixStack, fr, modifiers + s, atX, atY, item.rgbColor, item.dropshadow, item.scale);
|
||||
|
||||
if (i < split.length - 1) {
|
||||
atY += fr.FONT_HEIGHT;
|
||||
|
||||
Reference in new issue
Block a user