tiled icon indicating copy to clipboard operation
tiled copied to clipboard

Resolve object types and properties should be split into two?

Open jestarray opened this issue 2 years ago • 3 comments

{
"gid":3993,
"height":32,
"id":310,
"name":"shutter2",
"rotation":0,
"type":"foo", // i just need the type written out and not all the props
"visible":true,
"width":32,
"x":1536,
"y":1248
},

These should be really split into two parts:

  1. Resolve object types
  2. Resolve object properties

because I only need object types resolved and not the properties themselves as I prefer to save safe and do a lookup.

jestarray avatar Jul 24 '23 16:07 jestarray

On that note, perhaps it should also work on save rather than file -> export? I was re-saving the file a lot of times looking for changes

jestarray avatar Jul 24 '23 19:07 jestarray

On that note, perhaps it should also work on save rather than file -> export? I was re-saving the file a lot of times looking for changes

Resolved properties erase the distinction between values that are inherited and not overridden, and values that are explicitly set but happen to match the current default. Writing out those values to the working map (i.e. on Save) would remove a lot of the benefit of the inheritance system. It would require the user to manually update all their maps any time they change the original value, as Tiled would not be able to correctly propagate the change.

Even an entirely separate option for enabling this on Save would likely lead to a lot of accidentally wrecked map files. (Well, not wrecked, but annoying-to-update xP)

Edit: Explicitly setting types and/or property values from tiles can be accomplished easily via scripting, so you can have that capability if you need it. For values inherited from custom types it's more challenging since the scripting API does not expose custom types yet, but it can be accomplished by parsing the project file. Scripts can listen for assetAboutToBeSaved signals and do this automatically on save.

eishiya avatar Jul 24 '23 19:07 eishiya

@eishiya Oh right! I have not thought about it erasing work. Never mind that suggestion then

jestarray avatar Jul 25 '23 02:07 jestarray