Revert uniqueId persistence
This commit is contained in:
@@ -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
|
||||
|
||||
Submodule hyperlap2d-runtime-libgdx updated: fd7c320ee0...398b6633dc
@@ -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
|
||||
|
||||
+1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user