Skip to content

Commit ce8acb4

Browse files
committed
Fix custom abilities breaking char sheet, and fix ability roll label to be non-translated so it uses the right data.
1 parent 6c5ed11 commit ce8acb4

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 4.0.5
2+
3+
- Additional fixes for abilities/languages.
4+
15
# 4.0.4
26

37
- Fix food roll in scvmfactory.

module/actor/sheet/character-sheet.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ export class MBCharacterSheet extends MBActorSheet {
6363
if (additionalAbilitiesCsv) {
6464
const customAbilities = additionalAbilitiesCsv.split(",").map((key) => {
6565
return {
66+
name: key,
67+
label: key, // currently, custom abilities aren't localized
6668
value: data.system.abilities[key.toLowerCase()]?.value ?? 0,
67-
label: key,
6869
};
6970
});
7071
if (customAbilities.length) {

module/handlebars.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ export function configureHandlebars() {
3535
return result;
3636
});
3737
Handlebars.registerHelper("abilityLabelClass", function (string) {
38-
string = string.label;
39-
if (!["Agility", "Presence", "Strength", "Toughness"].includes(string)) {
40-
return "custom " + string.toLowerCase();
38+
string = string.toLowerCase();
39+
if (!["agility", "presence", "strength", "toughness"].includes(string)) {
40+
return "custom " + string;
4141
}
42-
return string.toLowerCase();
42+
return string;
4343
});
4444
Handlebars.registerHelper("inputName", function (string) {
4545
return "system.abilities." + string.toLowerCase() + ".value";

templates/actor/character/sheet-header.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
data-dtype="Number"
131131
size="3"
132132
/>
133-
<span class="ability-label rollable {{abilityLabelClass this}}">{{abbreviate this.label}}</span>
133+
<span class="ability-label rollable {{abilityLabelClass this.name}}">{{abbreviate this.label}}</span>
134134
</div>
135135
{{/each}}
136136
</div>

0 commit comments

Comments
 (0)