editor mode pauses simulation
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2025-03-26 22:38:09 -04:00
parent 62ad638255
commit 2cf46cc38f
3 changed files with 20 additions and 1 deletions

View File

@ -1328,6 +1328,7 @@ Fix block meshgen algorithm iteration bug
Add debug control to swap first/third person
Setup scaffolding for drag-and-drop asset handling
Editor mode asset file drag and drop
Editor mode pauses simulation

View File

@ -2,6 +2,7 @@ package electrosphere.client.ui.menu.editor;
import electrosphere.controls.ControlHandler.ControlsState;
import electrosphere.engine.Globals;
import electrosphere.engine.Main;
import electrosphere.renderer.ui.imgui.ImGuiWindow;
import electrosphere.renderer.ui.imgui.ImGuiWindow.ImGuiWindowCallback;
import imgui.ImGui;
@ -62,8 +63,10 @@ public class ImGuiEditorWindows {
ImGuiEditorWindows.editorIsOpen = mainWindow.isOpen();
if(mainWindow.isOpen()){
Globals.controlHandler.hintUpdateControlState(ControlsState.IN_GAME_MAIN_MENU);
Main.setFramestep(Main.FRAMESTEP_PAUSE);
} else {
Globals.controlHandler.hintUpdateControlState(ControlsState.MAIN_GAME);
Main.setFramestep(Main.FRAMESTEP_AUTO);
}
//toggle all windows

View File

@ -33,6 +33,20 @@ public class Main {
/**
* Pauses simulation
*/
public static final int FRAMESTEP_PAUSE = 0;
/**
* Simulates a single frame
*/
public static final int FRAMESTEP_SINGLE = 1;
/**
* Toggles automatic simulation
*/
public static final int FRAMESTEP_AUTO = 2;
@ -51,6 +65,7 @@ public class Main {
//framestep variable
static int framestep = 2;
public static void main(String args[]){
//