Allow setting of default index in itempicker.

Post ideas & suggestions you have pertaining to the game here.
Post Reply
PM
Fleet Admiral
Fleet Admiral
Posts: 2570
Joined: Wed Sep 01, 2010 12:54 am

Every time the player goes to a screen with an itempicker, it always highlights the very first item at the top. It would be nice to be able to set the item highlighted to be anything other than first. If selected index is valid, use it; otherwise, default to the first.

For example, you have two menu screens, one featuring an itempicker for faster selection and another that does not but shows other information (such as Battle Arena ship select). Currently, it is possible to preserve the index selected from itempicker screen to other menu screen, but not vice versa.
Download and Play in 1.9 beta 1...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Play a classic arcade game adventure, with or without more features (like powerups)!
Playership Drones: Buy or restore exotic ships to command!

Other playable mods from 1.8 and 1.7, waiting to be updated...
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
george moromisato
Developer
Developer
Posts: 2998
Joined: Thu Jul 24, 2003 9:53 pm
Contact:

Try the following:

Code: Select all

<ListOptions
   ...
   initialItem=      "=(if test to see if you want to select this item using...(scrGetItem gScreen)...)"
   ...
   />
For example:

Code: Select all

<ListOptions
   ...
   initialItem="=(if (itmGetData (scrGetItem gScreen) 'myItem) True Nil)"
   ...
   />
initialItem will be called for all items in the list. You should return True for the item you wish to select.
PM
Fleet Admiral
Fleet Admiral
Posts: 2570
Joined: Wed Sep 01, 2010 12:54 am

This does not seem to work for custom item picker.

For regular item picker, using "=Nil" as the test sets the cursor to the final item. Using that same test for the custom picker does nothing since the cursor remains at the top.
Download and Play in 1.9 beta 1...
Drake Technologies (Alpha): More hardware for combat in parts 1 and 2!
Star Castle Arcade: Play a classic arcade game adventure, with or without more features (like powerups)!
Playership Drones: Buy or restore exotic ships to command!

Other playable mods from 1.8 and 1.7, waiting to be updated...
Godmode v3 (WIP): Dev/cheat tool compatible with D&O parts 1 or 2.
User avatar
pixelfck
Militia Captain
Militia Captain
Posts: 571
Joined: Tue Aug 11, 2009 8:47 pm
Location: Travelling around in Europe

It does work, only not as expected. In fact, it was a major hassle to figure out how to get it to work.

You can see it in action in the Useful Items Dockscreens-mod.

Cheers,
Pixelfck
Image
Download the Black Market Expansion from Xelerus.de today!
My other mods at xelerus.de
Post Reply