diff --git a/DelvEdit/src/com/interrupt/dungeoneer/editor/ui/EditorUi.java b/DelvEdit/src/com/interrupt/dungeoneer/editor/ui/EditorUi.java index c502fa37..104a0ac4 100644 --- a/DelvEdit/src/com/interrupt/dungeoneer/editor/ui/EditorUi.java +++ b/DelvEdit/src/com/interrupt/dungeoneer/editor/ui/EditorUi.java @@ -424,8 +424,7 @@ public boolean handle(Event event) { if(resetScroll) entityPropertiesPane.setScrollY(0f); - propertiesSize.set(propertiesMenu.getWidth(), propertiesMenu.getHeight()); - resize(stage.getWidth(), stage.getHeight()); + resize(); sidebarTable.setVisible(true); } @@ -435,6 +434,10 @@ else if(entityPropertiesPane != null) { } } + public void resize() { + resize(stage.getWidth(), stage.getHeight()); + } + public void resize(float width, float height) { viewport.setWorldSize(width, height); viewport.update((int)width, (int)height, true); @@ -444,6 +447,9 @@ public void resize(float width, float height) { mainTable.pack(); if(entityPropertiesPane != null && propertiesMenu != null) { + propertiesSize.set(Math.min(propertiesMenu.getWidth(), stage.getWidth() * 0.25f), + propertiesMenu.getHeight()); + boolean fillsStage = propertiesSize.y > stage.getHeight() - menuBar.getHeight(); entityPropertiesPane.setSize(propertiesSize.x + (fillsStage ? 60f : 30f), propertiesSize.y); diff --git a/DelvEdit/src/com/interrupt/dungeoneer/editor/ui/PropertiesMenu.java b/DelvEdit/src/com/interrupt/dungeoneer/editor/ui/PropertiesMenu.java index ee3fc6b2..53d1fbda 100644 --- a/DelvEdit/src/com/interrupt/dungeoneer/editor/ui/PropertiesMenu.java +++ b/DelvEdit/src/com/interrupt/dungeoneer/editor/ui/PropertiesMenu.java @@ -577,6 +577,8 @@ public void applyChanges(final Field currentField, String val) { for (Entity entity : selectedEntities) { currentField.set(entity, Integer.parseInt(val)); } + + updateSize(); } } catch(Exception ex) { @@ -590,6 +592,8 @@ public void applyChanges(final Field currentField, Material val) { for (Entity entity : selectedEntities) { currentField.set(entity, new Material(val.texAtlas, val.tex)); } + + updateSize(); } } catch(Exception ex) { @@ -712,12 +716,19 @@ else if(currentField.getType() == Color.class) { ((ProjectedDecal) entity).refresh(); } } + + updateSize(); } catch(Exception ex) { Gdx.app.error("DelvEdit", ex.getMessage()); } } + private void updateSize() { + pack(); + Editor.app.ui.resize(); + } + static public class DecimalsFilter implements TextField.TextFieldFilter { @Override public boolean acceptChar (TextField textField, char c) {