PDA

View Full Version : Strike rank sorting



peterb
March 31st, 2024, 13:14
I'm coding an extension that calculates strike ranks according to the rules on page 199 ff. in "Classic Basic Roleplaying", i.e. the version published 2010, which is the version included in this ruleset.

The end result should be sorted in the CT in ascending order (lower to higher). How do you accomplish that in the CT? I see that the onSortCompare function is being used but according to the documentation (https://fantasygroundsunity.atlassian.net/wiki/spaces/FGCP/pages/996645260/windowlist) the comparison should perform a greater than operation and that is not what I need. Is there some underlying code that depends on a greater than operation that cannot be overridden?

superteddy57
March 31st, 2024, 23:12
You would need to define a new sort function (example: CombatManager.setCustomSort(fSort). This will sort it based on how your new function will sort it. An example function would be the CombatManager.sortfuncSimple. These are all in CoreRPG by the way.