gdxapp4d/gdxapp4d-lib-imxmi/src/main/java/love/distributedrebirth/imxmi/lang/ImComboˣᴹᴵ.java

57 lines
1.1 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package love.distributedrebirth.imxmi.lang;
import imgui.ImGui;
import imgui.type.ImInt;
import love.distributedrebirth.bassboonyd.info.BãßBȍőnAuthor注;
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class ImComboˣᴹᴵ extends AbstractImComponentˣᴹᴵ {
private String label;
private final ImInt currentItem = new ImInt();
private String[] items;
private Runnable callback;
public ImComboˣᴹᴵ() {
}
public ImComboˣᴹᴵ(String label) {
setLabel(label);
}
@Override
public void renderComponent() {
if (ImGui.combo(label, currentItem, items) && 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;
}
public ImInt getCurrentItem() {
return currentItem;
}
public String[] getItems() {
return items;
}
public void setItems(String[] items) {
this.items = items;
}
}