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

Vehicle Record Sheet Overhaul #398

Merged
merged 39 commits into from
Jan 17, 2020
Merged

Vehicle Record Sheet Overhaul #398

merged 39 commits into from
Jan 17, 2020

Conversation

neoancient
Copy link
Member

Implements the SVG template-based printing method currently used for 'Mechs, conventional infantry, and JS/WS/SS. Some things worth particular note:

  1. I wrote an all-new pip layout algorithm that is less rigid than the one I wrote a few years ago for superheavy 'Mechs. The results come much closer to the canon layout patterns used by biped 'Mechs. Coding for aesthetics is much more involved than making it just work, so ArmorPipLayout.java is rather involved but hopefully not too obscure.
  2. I've replaced the String literals used as SVG element ids with a set of named constants.
  3. I reworked the way PrintRecordSheet initializes the SVG document to make it more flexible. This allows the non-naval vehicle sheets, which have either two units or a unit and a set of tables, to create a base document in memory and insert the two appropriate templates.
  4. While creating superheavy naval vehicles to test, I discovered a bug in the way new vehicle entities are initialized and fixed it. This change makes this branch dependent on Misc changes for printing vee record sheets megamek#1605

Here is a sample of the results. There are a few at the end that are not fully constructed units but show what the sheets look like for naval/WiGE dual turrets and superheavy naval combat vehicles, none of which are represented in the units in MM:

Skulker_Wheeled_Scout_Tank__Standard__etc__ated_files-job_1193.pdf

Fixes #42

Optimized for more regular regions, such as used by vehicles and aerospace units.
Show supercharger and vjj on equipment list.
Copy link
Collaborator

@sixlettervariables sixlettervariables left a comment

Choose a reason for hiding this comment

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

Just two comments. The new SVGs look great.

@@ -0,0 +1,1495 @@
<?xml version="1.0" encoding="UTF-8"?>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I normally wouldn't review these by hand, but the files are formatted quite bizarrely.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, they're built in memory using DOM then written to a file using Batik's SVGGraphics2D#stream. I haven't found a way to influence the formatting of the output, but I haven't spent a lot of time looking.

src/megameklab/com/printing/PrintTank.java Show resolved Hide resolved
@neoancient neoancient merged commit 20bfb31 into master Jan 17, 2020
@neoancient neoancient deleted the vehicle_rs branch January 17, 2020 03:37
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.

Can't print naval vehicles
2 participants