mapeditor / tiled

Flexible level editor
https://www.mapeditor.org/
Other
11.16k stars 1.76k forks source link

Copy and paste to object types editor from tileset props/objects #3676

Open jestarray opened 1 year ago

jestarray commented 1 year ago
// objecttypes.json
{
        "name": "Liquid",
        "type": "class",
        "members": [
            {
                "name": "test",
                "type": "string",
                "value": "foo"
            }
        ],
    }

// tileset.tsj props
tiles [{
         "id":2,
         "properties":[
                {
                 "name":"test",
                 "type":"string",
                 "value":"foo"
                }, ]
        }]

So objecttypes.json has a member field that is pretty much compatible with tile.properties and or custom objects but you cant copy and paste to the object types editor in the ui. You also can't copy members from objecttypes class to another objecttypes class. I'm currently copying via text editor for now.

bjorn commented 1 year ago

I agree this should be supported. The main difficulty in sharing this code is probably that the actions will need to work on different kinds of data, with the current actions changing one or more Object instances using an undo command, whereas for the Custom Types Editor, the change works without undo command and changes a ClassPropertyType.