diff --git a/dungeonsheets/fill_pdf_template.py b/dungeonsheets/fill_pdf_template.py index 6eea028..82f0bce 100644 --- a/dungeonsheets/fill_pdf_template.py +++ b/dungeonsheets/fill_pdf_template.py @@ -458,9 +458,17 @@ def create_spells_pdf_template(character, basename, flatten=False): 3083, ), } + # Prepare the lists of spells for each level for level in field_numbers.keys(): - spells = tuple(spl for spl in character.spells if spl.level == level) - field_names = tuple(f"Spells {i}" for i in field_numbers[level]) + spells = [spl for spl in character.spells if spl.level == level] + # Determine if we should omit un-prepared spells to save space + if len(spells) > len(field_numbers[level]): + spells = [s for s in spells if s in character.spells_prepared] + warnings.warn(f"{character.name} knows more spells than the number of " + "lines available in spell sheet. Limited to prepared " + "spells only.") + # Build the list of PDF controls to set/toggle + field_names = [f"Spells {i}" for i in field_numbers[level]] prep_names = tuple(f"Check Box {i}" for i in prep_numbers[level]) for spell, field, chk_field in zip(spells, field_names, prep_names): fields[field] = str(spell) diff --git a/examples/gm-campaign-notes.py b/examples/gm-campaign-notes.py new file mode 100644 index 0000000..678c0da --- /dev/null +++ b/examples/gm-campaign-notes.py @@ -0,0 +1,14 @@ +"""This file describes game-manager notes. + +It's used for creating notes for the GM to keep track of various +monsters, etc. + +""" + +dungeonsheets_version = "0.14.0" + +sheet_type = "gm" + +session_title = "Objects in Space" + +party = ["rogue1.py", "paladin2.py"] diff --git a/examples/gm-session-notes.py b/examples/gm-session-notes.py new file mode 100644 index 0000000..c206f7a --- /dev/null +++ b/examples/gm-session-notes.py @@ -0,0 +1,16 @@ +"""This file describes game-manager notes. + +It's used for creating notes for the GM to keep track of various +monsters, etc. + +""" + +dungeonsheets_version = "0.15.0" + +sheet_type = "gm" + +session_title = "Objects in Space - Session 1" + +parent_sheets = ["gm-campaign-notes.py"] + +monsters = ["aboleth", "wolf", "giant eagle", "Vashta Nerada"]