Skip to main content

SortOption

This construct represents a way of sorting results that a player can use when searching resources in the resource (orange) section of the system.

JSON Format

{
"type": "SortOption",
"name": ...,
"stat": ...,
"true_name": ...,
"false_name": ...,
"options": ...,
"options_display_stat": ...,
"order": ...
}

Fields

FieldTypeRequiredDescription
nameStringThe name for this sort option. This is the name the player will see pop up when tapping on the "sort" button.
statStringThe stat this sort option will be sorting on.
true_nameStringOptional. Defaults to the name of stat. Relevant only for bool stats. How to display the true value for this stat in the headers that the app displays when seeing results. For example, if the stat name is "Is magic", you might want to have the true_name be "Magical" and the false_name be "Non-magical".
false_nameStringOptional. Defaults to "Not " + the name of stat. Relevant only for bool stats. How to display the false value for this stat in the headers that the app displays when seeing results. For example, if the stat name is "Is magic", you might want to have the true_name be "Magical" and the false_name be "Non-magical".
optionsStringFor string or resource values, you should include what options should be available for the stat sort headers. These can be an enumerated type id (for string) or the id of a resource (for resource). For the latter, you need to also specify the options_display_stat property. This is mandatory for resource stats, but optional for string stats. If it is omitted for a string stat, the app will just sort alphabetically based on this stat.
options_display_statStringFor resource-type stat sort options, you need to provide the resource id of the values that the stat will contain in the options property, and you also need to specify what stat of this resource should be used to display its option value in the sort headers. For example, if this is a sort option for a species on its source stat, and source is a resource of type source that contains a stat called the_source_name, you could set this property to the_source_name as you would want to display that when showing the player the search results for each particular source.
orderSortByOrderOptional. Defaults to asc. The order to use when sorting.