Barotrauma
Barotrauma copied to clipboard
Upgrade UI supports upgrade categories with only swappables
Related to #10152, though I've basically resolved all the issues I had.
This lets the upgrade UI show upgrade categories that have no upgrade modules, but which do have swappable items that are on the submarine.
The UI works as you would expect- the upgrade indicators are hidden, and the customize/upgrade buttons are hidden.
Categories with both (weapons) still show both correctly. as they did before.
The only unintended change is that in order to make upgradeless categories show up when first opening the UI, I call SelectTab(UpgradeTab.Upgrade)
which does work, but also has the side effect of resetting your selected upgrade category, etc.
Given this only happens when you talk to the NPC to open the upgrade UI, I don't consider this very problematic, but it probably could be improved.
Probably needs more thorough testing, but in my limited testing I haven't found any other issues, and it provides the functionality I wanted to add.
Here is my mod (and a sub with the right swappables for convenience) that can be used for testing: upgradeUIrepro.zip
Please let me know if there's anything I can add or need to change.
#6180 and #8632 are basically the same as my mod plans and could also could benefit from this enhancement.