Skip to content

Commit

Permalink
8.3.1 - close #2324
Browse files Browse the repository at this point in the history
  • Loading branch information
moo-man committed Dec 5, 2024
1 parent b69a227 commit d279067
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 15 deletions.
6 changes: 3 additions & 3 deletions modules/apps/chargen/char-gen.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export default class CharGenWfrp4e extends FormApplication {
let actorItems = this.actor.items;
this.actor.items = [];
let document = await Actor.create(this.actor, {skipItems : true});
await document.createEmbeddedDocuments("Item", actorItems)
await document.createEmbeddedDocuments("Item", actorItems, {skipSpecialisationChoice : true})
for(let i of document.items.contents)
{
// Run onCreate scripts
Expand All @@ -392,9 +392,9 @@ export default class CharGenWfrp4e extends FormApplication {
for(let i of tempActor.items.contents)
{
// Run preCreate scripts
await i._preCreate(i._source, {}, game.user.id);
await i._preCreate(i._source, {skipSpecialisationChoice : true}, game.user.id);
}
const payload = {id : game.user.id, data : tempActor.toObject()}
const payload = {id : game.user.id, data : tempActor.toObject(), options : {skipSpecialisationChoice : true}}
let id = await SocketHandlers.executeOnUserAndWait("GM", "createActor", payload);
let actor = game.actors.get(id);
if (actor && actor.isOwner) {
Expand Down
7 changes: 6 additions & 1 deletion modules/apps/wfrp-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,18 @@ export default class BrowserWfrp4e extends Application {
}
break;

case "characteristics":
case "skills":
case "talents":
if (this.filters.dynamic[filter].value.length && this.filters.dynamic[filter].value.some(x => x))
filteredItems = filteredItems.filter(i => !i.system[filter] || (i.system[filter] && this.filters.dynamic[filter].value.every(value => { return i.system[filter].find(v => v.toLowerCase().includes(value.toLowerCase())) })))
break;


case "characteristics":
if (this.filters.dynamic[filter].value.length && this.filters.dynamic[filter].value.some(x => x))
filteredItems = filteredItems.filter(i => !i.system[filter] || (i.system[filter] && this.filters.dynamic[filter].value.every(value => { return i.system[filter][value.toLowerCase()]})))
break;

case "twohanded":
case "rollable":
case "magicMissile":
Expand Down
4 changes: 2 additions & 2 deletions modules/model/item/career.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export class CareerModel extends BaseItemModel
data.properties.push(`<b>${game.i18n.localize("Class")}</b>: ${this.class.value}`);
data.properties.push(`<b>${game.i18n.localize("Group")}</b>: ${this.careergroup.value}`);
data.properties.push(game.wfrp4e.config.statusTiers[this.status.tier] + " " + this.status.standing);
data.properties.push(`<b>${game.i18n.localize("Characteristics")}</b>: ${this.characteristics.map(i => i = " " + game.wfrp4e.config.characteristicsAbbrev[i])}`);
data.properties.push(`<b>${game.i18n.localize("Characteristics")}</b>: ${Object.keys(this.characteristics).filter(i => this.characteristics[i]).map(i => i = " " + game.wfrp4e.config.characteristicsAbbrev[i])}`);
data.properties.push(`<b>${game.i18n.localize("Skills")}</b>: ${this.skills.map(i => i = " " + i)}`);
data.properties.push(`<b>${game.i18n.localize("Talents")}</b>: ${this.talents.map(i => i = " " + i)}`);
data.properties.push(`<b>${game.i18n.localize("Trappings")}</b>: ${this.trappings.map(i => i = " " + i)}`);
Expand All @@ -192,7 +192,7 @@ export class CareerModel extends BaseItemModel
properties.push(`<b>${game.i18n.localize("Class")}</b>: ${this.class.value}`);
properties.push(`<b>${game.i18n.localize("Group")}</b>: ${this.careergroup.value}`);
properties.push(`<b>${game.i18n.localize("Status")}</b>: ${game.wfrp4e.config.statusTiers[this.status.tier] + " " + this.status.standing}`);
properties.push(`<b>${game.i18n.localize("Characteristics")}</b>: ${this.characteristics.map(i => i = " " + game.wfrp4e.config.characteristicsAbbrev[i])}`);
properties.push(`<b>${game.i18n.localize("Characteristics")}</b>: ${Object.keys(this.characteristics).filter(i => this.characteristics[i]).map(i => i = " " + game.wfrp4e.config.characteristicsAbbrev[i])}`);
properties.push(`<b>${game.i18n.localize("Skills")}</b>: ${this.skills.map(i => i = " " + "<a class = 'skill-lookup'>" + i + "</a>")}`);
properties.push(`<b>${game.i18n.localize("Talents")}</b>: ${this.talents.map(i => i = " " + "<a class = 'talent-lookup'>" + i + "</a>")}`);
properties.push(`<b>${game.i18n.localize("Trappings")}</b>: ${this.trappings.map(i => i = " " + i)}`);
Expand Down
2 changes: 1 addition & 1 deletion modules/system/socket-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function () {
default: 0,
[id]: 3
}
let actor = await Actor.implementation.create(actorData)
let actor = await Actor.implementation.create(actorData, payload.options || {})
return actor.id;
},

Expand Down
14 changes: 8 additions & 6 deletions static/templates/apps/chargen/attributes.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@

<p class="centered">{{localize "CHARGEN.Attributes.CharacteristicAdvances"}}</p>
<div class="flexrow">
{{#each data.items.career.system.characteristics as |characteristic ch|}}
<div class="flexcol allocation-input">
<h4>{{configLookup "characteristics" characteristic}}</h4>
{{#with (lookup ../context.characteristics characteristic)}}
<input class="ch-advance" value="{{advances}}" data-ch="{{../this}}" type="number">
{{#each data.items.career.system.characteristics}}
{{#if this}}
<div class="flexcol allocation-input">
<h4>{{configLookup "characteristics" @key}}</h4>
{{#with (lookup ../context.characteristics @key)}}
<input class="ch-advance" value="{{advances}}" data-ch="{{@key}}" type="number">
{{/with}}
</div>
</div>
{{/if}}
{{/each}}
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "wfrp4e",
"title": "Warhammer Fantasy Roleplay 4th Edition",
"description": "A comprehensive system for running grim and perilous games of Warhammer Fantasy Roleplay in the Foundry VTT environment.",
"version": "8.3.0",
"version": "8.3.1",
"authors" : [
{
"name": "Moo Man",
Expand Down Expand Up @@ -72,6 +72,6 @@
},
"socket": true,
"manifest" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/latest/download/system.json",
"download" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/download/8.3.0/wfrp4e.zip",
"download" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/download/8.3.1/wfrp4e.zip",
"url" : "https://github.com/moo-man/WFRP4e-FoundryVTT"
}

0 comments on commit d279067

Please sign in to comment.