mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-05-18 20:23:27 +02:00
Spell list now only includes prepared spells if the list would overflow the available lines.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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"]
|
||||
@@ -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"]
|
||||
Reference in New Issue
Block a user