-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix 4739 custom protomech bay does not load #4740
Fix 4739 custom protomech bay does not load #4740
Conversation
…sing load issues with custom dropships.
We should move to Mek. We try to avoid Mech. |
The MML UI still uses "mech", and extant BLK files do as well. Additionally, the reporter of the bug found that there's a further mismatch between the bay type "ProtoMek" and the unit type itself, so we'd probably need to update a lot more than just BLKFile.java and the MML UI. I propose this:
@HammerGS what say you? |
Sounds good to me. The move to Mek needs to happen, but there is no set timeline for it. But we should make sure there are no impacts to MekHQ as well. |
Well, digging into the code more, I'm finding that all three projects sport an almost-even mix of both forms ("ProtoMech" vs "ProtoMek") so maybe I'll just throw up my hands in despair and try to fix the issue with loading ProtoMechs into ProtoMek bays (or vice-versa) in MekHQ. I'd estimate that normalizing all remaining references using "ProtoMech" -> "ProtoMek" to be at least a week of full-time work but it looks like about that much work has been done already, so it might be good to set up a longer-running branch to track that. Sorry for all the hassle; this turned out to be a can full of other cans of worms. |
Welcome to MegaMek! :) A separate branch and a basic fix is good. |
It looks like the ProtoMek-specific loading submenu is still very rough: - logic error prevented checking if non-mechs could load Protos - even if entities with bays could load Protos, they weren't getting added to the menu. I cribbed some code from the general Load menu builder to add options other than just Mek Front or Mek Rear as ProtoMek load targets; honestly this should all get combined back into the loadMenu at some point. Testing: - Added regular ProtoMeks to a dropship with ProtoMekBays in MM: works now. - Loaded same ProtoMeks back into the dropship after landing it in a game: works fine. - Confirmed Protos with Magnetic Clamp System can also be loaded onto Meks, and unloaded during games. TODO: add unit tests to validate various ProtoMek loading/unloading options, separate from UI.
It looks like there was a change, or series of changes, to ProtoMechBay.java back in March of 2022 that broke compatibility between saving ProtoMech bays (or "ProtoMekBays") and loading them.
The fix I've proposed here just reads both lines and treats them equally. It's quick and easy and I've tested it with the original file from #4739 successfully.
An alternative fix would be to revert the March 2022 change completely; I feel this warrants consideration as there are several places in the MML UI (not to mention in the filename itself) where we use "ProtoMech".
Close #4739