Krager wrote: ↑Tue Jun 03, 2025 11:44 pm
Искал где в коде находиться "EQ_WEAPON_NONE" и не нашёл. Нет его. В файле shipversion.js в строке 614 находиться текст, который должен выводиться на экран при отсутствии лазера. Однако почему то не выводиться...
There is a bug in the code. On lines 605-614 a text string is being built up with descriptions of the lasers installed on the new ship. However, it is doing a null check against each of the laser positions, which will likely never be true, because even on a ship with no laser mounts the positions have "EQ_WEAPON_NONE" installed there.
So, this is the code in question:
Code: Select all
s=player.ship.forwardWeapon;
if(s!=null) equip+="Forward "+s.name;
s=player.ship.aftWeapon;
if(s!=null) equip+=", Aft "+s.name;
s=player.ship.portWeapon;
if(s!=null) equip+="\nPort "+s.name;
s=player.ship.starboardWeapon;
if(s!=null) equip+=", Starboard "+s.name;
if(equip.length > 0) equip+="\n";
else equip+="No Laser\n";
To get this to work how I imagine it's supposed to work, you would need to change it to this:
Code: Select all
s=player.ship.forwardWeapon;
if(s.equipmentKey!="EQ_WEAPON_NONE") equip+="Forward "+s.name;
s=player.ship.aftWeapon;
if(s.equipmentKey!="EQ_WEAPON_NONE") equip+=", Aft "+s.name;
s=player.ship.portWeapon;
if(s.equipmentKey!="EQ_WEAPON_NONE") equip+="\nPort "+s.name;
s=player.ship.starboardWeapon;
if(s.equipmentKey!="EQ_WEAPON_NONE") equip+=", Starboard "+s.name;
if(equip.length > 0) equip+="\n";
else equip+="No Laser\n";
Krager wrote: ↑Tue Jun 03, 2025 11:44 pm
И ещё один косяк в этом дополнении есть. На эакране F3-F3 при покупки корабля, если нажать нет, отказаться от покупки. Возвращаешься на экран списка кораблей для покупки. Однако сам просмотренный корабль исчезает. И фон этого экрана тоже исчезает...
I believe this was always a limitation with the OXP - I think I remember Norby mentioning this issue. The issue can be worked around now, as we have programmatic access to the stations shipyard and could theoretically add the ship back into the list, so from a technical perspective it can be solved. But Norby hasn't been around to update this OXP to utilise the newer methods.
As for the issue with the backgrounds changing, I believe that's is basically down to lots of OXP's in play (Library GUI, XenonUI, whatever HUD you have, ShipVersion and potentially Hyperspace Hangar) and insufficient testing. The are a few scenarios that haven't been fully catered for in the code. I notice the same thing when I'm testing ShipVersion. It gives me my old ship back if I say no, but messes up my HUD and backgrounds. Annoying, somewhat immersion breaking, but only a cosmetic bug, I'd say.