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

Improve readability of Dictionaries in the inspector #2018

Closed
haaldor opened this issue Dec 24, 2020 · 5 comments · Fixed by godotengine/godot#75482
Closed

Improve readability of Dictionaries in the inspector #2018

haaldor opened this issue Dec 24, 2020 · 5 comments · Fixed by godotengine/godot#75482
Milestone

Comments

@haaldor
Copy link

haaldor commented Dec 24, 2020

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:
    image
    image

  • 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:
    image

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.

@Calinou
Copy link
Member

Calinou commented Dec 24, 2020

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.

Shouldn't we show quotes in string keys only if they can be confused with other types (such as false and true)? Otherwise, we can safely hide them as they can't bring any confusion.

@Calinou Calinou changed the title Improve readability of dictionary in the inspector Improve readability of Dictionaries in the inspector Dec 24, 2020
@Shadowblitz16
Copy link

Shadowblitz16 commented Feb 18, 2021

The whole inspector is very hard to read when it comes to any sort of nested data.
I honestly don't see any readability improvements though.

@hilfazer
Copy link

I'd like that pencil button to be narrower - more horizontal space.

@Calinou
Copy link
Member

Calinou commented Feb 18, 2021

I'd like that pencil button to be narrower - more horizontal space.

I think it's better to keep the same margin to all buttons to make them easy enough to click. We'd have to introduce dedicated button styles that have a lower margin just for those edit buttons, and it'd make them difficult to click (especially on a touch screen).

We can probably find a way to remove the margin between the editable field and the edit button though.

@don-tnowe
Copy link

Nested collection view could be improved in another way. Look at Resources, they already have a colored border that shifts hue based on nesting level! Offset is a nice tiny bonus.

Though readability isn't my biggest gripe with Inspector collections. I rarely use them because the editing process is clumsy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants