diff --git a/CHANGES b/CHANGES index 503008b3..35796686 100644 --- a/CHANGES +++ b/CHANGES @@ -9,7 +9,7 @@ - Bug fixing and stability improvements **Runtime** -- [BREAK CHANGE] New `MainItemComponent#uniqueId` management, change from integer to a non persistent random string +- [BREAK CHANGE] New `MainItemComponent#uniqueId` management, change from integer to a random string - Chained Entities and Spine' SkeletonRenderSeparator - Improved PhysicsActions. Add `PhysicsActions#transformTo` and `PhysicsActions#transformBy` - Fixed physic's step diff --git a/hyperlap2d-runtime-libgdx b/hyperlap2d-runtime-libgdx index fd7c320e..398b6633 160000 --- a/hyperlap2d-runtime-libgdx +++ b/hyperlap2d-runtime-libgdx @@ -1 +1 @@ -Subproject commit fd7c320ee038c6cb45e4a562538a6111e073d669 +Subproject commit 398b6633dc6d11af840deab181bbf1f0b3e1ac5c diff --git a/src/main/java/games/rednblack/editor/controller/commands/AddToLibraryCommand.java b/src/main/java/games/rednblack/editor/controller/commands/AddToLibraryCommand.java index 6e2594b9..397de929 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/AddToLibraryCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/AddToLibraryCommand.java @@ -59,6 +59,7 @@ public class AddToLibraryCommand extends HistoricRevertibleCommand { CompositeItemVO newVO = new CompositeItemVO(); newVO.loadFromEntity(item, sandbox.getEngine(), sandbox.sceneControl.sceneLoader.getEntityFactory()); + newVO.cleanIds(); libraryItems.put(createdLibraryItemName, newVO); //mark this entity as belonging to library diff --git a/src/main/java/games/rednblack/editor/controller/commands/EntityModifyRevertibleCommand.java b/src/main/java/games/rednblack/editor/controller/commands/EntityModifyRevertibleCommand.java index c9d4761b..ded58d92 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/EntityModifyRevertibleCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/EntityModifyRevertibleCommand.java @@ -60,6 +60,7 @@ public abstract class EntityModifyRevertibleCommand extends HistoricRevertibleCo if (libraryItems.containsKey(mainItemComponent.libraryLink)) { CompositeItemVO itemVO = new CompositeItemVO(); itemVO.loadFromEntity(entity, sandbox.getEngine(), sandbox.sceneControl.sceneLoader.getEntityFactory()); + itemVO.cleanIds(); libraryItems.put(mainItemComponent.libraryLink, itemVO); } diff --git a/src/main/java/games/rednblack/editor/controller/commands/PasteItemsCommand.java b/src/main/java/games/rednblack/editor/controller/commands/PasteItemsCommand.java index 2f61a31d..1670328d 100644 --- a/src/main/java/games/rednblack/editor/controller/commands/PasteItemsCommand.java +++ b/src/main/java/games/rednblack/editor/controller/commands/PasteItemsCommand.java @@ -63,6 +63,7 @@ public class PasteItemsCommand extends EntityModifyRevertibleCommand { Json json = HyperJson.getJson(); CompositeItemVO compositeVO = json.fromJson(CompositeItemVO.class, (String) payload[1]); + compositeVO.cleanIds(); Set newEntitiesList = createEntitiesFromVO(compositeVO); sandbox.getEngine().process(); diff --git a/src/main/java/games/rednblack/editor/factory/ItemFactory.java b/src/main/java/games/rednblack/editor/factory/ItemFactory.java index e3adc4c1..bf3060d8 100644 --- a/src/main/java/games/rednblack/editor/factory/ItemFactory.java +++ b/src/main/java/games/rednblack/editor/factory/ItemFactory.java @@ -173,6 +173,7 @@ public class ItemFactory implements IFactory { HashMap libraryItems = projectManager.currentProjectInfoVO.libraryItems; CompositeItemVO itemVO = libraryItems.get(libraryName); + itemVO.cleanIds(); createdEntity = createCompositeItem(itemVO, position); if (createdEntity == -1) return false;