Closed zrksyd closed 8 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.
The selected_material_index change with sorting materials doesn't seem to be working.
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.
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.
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.
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.
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.