1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-23 14:03:13 +00:00

Fix pxo loading

This commit is contained in:
Emmanouil Papadeas 2023-03-28 03:02:55 +03:00
parent 46929b97d2
commit 4531b5993c
2 changed files with 6 additions and 2 deletions

View file

@ -596,5 +596,5 @@ func convert_dictionary_values(dict: Dictionary) -> void:
dict[key] = str2var("Color(" + dict[key] + ")") dict[key] = str2var("Color(" + dict[key] + ")")
elif "v2" in key: # Convert a String to a Vector2 elif "v2" in key: # Convert a String to a Vector2
dict[key] = str2var("Vector2" + dict[key]) dict[key] = str2var("Vector2" + dict[key])
elif "size" in key: # Convert a String to a Vector3 elif "size" in key or "center_offset" in key: # Convert a String to a Vector3
dict[key] = str2var("Vector3" + dict[key]) dict[key] = str2var("Vector3" + dict[key])

View file

@ -120,7 +120,11 @@ func serialize() -> Dictionary:
func deserialize(dict: Dictionary) -> void: func deserialize(dict: Dictionary) -> void:
.deserialize(dict) .deserialize(dict)
properties = dict["properties"] properties = dict["properties"]
objects = dict["objects"] var objects_copy = dict["objects"]
for object in objects_copy:
if typeof(object) != TYPE_STRING:
return
objects[int(object)] = int(objects_copy[object])
# new_cels_linked = dict.new_cels_linked # new_cels_linked = dict.new_cels_linked
current_object_id = objects.size() current_object_id = objects.size()
Global.convert_dictionary_values(properties) Global.convert_dictionary_values(properties)