-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow specifying the type of a property #14
Comments
The "file" type would be a great addition besides the more common types, as we store file links to object images as a property and having a file browser would speed up adding a file link much. |
I implemented a basic version of property types here: You can specify int,uint,float,string,filepath, or link It will make more sense if you try it yourself. :) |
I would definitely love to see this implemented soon. |
+1 Currently trying to infer the type of a property from its value. It's a pain to do this in C++ (or C) and will lead to odd behavior:
I don't think we need to differentiate between int/uint and float/double because there exist viable runtime conversions. A uint can safely be stored to an int and then cast back to uint if needed. Float values can be read as double, if needed, but I don't think any user will ever need to enter a value with double precision, so float will suffice. As for other uses of strings, their use (path, URL, image, etc) should be inferred from the property's name. But even where that is somehow not possible or feasible, it can easily be determined by using regex or string search. Although ... this could make sense with editor support, ie browse file dialog. I'd propose to stick to the most common, most basic types in the TMX format for denoting a property's type (type-specific editor support notwithstanding):
Update: I should have read the first post. :) |
Show OS X daily builds with inverted order
+1 |
Multi-line editing is independent of supporting more property types than just strings, but it's definitely something I want to support as well! It is covered by issue #205. |
that´s great @bjorn ! |
In some cases it may be nice to know the type of a property. This can also be used to determine an appropriate editor for the property value, once we have a more advanced property editor.
Suggestions for supported types: string (the default), number (floating point), int, bool
Possibly we could even have "file", which would enable a file chooser.
This issue spawned from the discussion at #12
The text was updated successfully, but these errors were encountered: