mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-23 21:49:49 +00:00
start 1.10.2
This commit is contained in:
1 parent
f969f63b66
commit
6a7c4bf67d
826 files changed
+60550
-63758
No files matched your search
@@ -1,66 +1,60 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.craftgui.controls.button;
|
||||
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.events.EventHandler;
|
||||
import binnie.craftgui.events.EventButtonClicked;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.events.EventButtonClicked;
|
||||
import binnie.craftgui.events.EventHandler;
|
||||
import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.resource.minecraft.CraftGUITexture;
|
||||
|
||||
public class ControlButton extends Control
|
||||
{
|
||||
private ControlText textWidget;
|
||||
private String text;
|
||||
public class ControlButton extends Control {
|
||||
private ControlText textWidget;
|
||||
private String text;
|
||||
|
||||
public ControlButton(final IWidget parent, final float x, final float y, final float width, final float height) {
|
||||
super(parent, x, y, width, height);
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
this.addEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
ControlButton.this.callEvent(new EventButtonClicked(ControlButton.this.getWidget()));
|
||||
ControlButton.this.onMouseClick(event);
|
||||
}
|
||||
}.setOrigin(EventHandler.Origin.Self, this));
|
||||
}
|
||||
public ControlButton(final IWidget parent, final float x, final float y, final float width, final float height) {
|
||||
super(parent, x, y, width, height);
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
this.addEventHandler(new EventMouse.Down.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventMouse.Down event) {
|
||||
ControlButton.this.callEvent(new EventButtonClicked(ControlButton.this.getWidget()));
|
||||
ControlButton.this.onMouseClick(event);
|
||||
}
|
||||
}.setOrigin(EventHandler.Origin.Self, this));
|
||||
}
|
||||
|
||||
protected void onMouseClick(final EventMouse.Down event) {
|
||||
}
|
||||
protected void onMouseClick(final EventMouse.Down event) {
|
||||
}
|
||||
|
||||
public ControlButton(final IWidget parent, final float x, final float y, final float width, final float height, final String text) {
|
||||
this(parent, x, y, width, height);
|
||||
this.text = text;
|
||||
this.textWidget = new ControlText(this, this.getArea(), text, TextJustification.MiddleCenter);
|
||||
}
|
||||
public ControlButton(final IWidget parent, final float x, final float y, final float width, final float height, final String text) {
|
||||
this(parent, x, y, width, height);
|
||||
this.text = text;
|
||||
this.textWidget = new ControlText(this, this.getArea(), text, TextJustification.MiddleCenter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
if (this.textWidget != null) {
|
||||
this.textWidget.setValue(this.getText());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onUpdateClient() {
|
||||
if (this.textWidget != null) {
|
||||
this.textWidget.setValue(this.getText());
|
||||
}
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return this.text;
|
||||
}
|
||||
public String getText() {
|
||||
return this.text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
Object texture = CraftGUITexture.ButtonDisabled;
|
||||
if (this.isMouseOver()) {
|
||||
texture = CraftGUITexture.ButtonHighlighted;
|
||||
}
|
||||
else if (this.isEnabled()) {
|
||||
texture = CraftGUITexture.Button;
|
||||
}
|
||||
CraftGUI.Render.texture(texture, this.getArea());
|
||||
}
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
Object texture = CraftGUITexture.ButtonDisabled;
|
||||
if (this.isMouseOver()) {
|
||||
texture = CraftGUITexture.ButtonHighlighted;
|
||||
} else if (this.isEnabled()) {
|
||||
texture = CraftGUITexture.Button;
|
||||
}
|
||||
CraftGUI.Render.texture(texture, this.getArea());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user