Add a way to skip the equip prompt for API-based creation when it's not desired
This commit is contained in:
parent
08278655dc
commit
cc61a0c3ac
2 changed files with 6 additions and 4 deletions
|
|
@ -43,8 +43,9 @@ export class ArmourData extends CommonItemData {
|
||||||
// #endregion Schema
|
// #endregion Schema
|
||||||
|
|
||||||
// #region Lifecycle
|
// #region Lifecycle
|
||||||
async _preCreate(item) {
|
async _preCreate(item, options) {
|
||||||
if (this.parent.isEmbedded && this._canEquip()) {
|
const showEquipPrompt = options.showEquipPrompt ?? true;
|
||||||
|
if (showEquipPrompt && this.parent.isEmbedded && this._canEquip()) {
|
||||||
const shouldEquip = await DialogV2.confirm({
|
const shouldEquip = await DialogV2.confirm({
|
||||||
window: { title: `Equip Item?` },
|
window: { title: `Equip Item?` },
|
||||||
content: `Do you want to equip ${item.name}?`,
|
content: `Do you want to equip ${item.name}?`,
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,9 @@ export class WeaponData extends CommonItemData {
|
||||||
// #endregion Schema
|
// #endregion Schema
|
||||||
|
|
||||||
// #region Lifecycle
|
// #region Lifecycle
|
||||||
async _preCreate(item) {
|
async _preCreate(item, options) {
|
||||||
if (this.parent.isEmbedded && this._canEquip()) {
|
const showEquipPrompt = options.showEquipPrompt ?? true;
|
||||||
|
if (showEquipPrompt && this.parent.isEmbedded && this._canEquip()) {
|
||||||
const shouldEquip = await DialogV2.confirm({
|
const shouldEquip = await DialogV2.confirm({
|
||||||
window: { title: `Equip Item?` },
|
window: { title: `Equip Item?` },
|
||||||
content: `Do you want to equip ${item.name}?`,
|
content: `Do you want to equip ${item.name}?`,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue