FG Spreadshirt Swag
  1. #1
    Valarian's Avatar
    Join Date
    Mar 2007
    Location
    Worcestershire, UK
    Posts
    2,567

    CoreRPG descending list sorts

    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.

    Code:
    <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>
    Using Ultimate license - that means anyone can play.
    Valarian's Fantasy Grounds Rulesets

  2. #2
    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

  3. #3
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,362
    Based off record_char_main.xml in the 3.5E ruleset you could use:
    Code:
    <sortby>
    	<control desc="true">bonus</control>
    	<control>label</control>
    </sortby>
    Last edited by Trenloe; March 12th, 2014 at 15:29.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  4. #4
    Valarian's Avatar
    Join Date
    Mar 2007
    Location
    Worcestershire, UK
    Posts
    2,567
    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.
    Using Ultimate license - that means anyone can play.
    Valarian's Fantasy Grounds Rulesets

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DICE PACKS BUNDLE

Log in

Log in