Description
Describe the project you are working on:
Generic 2D platformer player controller.
Describe the problem or limitation you are having in your project
Using dictionaries for creating categories in exported variables.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
It's few small propositions of Quality of Life changes - it doesn't necessarily change functionality, but is more visual help.
As (as far as I know) we can't make categories in inspector, using dictionaries would help us work around this issue.
Moreover, I believe using dictionary for settings makes code much clearer.
Small changes that would help readability of dictionary in Inspector:
-
Option to remove possibility to add new keys to dictionary and change type of existing values in inspector. Could be accomplished by simply not showing the following:
-
Option to show String keys without quotes (by using option in project, creating dictionary with only String keys or by any other way). It helps readability.
-
If dictionary contains dictionary, the "inside" dictionary could be shifted slightly to the right to show which options are "inside". On following example, keys in red rectangles should be shifted to the right:
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Sadly I don't know GDscript engine from it's inside point of view, so I don't know what way of implementing this would be easiest/best.
In Script probably it would look something like:
export const myDictionary = {
"key": value,
"insideDict": {
"insideKey": value
}
}
If this enhancement will not be used often, can it be worked around with a few lines of script?
Not really, as those are Quality of Life improvements. Possibly could create categories instead, but in this case we can't use one dictionary for settings, which is the target here.
Is there a reason why this should be core and not an add-on in the asset library?
Right now dictionaries are so unreadable in the inspector, that they aren't useful. Making them as readable as other variables would make it consistent.
Activity