2022-09-04 21:21:24 +02:00
|
|
|
package io.gitlab.jfronny.inceptum.imgui.control;
|
2022-01-23 18:53:16 +01:00
|
|
|
|
|
|
|
import imgui.ImGui;
|
|
|
|
|
|
|
|
public abstract class Tab {
|
|
|
|
private final String name;
|
|
|
|
|
|
|
|
public Tab(String name) {
|
|
|
|
this.name = name;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected abstract void renderInner();
|
|
|
|
|
|
|
|
public void render() {
|
2023-05-05 18:49:56 +02:00
|
|
|
if (isVisible() && ImGui.beginTabItem(name)) {
|
2022-01-23 18:53:16 +01:00
|
|
|
renderInner();
|
|
|
|
ImGui.endTabItem();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-18 21:58:40 +01:00
|
|
|
protected boolean isVisible() {
|
2022-01-23 18:53:16 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|