Upload files to "src/openonyx/ui/internal"
This commit is contained in:
1 parent
93fc36cde0
commit
c5cf9b7531
1 file changed
+71
@@ -0,0 +1,71 @@
|
||||
package openonyx.ui.internal;
|
||||
|
||||
import openonyx.render.Render2D;
|
||||
import openonyx.theme.ThemeManager;
|
||||
import openonyx.ui.RenderContext;
|
||||
import openonyx.ui.UiComponent;
|
||||
import openonyx.ui.UiSupport_545;
|
||||
|
||||
public class UiSupport_602 extends UiComponent {
|
||||
private final UiSupport_545 uiSupport_545 = new UiSupport_545();
|
||||
public static final float I = 30.0F;
|
||||
private String d;
|
||||
private final Runnable runnable;
|
||||
private Integer f;
|
||||
private static final float H = 18.0F;
|
||||
|
||||
@Override
|
||||
public void render(RenderContext renderContext) {
|
||||
UiSupport_602 uiSupport_6021 = this;
|
||||
Render2D render2D = renderContext.render2D;
|
||||
int i = uiSupport_6021.f != null ? uiSupport_6021.f : renderContext.palette().onSurfaceVariant();
|
||||
uiSupport_6021.uiSupport_545.L(render2D, uiSupport_6021.f, uiSupport_6021.d, uiSupport_6021.e, uiSupport_6021.i, Float.MAX_VALUE, i);
|
||||
render2D.drawIcon(
|
||||
uiSupport_6021.d,
|
||||
uiSupport_6021.f + uiSupport_6021.e / 2.0F,
|
||||
uiSupport_6021.d + uiSupport_6021.i / 2.0F,
|
||||
18.0F,
|
||||
uiSupport_6021.I ? i : ThemeManager.disabled(i)
|
||||
);
|
||||
if (uiSupport_6021.h) {
|
||||
render2D.usePointerCursor();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(RenderContext renderContext) {
|
||||
super.update(renderContext);
|
||||
this.uiSupport_545.L(renderContext.i, this.h, this.H);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseReleased(float f, float g, int i) {
|
||||
return this.H = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mouseClicked(float f, float g, int i) {
|
||||
if (i == 0 && this.I && this.contains(fx, g)) {
|
||||
this.H = true;
|
||||
this.runnable.run();
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void L(String string) {
|
||||
this.d = string;
|
||||
}
|
||||
|
||||
public UiSupport_602(String string, Runnable runnable) {
|
||||
this.d = string;
|
||||
this.runnable = runnablex;
|
||||
this.e = 30.0F;
|
||||
this.i = 30.0F;
|
||||
}
|
||||
|
||||
public void L(Integer integer) {
|
||||
this.f = integer;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user