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

Request to Add Support for Enumeration Properties #1211

Open
lazybotter opened this issue Feb 25, 2016 · 15 comments
Open

Request to Add Support for Enumeration Properties #1211

lazybotter opened this issue Feb 25, 2016 · 15 comments
Labels
Milestone

Comments

@lazybotter
Copy link

@lazybotter lazybotter commented Feb 25, 2016

One really good option to add to the "Add Property" dialogue would be the ability to add multiple string values that would display as a "Select" or "Dropdown Menu".

So for an example:

I could create an object that has a Type of "Box".
The "Box" could then have a "BoxType" property. "Solid Box, Mystery Box, Danger Box".
Then when creating the object on the map we can just select what "BoxType" we would like the "Box" to be.
This would be great for custom game engines etc when creating the maps.

Thanks! Carl ;-)

@bjorn
Copy link
Owner

@bjorn bjorn commented Feb 28, 2016

Definitely. The main challenge here is that such enumeration properties would need to be based on enumeration types, which would have to be defined before you can define a property of that type. So this means a new section in objecttypes.xml for complex type definitions (I could also imagine supporting types that have sub-properties here later) and then coding some way in which these types get used by the property browser.

Starting with just enumeration properties would be a good idea, I just want to be prepared a little for sub-properties later.

@bjorn bjorn added the feature label Feb 28, 2016
@lazybotter
Copy link
Author

@lazybotter lazybotter commented Apr 11, 2016

Any movement on this? :-)

@lazybotter
Copy link
Author

@lazybotter lazybotter commented Aug 8, 2016

Anyone started on this yet?

@bjorn
Copy link
Owner

@bjorn bjorn commented Aug 8, 2016

I haven't gotten around to this yet. If it is any comfort, for Tiled 0.17 I did get around to several other property enhancements, like adding "file" and "color" types and supporting multi-line values for "string" properties.

This feature is definitely still on the list of things to improve about the custom properties system.

@jeremyherbert
Copy link

@jeremyherbert jeremyherbert commented Mar 19, 2017

Has any work been done on the UI of this? ie how would one define the enum types? Would you have a separate editor window, much like the object types editor, but one that is used just for defining enums? Or something in the same window? Are enums defined as a simple integer->string mapping like in C, or something else?

I'd be interested in giving this a go, but I am not sure which is the best way to proceed. I'd of course like to try and have the code merged eventually.

@bjorn
Copy link
Owner

@bjorn bjorn commented Mar 20, 2017

@jeremyherbert No work has been done on this. Indeed it would be good to mock up the UI before starting to code this. Thanks for your interest to work on this and to try getting it merged!

Are enums defined as a simple integer->string mapping like in C, or something else?

I imagine the enum will be defined only as the list of options (strings), and these strings will be used when saving/loading. A downside of that is that you can't easily rename one of the enum options, but it does mean you can add/remove them without causing many issues (and without requiring the user to be careful with value assignment in this case).

Would you have a separate editor window, much like the object types editor, but one that is used just for defining enums? Or something in the same window?

I'm hope we don't need too many separate windows and am thinking of something like this to start with:

object-types-dialog

When you'd click the button to add a new property type, then a new window would pop up where you could define what the new property type would be (eventually, it could be more than just enum, and it could even base on existing types like 'int' and just add a min/max value - not sure yet at which level that makes most sense). In case of an enum, you'd have a list of strings there with +/- buttons and Ok/Cancel buttons.

As a bonus it would be cool if you could drag-n-drop from Property Types into Properties to add a new property of that type. :-)

@jeremyherbert
Copy link

@jeremyherbert jeremyherbert commented Mar 21, 2017

Do you think it would be ok to put it in the object properties window when these types can also apply to tiles? The feature I'm personally looking for is the ability to attach enums to tiles, rather than objects.

@bjorn
Copy link
Owner

@bjorn bjorn commented Mar 21, 2017

Do you think it would be ok to put it in the object properties window when these types can also apply to tiles? The feature I'm personally looking for is the ability to attach enums to tiles, rather than objects.

Yes, that's alright. Actually, there is another issue open for defining custom properties for other data types (#1410) which means this dialog will probably be further extended to support that as well.

@MikaelMollberg
Copy link

@MikaelMollberg MikaelMollberg commented Feb 1, 2019

This would be great to have!

@Tanz0rz
Copy link

@Tanz0rz Tanz0rz commented May 11, 2019

I want to give a big +1 for this feature! It would really come in handy for my project right now.

@JoeCreates
Copy link

@JoeCreates JoeCreates commented Jul 23, 2019

Another +1 from me.

@tolgakaranlik
Copy link

@tolgakaranlik tolgakaranlik commented Feb 7, 2020

What kind of Patreon or GitHub Sponsors support can I make to speed up the development of this feature?

How long would it take to have this feature done if I pay for the right Patreonship?

If it would take long, can I contribute to the development with coding this feature for Tiled?

Thanks

@bjorn
Copy link
Owner

@bjorn bjorn commented Feb 7, 2020

@tolgakaranlik Thank you for your interest in sponsoring this feature! On both Patreon and GitHub, there is a $200/month sponsorship level at which you can determine what I should work on for an entire day. Even when a day may not be enough to implement this feature, I will make sure it will get done.

Alternatively, if you have the time and ability to develop this feature yourself, then this is a great option as well. I give reviewing pull requests generally a high priority and I can help with polishing it up if needed.

Regardless, any level of support would be really appreciated!

@tolgakaranlik
Copy link

@tolgakaranlik tolgakaranlik commented Feb 19, 2020

Sorry I have seen your reply late. I am going to do both, I'll donate $200 bucks for your development and I will also implement some features by myself. If all goes like I planned, I will be donating that amount on 23rd of Feb and as soon as I make the donation, we can argue about which portion you will do and which portion that I will do. Feel free to contact me at tolgakaranlik@gmail.com after you get your payment

@bjorn
Copy link
Owner

@bjorn bjorn commented Feb 19, 2020

@tolgakaranlik That's great to hear, I'm looking forward to working together! When you're ready I'm also open for a video call over Discord, Skype or Jitsi Meet.

@bjorn bjorn added this to Tiled 1.5 in Roadmap May 12, 2020
@bjorn bjorn added this to the Tiled 1.5 milestone May 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
7 participants
You can’t perform that action at this time.