CHANGES
Added the FreightersAndMore attribute to all devices except the Heliotrope solar panel array
Changed some device descriptions
Changed the location of the settings link in the ship interior dockscreen so that the link now shows up near the bottom of the list instead of at the top
Added scrRefreshScreen to refresh the current dockscreen after a spider or array automatically installs/uninstalls. Fixed a bug where the refresh was causing the itemPicker screen to reset the cursor position to the beginning of the list.
KNOWN ISSUE: When this mod is enabled, the Naginata ship in The Backroads is unusable. When TBR tries to install items onto the ship at the beginning of the game, the game generates errors and keeps the player from exiting the installation dockscreen.
SOLVED. The problem was in TBR code from the file AE-AA09-TBRPlayerships.xml, line 1048 (accessed 2016 March). (enum (objGetItems gSource "*U") aeInstall (shpInstallDevice gSource aeInstall)) tries to install anything in the ship's cargo hold, even if it is not an installable device, generating an error. Fixed this by adding <MiscellaneousDevice/> to the box with the faded label, making the box uninstallable at stations, and making it uninstall itself if a mod happens to install it. A more robust fix would involve changing the TBR code for the Naginata playership.
I initially tried fixing the update problem by just refreshing the screen whenever a spider or array installs or uninstalls:gunship256 wrote:That's a really good idea. I don't know if there's a function I can use to test whether a screen is currently active, and I'm not sure what will happen if I call scrRefreshScreen when no screen is active. I'll have to test this and hopefully incorporate a fix in the next release.Still get the Nil,nil device slot bug in the Misc Devices screen as well. Someone else is having trouble with updating screens. I'll try and find the reference. It might help. EDIT: It's AP in The Backroads with a casino(?) not being cooperative. But he hasn't fixed it yet. Looking at the code in your mods I saw scrRefreshScreen. Possibly if you can get this function in the code after the arrays/spiders uninstall that might help to fix it.
Code: Select all
(scrRefreshScreen gScreen)
Code: Select all
(isError (scrRefreshScreen gScreen))
After the changes, the dockscreen would refresh but bring the player all the way back to the top of the list, which was a big annoyance, especially since there was no warning or explanation for it. I (mostly) solved this problem by having the game remember the cursor position before refreshing the screen:
Code: Select all
(isError (setq theCursor (scrGetListCursor gScreen)))
(isError (scrRefreshScreen gScreen))
(isError (scrSetListCursor gScreen theCursor))
Also, when itemPicker refreshes, the mod remembers the cursor position, but the spider has ALREADY installed/uninstalled by the time I call (scrGetListCursor). This smaller bug no longer results in the player buying/selling the wrong item, but it does move seem to move the cursor around unpredictably. It's more of an annoyance than a problem, since the screen still refreshes and displays the cursor position properly.
I think I can fix this by moving scrGetListCursor to a point before the spider installs/uninstalls. If it works, the fix will be in the next version.
EDIT: Solved! The code below works correctly in preliminary testing, though I haven't released the changes in a new version yet.
Code: Select all
(isError (setq theCursor (scrGetListCursor gScreen)))
(shpInstallDevice gSource theDevice)
; Refresh the dockscreen pane in case moving this device around broke itemPicker
; Used isError in case scrRefreshScreen is called while a dockscreen is not currently pulled up
; Use scrGetListCursor and scrSetListCursor to remember where we were in
; the itemPicker list
(isError (scrRefreshScreen gScreen))
(isError (scrSetListCursor gScreen theCursor))