-
Notifications
You must be signed in to change notification settings - Fork 334
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 support for inline /act syntax for using actions #12733
Add support for inline /act syntax for using actions #12733
Conversation
fc5d852
to
ef9e998
Compare
ef9e998
to
f39d328
Compare
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.
It looks like we'd be better off overriding ChatLog.parse
and ChatLog#processMessage
types/foundry/client/application/sidebar/sidebar-tab/chat-log.d.ts
Outdated
Show resolved
Hide resolved
That was my initial attempt. I gave up on that once I basically copied the whole thing and added just another case for the switch in there. It works, but we’d have to maintain it ourselves since it’s not currently set to be changed in core. |
1737450
to
8db7a54
Compare
aaaefd4
to
a256c47
Compare
Rough draft for the Style Guide: Inline Action Syntax
Supported parameters
What is a "statistic slug"?A language-agnostic representation of a creature statistic. For most actions the supported statistics are perception, any saving throw, and any skill. perception |
2d71cb5
to
ac87d70
Compare
488b39c
to
9c24c96
Compare
16489cf
to
a55f5f4
Compare
src/module/system/text-editor.ts
Outdated
element.appendChild(document.createTextNode(" ")); | ||
|
||
const details = document.createElement("span"); | ||
if (dc && showDC && Number.isNumeric(dc)) { |
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.
We should have our own helper for this: mind making something like isIntegerString
that does a strict regex test?
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.
Sure, but I think it's Foundry providing that Number.isNumeric
function. Though I guess it's originally from jQuery.
Alternatively, there is something like Number.isInteger(Number("10"))
.
a55f5f4
to
e2734e7
Compare
Add support for inline slash-style syntax, specifically /act, for actions.
e2734e7
to
ad0f55c
Compare
Add support for inline slash-style syntax, specifically
/act
, for actions.Also give priority to the action objects instead of the old action functions when using both the old HTML syntax and the new slash syntax.
Examples
[[/act administer-first-aid variant=stop-bleeding dc=25]]
[[/act escape statistic=acrobatics dc=fortitude]]
[[/act grapple]]
Depends on #13043 and #13047