diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index d5c1d314..150c70a2 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -668,6 +668,8 @@ Unit definition/spawning Hitbox updates for katana 2H Fix bug with geometry references not properly flipping in server hitbox collision callback Fix level editor entity tree not re-rendering when an entity is deleted +Fix server entity not rotation when first person camera rotates +Entity details debug menu Data View # TODO diff --git a/src/main/java/electrosphere/entity/Entity.java b/src/main/java/electrosphere/entity/Entity.java index 0c90d9e6..505a9aaf 100644 --- a/src/main/java/electrosphere/entity/Entity.java +++ b/src/main/java/electrosphere/entity/Entity.java @@ -1,6 +1,7 @@ package electrosphere.entity; import java.util.HashMap; +import java.util.Set; import org.graalvm.polyglot.HostAccess.Export; @@ -87,4 +88,12 @@ public class Entity { public void removeData(String key){ data.remove(key); } + + /** + * Gets the set of all keys on the entity + * @return The set of all keys + */ + public Set getKeys(){ + return this.data.keySet(); + } } diff --git a/src/main/java/electrosphere/menu/debug/ImGuiEntityMacros.java b/src/main/java/electrosphere/menu/debug/ImGuiEntityMacros.java index 94f224f9..b1cf7a9a 100644 --- a/src/main/java/electrosphere/menu/debug/ImGuiEntityMacros.java +++ b/src/main/java/electrosphere/menu/debug/ImGuiEntityMacros.java @@ -51,6 +51,7 @@ public class ImGuiEntityMacros { private static Entity detailViewEntity = null; //tree node values + private static boolean showDataTab = false; //show all data names stored in the entity private static boolean showActorTab = false; //show the actor tab private static boolean showPoseActorTab = false; //show the pose actor tab private static boolean showEquipStateTab = false; //actor details @@ -111,6 +112,9 @@ public class ImGuiEntityMacros { public void exec() { ImGui.text("Current ID: " + detailViewEntity.getId()); if(ImGui.treeNode("Views")){ + if(ImGui.checkbox("Data View", showDataTab)){ + showDataTab = !showDataTab; + } if(EntityUtils.getActor(detailViewEntity) != null && ImGui.checkbox("Actor Details", showActorTab)){ showActorTab = !showActorTab; } @@ -145,6 +149,7 @@ public class ImGuiEntityMacros { drawLinkedEntities(); drawServerViewDir(); drawPhysicsDetails(); + drawDataView(); } }); clientEntityDetailWindow.setOpen(false); @@ -160,6 +165,19 @@ public class ImGuiEntityMacros { clientEntityDetailWindow.setOpen(true); } + /** + * Draws the data view + */ + protected static void drawDataView(){ + if(showDataTab && ImGui.collapsingHeader("Data View")){ + if(detailViewEntity != null){ + for(String key : detailViewEntity.getKeys()){ + ImGui.text(key); + } + } + } + } + /** * Client scene entity view */