-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #592 from friendlyhj/gui_default_text_color
Set gui default text color
- Loading branch information
Showing
4 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
src/main/java/mod/acgaming/universaltweaks/tweaks/misc/gui/mixin/UTDefaultGuiTextColor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package mod.acgaming.universaltweaks.tweaks.misc.gui.mixin; | ||
|
||
import mod.acgaming.universaltweaks.config.UTConfigTweaks; | ||
|
||
import net.minecraft.client.gui.FontRenderer; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyVariable; | ||
|
||
// Courtesy of youyihj | ||
@Mixin(FontRenderer.class) | ||
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; | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/resources/mixins.tweaks.misc.gui.defaultguitextcolor.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"package": "mod.acgaming.universaltweaks.tweaks.misc.gui.mixin", | ||
"refmap": "universaltweaks.refmap.json", | ||
"minVersion": "0.8", | ||
"compatibilityLevel": "JAVA_8", | ||
"client": ["UTDefaultGuiTextColor"] | ||
} |