Sync to latest WFRP release

This commit is contained in:
2026-02-26 21:53:55 +01:00
parent e0383def30
commit 786afeab74
480 changed files with 4221 additions and 91 deletions

View File

@@ -0,0 +1,29 @@
if (this.item.name.includes("("))
{
let trade = this.item.parenthesesText;
if (trade?.toLowerCase() != "any")
return this.item.updateSource({"system.tests.value" : this.item.system.tests.value.replace("any one", trade)})
}
let index = game.packs
.filter(i => i.metadata.type == "Item")
.reduce((acc, pack) => acc.concat(pack.index.contents), [])
.filter(i => i.type == "skill" && i.name.includes(game.i18n.localize("NAME.Trade")))
.map(i => {
i.id = i._id
return i
})
let choice = await ItemDialog.create(index, 1, {text : "Choose a Trade Skill, or select none to enter manually.", title : this.effect.name})
let text;
if (!choice[0])
{
let custom = await ValueDialog.create({text : "Enter Custom Trade Skill", title : "Custom Trade"});
text = custom || ""
}
else
{
text = game.wfrp4e.utility.extractParenthesesText(choice[0].name)
}
await this.item.updateSource({name : this.item.name.replace("(Any)", "").replace("(any)", "").trim() + ` (${text})`, "system.tests.value" : this.item.system.tests.value.replace("any one", text)});