Background info:
A station contains items which can be shipped to another station for the player.
The player selects a system which has the desired destination station and navigates to an itemPicker list.
Selecting items from the list to be transferred removes them from the display but not the station.
So the list appearing in the display area is items remaining that aren't selected for transfer.
Once items to transfer have been selected, the player navigates to the next pane which shows these items (still in the station) that have been selected for transfer.
So the list would be the items in the station inventory that have had the item data 'transfer added to it.
Sounds easy enough but it isn't working.
Either no items are removed from the display or all of them are.
Possible causes:
Using itmSetData incorrectly; the function seems to need a variable set to use it.
Items appearing in the display list aren't individual items but an item struct or some grouping of items; maybe enum is needed.
Restrictions in using scrSetListFilter that I'm not aware of.
Incorrect screen/pane navigation order.
Here's one lot of code (not working):
Code: Select all
<TransferItems
name="Freight Service"
type="itemPicker"
>
<Display type="itemPicker"
dataFrom= "station"
list= "*"
>
<OnDisplayInit>
(scrSetListFilter gScreen (lambda (theItem)
(not (itmIsInstalled theItem))
))
</OnDisplayInit>
</Display>
<Panes>
<Default showCounter="true">
<OnPaneInit>
(block Nil
(scrSetDesc gScreen "Select number of items to transfer.")
(scrSetCounter gScreen (itmGetCount (scrGetItem gScreen)))
)
</OnPaneInit>
<Actions>
<Action id="actionSelectItem" default="1">
(block Nil
;If item selected add itmData, filter list again, refresh, showPane, maintain cursor pos.
;(itmGetData item attrib) = data
;(itmSetData item attrib data [count]) = item
(setq theItem (itmSetData (scrGetItem gScreen) 'transfer True))
(scrSetListFilter gScreen (lambda (theItem)
(and (not (itmIsInstalled theItem))
(not (itmGetData theItem 'transfer))
)
))
(scrShowPane gScreen "Default")
)
</Action>
<Action id="actionBack" cancel="1">
(scrExitScreen gScreen)
</Action>
</Actions>
</Default>
</Panes>
</TransferItems>
dsRPGAnalyzeItem uses scrSetListFilter inside a dockscreen action but navigates to another pane.
scrAddListFilter might be better but examples are very rare and documentation non-existent.