Skip to content

Commit

Permalink
Merge pull request #56 from farling42/master
Browse files Browse the repository at this point in the history
Update to work with cyphersystem V2.0.x
  • Loading branch information
mclemente authored Nov 7, 2022
2 parents 6feb07a + 31d494b commit 0525740
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 28 deletions.
38 changes: 16 additions & 22 deletions module/SystemProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -1346,35 +1346,29 @@ export class cyphersystemProvider extends SystemProvider {
id: actor.id,
name: actor.name,
type: actor.type,
might: data.pools?.might,
speed: data.pools?.speed,
intellect: data.pools?.intellect,
additional: data.pools?.additional,
additionalPool: data.additionalPool,
mightEdge: data.pools?.mightEdge,
speedEdge: data.pools?.speedEdge,
intellectEdge: data.pools?.intellectEdge,
tier: data.basic?.tier,
effort: data.basic?.effort,
xp: data.basic?.xp,
armorValueTotal: data.armor?.armorValueTotal,
speedCostTotal: data.armor?.speedCostTotal,
damageTrack: data.damage?.damageTrack,
might: data.pools.might,
speed: data.pools.speed,
intellect: data.pools.intellect,
additional: data.pools.additional,
additionalPool: {
active: data.settings.general.additionalPool.active,
name: data.settings.general.additionalPool.label,
pool: data.pools.additionalPool,
},
tier: data.basic.tier,
effort: data.basic.effort,
xp: data.basic.xp,
armorValueTotal: data.combat.armor.ratingTotal,
speedCostTotal: data.combat.armor.costTotal,
damageTrack: data.combat.damageTrack.state,
};
}

getUpdate(actors) {
let showAdditional = false;
for (let actor of actors) {
if (actor.additionalPool?.active) {
showAdditional = true;
break;
}
}
return [
actors,
{
showAdditional: showAdditional,
showAdditional: actors.some(actor => actor.additionalPool.active),
},
];
}
Expand Down
12 changes: 6 additions & 6 deletions templates/cyphersystem.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@
</div>

{{#each actors as | actor | }}
{{#if (eq actor.type 'PC')}}
{{#if (eq actor.type 'pc')}}
<div class="table-row">
{{> "modules/party-overview/templates/parts/ToggleVisibilityButton.html" actor=actor}}
<div class="text">{{ actor.shortestName }}</div>

<div class="widenum" title="Current/Maximum ({{localize 'CYPHERSYSTEM.Edge'}})">{{ actor.might.value }}/{{ actor.might.max }} ({{actor.mightEdge}})</div>
<div class="widenum" title="Current/Maximum ({{localize 'CYPHERSYSTEM.Edge'}})">{{ actor.speed.value }}/{{ actor.speed.max }} ({{actor.speedEdge}})</div>
<div class="widenum" title="Current/Maximum ({{localize 'CYPHERSYSTEM.Edge'}})">{{ actor.intellect.value }}/{{ actor.intellect.max }} ({{actor.intellectEdge}})</div>
<div class="widenum" title="Current/Maximum ({{localize 'CYPHERSYSTEM.Edge'}})">{{ actor.might.value }}/{{ actor.might.max }} ({{actor.might.edge}})</div>
<div class="widenum" title="Current/Maximum ({{localize 'CYPHERSYSTEM.Edge'}})">{{ actor.speed.value }}/{{ actor.speed.max }} ({{actor.speed.edge}})</div>
<div class="widenum" title="Current/Maximum ({{localize 'CYPHERSYSTEM.Edge'}})">{{ actor.intellect.value }}/{{ actor.intellect.max }} ({{actor.intellect.edge}})</div>
{{#if ../showAdditional}}
{{#if actor.additionalPool.active}}
{{#if (eq actor.additionalPool.additionalPoolName "")}}
{{#if (eq actor.additionalPool.name "")}}
<div class="widenum" title="{{localize 'CYPHERSYSTEM.AdditionalPool'}} (Current/Maximum)">{{ actor.additional.value }}/{{ actor.additional.max }}</div>
{{else}}
<div class="widenum" title="{{actor.additionalPool.additionalPoolName}} (Current/Maximum)">{{ actor.additional.value }}/{{ actor.additional.max }}</div>
<div class="widenum" title="{{actor.additionalPool.name}} (Current/Maximum)">{{ actor.additional.value }}/{{ actor.additional.max }}</div>
{{/if}}
{{else}}
<div class="widenum">-</div>
Expand Down

0 comments on commit 0525740

Please sign in to comment.