Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the Dropoff Button texture #16

Merged
merged 3 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ public static SortHandler createSortHandler(GuiScreen guiScreen, @Nullable ISlot
}
return null;
}

private static boolean Keypress(KeyBinding key){
int keyCode = key.getKeyCode();
if (keyCode > 0) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package com.cleanroommc.bogosorter.common.dropoff;

import com.cleanroommc.bogosorter.BogoSorter;
import com.cleanroommc.bogosorter.common.config.BogoSorterConfig;
import com.cleanroommc.bogosorter.common.network.CDropOff;
import com.cleanroommc.bogosorter.common.network.NetworkHandler;
import com.cleanroommc.modularui.drawable.UITexture;
import com.cleanroommc.modularui.utils.Color;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.SoundHandler;
import net.minecraft.client.gui.GuiButton;
Expand All @@ -17,6 +21,12 @@ public class InvButton extends GuiButton {
private final GuiContainer parent;
private boolean hold = false;
private static long timeDropoff = 0;
public static final UITexture BUTTON_BACKGROUND = UITexture.builder()
.location(BogoSorter.ID, "gui/base_button")
.imageSize(18, 18)
.adaptable(1)
.build();

public InvButton(GuiContainer parentGui) {
super(394658248, parentGui.guiLeft + DropOffButtonHandler.buttonX, parentGui.guiTop + DropOffButtonHandler.buttonY, 10, 10, "d");
parent = parentGui;
Expand All @@ -27,8 +37,10 @@ public void drawButton(Minecraft mc, int mouseX, int mouseY) {
if (hold) {
drag(mouseX, mouseY);
}

super.drawButton(mc, mouseX, mouseY);
Color.setGlColor(BogoSorterConfig.buttonColor);
BUTTON_BACKGROUND.draw(this.xPosition, this.yPosition, this.width, this.height);
Color.resetGlColor();
this.drawCenteredString(mc.fontRenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + 1, 14737632);
}

@Override
Expand Down
Loading