2022-02-07 13:29:23 +00:00
|
|
|
package love.distributedrebirth.imxmi.lang;
|
|
|
|
|
2022-02-07 22:38:44 +00:00
|
|
|
import imgui.ImGui;
|
2022-02-07 14:30:07 +00:00
|
|
|
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
|
|
|
|
|
|
|
|
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
2022-02-07 22:38:44 +00:00
|
|
|
public class ImButtonˣᴹᴵ extends AbstractImComponentˣᴹᴵ {
|
|
|
|
|
|
|
|
private String label;
|
|
|
|
private Runnable callback;
|
|
|
|
|
|
|
|
public ImButtonˣᴹᴵ() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public ImButtonˣᴹᴵ(String label) {
|
|
|
|
setLabel(label);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void renderComponent() {
|
|
|
|
if (ImGui.button(label) && callback != null) {
|
|
|
|
callback.run();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getLabel() {
|
|
|
|
return label;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setLabel(String label) {
|
|
|
|
this.label = label;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Runnable getCallback() {
|
|
|
|
return callback;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setCallback(Runnable callback) {
|
|
|
|
this.callback = callback;
|
|
|
|
}
|
2022-02-07 13:29:23 +00:00
|
|
|
}
|