From 49204267a04d88d72607d0b7814920ed907b58a1 Mon Sep 17 00:00:00 2001 From: Integer Limit <103940576+IntegerLimit@users.noreply.github.com> Date: Thu, 7 Mar 2024 19:49:16 +1100 Subject: [PATCH] Improve Colors --- .../architecturecraft/GuiSawbenchMixin.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/architecturecraft/GuiSawbenchMixin.java b/src/main/java/com/nomiceu/nomilabs/mixin/architecturecraft/GuiSawbenchMixin.java index 598e33a3..dcffddf5 100644 --- a/src/main/java/com/nomiceu/nomilabs/mixin/architecturecraft/GuiSawbenchMixin.java +++ b/src/main/java/com/nomiceu/nomilabs/mixin/architecturecraft/GuiSawbenchMixin.java @@ -6,10 +6,12 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; /** - * Changes the Gui Shape Item Texture Used. + * Changes the Gui Textures and Colors Used. */ @Mixin(value = GuiSawbench.class, remap = false) public class GuiSawbenchMixin extends BaseGui.Screen { @@ -47,6 +49,22 @@ public void bindNewGuiTexture(GuiSawbench instance, String texture, int u, int v instance.bindTexture(texture, u, v); } + @Redirect(method = "drawPageMenu", at = @At(value = "INVOKE", target = "Lcom/elytradev/architecture/client/gui/GuiSawbench;setColor(DDD)V")) + public void setHighlightColor(GuiSawbench instance, double r, double g, double b) { + instance.setColor(0.0, 0.98, 0.94); + } + + @Inject(method = "drawPageMenu", at = @At(value = "INVOKE", target = "Lcom/elytradev/architecture/client/gui/GuiSawbench;gRestore()V", shift = At.Shift.AFTER)) + public void setNewTextColor(CallbackInfo ci) { + gSave(); + setTextColor(0, 0, 0); + } + + @Inject(method = "drawPageMenu", at = @At(value = "TAIL")) + public void restorePrevious(CallbackInfo ci) { + gRestore(); + } + @Redirect(method = "drawShapeMenu", at = @At(value = "INVOKE", target = "Lcom/elytradev/architecture/client/gui/GuiSawbench;bindTexture(Ljava/lang/String;II)V")) public void bindNewGuiShapeTexture(GuiSawbench instance, String texture, int u, int v) { if (texture.equals(ORIGINAL_GUI_BG_PATH)) {