Skip to content

Commit

Permalink
Improve Colors
Browse files Browse the repository at this point in the history
  • Loading branch information
IntegerLimit committed Mar 7, 2024
1 parent 8a84da2 commit 4920426
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 4920426

Please sign in to comment.