-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Bugfixes and refactoring to give more granular access to template authors #646
Open
miscoined
wants to merge
17
commits into
ebullient:main
Choose a base branch
from
miscoined:statblock-pre
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Comparison was done with ==, not .equals, so it never triggered.
- Fix an embarrassing regex backreferencing bug where I was accidentally turning all costs into a single 0x01 unicode character - Remove trailing newlines for ability triggers as well
Allows template authors to more easily access the components of a note reference rather than just the markdown link text.
- Don't embed the "**AC**" within the AC string - Rename StringUtil.format to formatIfPresent - Remove joinWithPrefix in favour of formatIfPresent - Add some helper template strings for later use in YAML statblocks
- Move the enum into QuteDataActivity directly so that we don't have to pass the rule, glyph, and name in every time when it'll be staying the same for a given action. - Make QuteDataActivity store a QuteDataRef to centralize some of the link formatting - Allows template authors to compare the activity itself and theoretically choose what kind of rendering they want
Replace with renderEmbeddedTemplate. This will make the next changes easier.
Generally pull things up into the main class rather than methods of the JsonNodeReader.
- Move entries, traits, and tags into Json2QuteBase - Incidentally fix a few cases where tags aren't populated correctly
Fits better with the other methods defined in that class rather than the recursive parse methods in JsonSource
- 🚸 Allows template authors to access trait reference data directly rather than just the markdown doc. - 🚸 Incidentally fixes trait ordering so that it's alphabetically by trait name, rather than by whether or not there's a link. - 🔥 Remove alignment field handling for creature nodes - it was never used in the data
Replace with linkifyListFrom. It's unnecessary now that we're no longer using it for creatures (which have their alignments defined directly within the trait field anyway). This also means that alignment formatting is easier to understand as it's all centralized within the linkifier now.
The implementation was the same in both trees. This makes debugging easier.
- Add a QuteDataTraits - dedicated class to hold traits so we can have easier bare linking - Rename collectTraitsFrom to getTraits, and pull Tag adding into QuteDataTraits - Fix creature statblock so it doesn't generate traits property when we don't have any generic traits - Fix some items being incorrectly tagged with their source (e.g. tagged as "trait/preparation-sog2" rather than "trait/preparation") - Fix some incorrectly formatted markdown links when the trait is surrounded in square brackets (e.g. for classes and magical traditions)
- 💥 Rename some properties to better reflect their usage - 🚸 Expose integers rather than formatted strings to the template - Add some StringUtil helpers for printing modifiers - Make the default output match the printed book text better
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey! I know it's been a while but I've got some time now and figured I'd get back to this. This is some refactoring, bug-fixes, and other pre-work which is required for #497 -- mostly trying to keep that other PR smaller.
Specifically, this is a few bugs, and then a bunch of refactoring with the goal of allowing template authors to access data with more granularity, which will be required for adding YAML statblock support later.
The largest change here is probably introducing a
QuteDataRef
which is an explicit type to use for reference links, primarily so that template authors can have more control over how these are displayed and formatted (e.g. for pf2e traits).Let me know if you'd like me to split out the bugfixes into a separate PR :)