javalent / fantasy-statblocks

Create Dungeons and Dragons style statblocks for Obsidian.md
MIT License
339 stars 68 forks source link

feat: Pass the current property as a parameter for trait callbacks #432

Closed miscoined closed 5 days ago

miscoined commented 5 days ago

Pull Request Description

This allows layout authors to write custom callbacks which can refer back to the trait for that callback. With the current implementation, the callback has access to the monster, but no reference to the current trait being rendered, which makes the utility very limited (eg every trait description would be the same)

Changes Proposed

Related Issues

I didn't make a feature request for this one. Let me know if you'd like me to.

Checklist

Additional Notes

As far as I can tell this shouldn't break any existing layouts. The only potential issue I can think of is if any existing layouts use the property variable in a trait callback, but I think in that case it would actually just get locally overridden - but I'm not 100% sure and haven't checked as it seems like a very edge case.