Made GuiColorPicker a subclass of GuiAdvancedButton and call pickerToggled() method from own click handler methods
This commit is contained in:
@@ -3,14 +3,13 @@ package eu.crushedpixel.replaymod.gui.elements;
|
||||
import eu.crushedpixel.replaymod.utils.MouseUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.util.Point;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
public class GuiColorPicker extends GuiButton {
|
||||
public class GuiColorPicker extends GuiAdvancedButton {
|
||||
|
||||
private final int PICKER_SIZE = 100;
|
||||
|
||||
@@ -82,6 +81,13 @@ public class GuiColorPicker extends GuiButton {
|
||||
return super.mousePressed(mc, mouseX, mouseY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClick(Minecraft mc, int mouseX, int mouseY, int button) {
|
||||
boolean clicked = super.mouseClick(mc, mouseX, mouseY, button);
|
||||
if(clicked) pickerToggled();
|
||||
return clicked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseDragged(Minecraft mc, int mouseX, int mouseY) {
|
||||
if(Mouse.isButtonDown(0)) mousePressed(mc, mouseX, mouseY);
|
||||
|
||||
Reference in New Issue
Block a user