45 lines
904 B
Java
45 lines
904 B
Java
package io.gitlab.jfronny.inceptum.windows;
|
|
|
|
import imgui.flag.ImGuiWindowFlags;
|
|
import imgui.type.ImBoolean;
|
|
import io.gitlab.jfronny.inceptum.Inceptum;
|
|
|
|
public abstract class Window {
|
|
private final String name;
|
|
private boolean isNew = true;
|
|
private ImBoolean openState = new ImBoolean(true);
|
|
|
|
public Window(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public void preFirstDraw() {
|
|
}
|
|
public abstract void draw();
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void close() {
|
|
openState.set(false);
|
|
Inceptum.WINDOWS.remove(this);
|
|
}
|
|
|
|
public boolean isNew() {
|
|
if (isNew) {
|
|
isNew = false;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public int getFlags() {
|
|
return ImGuiWindowFlags.AlwaysAutoResize;
|
|
}
|
|
|
|
public ImBoolean getOpenState() {
|
|
return openState;
|
|
}
|
|
}
|