diff --git a/CHANGELOG.md b/CHANGELOG.md index d2c3437..a23731f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## [0.10.1] - 2025-04-01 + +### Fixed +- (Sprite Editor) Imported sprites from old versions now load rasters properly +- (Sprite Editor) Component rendering is now sorted in the correct order +- (Map Editor) Push block grid indices are now saved + ## [0.10.0] - 2025-03-13 ### Added @@ -24,6 +31,7 @@ All notable changes to this project will be documented in this file. ### Fixed - (Map Editor) Importing/exporting +- (Map Editor) Camera target override toggles now save properly ## [0.9.4] - 2025-02-21 diff --git a/app.properties b/app.properties index 825e6cf..c1bf17f 100644 --- a/app.properties +++ b/app.properties @@ -1 +1 @@ -version=0.10.0 +version=0.10.1 diff --git a/src/main/java/game/map/MapKey.java b/src/main/java/game/map/MapKey.java index 249d9b6..aa3ba3b 100644 --- a/src/main/java/game/map/MapKey.java +++ b/src/main/java/game/map/MapKey.java @@ -75,6 +75,7 @@ public enum MapKey implements XmlKey ATTR_EXTRACTED ("extracted"), TAG_MARKER_GRID ("Grid"), + ATTR_MARKER_GRID_INDEX ("index"), ATTR_MARKER_GRID_SIZE ("size"), ATTR_MARKER_GRID_OCC ("gridContent"), ATTR_MARKER_GRID_GRAV ("blockGravity"), diff --git a/src/main/java/game/map/marker/GridComponent.java b/src/main/java/game/map/marker/GridComponent.java index 4b28281..3bf2248 100644 --- a/src/main/java/game/map/marker/GridComponent.java +++ b/src/main/java/game/map/marker/GridComponent.java @@ -9,6 +9,7 @@ import java.util.function.Consumer; import org.w3c.dom.Element; import app.input.InputFileException; +import common.commands.AbstractCommand; import common.commands.EditableField; import common.commands.EditableField.EditableFieldFactory; import common.commands.EditableField.StandardBoolName; @@ -16,7 +17,6 @@ import game.entity.EntityInfo.EntityType; import game.map.BoundingBox; import game.map.editor.MapEditor; import game.map.editor.camera.MapEditViewport; -import common.commands.AbstractCommand; import game.map.editor.render.PresetColor; import game.map.editor.render.Renderer; import game.map.editor.render.RenderingOptions; @@ -92,6 +92,7 @@ public class GridComponent extends BaseMarkerComponent public void toXML(XmlWriter xmw) { XmlTag compTag = xmw.createTag(TAG_MARKER_GRID, true); + xmw.addInt(compTag, ATTR_MARKER_GRID_INDEX, gridIndex.get()); xmw.addIntArray(compTag, ATTR_MARKER_GRID_SIZE, gridSizeX.get(), gridSizeZ.get(), gridSpacing.get()); int[] gridContent = new int[gridOccupants.size() * 3]; @@ -115,6 +116,9 @@ public class GridComponent extends BaseMarkerComponent { Element gridElem = xmr.getUniqueRequiredTag(markerElem, TAG_MARKER_GRID); + if (xmr.hasAttribute(gridElem, ATTR_MARKER_GRID_INDEX)) // optional to allow loading old versions + gridIndex.set(xmr.readInt(gridElem, ATTR_MARKER_GRID_INDEX)); + int[] grid = xmr.readIntArray(gridElem, ATTR_MARKER_GRID_SIZE, 3); gridSizeX.set(grid[0]); gridSizeZ.set(grid[1]); diff --git a/src/main/java/game/sprite/SpriteComponent.java b/src/main/java/game/sprite/SpriteComponent.java index 51e7ad6..c9ba66e 100644 --- a/src/main/java/game/sprite/SpriteComponent.java +++ b/src/main/java/game/sprite/SpriteComponent.java @@ -450,8 +450,6 @@ public class SpriteComponent implements XmlSerializable, Indexable> 20; + if (id < 0 || id >= sprite.rasters.size()) - img = null; - else - img = sprite.rasters.get(id); + imgIndex = id; } public SetImage(CommandAnimator animator, SpriteRaster img)