Merge pull request #96 from Tim-Jackins/master

Adding the second page of the standard character sheet to the generation (WIP)
This commit is contained in:
Mark Wolfman
2021-06-12 13:14:10 -05:00
committed by GitHub
5 changed files with 88 additions and 3 deletions
+8 -3
View File
@@ -17,6 +17,7 @@ from dungeonsheets import character as _char, exceptions, readers, latex, monste
from dungeonsheets.stats import mod_str, findattr
from dungeonsheets.fill_pdf_template import (
create_character_pdf_template,
create_personality_pdf_template,
create_spells_pdf_template,
)
from dungeonsheets.character import Character
@@ -283,9 +284,9 @@ def make_character_sheet(
character_props = readers.read_sheet_file(char_file)
character = _char.Character.load(character_props)
# Set the fields in the FDF
basename = char_file.stem
char_base = basename + "_char"
sheets = [char_base + ".pdf"]
char_base = os.path.splitext(character_file)[0] + "_char"
person_base = os.path.splitext(character_file)[0] + "_person"
sheets = [char_base + ".pdf", person_base + ".pdf"]
pages = []
tex = [
jinja_env.get_template("preamble.tex").render(
@@ -299,6 +300,10 @@ def make_character_sheet(
character=character, basename=char_base, flatten=flatten
)
pages.append(char_pdf)
person_pdf = create_personality_pdf_template(
character=character, basename=person_base, flatten=flatten
)
pages.append(person_pdf)
if character.is_spellcaster:
# Create spell sheet
spell_base = "{:s}_spells".format(basename)