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

Record sheet fixes and improvements #1574

Merged
merged 4 commits into from
Jul 31, 2024
Merged

Conversation

pavelbraginskiy
Copy link
Collaborator

This PR collects several bug fixes and improvements that are somewhat related which I worked on at the same time.

  • Row shading for tables looks better, the shading is now centered within the table.
  • Record sheet preview for small units (CI/BA/Protos) was fixed to not cut off the right edge of the sheet.
  • The option to replace mek fluff art with tables has been reworded to indicate it works on more than just meks.
  • Small units will now include a cluster table instead of empty space when there aren't enough units to fill a whole sheet.
  • The code that detects when a small unit sheet is full has been factored out into its own method and given unit tests.

Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.65%. Comparing base (f022e43) to head (5e34116).
Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##             master   #1574      +/-   ##
===========================================
+ Coverage      0.52%   0.65%   +0.13%     
- Complexity       49      64      +15     
===========================================
  Files           266     266              
  Lines         30481   30511      +30     
  Branches       5190    5200      +10     
===========================================
+ Hits            160     201      +41     
+ Misses        30280   30270      -10     
+ Partials         41      40       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -155,23 +155,23 @@ public static List<PrintRecordSheet> createSheets(List<? extends BTObject> entit
}
} else if (unit instanceof BattleArmor) {
baList.add((BattleArmor) unit);
if (singlePrint || baList.size() > 4) {
if (singlePrint || PrintSmallUnitSheet.fillsSheet(baList, options)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Here too

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think it makes sense to add parentheses here. There's only one operator in the new expression, although the code that was here before could have used them.

PrintRecordSheet prs = new PrintSmallUnitSheet(baList, pageCount, options);
pageCount += prs.getPageCount();
sheets.add(prs);
baList = new ArrayList<>();
}
} else if (unit instanceof Infantry) {
infList.add((Infantry) unit);
if (singlePrint || infList.size() > (options.showReferenceCharts() ? 2 : 3)) {
if (singlePrint || PrintSmallUnitSheet.fillsSheet(infList, options)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

And here. Though you probably get the point.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same here. a || b is fine, it doesn't need to be (a) || (b) unless a and b themselves have some operator in them.

@HammerGS HammerGS requested a review from SJuliez July 31, 2024 01:32
@IllianiCBT IllianiCBT merged commit bb9e74f into MegaMek:master Jul 31, 2024
5 checks passed
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