-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Ability to change order of elements in export (Array) #23
Comments
interesting idea. |
I actually had to implement a custom |
In order to make this change, someone would need to add the up/down arrows (which I believe is a SpinBox control node) to be adjacent to the displayed index inside the EditorPropertyArray class in Edit: a more complicated operation would be to add drag-n-drop support, as also suggested by OP, where people click and drag from a specific drag icon (I think that's usually three horizontal lines or something? Could be wrong...). |
Describe the project you are working on:
Any project that uses an export (Array). for example an export (Array, PackedScene)
Describe how this feature / enhancement will help your project:
If I need to iterate through array, but need it to be in a certain order, and I want to add an element (in this case a packedscene) at a certain index. Right now I have to erase every element until I get to the index I want, insert the new element, then reinsert every element after.
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
Current:
There are a few ways to add this, for example:
-arrows next to the element index number to move it up or down the array
-Being able to drag the elements to sort them (however would not work with more than 1 page)
-Editable index number that will re-arrange elements according to the number you change it to
-"Insert at index #" option at top of the array
Describe implementation detail for your proposal (in code), if possible:
Sorry, I'm not sure how it would be implemented in code :(
If this enhancement will not be used often, can it be worked around with a few lines of script?:
Possibly, for example by making a new export var and, in code, inserting that var to the export array at the index you want, but the point of exports are to be able to change it through the inspector right?
Is there a reason why this should be core and not an add-on in the asset library?:
Yes, this is a enhancement to the already implemented export arrays, which makes them easier to edit.
The text was updated successfully, but these errors were encountered: