Auto-equip weapons when embedded into Geist

This commit is contained in:
Eldritch-Oliver 2025-10-12 20:37:16 -06:00
parent e7ac049ae3
commit d81d86ef47

View file

@ -49,10 +49,13 @@ export class WeaponData extends CommonItemData {
async _preCreate(item, options) { async _preCreate(item, options) {
const showEquipPrompt = options.showEquipPrompt ?? true; const showEquipPrompt = options.showEquipPrompt ?? true;
if (showEquipPrompt && this.parent.isEmbedded && this._canEquip()) { if (showEquipPrompt && this.parent.isEmbedded && this._canEquip()) {
const shouldEquip = await DialogV2.confirm({ let shouldEquip = this.parent.parent.type === `geist`;
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}?`,
}); });
if (shouldEquip) { if (shouldEquip) {
this.updateSource({ "equipped": true }); this.updateSource({ "equipped": true });
}; };