From 3bb977e83459438ab925c90ef136b11aa485bc8c Mon Sep 17 00:00:00 2001 From: ACGaming <4818419+ACGaming@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:39:05 +0100 Subject: [PATCH] Adjust Default GUI Text Color tweak --- README.md | 1 + .../universaltweaks/config/UTConfigTweaks.java | 4 ++-- .../tweaks/misc/gui/mixin/UTDefaultGuiTextColor.java | 11 +++-------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 2d151c6a..cee8202c 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,7 @@ All changes are toggleable via config files. * **Damage Tilt:** Restores feature to tilt the camera when damaged * **Damage Velocity:** Enables the modification of damage sources that change the entity's velocity * **Default Difficulty:** Sets the default difficulty for newly generated worlds +* **Default GUI Text Color:** Sets the default GUI text color (HEX RGB code) which can improve readability in dark mode resource packs * **Dimension Unload:** Unloads dimensions not in use to free up resources * **Disable Advancements:** Prevents the advancement system from loading entirely * **Disable Audio Debug:** Improves loading times by removing debug code for missing sounds and subtitles diff --git a/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java b/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java index 63527d02..7d843190 100644 --- a/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java +++ b/src/main/java/mod/acgaming/universaltweaks/config/UTConfigTweaks.java @@ -1453,10 +1453,10 @@ public static class MiscCategory @Config.RequiresMcRestart - @Config.Name("Default Gui Text Color") + @Config.Name("Default GUI Text Color") @Config.Comment ({ - "Sets the default gui text color (hex rgb code). It is useful for dark mode texture pack", + "Sets the default GUI text color (HEX RGB code) which can improve readability in dark mode resource packs", "404040 for vanilla default" }) public String utDefaultGuiTextColor = "404040"; diff --git a/src/main/java/mod/acgaming/universaltweaks/tweaks/misc/gui/mixin/UTDefaultGuiTextColor.java b/src/main/java/mod/acgaming/universaltweaks/tweaks/misc/gui/mixin/UTDefaultGuiTextColor.java index 8965c8b8..5a1bb233 100644 --- a/src/main/java/mod/acgaming/universaltweaks/tweaks/misc/gui/mixin/UTDefaultGuiTextColor.java +++ b/src/main/java/mod/acgaming/universaltweaks/tweaks/misc/gui/mixin/UTDefaultGuiTextColor.java @@ -1,9 +1,8 @@ package mod.acgaming.universaltweaks.tweaks.misc.gui.mixin; -import mod.acgaming.universaltweaks.config.UTConfigTweaks; - import net.minecraft.client.gui.FontRenderer; +import mod.acgaming.universaltweaks.config.UTConfigTweaks; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.ModifyVariable; @@ -15,10 +14,6 @@ public class UTDefaultGuiTextColor @ModifyVariable(method = "drawString(Ljava/lang/String;FFIZ)I", at = @At("HEAD"), argsOnly = true) private int utSetDefaultGuiTextColor(int color) { - if (color == 0x404040) { - return Integer.parseInt(UTConfigTweaks.MISC.utDefaultGuiTextColor, 16); - } else { - return color; - } + return color == 0x404040 ? Integer.parseInt(UTConfigTweaks.MISC.utDefaultGuiTextColor, 16) : color; } -} +} \ No newline at end of file