diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java | 31 | ||||
-rw-r--r-- | src/main/resources/fabric.mod.json | 7 |
2 files changed, 34 insertions, 4 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java index fb034b8..6c6f82a 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WLabel.java @@ -1,13 +1,16 @@ package io.github.cottonmc.cotton.gui.widget; +import io.github.cottonmc.cotton.gui.client.LibGuiClient; import io.github.cottonmc.cotton.gui.client.ScreenDrawing; import net.minecraft.text.LiteralText; import net.minecraft.text.Text; public class WLabel extends WWidget { - protected final Text text; - protected final int color; + protected Text text; + protected int color; + protected int darkmodeColor; public static final int DEFAULT_TEXT_COLOR = 0x404040; + public static final int DEFAULT_DARKMODE_TEXT_COLOR = 0xbcbcbc; public WLabel(String text, int color) { this(new LiteralText(text), color); @@ -16,6 +19,7 @@ public class WLabel extends WWidget { public WLabel(Text text, int color) { this.text = text; this.color = color; + this.darkmodeColor = (color==DEFAULT_TEXT_COLOR) ? DEFAULT_DARKMODE_TEXT_COLOR : color; } public WLabel(String text) { @@ -25,7 +29,7 @@ public class WLabel extends WWidget { @Override public void paintBackground(int x, int y) { String translated = text.asFormattedString(); - ScreenDrawing.drawString(translated, x, y, color); + ScreenDrawing.drawString(translated, x, y, LibGuiClient.config.darkMode ? darkmodeColor : color); } @Override @@ -42,4 +46,25 @@ public class WLabel extends WWidget { public int getHeight() { return 8; } + + public WLabel setDarkmodeColor(int color) { + darkmodeColor = color; + return this; + } + + public WLabel disableDarkmode() { + this.darkmodeColor = this.color; + return this; + } + + public WLabel setColor(int color, int darkmodeColor) { + this.color = color; + this.darkmodeColor = darkmodeColor; + return this; + } + + public WLabel setText(Text text) { + this.text = text; + return this; + } }
\ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 4e658e7..05faf69 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -18,7 +18,7 @@ "environment": "*", "entrypoints": { "client": [ - "io.github.cottonmc.libgui.client.LibGuiClient" + "io.github.cottonmc.cotton.gui.client.LibGuiClient" ] }, "depends": { @@ -27,5 +27,10 @@ }, "suggests": { "flamingo": "*" + }, + + "custom": { + "modmenu:api": true, + "modmenu:clientsideOnly": false } } |