mirror of
https://github.com/Kornstalx/5etools-mirror-2.github.io.git
synced 2025-10-28 20:45:35 -05:00
v1.201.0
This commit is contained in:
@@ -195,6 +195,8 @@ Renderer.dice = {
|
||||
// endregion
|
||||
|
||||
// region Event handling
|
||||
RE_PROMPT: /#\$prompt_number:?([^$]*)\$#/g,
|
||||
|
||||
async pRollerClickUseData (evt, ele) {
|
||||
evt.stopPropagation();
|
||||
evt.preventDefault();
|
||||
@@ -233,10 +235,8 @@ Renderer.dice = {
|
||||
|
||||
if (!chosenRollData) return;
|
||||
|
||||
const rePrompt = /#\$prompt_number:?([^$]*)\$#/g;
|
||||
const results = [];
|
||||
let m;
|
||||
while ((m = rePrompt.exec(chosenRollData.toRoll))) {
|
||||
for (const m of chosenRollData.toRoll.matchAll(Renderer.dice.RE_PROMPT)) {
|
||||
const optionsRaw = m[1];
|
||||
const opts = {};
|
||||
if (optionsRaw) {
|
||||
@@ -263,8 +263,7 @@ Renderer.dice = {
|
||||
}
|
||||
|
||||
const rollDataCpy = MiscUtil.copyFast(chosenRollData);
|
||||
rePrompt.lastIndex = 0;
|
||||
rollDataCpy.toRoll = rollDataCpy.toRoll.replace(rePrompt, () => results.shift());
|
||||
rollDataCpy.toRoll = rollDataCpy.toRoll.replace(Renderer.dice.RE_PROMPT, () => results.shift());
|
||||
|
||||
// If there's a prompt, prompt the user to select the dice
|
||||
let rollDataCpyToRoll;
|
||||
|
||||
Reference in New Issue
Block a user