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

Show all locations for spreadable equipment in summary view #2912

Merged
merged 4 commits into from
Jun 5, 2021

Conversation

neoancient
Copy link
Member

  1. Adds a method to Mounted that returns all locations where the equipment is located. For most equipment, including weapons that are split between two adjacent locations, this is fairly simple. For spreadable equipment, which includes myomer and bulky armor/structure, but also equipment with multiple fixed locations like the partial wing, it's necessary to check all the critical slots.
  2. Adds a method to Entity that formats the location(s) into a string for display. A second argument permits setting a limit to the number of slots that should be displayed without abbreviation. There are some special abbreviations for all-torso or all-leg equipment on Mechs.
  3. Uses the new methods to show all locations instead of the single one returned by Mounted#getLocation in the MechView summary.

The fix for MegaMek/megameklab#869 is based on this.

@neoancient neoancient merged commit 457f130 into master Jun 5, 2021
@neoancient neoancient deleted the spreadable_mount_locations branch June 5, 2021 13:21
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