#610 extend feature boxes for icewind/mythos CS#610
#610 extend feature boxes for icewind/mythos CS#610Jessomadic wants to merge 5 commits intoOrcpub:developfrom
Conversation
[pull] develop from Orcpub:develop
…r-icewindmythos-csoptional-variant
Added dedicated Feature Sheet to both Icewind Dale Sheet and the Mythos Sheet. In order to not waste the space on the Mythos sheet that is about half a page for features I added a new field "Features-and-traits-3" for the full pages on Mythos and kept the normal "features-and-traits-2" but limited it to 500 char to avoid it shrinking to unreadable sizes.
Increased char limit of Feature2 to 1000
src/cljc/orcpub/pdf_spec.cljc
Outdated
| (seq traits)) | ||
| header (features-and-traits-header built-char) | ||
| ] | ||
| {:features-and-traits-3 (str header "\n\n" |
There was a problem hiding this comment.
Sounds good. I found a fallback that I can make whats called a "PDF Portfolio" that will allow multiple of the same form field name while not linking them so I can set Char limits
There was a problem hiding this comment.
It is strange that they are coming across blank though
There was a problem hiding this comment.
@Jessomadic
This work flow takes the form data from the "download-form" in the browser and loops through all the elements in it.
If you look in the data, there is no :features-and-traits-3. But there is :features-and-traits-2.
It's looping through all the fields being passed down from the as built character.
Ideally, we need a chunk of code that looks at the size of what features-and-traits are going to be and adds another page if needed.
Example, where 900 is the character length that looks good in the PDF Text field. something like:
do while ( features-and-traits >=900 )
add page
take first 900 characters from features-and-traits and insert it into the page.
remove the first 900 characters from features-and-traits and set features-and-traits to the new value.
)
The routes is responsible for filling the PDF text fields, and it is called here.
orcpub/src/clj/orcpub/routes.clj
Line 478 in 6b709e7
Implementation of it lives here:
Lines 31 to 55 in 6b709e7
Which is just looping through all the fields/elements that are in the edn.
The (doseq [[k v] fields] is basically the do while above for all the fields/elements being passed in, eg :religion :dex-save :hp-current etc.
https://clojuredocs.org/clojure.core/doseq
I don't know. It's a toss up to break up that function or just live with it.
There was a problem hiding this comment.
lets just live with it. I'll make a workaround. It was more if it was an easy 10 min change it would be nice to have but I can get it all done in Adobe. Thanks for breaking it down though that explains alot
There was a problem hiding this comment.
I'll look into the logic zotz pointed out once I get a free weekend again.
Reverted Routes and PDF Spec changes to remove Feature 3


Description:
Added a dedicated Feature Sheet to both the Icewind Dale Sheet and the Mythos Sheet. To not waste the space on the Mythos sheet which is about half a page for features I added a new field "Features-and-traits-3" for the full pages on Mythos and kept the normal "features-and-traits-2" but limited it to 500 chars to avoid it shrinking to unreadable sizes.
Related issue (if applicable): fixes #608
Checklist: