gScreen troubles ? (resolved)

Freeform discussion about anything related to modding Transcendence.
User avatar
digdug
Fleet Admiral
Fleet Admiral
Posts: 2615
Joined: Mon Oct 29, 2007 9:23 pm
Location: Decoding hieroglyphics on Tan-Ru-Dorem

Mon Apr 18, 2016 1:56 am

That totally happened in the past to me too.
I now pause any recurring event that add/remove items in a cargo hold/station before using a itempicker with that station.
Otherwise the cursor gets constantly resetted at the top.

gunship256
Militia Commander
Militia Commander
Posts: 451
Joined: Sat Jul 25, 2015 11:41 pm
Location: repairing armor

Mon Apr 18, 2016 8:34 pm

digdug wrote:That totally happened in the past to me too.
I now pause any recurring event that add/remove items in a cargo hold/station before using a itempicker with that station.
Otherwise the cursor gets constantly resetted at the top.
I think the cursor is resetting at the top because the engine forgets the cursor position when the screen refreshes.

Using scrGetListCursor and scrSetListCursor to get and re-set the cursor position as I did in yesterday's post seems to solve the problem *if* that code is incorporated into all devices that can move into or out of the itemPicker list while the list is open.

EDIT: A more robust solution is for scrRefreshScreen to include an optional argument that lets the modder choose whether the screen remembers the current cursor position when it's refreshed. This isn't completely ideal, though, since there are some situations where the cursor position changes without the user being aware of it, such as when a device is added or removed from the itemPicker list without the user's consent.

The best solution would be for the game to dynamically check for devices that move into or out of the itemPicker list and to update the list automatically without refreshing the entire screen.

Post Reply