working as intended

This commit is contained in:
jalensailin
2022-09-01 01:14:59 -04:00
parent 1a63a2318b
commit db2809eac0
3 changed files with 43 additions and 15 deletions
+4
View File
@@ -80,6 +80,10 @@ section.window-content{
color: #999999;
}
.dg-red{
color:rgb(117, 0, 0);
}
.grid-1col{
display: grid;
grid-column: span 1 / span 1;
+12
View File
@@ -321,9 +321,21 @@ export class DeltaGreenActorSheet extends ActorSheet {
html.find('.gear-browse').click(ev => {
//game.packs.find(k=>k.collection==="deltagreen.firearms").render(true);
});
html.find('.toggle-lethality').click(event => {
this._toggleLethality(event);
});
}
_toggleLethality(event) {
const itemId = event.target.getAttribute("item-id");
const isLethal = event.target.getAttribute("is-lethal") === "true";
const item = this.actor.data.items.find((i) => i.id === itemId);
item.update({"data.isLethal": !isLethal});
}
_showNewEditTypeSkillDialog(targetSkill, currentLabel, currentGroup){
// TO DO: BUILD DIALOG TO CAPTURE UPDATED DATA
+27 -15
View File
@@ -313,23 +313,35 @@
{{item.name}}
</h4>
{{#unless item.data.data.isLethal}}
<span class="rollable centered-item-property"
<span class = "centered-item-property">
{{#unless item.data.data.isLethal}}
<span class="rollable"
data-rolltype="damage"
data-target="damage"
data-label="{{toUpperCase item.name}}"
data-roll="{{toUpperCase item.data.data.damage}}"
data-skill="{{item.data.data.skill}}"
>
{{toUpperCase item.data.data.damage}}{{#if_eq item.data.data.skill 'unarmed_combat'}}{{actor.data.data.statistics.str.meleeDamageBonusFormula}}{{/if_eq}}{{#if_eq item.data.data.skill 'melee_weapons'}}{{actor.data.data.statistics.str.meleeDamageBonusFormula}}{{/if_eq}}</span>
{{/unless}}
{{#if item.data.data.isLethal}}
<span class="rollable" data-rolltype="lethality" data-target="{{item.data.data.lethality}}" data-label="{{item.name}}" data-roll="d100"
title="{{localize 'DG.ItemWindow.Weapons.LethalityTooltip'}}">
{{item.data.data.lethality}}%</span>
{{/if}}
data-rolltype="damage"
data-target="damage"
data-label="{{toUpperCase item.name}}"
data-roll="{{toUpperCase item.data.data.damage}}"
data-skill="{{item.data.data.skill}}"
>
{{toUpperCase item.data.data.damage}}{{#if_eq item.data.data.skill 'unarmed_combat'}}{{actor.data.data.statistics.str.meleeDamageBonusFormula}}{{/if_eq}}{{#if_eq item.data.data.skill 'melee_weapons'}}{{actor.data.data.statistics.str.meleeDamageBonusFormula}}{{/if_eq}}</span>
{{/unless}}
{{#if item.data.data.lethality}}
-
{{#if item.data.data.isLethal}}
<a class="item-control toggle-lethality dg-red" title="Toggle Lethality (Current Lethality: {{item.data.data.lethality}}%)"><i class="fas fa-tint" item-id="{{item.id}}" is-lethal="true"></i></a>
{{else}}
<a class="item-control toggle-lethality" title="Toggle Lethality (Currently No Lethality)"><i class="fas fa-tint-slash" item-id="{{item.id}}" is-lethal="false"></i></a>
{{/if}}
{{/if}}
</span>
{{#if item.data.data.isLethal}}
<span class="rollable centered-item-property" data-rolltype="lethality" data-target="{{item.data.data.lethality}}" data-label="{{item.name}}" data-roll="d100"
title="{{localize 'DG.ItemWindow.Weapons.LethalityTooltip'}}"
>{{formatLethality item.data.data.lethality}}</span>
{{/if}}
<span class="centered-item-property">{{item.data.data.armorPiercing}}</span>