@skew said in Sort by last character?:
Thank you all for the replies. I've not actually gotten around to testing the latest solutions, because I discovered a way to sort my rotes by arcanum in a nice, clean, neat fashion. So, deciding if I want to mess with reverse order.
It's not exactly code, but anyone have an opinion? Would you rather see rotes (For Mage: The Awakening 2E) alphabetical, or by dot level? They're dot level in the book.
My suggestion? If you're designing this from scratch, allow player customization so that the player can specify what sort method they want for it.
It should, theoretically, just be a matter of u()ing a different attribute based on the customization the player wants.
So something like oh....
...[u(#obj/SORT.[default(%#/_sheet_sort_method,default)])] ...
Then SORT.DEFAULT is the default sorting method (however you want).
Then the customized attribute '_SHEET_SORT_METHOD' on the player contains the sort method they want to use (whatever you define)
Then just u() the #obj/SORT.DEFAULT (or SORT.NUMERICAL, or SORT.ALPHANUM, or whatever) and design your own sorting algos for how you want to sort it on the fly.
This method also allows adding new sorting algos on the fly without really re-designing any core functionality.