Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom properties and templates #818

Closed
benjastudio opened this issue Nov 3, 2014 · 2 comments
Closed

Custom properties and templates #818

benjastudio opened this issue Nov 3, 2014 · 2 comments

Comments

@benjastudio
Copy link

Hello,

First I would like to thank author and contributors of the tiled project.

Then, I was looking for a quick way to set up properties of my objects, cause I'm using them a lot!
Something like wich may add properties without editing them manually and also apply templates (a set of predefined properties).
So I created, 2 features enabling these actions.

What the (diry) code does:
Parse 2 xml files, one definiying custom properties and another for our custom templates:
xml

What it looks like in the UI:
custom prop
custom template

So for now I just changed abstractobjecttool.cpp/.h and changeproperties.cpp/.h files, the parsing of the xml file is done on the AbstractObjectTool::showContextMenu method, it's dirty but it works fine. Also, the disadvantage of this is that is not possible to assign shortcut to our custom templates or properties.

So I'm here to know if you're interested in adding this feature, and also knowing your suggestions about it and also where is the better place in the code to parse xml files..

Thank you

@bjorn
Copy link
Member

bjorn commented Nov 4, 2014

First I would like to thank author and contributors of the tiled project.

You're welcome! :-)

So I'm here to know if you're interested in adding this feature, and also knowing your suggestions about it and also where is the better place in the code to parse xml files..

Of course, many people are interested in such a feature and the thing that needs to be done is deciding exactly how to add it and then to implement it. There's many other issues open about it as recently mentioned on the forum: #24, #70, #367. They all talk about essentially the same problem but have different ways of looking at it or different suggested solutions.

Your approach is interesting but I think we do really need a way to define the list of properties for each object template and their default values, so that we can avoid writing out a large amount of defaults into the map file. Also I think the template should include the object type and the kind of object (rectangle, polygon, tile, etc.), rather than just be about sets of custom properties. Also I think as mentioned in issue #24, these object templates should probably be tied to a project file. But then it becomes a larger change of course.

@bjorn
Copy link
Member

bjorn commented Sep 6, 2017

I'll close this since this feature is now largely provided by predefined custom properties and object templates.

I think the menu could be extended similar to the "Apply custom template", as a way to turn an existing object into an instance of a certain template, but we could also rely on the selection in the Templates view and avoid duplicating that as a menu hierarchy. I've opened #818 about this.

If you are still using Tiled, any feedback on the new object templates system would be very welcome!

@bjorn bjorn closed this as completed Sep 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants