mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 16:09:03 +01:00
Pass the actor id through the button; fix /dr and /fr flavor text
This commit is contained in:
parent
2c93defd9c
commit
1058b152c2
7 changed files with 15 additions and 12 deletions
|
|
@ -5,10 +5,10 @@ export const capitalize = string => {
|
|||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
};
|
||||
|
||||
export function rollCommandToJSON(text, raw) {
|
||||
export function rollCommandToJSON(text) {
|
||||
if (!text) return {};
|
||||
|
||||
const flavorMatch = raw?.match(/{(.*)}$/);
|
||||
const flavorMatch = text?.match(/{(.*)}$/);
|
||||
const flavor = flavorMatch ? flavorMatch[1] : null;
|
||||
|
||||
// Match key="quoted string" OR key=unquotedValue
|
||||
|
|
@ -31,7 +31,7 @@ export function rollCommandToJSON(text, raw) {
|
|||
}
|
||||
result[key] = value;
|
||||
}
|
||||
return Object.keys(result).length > 0 ? { result, flavor } : null;
|
||||
return { result, flavor };
|
||||
}
|
||||
|
||||
export const getCommandTarget = (options = {}) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue