Skip to content

Commit

Permalink
Scum and Villainy improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mclemente committed Jan 6, 2022
1 parent e9465cb commit a530168
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
19 changes: 9 additions & 10 deletions module/SystemProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ export class pf2eProvider extends SystemProvider {
get template() {
return "/modules/party-overview/templates/pf2e.hbs";
}

get width() {
return 600;
}
Expand Down Expand Up @@ -474,13 +474,11 @@ export class scumAndVillainyProvider extends SystemProvider {
}

getHarm(data) {
const light = game.i18n.localize("BITD.LessEffect");
const medium = "-1D";
const heavy = game.i18n.localize("BITD.NeedHelp");
if (data.harm.heavy.one) return `${light}, ${medium}, ${heavy}`;
if (data.harm.medium.one || data.harm.medium.two) return `${light}, ${medium}`;
if (data.harm.light.one || data.harm.light.two) return `${light}`;
return "";
let result = [];
if (data.harm.light.one || data.harm.light.two) result.push(game.i18n.localize("BITD.LessEffect"));
if (data.harm.medium.one || data.harm.medium.two) result.push("-1D");
if (data.harm.heavy.one) result.push(game.i18n.localize("BITD.NeedHelp"));
return result.join(", ");
}

getActorDetails(actor) {
Expand All @@ -489,12 +487,12 @@ export class scumAndVillainyProvider extends SystemProvider {
id: actor.id,
name: actor.name,
type: actor.type,
coins: data.coins,
};
if (actor.type == "character") {
return {
...base,
stress: data.stress || { value: "-", max: "-" },
stress: data.stress,
coins: data.coins,
harm: this.getHarm(data),
};
} else if (actor.type == "ship") {
Expand Down Expand Up @@ -531,6 +529,7 @@ export class scumAndVillainyProvider extends SystemProvider {
characters,
{
ships,
shipsNotVisible: !Object.keys(ships).length,
},
];
}
Expand Down
14 changes: 7 additions & 7 deletions templates/scum-and-villainy.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<div>
{{> "modules/party-overview/templates/parts/Tabs.html"}}
<section class="content">
<div class="tab" data-tab="general" data-group="party">
<div class="tab" data-group="party">
<div class="table-row header">
{{> "modules/party-overview/templates/parts/FilterButton.html"}}
<div class="text">{{localize "party-overview.NAME"}}</div>
Expand All @@ -25,13 +24,14 @@
</div>
{{/each}}
</div>

<div class="tab" data-tab="ship" data-group="party">
{{#if shipsNotVisible}}
{{else}}
<div class="tab" data-group="party">
<h3 class="item">{{localize "BITD.Ship"}}</h3>
<div class="table-row header">
{{> "modules/party-overview/templates/parts/FilterButton.html"}}
<div class="button"></div>
<div class="text">{{localize "party-overview.NAME"}}</div>
<div class="text icon">{{localize "BITD.Gambits"}}</i></div>
<div class="text icon">{{localize "BITD.Coins"}}</i></div>
<div class="text icon">{{localize "BITD.SystemsCrew"}}</i></div>
</div>

Expand All @@ -45,10 +45,10 @@
</div>
<div class="text">{{ actor.shortestName }}</div>
<div class="text icon">{{ actor.gambits.value }}/{{ actor.gambits.max }}</div>
<div class="text icon">{{ actor.coins }}</div>
<div class="text icon">{{ actor.crew.value }}/{{ actor.crew.max }}</div>
</div>
{{/each}}
</div>
{{/if}}
</section>
</div>

0 comments on commit a530168

Please sign in to comment.