Revert uniqueId persistence

This commit is contained in:
fgnm
2023-09-19 13:36:28 +02:00
parent aa15255aee
commit 4e681d97ff
6 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -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
@@ -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
@@ -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);
}
@@ -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<Integer> newEntitiesList = createEntitiesFromVO(compositeVO);
sandbox.getEngine().process();
@@ -173,6 +173,7 @@ public class ItemFactory implements IFactory {
HashMap<String, CompositeItemVO> libraryItems = projectManager.currentProjectInfoVO.libraryItems;
CompositeItemVO itemVO = libraryItems.get(libraryName);
itemVO.cleanIds();
createdEntity = createCompositeItem(itemVO, position);
if (createdEntity == -1) return false;