-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
feat: Add new Pathfinder 2e Creature layout (#436) #438
base: main
Are you sure you want to change the base?
Conversation
The previous regex would match the following: ``` abilityMods: [4, 2, 3, -3, 1, -1] resistances: "[Some Link](note.md)" ``` So that that the first group (the link text) would match: ``` 4, 2, 3, -3, 1, -1]\n resistances: "[Some Link ``` and the second group (the path) would match: ``` note.md ``` This commit changes the regex so that it doesn't falsely match in these cases and instead just matches the actual markdown link.
pf2e.css generated from the Fantasy-Statblocks-CSS-Development repo
As far as I can tell this is never used anywhere and doesn't appear to have contents relevant to PF2e.
This allows conditional blocks to do things like check plugin settings and whether other plugins are enabled. In particular, this allows layouts to only show encounter buttons when the Initiative Tracker plugin is enabled.
Separates out the name and value into their own HTML elements rather than just rendered text so that we can style individual portions with CSS. This change has no visible effects - existing statblocks should look exactly the same.
This is instead of adding them to the text content itself. This allows layout authors to customize the appearance with CSS.
Thank you to MostTornBrain for valuable feedback! Most of this comes from there :) - Fix traits only showing when the trait property was present (even if alignment, size, or rarity was present) - Add sign (+/-) to perception modifier - Move Weaknesses before Resistances to match book layout - Don't show Initiative Tracker encounter buttons if Initiative Tracker isn't enabled - Show the initiative tracker view when the encounter buttons are pressed, to match the functionality of encounter buttons in the actual encounter blocks - Bold save names - Add sign (+/-) to ability modifiers
Hey @miscoined, this looks great. Is this meant to slot into existing PF2e creature stat blocks used by the TTRPG share? |
@@ -926,6 +979,17 @@ class TableModal extends BasicModal<TableItem> { | |||
this.block.calculate = v; | |||
}); | |||
}); | |||
new Setting(el) | |||
.setName("Do Not Add Property as CSS Class") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I usually try to prefer making these things perform the task rather than turning it off. Could you please refactor this setting to that?
] | ||
} | ||
], | ||
condition: "return plugin.app.plugins.enabledPlugins.has(\"initiative-tracker\");\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually genius! Very clever.
markdown: true, | ||
headingProp: false, | ||
heading: "", | ||
callback: "var s = property.bonus < 0 ? \"-\" : \"+\";\ns += Math.abs(property.bonus);\nif (property.desc) {\n s += \" \" + property.desc\n}\nif (property.damage) {\n s += \", __Damage__ \" + property.damage\n}\nreturn s" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will return NaN
if property.bonus
is undefined
Sorry I let this sit for so long; been a very busy summer. I appreciate the work you have been doing. |
Pull Request Description
Add a new default Pathfinder 2e Creature layout. See #436 for rationale and background. This adds this as a new layout, without replacing the existing Basic layout. I'm opening this as a draft PR for now until I finish adding documentation and layout restoration functionality - I thought early feedback would be useful in this case.
Changes Proposed
Related Issues
Progresses #436.
Checklist (WIP)
Screenshots (if applicable)
Will add later, before flipping this out of a draft PR