User Tools

Site Tools


modding:function:scrsetlistfilter

Discuss this page on this page's Talk Page

scrSetListFilter

See scrSetListFilter at Xelerus

Syntax (scrSetListFilter screen expression)
Arguments screen: The screen you want to filter the items on.
expression: This can be one of three things. a) A string containing the criteria you want to filter the item list with.
b) A number giving the margin on sales. 100 = normal price, 0 = free, etc.
c) A function returning True or Nil. It is evaluated for each item with True = include in list, Nil = exclude from list.
Returns condition: True is successful.
Category screen
Description Sets the list filter from the given screen. Will only display the items that fit the criteria.

Very helpful in filtering item selection screens like loot screens.

Example

(scrSetListFilter gScreen "*U")

The current screen lists all the non equipped items.

      <ListOptions
            dataFrom=   "station"
            list=      "*"
            >
         (switch
            (not gMargin)
               (scrSetListFilter gScreen intComputeSellPrice) ; Price is calculated individually by item.
 
            (isfunction gMargin)
               (scrSetListFilter gScreen gMargin) ; expression is function
 
            (scrSetListFilter gScreen "*") ; expression is criteria string
            )
      </ListOptions>

Here we see scrSetListFilter used within the ListOptions element in the dockscreen dsExchangeBuy from Transcendence.xml

Return to Functions list

modding/function/scrsetlistfilter.txt · Last modified: 2014/12/27 04:40 (external edit)