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

Add extra character sheets #609

Merged
merged 4 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified resources/fillable-char-sheetstyle-2-0-spells.pdf
Binary file not shown.
Binary file modified resources/fillable-char-sheetstyle-2-1-spells.pdf
Binary file not shown.
Binary file modified resources/fillable-char-sheetstyle-2-2-spells.pdf
Binary file not shown.
Binary file modified resources/fillable-char-sheetstyle-2-3-spells.pdf
Binary file not shown.
Binary file modified resources/fillable-char-sheetstyle-2-4-spells.pdf
Binary file not shown.
Binary file modified resources/fillable-char-sheetstyle-2-5-spells.pdf
Binary file not shown.
Binary file modified resources/fillable-char-sheetstyle-2-6-spells.pdf
Binary file not shown.
Binary file added resources/fillable-char-sheetstyle-3-0-spells.pdf
Binary file not shown.
Binary file added resources/fillable-char-sheetstyle-3-1-spells.pdf
Binary file not shown.
Binary file added resources/fillable-char-sheetstyle-3-2-spells.pdf
Binary file not shown.
Binary file added resources/fillable-char-sheetstyle-3-3-spells.pdf
Binary file not shown.
Binary file added resources/fillable-char-sheetstyle-3-4-spells.pdf
Binary file not shown.
Binary file added resources/fillable-char-sheetstyle-3-5-spells.pdf
Binary file not shown.
Binary file added resources/fillable-char-sheetstyle-3-6-spells.pdf
Binary file not shown.
Binary file added resources/fillable-char-sheetstyle-4-0-spells.pdf
Binary file not shown.
Binary file added resources/fillable-char-sheetstyle-4-1-spells.pdf
Binary file not shown.
Binary file added resources/fillable-char-sheetstyle-4-2-spells.pdf
Binary file not shown.
Binary file added resources/fillable-char-sheetstyle-4-3-spells.pdf
Binary file not shown.
Binary file added resources/fillable-char-sheetstyle-4-4-spells.pdf
Binary file not shown.
Binary file added resources/fillable-char-sheetstyle-4-5-spells.pdf
Binary file not shown.
Binary file added resources/fillable-char-sheetstyle-4-6-spells.pdf
Binary file not shown.
13 changes: 11 additions & 2 deletions src/clj/orcpub/routes.clj
Original file line number Diff line number Diff line change
Expand Up @@ -478,14 +478,23 @@
(pdf/write-fields! doc fields (not chrome?) font-sizes)
(if (and print-spell-cards? (seq spells-known))
(add-spell-cards! doc spells-known spell-save-dcs spell-attack-mods custom-spells print-spell-card-dc-mod?))

(if (and image-url
(re-matches #"^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" image-url)
(not image-url-failed))
(pdf/draw-image! doc (pdf/get-page doc 1) image-url 0.45 1.75 2.35 3.15))
(case print-character-sheet-style?
1 (pdf/draw-image! doc (pdf/get-page doc 1) image-url 0.45 1.75 2.35 3.15)
2 (pdf/draw-image! doc (pdf/get-page doc 1) image-url 0.45 1.75 2.35 3.15)
3 (pdf/draw-image! doc (pdf/get-page doc 1) image-url 0.45 1.75 2.35 3.15)
4 (pdf/draw-image! doc (pdf/get-page doc 0) image-url 0.50 0.85 2.35 3.15)))
(if (and faction-image-url
(re-matches #"^(https?|ftp|file)://[-a-zA-Z0-9+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9+&@#/%=~_|]" faction-image-url)
(not faction-image-url-failed))
(pdf/draw-image! doc (pdf/get-page doc 1) faction-image-url 5.88 2.4 1.905 1.52))
(case print-character-sheet-style?
1 (pdf/draw-image! doc (pdf/get-page doc 1) faction-image-url 5.88 2.4 1.905 1.52)
2 (pdf/draw-image! doc (pdf/get-page doc 1) faction-image-url 5.88 2.4 1.905 1.52)
3 (pdf/draw-image! doc (pdf/get-page doc 1) faction-image-url 5.88 2.0 1.905 1.52)
4 ()))
(.save doc output))
(let [a (.toByteArray output)]
{:status 200 :body (ByteArrayInputStream. a)})))
Expand Down
4 changes: 3 additions & 1 deletion src/cljs/orcpub/dnd/e5/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -3526,7 +3526,9 @@
"Select Character sheet"
{:items [{:title "Select" :value " "}
{:title "Original 5e Character sheet" :value 1}
{:title "Original 5e Character sheet - optional variant" :value 2}]
{:title "Original 5e Character sheet - optional variant" :value 2}
{:title "Icewind Dale 5e Character sheet" :value 3}
{:title "Petersen Games - Cthulhu Mythos Sagas sheet" :value 4}]
:value print-character-sheet-style?
:on-change (make-arg-event-handler ::char/set-print-character-sheet-style? js/parseInt)}]]]
[:div.flex
Expand Down
Loading