PDA

View Full Version : CoreRPG descending list sorts



Valarian
March 11th, 2014, 23:37
Is it possible to do a descending sort in a list in the new structure?
I want to be able to sort the skills by skill level (highest first) and then by name.



<template name="list_charskill">
<list_text>
<datasource>.skilllist</datasource>
<class>char_skill</class>
<columns width="230" filldown="true"/>
<sortby>
<control>bonus</control> <!-- Descending -->
<control>label</control> <!-- Ascending -->
</sortby>
<newfocus>label</newfocus>
<script file="campaign/scripts/char_skilllist.lua"/>
</list_text>
</template>

Moon Wizard
March 12th, 2014, 01:08
There's a desc attribute that can be used with sortby tag. Not sure of exact usage, since I am away from machine. You can check in CoreRPG or 3.5E rulesets for example. If that doesn't work, you can fall back to onSortCompare event for windowlists.

Cheers,
JPG

Trenloe
March 12th, 2014, 01:37
Based off record_char_main.xml in the 3.5E ruleset you could use:


<sortby>
<control desc="true">bonus</control>
<control>label</control>
</sortby>

Valarian
March 12th, 2014, 07:35
Thank you both. I was searching through the 3.5e ruleset files but didn't see that one. Glad the new syntax has the option. I'll have to give it a go tonight.