forked from GitHub-Mirrors/foundry-sw5e
Weapon & Armor Properties Update
This was now baked into the system so I had to remove our custom code and tweak it for armor.
This commit is contained in:
parent
c1d85a1ada
commit
fd4ad744bc
1 changed files with 2 additions and 58 deletions
|
@ -251,10 +251,10 @@ export default class ItemSheet5e extends ItemSheet {
|
||||||
html.find('.trait-selector.class-skills').click(this._onConfigureClassSkills.bind(this));
|
html.find('.trait-selector.class-skills').click(this._onConfigureClassSkills.bind(this));
|
||||||
|
|
||||||
// Armor properties
|
// Armor properties
|
||||||
html.find(".armorproperties-control").click(this._onarmorpropertiesControl.bind(this));
|
// html.find(".armorproperties-control").click(this._onarmorpropertiesControl.bind(this));
|
||||||
|
|
||||||
// Weapon properties
|
// Weapon properties
|
||||||
html.find(".weaponproperties-control").click(this._onweaponpropertiesControl.bind(this));
|
// html.find(".weaponproperties-control").click(this._onweaponpropertiesControl.bind(this));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,62 +289,6 @@ export default class ItemSheet5e extends ItemSheet {
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
/**
|
|
||||||
* Add or remove a armorproperties part from the armorproperties formula
|
|
||||||
* @param {Event} event The original click event
|
|
||||||
* @return {Promise}
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
async _onarmorpropertiesControl(event) {
|
|
||||||
event.preventDefault();
|
|
||||||
const a = event.currentTarget;
|
|
||||||
|
|
||||||
// Add new armorproperties component
|
|
||||||
if ( a.classList.contains("add-armorproperties") ) {
|
|
||||||
await this._onSubmit(event); // Submit any unsaved changes
|
|
||||||
const armorproperties = this.item.data.data.armorproperties;
|
|
||||||
return this.item.update({"data.armorproperties.parts": armorproperties.parts.concat([["", ""]])});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove a armorproperties component
|
|
||||||
if ( a.classList.contains("delete-armorproperties") ) {
|
|
||||||
await this._onSubmit(event); // Submit any unsaved changes
|
|
||||||
const li = a.closest(".armorproperties-part");
|
|
||||||
const armorproperties = duplicate(this.item.data.data.armorproperties);
|
|
||||||
armorproperties.parts.splice(Number(li.dataset.armorpropertiesPart), 1);
|
|
||||||
return this.item.update({"data.armorproperties.parts": armorproperties.parts});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add or remove a weaponproperties part from the weaponproperties formula
|
|
||||||
* @param {Event} event The original click event
|
|
||||||
* @return {Promise}
|
|
||||||
* @private
|
|
||||||
*/
|
|
||||||
async _onweaponpropertiesControl(event) {
|
|
||||||
event.preventDefault();
|
|
||||||
const a = event.currentTarget;
|
|
||||||
|
|
||||||
// Add new weaponproperties component
|
|
||||||
if ( a.classList.contains("add-weaponproperties") ) {
|
|
||||||
await this._onSubmit(event); // Submit any unsaved changes
|
|
||||||
const weaponproperties = this.item.data.data.weaponproperties;
|
|
||||||
return this.item.update({"data.weaponproperties.parts": weaponproperties.parts.concat([["", ""]])});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove a weaponproperties component
|
|
||||||
if ( a.classList.contains("delete-weaponproperties") ) {
|
|
||||||
await this._onSubmit(event); // Submit any unsaved changes
|
|
||||||
const li = a.closest(".weaponproperties-part");
|
|
||||||
const weaponproperties = duplicate(this.item.data.data.weaponproperties);
|
|
||||||
weaponproperties.parts.splice(Number(li.dataset.weaponpropertiesPart), 1);
|
|
||||||
return this.item.update({"data.weaponproperties.parts": weaponproperties.parts});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle spawning the TraitSelector application which allows a checkbox of multiple trait options
|
* Handle spawning the TraitSelector application which allows a checkbox of multiple trait options
|
||||||
* @param {Event} event The click event which originated the selection
|
* @param {Event} event The click event which originated the selection
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue