From 3fd97d415a42f5afb6c11d467aa68379eaefcd66 Mon Sep 17 00:00:00 2001 From: austin Date: Tue, 10 Sep 2024 19:32:09 -0400 Subject: [PATCH] voxel selection popout fixes --- buildNumber.properties | 4 ++-- docs/src/progress/renderertodo.md | 1 + src/main/java/electrosphere/engine/Globals.java | 2 +- src/main/java/electrosphere/entity/scene/SceneLoader.java | 1 - .../menu/ingame/MenuGeneratorsLevelEditor.java | 2 +- .../menu/ingame/MenuGeneratorsTerrainEditing.java | 3 ++- .../menu/mainmenu/MenuGeneratorsLevelEditor.java | 5 +---- .../electrosphere/renderer/ui/elements/ImagePanel.java | 7 +++++-- src/main/java/electrosphere/server/saves/SaveUtils.java | 4 ++-- 9 files changed, 15 insertions(+), 14 deletions(-) diff --git a/buildNumber.properties b/buildNumber.properties index f1df9a01..2c47b05f 100644 --- a/buildNumber.properties +++ b/buildNumber.properties @@ -1,3 +1,3 @@ #maven.buildNumber.plugin properties file -#Sun Sep 08 21:41:56 EDT 2024 -buildNumber=325 +#Tue Sep 10 19:22:32 EDT 2024 +buildNumber=326 diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index c96d755d..39a4f2d9 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -717,6 +717,7 @@ Fix cursor visuals Fix jump/fall/land animations being buggy and inconsistent between client/server Remove extraneous println's Fix empty item slot not showing underneath dragged item +Fix voxel selection popout rendering, nav logic # TODO diff --git a/src/main/java/electrosphere/engine/Globals.java b/src/main/java/electrosphere/engine/Globals.java index 8064170d..806812a3 100644 --- a/src/main/java/electrosphere/engine/Globals.java +++ b/src/main/java/electrosphere/engine/Globals.java @@ -160,7 +160,7 @@ public class Globals { public static boolean RUN_CLIENT = true; public static boolean RUN_HIDDEN = false; //glfw session will be created with hidden window public static boolean RUN_AUDIO = true; - public static boolean RUN_SCRIPTS = false; + public static boolean RUN_SCRIPTS = true; public static int clientCharacterID; public static NetConfig netConfig = null; diff --git a/src/main/java/electrosphere/entity/scene/SceneLoader.java b/src/main/java/electrosphere/entity/scene/SceneLoader.java index af044fba..fef04988 100644 --- a/src/main/java/electrosphere/entity/scene/SceneLoader.java +++ b/src/main/java/electrosphere/entity/scene/SceneLoader.java @@ -12,7 +12,6 @@ import electrosphere.game.server.world.ServerWorldData; import electrosphere.server.content.ServerContentManager; import electrosphere.server.datacell.GriddedDataCellManager; import electrosphere.server.datacell.Realm; -import electrosphere.server.datacell.ServerDataCell; import electrosphere.util.FileUtils; /** diff --git a/src/main/java/electrosphere/menu/ingame/MenuGeneratorsLevelEditor.java b/src/main/java/electrosphere/menu/ingame/MenuGeneratorsLevelEditor.java index 2ba8c4ed..3bfe03c2 100644 --- a/src/main/java/electrosphere/menu/ingame/MenuGeneratorsLevelEditor.java +++ b/src/main/java/electrosphere/menu/ingame/MenuGeneratorsLevelEditor.java @@ -53,7 +53,7 @@ public class MenuGeneratorsLevelEditor { static final int SIDE_PANEL_WIDTH = 500; //is the voxel selection window open - static boolean voxelWindowOpen = false; + protected static boolean voxelWindowOpen = false; //vertical offset from cursor position to spawn things at static final Vector3d cursorVerticalOffset = new Vector3d(0,0.05,0); diff --git a/src/main/java/electrosphere/menu/ingame/MenuGeneratorsTerrainEditing.java b/src/main/java/electrosphere/menu/ingame/MenuGeneratorsTerrainEditing.java index b1ecdafa..2bc993b2 100644 --- a/src/main/java/electrosphere/menu/ingame/MenuGeneratorsTerrainEditing.java +++ b/src/main/java/electrosphere/menu/ingame/MenuGeneratorsTerrainEditing.java @@ -70,7 +70,8 @@ public class MenuGeneratorsTerrainEditing { scrollable.setFlexDirection(YogaFlexDirection.Row); scrollable.setAlignItems(YogaAlignment.Start); rVal.setOnNavigationCallback(new NavigationEventCallback() {public boolean execute(NavigationEvent event){ - WindowUtils.closeWindow(WindowStrings.LEVEL_EDTIOR_SIDE_PANEL); + WindowUtils.closeWindow(WindowStrings.VOXEL_TYPE_SELECTION); + MenuGeneratorsLevelEditor.voxelWindowOpen = false; return false; }}); diff --git a/src/main/java/electrosphere/menu/mainmenu/MenuGeneratorsLevelEditor.java b/src/main/java/electrosphere/menu/mainmenu/MenuGeneratorsLevelEditor.java index 41d2690f..66002ddf 100644 --- a/src/main/java/electrosphere/menu/mainmenu/MenuGeneratorsLevelEditor.java +++ b/src/main/java/electrosphere/menu/mainmenu/MenuGeneratorsLevelEditor.java @@ -126,6 +126,7 @@ public class MenuGeneratorsLevelEditor { //values to creat the level with LevelDescription inFlightLevel = new LevelDescription(); SceneFile sceneFile = SceneFile.createSceneFile(); + sceneFile.setCreateSaveInstance(true); inFlightLevel.setSceneFile(sceneFile); @@ -188,10 +189,6 @@ public class MenuGeneratorsLevelEditor { }, DEFAULT_GRID_SIZE / (float)GriddedDataCellManager.MAX_GRID_SIZE) ); sceneFile.getRealmDescriptor().setGriddedRealmSize(DEFAULT_GRID_SIZE); - - griddedRealmControls.addChild(InputMacros.createToggle("Create Scene File", false, (ValueChangeEvent event) -> { - sceneFile.setCreateSaveInstance(event.getAsBoolean()); - })); } rVal.addChild(griddedRealmControls); diff --git a/src/main/java/electrosphere/renderer/ui/elements/ImagePanel.java b/src/main/java/electrosphere/renderer/ui/elements/ImagePanel.java index b09aede8..bda194c3 100644 --- a/src/main/java/electrosphere/renderer/ui/elements/ImagePanel.java +++ b/src/main/java/electrosphere/renderer/ui/elements/ImagePanel.java @@ -127,8 +127,8 @@ public class ImagePanel extends StandardElement implements DrawableElement, Drag float ndcWidth = (float)getInternalWidth()/parentWidth; float ndcHeight = (float)getInternalHeight()/parentHeight; - float ndcX = (float)(getAbsoluteX())/parentWidth; - float ndcY = (float)(getAbsoluteY())/parentHeight; + float ndcX = (float)(getInternalX() + parentPosX)/parentWidth; + float ndcY = (float)(getInternalY() + parentPosY)/parentHeight; boxPosition = new Vector3f(ndcX,ndcY,0); boxDimensions = new Vector3f(ndcWidth,ndcHeight,0); @@ -144,6 +144,9 @@ public class ImagePanel extends StandardElement implements DrawableElement, Drag openGLState.glBindFramebuffer(GL_FRAMEBUFFER, parentFramebufferPointer); openGLState.glViewport(parentWidth, parentHeight); + renderPipelineState.setUseMaterial(true); + renderPipelineState.setBufferNonStandardUniforms(true); + if(planeModel != null){ planeModel.pushUniformToMesh("plane", "mPosition", boxPosition); planeModel.pushUniformToMesh("plane", "mDimension", boxDimensions); diff --git a/src/main/java/electrosphere/server/saves/SaveUtils.java b/src/main/java/electrosphere/server/saves/SaveUtils.java index e8885afe..997d252d 100644 --- a/src/main/java/electrosphere/server/saves/SaveUtils.java +++ b/src/main/java/electrosphere/server/saves/SaveUtils.java @@ -192,8 +192,8 @@ public class SaveUtils { LoggerInterface.loggerEngine.INFO("Load world data from scene " + saveName); serverWorldData = ServerWorldData.loadWorldData(saveName, true); } else { - //The scene is neither defined in the save itself nor in the assets scene files - throw new IllegalStateException("Trying to load a save that does not contain a scene!"); + //The world data is neither defined in the save itself nor in the assets scene files + throw new IllegalStateException("Trying to load a save that does not contain world data!"); } //load scene file