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

Summary view #1357

Merged
merged 11 commits into from
Jan 4, 2024
Merged

Summary view #1357

merged 11 commits into from
Jan 4, 2024

Conversation

SJuliez
Copy link
Member

@SJuliez SJuliez commented Dec 31, 2023

Adds availability info in the summary view on the main tab.

image
image

Again, these are a lot of code changes. The goal was to have the code not repeated for each unit type and so have the availability data present on all unit types that use the summary view (BA/CI don't). It is now organized such that each line in the summary is represented by its own object which implements SummaryItem and is responsible for updating the crits, weight and availability data. There is only one SummaryView class left that handles all unit types. For each unit type, the SummaryView is given whatever lines (=SummaryItems) that unit type uses during construction (see e.g. BMSTructureTab).

While the display as such works, there are numerous issues in the results that were present before and I did not correct; I probably added some as well. I think this is all outside this PR which is already big enough.

  • The weights may miss some or count some stuff twice
  • availability is not available for many items such as gyros (at least, as far as I can see)
  • it is not clear to me on which units the crits column can be omitted (PM?);
  • the size of the text cells should not be fixed (this breaks w.r.t. to font type, font size, operating system window scaling, very wide content)

} else if (entity instanceof Tank) {
critLabel.setText(formatCrits(getTankArmorCrits(entity)));
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Armor can also take up space on conventional and aerospace fighters. TestAero.AeroArmor gives the slot costs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, fighter armor slots are now shown. Also had to change a "new Aero()" to "new AeroSpaceFighter()"

@SJuliez SJuliez merged commit 25f9f77 into MegaMek:master Jan 4, 2024
3 of 4 checks passed
@SJuliez SJuliez deleted the summary-view branch March 9, 2024 09:23
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