ScanMountGoat / ssbh_editor

View, edit, and validate models for Smash Ultimate
MIT License
34 stars 5 forks source link

Reorder Materials in MATL Editor #184

Closed zrksyd closed 8 months ago

zrksyd commented 9 months ago

I attempted to add a Sort Materials option but I couldn't get it working and I knew stuff like the selected_material_index would need some reworking so I just left it in the code commented out. It would be better if you could see the full material list as you were reordering but I thought this was good enough for now.

ScanMountGoat commented 9 months ago

If you want the current material to still be selected after sorting, you could store the name of the currently selected material and then use that to fix the selected index after sorting. I wouldn't worry about two materials having the same name. I can make duplicate names a validation error later.

zrksyd commented 9 months ago

The selected_material_index change with sorting materials doesn't seem to be working.

ScanMountGoat commented 9 months ago

It would be better if you could see the full material list as you were reordering but I thought this was good enough for now.

Yeah. Showing the full list while manually sorting would be ideal. Unless you've already started implementing something, I would like to just merge the "Reorder" menu options for sorting materials. You can remove the code for manually moving a material up or down by one since it will be replaced later anyway.

zrksyd commented 9 months ago

It would be better if you could see the full material list as you were reordering but I thought this was good enough for now.

Yeah. Showing the full list while manually sorting would be ideal. Unless you've already started implementing something, I would like to just merge the "Reorder" menu options for sorting materials. You can remove the code for manually moving a material up or down by one since it will be replaced later anyway.

I'll leave the option for now and once the full thing is implemented it can be removed.

zrksyd commented 8 months ago

Shoudl I remove the features for you to merge this PR. I thought it would be better to keep them there as a temp solution since there was no option to move the materials around before.

ScanMountGoat commented 8 months ago

Yes. Please remove the code I mentioned, so I can merge your menu changes. It makes the commit history a little harder to understand if a lot of small temporary changes get undone later. I plan on doing a more involved rework of the matl editor later to support manual sorting.