Skip to content

Commit

Permalink
Adjust Default GUI Text Color tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Nov 21, 2024
1 parent 8fd343d commit 3bb977e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
}
}
}

0 comments on commit 3bb977e

Please sign in to comment.