"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:
@@ -3,6 +3,9 @@ package eu.crushedpixel.replaymod.gui.elements;
|
||||
import net.minecraft.client.Minecraft;
|
||||
|
||||
public abstract class DelegatingElement implements GuiElement {
|
||||
|
||||
protected boolean enabled = true;
|
||||
|
||||
public static DelegatingElement of(final GuiElement element) {
|
||||
return new DelegatingElement() {
|
||||
@Override
|
||||
@@ -55,5 +58,7 @@ public abstract class DelegatingElement implements GuiElement {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnabled(boolean enabled) {}
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user