power menu selection complete
This commit is contained in:
parent
94ee4243fa
commit
43cfa125ea
@ -321,13 +321,13 @@ export async function powerEffectsMenu(options = {}) {
|
|||||||
}
|
}
|
||||||
form += `<option>${powerName}</option>`;
|
form += `<option>${powerName}</option>`;
|
||||||
}
|
}
|
||||||
form += `</optgroup></div></form>`;
|
form += `</optgroup></select></div></form>`;
|
||||||
const formResult = await Dialog.wait({
|
const formResult = await Dialog.wait({
|
||||||
title: 'Select a power',
|
title: 'Select a power',
|
||||||
content: form,
|
content: form,
|
||||||
buttons: {
|
buttons: {
|
||||||
submit: {
|
submit: {
|
||||||
label: 'Submit',
|
label: 'Choose Power',
|
||||||
callback: (html) => {
|
callback: (html) => {
|
||||||
const formElement = html[0].querySelector('form');
|
const formElement = html[0].querySelector('form');
|
||||||
const formData = new FormDataExtended(formElement);
|
const formData = new FormDataExtended(formElement);
|
||||||
@ -339,4 +339,15 @@ export async function powerEffectsMenu(options = {}) {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
console.log(formResult);
|
console.log(formResult);
|
||||||
|
const powerName = formResult.power;
|
||||||
|
const token = 'token' in options ? options.token : null;
|
||||||
|
if (token === undefined || token === null) {
|
||||||
|
ui.notifications.error('Please select one token to be the caster');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const targets = 'targets' in options ? Array.from(options.targets) : [];
|
||||||
|
const runner = new powers[powerName](token, targets);
|
||||||
|
runner.render();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user