more menus
Some checks failed
Linux arm64 / Build (push) Failing after 14m21s

This commit is contained in:
2025-01-23 15:50:10 +01:00
parent 7ab1173fb3
commit b05351bc20
6 changed files with 117 additions and 8 deletions

View File

@@ -4,6 +4,7 @@ import java.util.Stack;
import imgui.ImGui;
import imgui.ImVec2;
import imgui.flag.ImGuiKey;
import imgui.flag.ImGuiWindowFlags;
public class StateMachine {
@@ -22,6 +23,12 @@ public class StateMachine {
menus.pop();
}
private void checkEscape() {
if (ImGui.isKeyPressed(ImGuiKey.Escape) && menus.size() > 1) {
popState();
}
}
public void render() {
var displaySize = ImGui.getIO().getDisplaySize();
ImGui.setNextWindowPos(new ImVec2(0.0f, 0.0f));
@@ -30,6 +37,7 @@ public class StateMachine {
| ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.NoBackground);
menus.getLast().render();
ImGui.end();
checkEscape();
}
}