"The Commit that properly implements the disabling of Gui Elements"

Added enabled Field to DelegatingElement, which every instance can handle itself
Made isEnabled Field in GuiAdvancedTextField protected for subclasses to access
Made GuiDraggingNumberInput only draggable while enabled
Made GuiDropdown check enabled field before accepting mouse clicks
Properly tints GuiTexturedButton if disabled
This commit is contained in:
CrushedPixel
2015-07-10 03:33:39 +02:00
parent 59e6b87935
commit 5828b04596
5 changed files with 18 additions and 6 deletions

View File

@@ -5,7 +5,6 @@ import eu.crushedpixel.replaymod.gui.elements.listeners.SelectionListener;
import eu.crushedpixel.replaymod.utils.MouseUtils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiTextField;
import org.lwjgl.input.Mouse;
import org.lwjgl.util.Point;
@@ -140,6 +139,7 @@ public class GuiDropdown<T> extends GuiAdvancedTextField {
public boolean mouseClickedResult(int xPos, int yPos) {
boolean success = false;
if(!isEnabled) return success;
if(xPos > xPosition + width - height && xPos < xPosition + width && yPos > yPosition && yPos < yPosition + height) {
open = !open;
} else {