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

better array layout for inspector #398

Closed
Shadowblitz16 opened this issue Jan 21, 2020 · 3 comments
Closed

better array layout for inspector #398

Shadowblitz16 opened this issue Jan 21, 2020 · 3 comments

Comments

@Shadowblitz16
Copy link

Shadowblitz16 commented Jan 21, 2020

Describe the project you are working on:
any project that uses data oriented design

Describe the problem or limitation you are having in your project:
I want to be able to edit array data freely without having to create a resource and pass it in.
I also want to a better array layout for nested arrays or data kinda like how unity indents and uses ⯈ to hind and show items

Describe how this feature / enhancement will help you overcome this problem or limitation:

  • allows resources to be exported
  • make by value resources type that allows for editing in arrays and other collections without needing to pass in or delete the data from a file
  • arrays should use ⯈ to show and hide items
  • items should be indented form array this would also be the case for multi dimensional arrays
  • clean up uneven lines and make inspector look nicer
  • items should be shrunk down vertically to fit more on screen

Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
new:
image
or
image
or
image

compared to..
old:
image

Describe implementation detail for your proposal (in code), if possible:
idk

If this enhancement will not be used often, can it be worked around with a few lines of script?:
would be used often and would and would take more the a few lines of code

Is there a reason why this should be core and not an add-on in the asset library?:

  • its useful for data driven programming
  • makes the editor look nicer
  • I don't think addons can do it yet.
@willnationsdev
Copy link
Contributor

allows resources to be exported

Well, aside from the aesthetic alterations in your proposal, everything else is (I think) covered by #18 which already has a PR ready-to-go.

make by value resources type that allows for editing in arrays and other collections without needing to pass in or delete the data from a file

You already don't need to have a file to reference a Resource instance. You can just do MyResourceType.new() and boom, you have an inlined reference. If you assign it to a variable on a Node and save the Node in a scene, then the resulting PackedScene resource will contain an embedded instance of your MyResourceType resource.

The thing that would be interesting here is the notion of creating by-value custom data structures. That would probably need to be a dedicated proposal for how to add custom "struct" types to the engine. You'd likely need a new Variant type that is essentially the same thing as a Dictionary, but which is always handled as a value rather than a reference. Unless a way of interpreting an Object as a value type was added to the engine core. Both of those changes would be very invasive though, so core devs would need to weigh in on whether the added maintenance and/or performance gains would even be worth it.

arrays should use ⯈ to show and hide items

If you replaced the Array (size X) button with this arrow symbol, you'd 1) lose the size information at a glance and 2) needlessly be popping the label text out to the right which would then offset the label text versus all the other properties in the Inspector. I much prefer the way the top-level Array property looks in its current state (with the button). But maybe others feel differently?

items should be indented form array this would also be the case for multi dimensional arrays
clean up uneven lines and make inspector look nicer

These aesthetic changes sound good to me.

items should be shrunk down vertically to fit more on screen

I see the benefit, but lots of packed data can have an effect on readability though. Maybe it should be a toggleable setting?


Also relevant to this is #13 which could help a lot with multi-dimensional array handling, especially if it supported multiple sheets as well as rows of resources.

@Shadowblitz16
Copy link
Author

@willnationsdev thankyou fo your feedback!

allows resources to be exported

Well, aside from the aesthetic alterations in your proposal, everything else is (I think) covered by #18 which already has a PR ready-to-go.

ya most of this was just my take on how it should be implemented

make by value resources type that allows for editing in arrays and other collections without needing to pass in or delete the data from a file

You already don't need to have a file to reference a Resource instance. You can just do MyResourceType.new() and boom, you have an inlined reference. If you assign it to a variable on a Node and save the Node in a scene, then the resulting PackedScene resource will contain an embedded instance of your MyResourceType resource.

The thing that would be interesting here is the notion of creating by-value custom data structures. That would probably need to be a dedicated proposal for how to add custom "struct" types to the engine. You'd likely need a new Variant type that is essentially the same thing as a Dictionary, but which is always handled as a value rather than a reference. Unless a way of interpreting an Object as a value type was added to the engine core. Both of those changes would be very invasive though, so core devs would need to weigh in on whether the added maintenance and/or performance gains would even be worth it.

its good to know this is actually possible right now without using value types
I still think there should be a flag for this though so we don't have to loop through and create a new instances every time the list is edited

arrays should use ⯈ to show and hide items

If you replaced the Array (size X) button with this arrow symbol, you'd 1) lose the size information at a glance and 2) needlessly be popping the label text out to the right which would then offset the label text versus all the other properties in the Inspector. I much prefer the way the top-level Array property looks in its current state (with the button). But maybe others feel differently?

the way I see it is the editbox already says the length of the array plus it allows you to change it
and having duplicates just takes up screen space.
there could be a difference between nested arrays and multi dimensional arrays if there isn't already

items should be indented form array this would also be the case for multi dimensional arrays
clean up uneven lines and make inspector look nicer

These aesthetic changes sound good to me.

items should be shrunk down vertically to fit more on screen

I see the benefit, but lots of packed data can have an effect on readability though. Maybe it should be a toggleable setting?

idk if anyone needs a option for indentation but yes I think it should be togglable for the vertical compactness

Also relevant to this is #13 which could help a lot with multi-dimensional array handling, especially if it supported multiple sheets as well as rows of resources.

I will take a look at it

@Shadowblitz16
Copy link
Author

this is super seeded by this

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

No branches or pull requests

3 participants