• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

Confirmed Bug Ship upgrades interface shows ticks for wrong ship

pedrwyth

Privateer
Storm Modder
Build 14 Beta 4 WIP: 24 Jan 2016

When you first open the upgrades interface in the shipyard it can show upgrades ticked for the wrong ship if you have moved the selection off the main character's ship before opening the interface. It resets correctly if you change the selected ship within the interface or behaves correctly to add an apparently ticked interface if appropriate for the selected ship. So just a minor display error
 

Attachments

  • -=Player=- QuickSave 7.7z
    411.9 KB · Views: 171
I have seen this as well (24 Jan + Levis 30 Jan zip) has been around for a long time.
If you go to the ship upgrade interface and click on a companion ship first, the ticks don't update for that ship - if you then click your ship and back to the companion ship it is all OK.

Not a show stopper but annoying.
 
I think this happens here in the shipyard interface file
Code:
case SCREEN_SHIPUPGRADE:
            //if(DEBUG_SHIPYARD_INTERFACE) trace("CASE: SCREEN_SHIPUPGRADE");
            // Screwface
            if(nCurFourNum!=sti(GameInterface.FourImage.current))
            {
                nCurFourNum = sti(GameInterface.FourImage.current);
                cn = GetCompanionIndex(GetMainCharacter(),nCurFourNum); // Screwface
                if (cn!=-1 && GetCharacterShipType(GetCharacter(cn)) != SHIP_NOTUSED)
                {
                    FillShipUpgradesScroll();
                    GameInterface.scrollshipupgrades.current = nCurSUScrollNum;
                    SendMessage(&GameInterface, "lsl", MSG_INTERFACE_SCROLL_CHANGE, "scrollshipupgrades", nCurSUScrollNum);
                    SendMessage(&GameInterface, "ls", MSG_INTERFACE_REFRESH_SCROLL, "scrollshipupgrades");
                    SetCurrentNode("scrollshipupgrades");
                    RefreshScreen();
                    GameInterface.strings.ShipName = GetCharShipName(GetCharacter(cn));
                }
            }
            // Screwface : end
            if (sti(GameInterface.scrollshipupgrades.current) != nCurSUScrollNum) {
                nCurSUScrollNum = sti(GameInterface.scrollshipupgrades.current);
                RefreshScreen();
            }
        break;

None or the wrong one of these functions might be called. This might lead people in the right direction. Putting some logging in here might help you fix it.
 
reminder to self to fix this. it shouldn't be hard ...
 
This is linked to similar behaviour in the cannons interface - where the choice is set on the character ship cannon type and more worryingly the repaint interface where the character's ship choices are shown - which I believe (in another thread?)
EDIT
this one
Unconfirmed Bug - Repainting can transform ships into others of the same tier | PiratesAhoy!
ENDEDIT
has led to repaint creating hybrid ships if you're not very careful. The first two (upgrades and cannons) are annoyances only but somehow the correct chosen ship needs picking up before each interface is called.

Hopefully @Levis is more familiar with the sequence of calls to work out where this refresh of chosen character ID needs to be put to be effective for all three?
 
Last edited:
Thinking (o_O) a bit more (for a change) since all three interface screens (upgrades , cannons and repaint) currently open with the character /player ship as focus it may well be easier to just force reset the selected character back to the player and avoid looking for fancy screen refreshes. At least then the painting the wrong ship, being pointed at a cannon set you can't install or upgrade confusion should be avoided.

Still not sure where to do that though.
 
Back
Top