Skip to content
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

AS Crit View: Compact criticals after removing equipment #1282

Merged
merged 3 commits into from
Jul 16, 2023

Conversation

SJuliez
Copy link
Member

@SJuliez SJuliez commented Jul 11, 2023

Fighter units use the crit slot system. Equipment is always shown in the crit view as if there were no gaps but removing e.g. equipment no. 2 in a location will currently leave the second slot empty. This leads to the right-click menu not working for some equipment after removing another equipment.

image

This PR compacts the crit slots on fighters when equipment is removed (deleted or removed by menu or dragged out) from a location, so that there don't remain empty crit slots between equipment. The change is not visible except for the popup menu now working more consistently.

Edit:
This proved a bit of a rabbit hole. So this PR now also:

  • Removes the ability to rear-mount weapons on fighters(!) according to TM p.195 (only AFT-mounted weapons can be rear-facing)
  • Makes the preview tab update whenever it is shown instead of for every change; this removes the quite noticeable lag when dragging equipment around between slots
  • For fighters, greatly reduces the number of actual refreshes happening when the unit is edited by invoking the refresh at the end of the current GUI action (SwingUtilities.invokeLater) and making sure it happens only once. This also helps reducing input lag
  • improves placement of the popup menu on the unallocated equipment list in the crit view

@SJuliez SJuliez marked this pull request as draft July 11, 2023 11:58
@SJuliez
Copy link
Member Author

SJuliez commented Jul 11, 2023

Need to update this for equipment dragged between locations

@SJuliez SJuliez marked this pull request as ready for review July 14, 2023 14:52
@SJuliez SJuliez merged commit bbc511c into MegaMek:master Jul 16, 2023
@SJuliez SJuliez deleted the crit_loc_compact branch July 24, 2023 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants