From 42e359c887e45bc1adccf11d0687807734ce54b7 Mon Sep 17 00:00:00 2001 From: supervj <64861570+supervj@users.noreply.github.com> Date: Tue, 15 Sep 2020 00:21:32 -0400 Subject: [PATCH 1/4] Weapon & Armor Properties Update This was now baked into the system so I had to remove our custom code and tweak it for armor. --- sw5e.css | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sw5e.css b/sw5e.css index bf00ddce..33e311b8 100644 --- a/sw5e.css +++ b/sw5e.css @@ -1313,7 +1313,10 @@ color: #7a7971; } .sw5e.sheet.item .weapon-properties label.checkbox { - flex: 0 0 98px; + flex: 0 0 110px; +} +.sw5e.sheet.item .armor-properties label.checkbox { + flex: 0 0 110px; } .sw5e.sheet.item .loot-header { margin-bottom: 10px; From c1d85a1ada5a8b25fbfed227c84a9524be911e5e Mon Sep 17 00:00:00 2001 From: supervj <64861570+supervj@users.noreply.github.com> Date: Tue, 15 Sep 2020 00:22:18 -0400 Subject: [PATCH 2/4] Weapon & Armor Properties Update This was now baked into the system so I had to remove our custom code and tweak it for armor. --- less/items.less | 70 ------------------------------------------------- 1 file changed, 70 deletions(-) diff --git a/less/items.less b/less/items.less index 5c5dd132..f85d929c 100644 --- a/less/items.less +++ b/less/items.less @@ -212,76 +212,6 @@ } } - h4.armorproperties-header { - margin: 0; - padding: 0; - font-weight: bold; - line-height: 24px; - color: @colorOlive; - } - - .armorproperties-parts { - list-style: none; - margin: 0; - padding: 0; - - .armorproperties-part { - flex: 0 0 100%; - padding: 0; - input { - flex: 3; - } - select { - margin-left: 5px; - flex: 1; - } - } - } - - .armorproperties-control { - width: 18px; - flex: 0 0 18px; - line-height: 24px; - float: right; - text-align: right; - color: @colorTan; - } - - h4.weaponproperties-header { - margin: 0; - padding: 0; - font-weight: bold; - line-height: 24px; - color: @colorOlive; - } - - .weaponproperties-parts { - list-style: none; - margin: 0; - padding: 0; - - .weaponproperties-part { - flex: 0 0 100%; - padding: 0; - input { - flex: 3; - } - select { - margin-left: 5px; - flex: 1; - } - } - } - - .weaponproperties-control { - width: 18px; - flex: 0 0 18px; - line-height: 24px; - float: right; - text-align: right; - color: @colorTan; - } - /* ----------------------------------------- */ /* Item Actions */ /* ----------------------------------------- */ From fd4ad744bcb1fb44d41eefc3625cd61da8587b30 Mon Sep 17 00:00:00 2001 From: supervj <64861570+supervj@users.noreply.github.com> Date: Tue, 15 Sep 2020 00:22:57 -0400 Subject: [PATCH 3/4] Weapon & Armor Properties Update This was now baked into the system so I had to remove our custom code and tweak it for armor. --- module/item/sheet.js | 60 ++------------------------------------------ 1 file changed, 2 insertions(+), 58 deletions(-) diff --git a/module/item/sheet.js b/module/item/sheet.js index a04db6b8..edc3b84d 100644 --- a/module/item/sheet.js +++ b/module/item/sheet.js @@ -251,10 +251,10 @@ export default class ItemSheet5e extends ItemSheet { html.find('.trait-selector.class-skills').click(this._onConfigureClassSkills.bind(this)); // Armor properties - html.find(".armorproperties-control").click(this._onarmorpropertiesControl.bind(this)); +// html.find(".armorproperties-control").click(this._onarmorpropertiesControl.bind(this)); // 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 * @param {Event} event The click event which originated the selection From 1be5e907c291634a16a2a74ad290e4ccc811ea11 Mon Sep 17 00:00:00 2001 From: supervj <64861570+supervj@users.noreply.github.com> Date: Tue, 15 Sep 2020 00:23:50 -0400 Subject: [PATCH 4/4] Weapon & Armor Properties Update This was now baked into the system so I had to remove our custom code and tweak it for armor. --- templates/items/equipment.html | 31 +++++++------------------------ templates/items/weapon.html | 29 ----------------------------- 2 files changed, 7 insertions(+), 53 deletions(-) diff --git a/templates/items/equipment.html b/templates/items/equipment.html index 9a9740f4..42415b85 100644 --- a/templates/items/equipment.html +++ b/templates/items/equipment.html @@ -76,32 +76,15 @@ {{/unless}} - {{#unless isWeapon }} - {{!-- ArmorProperties Formula --}} -
-

- {{#unless isWeapon }}{{ localize "SW5E.ArmorProperties" }}{{ else }}{{ localize "SW5E.ItemWeaponProperties" }}{{/unless}} - -

-
    - {{#each data.armorproperties.parts as |part i| }} -
  1. - - - - -
  2. + {{!-- Armor Properties --}} +
    + + {{#each config.armorPropertiesTypes as |name prop|}} + {{/each}} -
- {{/unless}} {{!-- Armor Class --}}
diff --git a/templates/items/weapon.html b/templates/items/weapon.html index 34d7376f..060e0979 100644 --- a/templates/items/weapon.html +++ b/templates/items/weapon.html @@ -77,7 +77,6 @@
{{/unless}} - {{#if sss}} {{!-- Weapon Properties --}}
@@ -87,34 +86,6 @@ {{/each}}
- {{/if}} - - {{#if isWeapon }} -
- {{!-- weaponproperties Formula --}} -

- {{#unless isWeapon }}{{ localize "SW5E.ArmorProperties" }}{{ else }}{{ localize "SW5E.ItemWeaponProperties" }}{{/unless}} - -

-
    - {{#each data.weaponproperties.parts as |part i| }} -
  1. - - - - -
  2. - {{/each}} -
-
- {{/if}} {{#if isMountable}}