diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md
index 09fc81a36..8589a2b18 100644
--- a/.github/ISSUE_TEMPLATE/bug-report.md
+++ b/.github/ISSUE_TEMPLATE/bug-report.md
@@ -29,3 +29,10 @@ wfrp4e-ua1:
wfrp4e-dotr:
wfrp4e-archives1:
wfrp4e-middenheim:
+wfrp4e-archives1:
+wfrp4e-pbtt:
+wfrp4e-altdorf:
+wfrp4e-ua2:
+wfrp4e-owb1:
+wfrp4e-horned-rat:
+wfrp4e-empire-ruins:
diff --git a/modules/actor/actor-wfrp4e.js b/modules/actor/actor-wfrp4e.js
index 546708b46..465af3b35 100644
--- a/modules/actor/actor-wfrp4e.js
+++ b/modules/actor/actor-wfrp4e.js
@@ -72,7 +72,7 @@ export default class ActorWfrp4e extends Actor {
createData.prototypeToken = data.prototypeToken
// Set custom default token
- if (data.img == "icons/svg/mystery-man.svg") {
+ if (!data.img || data.img == "icons/svg/mystery-man.svg") {
createData.img = "systems/wfrp4e/tokens/unknown.png"
if (data.type == "vehicle")
createData.img = "systems/wfrp4e/tokens/vehicle.png"
@@ -94,7 +94,7 @@ export default class ActorWfrp4e extends Actor {
async _preUpdate(updateData, options, user) {
await super._preUpdate(updateData, options, user)
- if (hasProperty(updateData, "system.status.advantage.value") && game.settings.get("wfrp4e", "useGroupAdvantage"))
+ if (!options.skipGroupAdvantage && hasProperty(updateData, "system.status.advantage.value") && game.settings.get("wfrp4e", "useGroupAdvantage"))
{
let combatant = game.combat?.getCombatantByActor(this.id)
@@ -376,7 +376,7 @@ export default class ActorWfrp4e extends Actor {
}
}
- // this.checkWounds();
+ this.checkWounds();
if (this.isMounted && !game.actors) {
@@ -1566,7 +1566,7 @@ export default class ActorWfrp4e extends Actor {
// Update hook?
checkWounds() {
- if (this.flags.autoCalcWounds) {
+ if (this.type != "vehicle" && this.flags.autoCalcWounds) {
let wounds = this._calculateWounds()
if (this.status.wounds.max != wounds) // If change detected, reassign max and current wounds
diff --git a/modules/actor/sheet/actor-sheet.js b/modules/actor/sheet/actor-sheet.js
index c223c2a1b..ad1043ef4 100644
--- a/modules/actor/sheet/actor-sheet.js
+++ b/modules/actor/sheet/actor-sheet.js
@@ -139,8 +139,8 @@ export default class ActorSheetWfrp4e extends ActorSheet {
async _handleEnrichment()
{
let enrichment = {}
- enrichment["system.details.biography.value"] = await TextEditor.enrichHTML(this.actor.system.details.biography.value, {async: true})
- enrichment["system.details.gmnotes.value"] = await TextEditor.enrichHTML(this.actor.system.details.gmnotes.value, {async: true})
+ enrichment["system.details.biography.value"] = await TextEditor.enrichHTML(this.actor.system.details.biography.value, {async: true, secrets: this.actor.isOwner, relativeTo: this.actor})
+ enrichment["system.details.gmnotes.value"] = await TextEditor.enrichHTML(this.actor.system.details.gmnotes.value, {async: true, secrets: this.actor.isOwner, relativeTo: this.actor})
return expandObject(enrichment)
}
@@ -1471,11 +1471,11 @@ export default class ActorSheetWfrp4e extends ActorSheet {
}
// Add condition description dropdown
- _onConditionClicked(ev) {
+ async _onConditionClicked(ev) {
ev.preventDefault();
let li = $(ev.currentTarget).parents(".sheet-condition"),
elementToAddTo = $(ev.currentTarget).parents(".condition-list"),
- condkey = li.attr("data-cond-id"), expandData = TextEditor.enrichHTML(`
${game.wfrp4e.config.conditions[condkey]}
` + game.wfrp4e.config.conditionDescriptions[condkey])
+ condkey = li.attr("data-cond-id"), expandData = await TextEditor.enrichHTML(`${game.wfrp4e.config.conditions[condkey]}
` + game.wfrp4e.config.conditionDescriptions[condkey], {async: true})
if (elementToAddTo.hasClass("expanded")) {
let summary = elementToAddTo.parents(".effects").children(".item-summary");
@@ -1793,7 +1793,7 @@ export default class ActorSheetWfrp4e extends ActorSheet {
let system = duplicate(this.actor._source.system);
system.details.experience.total += dragData.payload;
system.details.experience.log = this.actor._addToExpLog(dragData.payload, "Character Creation", undefined, system.details.experience.total);
- this.actor.update({ "data": data })
+ this.actor.update({ "system": system })
}
// From Income results - drag money value over to add
@@ -1894,12 +1894,12 @@ export default class ActorSheetWfrp4e extends ActorSheet {
*
* @param {Object} ev ev generated by the click
*/
- _onItemSummary(ev) {
+ async _onItemSummary(ev) {
ev.preventDefault();
let li = $(ev.currentTarget).parents(".item"),
item = this.actor.items.get(li.attr("data-item-id"));
// Call the item's expandData() which gives us what to display
- let expandData = item.getExpandData(
+ let expandData = await item.getExpandData(
{
secrets: this.actor.isOwner
});
@@ -2203,6 +2203,6 @@ export default class ActorSheetWfrp4e extends ActorSheet {
toggleItemCheckbox(itemId, target) {
let item = this.actor.items.get(itemId)
- return item.update({ [`${target}`]: !getProperty(item.system, target) })
+ return item.update({ [`${target}`]: !getProperty(item, target) })
}
}
\ No newline at end of file
diff --git a/modules/actor/sheet/creature-sheet.js b/modules/actor/sheet/creature-sheet.js
index 25a3807c3..807df0051 100644
--- a/modules/actor/sheet/creature-sheet.js
+++ b/modules/actor/sheet/creature-sheet.js
@@ -90,12 +90,12 @@ export default class ActorSheetWfrp4eCreature extends ActorSheetWfrp4e {
*
* @param {Object} event event fired from clicking on an item
*/
- _onCreatureItemSummary(event) {
+ async _onCreatureItemSummary(event) {
event.preventDefault();
let li = $(event.currentTarget).parent('.list'),
item = this.actor.items.get($(event.currentTarget).attr("data-item-id")),
// Get expansion info to place in the dropdown
- expandData = item.getExpandData(
+ expandData = await item.getExpandData(
{
secrets: this.actor.isOwner
});
diff --git a/modules/actor/sheet/vehicle-sheet.js b/modules/actor/sheet/vehicle-sheet.js
index 0db018a46..9acc43392 100644
--- a/modules/actor/sheet/vehicle-sheet.js
+++ b/modules/actor/sheet/vehicle-sheet.js
@@ -19,14 +19,13 @@ export default class ActorSheetWfrp4eVehicle extends ActorSheetWfrp4e {
async _onDrop(event) {
let dragData = JSON.parse(event.dataTransfer.getData("text/plain"));
- let actor = await Actor.implementation.fromDropData(dragData)
-
- if (actor)
+
+ if (dragData?.type == "Actor")
{
+ let actor = await fromUuid(dragData.uuid)
let passengers = duplicate(this.actor.system.passengers);
passengers.push({ id: actor.id, count: 1 });
this.actor.update({ "system.passengers": passengers })
-
}
else return super._onDrop(event);
}
diff --git a/modules/apps/roll-dialog.js b/modules/apps/roll-dialog.js
index 4ee5b9f98..733b87a1b 100644
--- a/modules/apps/roll-dialog.js
+++ b/modules/apps/roll-dialog.js
@@ -1,3 +1,5 @@
+import WFRP_Utility from "../system/utility-wfrp4e";
+
export default class RollDialog extends Dialog {
static get defaultOptions() {
@@ -14,25 +16,22 @@ export default class RollDialog extends Dialog {
let modifier = html.find('[name="testModifier"]')[0]
let successBonus = html.find('[name="successBonus"]')[0]
- modifier.value = (this.userEntry.testModifier || 0) + (this.cumulativeBonuses.testModifier || 0)
-
-
- // Called Shot
- if (this.selectedHitLocation?.value && !["none", "roll"].includes(this.selectedHitLocation.value))
- {
-
- if (!this.data.testData.deadeyeShot && !(this.data.testData.strikeToStun && this.selectedHitLocation.value == "head")) // Deadeye shot and strike to stun not applied
- modifier.value -= 20;
- }
+ modifier.value =
+ (this.userEntry.testModifier || 0) +
+ (this.cumulativeBonuses.testModifier || 0) +
+ (this.userEntry.calledShot || 0)
- if (!game.settings.get("wfrp4e", "mooAdvantage"))
+ if (!game.settings.get("wfrp4e", "mooAdvantage") && game.settings.get("wfrp4e", "autoFillAdvantage"))
modifier.value = Number(modifier.value) + (game.settings.get("wfrp4e", "advantageBonus") * this.advantage || 0) || 0
successBonus.value = (this.userEntry.successBonus || 0) + (this.cumulativeBonuses.successBonus || 0)
//@HOUSE
if (game.settings.get("wfrp4e", "mooAdvantage"))
+ {
successBonus.value = Number(successBonus.value) + Number(this.advantage || 0)
+ WFRP_Utility.logHomebrew("mooAdvantage")
+ }
//@/HOUSE
html.find('[name="slBonus"]')[0].value = (this.userEntry.slBonus || 0) + (this.cumulativeBonuses.slBonus || 0)
@@ -63,10 +62,22 @@ export default class RollDialog extends Dialog {
}).val());
html.find('[name="charging"]').change(ev => {
+
+ let onlyModifier = game.settings.get("wfrp4e","useGroupAdvantage");
if (ev.target.checked)
- game.settings.get("wfrp4e","useGroupAdvantage") ? this.userEntry.testModifier += (+10) : this.changeAdvantage((this.advantage || 0) + 1)
- else if (this.advantage >= 1)
- game.settings.get("wfrp4e","useGroupAdvantage") ? this.userEntry.testModifier += (-10) : this.changeAdvantage((this.advantage || 0) - 1)
+ {
+ // If advantage cap, only add modifier if at cap
+ if (!onlyModifier && game.settings.get("wfrp4e", "capAdvantageIB"))
+ {
+ onlyModifier = (this.advantage >= this.data.actor.characteristics.i.bonus)
+ }
+
+ onlyModifier ? this.userEntry.testModifier += (+10) : this.changeAdvantage((this.advantage || 0) + 1)
+ }
+ else
+ {
+ onlyModifier ? this.userEntry.testModifier += (-10) : this.changeAdvantage((this.advantage || 0) - 1)
+ }
html.find('[name="advantage"]')[0].value = this.advantage
this.updateValues(html)
@@ -97,7 +108,7 @@ export default class RollDialog extends Dialog {
this.userEntry.testModifier = Number(html.find('[name="testModifier"]').change(ev => {
this.userEntry.testModifier = Number(ev.target.value)
- if (!game.settings.get("wfrp4e", "mooAdvantage"))
+ if (!game.settings.get("wfrp4e", "mooAdvantage") && game.settings.get("wfrp4e", "autoFillAdvantage"))
this.userEntry.testModifier -= (game.settings.get("wfrp4e", "advantageBonus") * this.advantage || 0) || 0
this.updateValues(html)
@@ -117,12 +128,25 @@ export default class RollDialog extends Dialog {
this.updateValues(html)
}).val()
+ this.userEntry.calledShot = 0;
this.selectedHitLocation = html.find('[name="selectedHitLocation"]').change(ev => {
+ // Called Shot - If targeting a specific hit location
+ if (ev.currentTarget.value && !["none", "roll"].includes(ev.currentTarget.value))
+ {
+ // If no talents prevent the penalty from being applied
+ if (!this.data.testData.deadeyeShot && !(this.data.testData.strikeToStun && this.selectedHitLocation.value == "head")) // Deadeye shot and strike to stun not applied
+ this.userEntry.calledShot = -20;
+ else
+ this.userEntry.calledShot = 0;
+ }
+ else {
+ this.userEntry.calledShot = 0;
+ }
this.updateValues(html);
})[0]
- if (!game.settings.get("wfrp4e", "mooAdvantage"))
+ if (!game.settings.get("wfrp4e", "mooAdvantage") && game.settings.get("wfrp4e", "autoFillAdvantage"))
this.userEntry.testModifier -= (game.settings.get("wfrp4e", "advantageBonus") * this.advantage || 0)
else if (game.settings.get("wfrp4e", "mooAdvantage"))
this.userEntry.successBonus -= (this.advantage || 0)
diff --git a/modules/apps/table-config.js b/modules/apps/table-config.js
index 39e048738..8fc193713 100644
--- a/modules/apps/table-config.js
+++ b/modules/apps/table-config.js
@@ -6,7 +6,15 @@ export default class WFRPTableConfig extends RollTableConfig {
return mergeObject(super.defaultOptions, {width: 725})
}
- get template() {
- return "systems/wfrp4e/templates/apps/table-config.html"
+ activateListeners(html)
+ {
+ super.activateListeners(html);
+
+ html.prepend($(`
+
+
+
+
+
`))
}
}
\ No newline at end of file
diff --git a/modules/apps/wfrp-browser.js b/modules/apps/wfrp-browser.js
index 82a21d0a3..d7018dd6b 100644
--- a/modules/apps/wfrp-browser.js
+++ b/modules/apps/wfrp-browser.js
@@ -173,7 +173,14 @@ export default class BrowserWfrp4e extends Application {
async loadItems() {
this.items = [];
this.filterId = 0;
+
+ let packCount = game.packs.size;
+ let packCounter = 0;
+
for (let p of game.packs) {
+ packCounter++;
+ SceneNavigation.displayProgressBar({label: game.i18n.localize("BROWSER.LoadingBrowser"), pct: (packCounter / packCount)*100 })
+
if (p.metadata.type == "Item" && (game.user.isGM || !p.private)) {
await p.getDocuments().then(content => {
this.addItems(content)
@@ -525,8 +532,8 @@ export default class BrowserWfrp4e extends Application {
Hooks.on("renderCompendiumDirectory", (app, html, data) => {
if (game.user.isGM || game.settings.get("wfrp4e", "playerBrowser")) {
- const button = $(``);
- html.find(".directory-footer").append(button);
+ const button = $(``);
+ html.find(".header-actions").append(button);
button.click(ev => {
game.wfrpbrowser.render(true)
diff --git a/modules/hooks/actor.js b/modules/hooks/actor.js
index c5fca8bad..ec82ebc94 100644
--- a/modules/hooks/actor.js
+++ b/modules/hooks/actor.js
@@ -2,6 +2,6 @@ export default function() {
Hooks.on("updateActor", (actor) =>{
- actor.checkWounds();
+ // actor.checkWounds();
})
-}
\ No newline at end of file
+}
diff --git a/modules/hooks/canvas.js b/modules/hooks/canvas.js
index 259628dac..51be7c5eb 100644
--- a/modules/hooks/canvas.js
+++ b/modules/hooks/canvas.js
@@ -4,11 +4,6 @@ import WFRPTokenHUD from "../apps/tokenHUD.js";
export default function() {
Hooks.on("canvasInit", (canvas) => {
- if (!(game.modules.get("fxmaster") && game.modules.get("fxmaster").active)) {
- // canvas.background.filters = [];
- // canvas.foreground.filters = [];
- // canvas.tokens.filters = [];
- }
/**
* Double every other diagonal movement
*/
@@ -46,9 +41,14 @@ export default function() {
if (!(game.modules.get("fxmaster") && game.modules.get("fxmaster").active)) {
let morrsliebActive = canvas.scene.getFlag("wfrp4e", "morrslieb")
if (morrsliebActive) {
- canvas.background.filters.push(CONFIG.Morrslieb)
- canvas.foreground.filters.push(CONFIG.Morrslieb)
- canvas.tokens.filters.push(CONFIG.Morrslieb)
+ if (!canvas.primary.filters)
+ canvas.primary.filters = [];
+ canvas.primary.filters.push(CONFIG.Morrslieb)
+ }
+ else if (canvas.primary.filters?.length)
+ {
+ // If morrslieb is not active, remove any morrslieb filters
+ canvas.primary.filters = canvas.primary.filters.filter(i => !i.morrslieb)
}
}
//canvas.hud.token = new WFRPTokenHUD();
diff --git a/modules/hooks/hotbarDrop.js b/modules/hooks/hotbarDrop.js
index 4c059250c..33531e05a 100644
--- a/modules/hooks/hotbarDrop.js
+++ b/modules/hooks/hotbarDrop.js
@@ -1,59 +1,57 @@
export default function() {
- /**
- * Create a macro when dropping an entity on the hotbar
- * Item - open roll dialog for item
- * Actor - open actor sheet
- * Journal - open journal sheet
- */
- Hooks.on("hotbarDrop", async (bar, data, slot) => {
+ // Needs to be syncrhonous to return false
+ Hooks.on("hotbarDrop", (bar, data, slot) => {
// Create item macro if rollable item - weapon, spell, prayer, trait, or skill
- if (data.type == "Item") {
- if (system.type != "weapon" && system.type != "spell" && system.type != "prayer" && system.type != "trait" && system.type != "skill")
- return
- let item = system
- let command = `game.wfrp4e.utility.rollItemMacro("${item.name}", "${item.type}");`;
- let macro = game.macros.contents.find(m => (m.name === item.name) && (m.command === command));
- if (!macro) {
- macro = await Macro.create({
- name: item.name,
- type: "script",
- img: item.img,
- command: command
- }, { displaySheet: false })
- }
- game.user.assignHotbarMacro(macro, slot);
- }
- // Create a macro to open the actor sheet of the actor dropped on the hotbar
- else if (data.type == "Actor") {
- let actor = game.actors.get(data.id);
- let command = `game.actors.get("${data.id}").sheet.render(true)`
- let macro = game.macros.contents.find(m => (m.name === actor.name) && (m.command === command));
- if (!macro) {
- macro = await Macro.create({
- name: actor.name,
- type: "script",
- img: actor.img,
- command: command
- }, { displaySheet: false })
- game.user.assignHotbarMacro(macro, slot);
- }
- }
- // Create a macro to open the journal sheet of the journal dropped on the hotbar
- else if (data.type == "JournalEntry") {
- let journal = game.journal.get(data.id);
- let command = `game.journal.get("${data.id}").sheet.render(true)`
- let macro = game.macros.contents.find(m => (m.name === journal.name) && (m.command === command));
- if (!macro) {
- macro = await Macro.create({
- name: journal.name,
- type: "script",
- img: "systems/wfrp4e/icons/buildings/scroll.png",
- command: command
- }, { displaySheet: false })
- game.user.assignHotbarMacro(macro, slot);
- }
- }
+ if (data.type == "Item" || data.type == "Actor") {
+ handleMacroCreation(bar, data,slot)
+ return false;
+ };
+
+ })
+}
+
+async function handleMacroCreation(bar, data, slot)
+{
+ let document = await fromUuid(data.uuid)
+
+ if (!document)
+ return
+
+ let macro
+ if (document.documentName == "Item")
+ {
+ if (document.type != "weapon" && document.type != "spell" && document.type != "prayer" && document.type != "trait" && document.type != "skill")
+ return
+ if (!document)
return false;
- });
+
+ let command = `game.wfrp4e.utility.rollItemMacro("${document.name}", "${document.type}");`;
+ macro = game.macros.contents.find(m => (m.name === document.name) && (m.command === command));
+ if (!macro) {
+ macro = await Macro.create({
+ name: document.name,
+ type: "script",
+ img: document.img,
+ command: command
+ }, { displaySheet: false })
+ }
+ }
+ else if (document.documentName == "Actor")
+ {
+ let command = `Hotbar.toggleDocumentSheet("${document.uuid}")`
+ macro = game.macros.contents.find(m => (m.name === document.name) && (m.command === command));
+ if (!macro) {
+ macro = await Macro.create({
+ name: "Display " + document.name,
+ type: "script",
+ img: document.prototypeToken.texture.src,
+ command: command
+ }, { displaySheet: false })
+ }
+ }
+
+
+ game.user.assignHotbarMacro(macro, slot);
}
+
diff --git a/modules/hooks/init.js b/modules/hooks/init.js
index ea2e02ea0..e8a4f7cd0 100644
--- a/modules/hooks/init.js
+++ b/modules/hooks/init.js
@@ -632,7 +632,7 @@ export default function() {
// Load name construction from files
NameGenWfrp._loadNames();
- CONFIG.Morrslieb = new PIXI.filters.AdjustmentFilter({ green: 0.7137, red: 0.302, blue: 0.2275 })
+ CONFIG.Morrslieb = new PIXI.filters.AdjustmentFilter({ green: 0.7137, red: 0.302, blue: 0.2275, morrslieb: true })
CONFIG.MorrsliebObject = {
color: { value:"#4cb53a", apply: true },
gamma: 1.0,
diff --git a/modules/hooks/settings.js b/modules/hooks/settings.js
index 65c0864ea..d3415c881 100644
--- a/modules/hooks/settings.js
+++ b/modules/hooks/settings.js
@@ -9,7 +9,7 @@ export default function() {
{
ui.notifications.notify(game.i18n.format("GroupAdvantageUpdated", {players : setting.value.players, enemies : setting.value.enemies}))
- if (game.user.isGM)
+ if (game.user.isGM && game.combat)
{
// This sorta sucks because there isn't a way to update both actors and synthetic actors in one call
game.combat.combatants.forEach(c => {
diff --git a/modules/hooks/sidebar.js b/modules/hooks/sidebar.js
index 46dc73a08..c2ece0cd3 100644
--- a/modules/hooks/sidebar.js
+++ b/modules/hooks/sidebar.js
@@ -3,6 +3,15 @@ import GeneratorWfrp4e from "../apps/char-gen.js";
export default function() {
Hooks.on("renderSidebarTab", async (app, html) => {
+
+
+ // WFRP styling makes popout sidebars really narrow because of the border so expand it
+ if (app.options.id == "chat" && app.options.popOut)
+ {
+ html[0].style.width = "390px"
+ }
+
+
if (app.options.id == "settings")
{
let button = $(``)
diff --git a/modules/hooks/token.js b/modules/hooks/token.js
index f5e570950..678612c51 100644
--- a/modules/hooks/token.js
+++ b/modules/hooks/token.js
@@ -26,8 +26,17 @@ export default function() {
if (token.actor.isMounted && canvas.scene.id == scene.id)
{
let mount = token.actor.mount;
- let mountToken = new TokenDocument(await mount.getTokenData(), mount)
- mountToken.update({ x : token.x, y : token.y, hidden: token.hidden })
+ let mountToken = await mount.getTokenDocument();
+ mountToken.updateSource({ x : token.x, y : token.y, hidden: token.hidden })
+
+ // Shift token slightly if same size
+ if (mountToken.actor.details.size.value == token.actor.details.size.value)
+ {
+ mountToken.updateSource({
+ x : mountToken.x + canvas.grid.size/4,
+ y : mountToken.y + canvas.grid.size/4
+ })
+ }
mountToken = (await scene.createEmbeddedDocuments("Token", [mountToken]))[0]
await token.update({"flags.wfrp4e.mount" : mountToken.id }) // place mount id in token so when it moves, the mount moves (see updateToken)
token.zIndex = 1 // Ensure rider is on top
@@ -93,8 +102,8 @@ export default function() {
if (!token1 || !token2)
return
- let mountee = hud.object;
- let mounter = hud.object.id == token1.id ? token2 : token1
+ let mountee = hud.object.document;
+ let mounter = hud.object.document.id == token1.id ? token2 : token1
if (game.wfrp4e.config.actorSizeNums[mounter.actor.details.size.value] > game.wfrp4e.config.actorSizeNums[mountee.actor.details.size.value])
{
let temp = mountee;
diff --git a/modules/item/item-wfrp4e.js b/modules/item/item-wfrp4e.js
index c0e02038b..67ba97c68 100644
--- a/modules/item/item-wfrp4e.js
+++ b/modules/item/item-wfrp4e.js
@@ -22,7 +22,7 @@ export default class ItemWfrp4e extends Item {
}
await super._preCreate(data, options, user)
- if (data.img == "icons/svg/item-bag.svg")
+ if (!data.img || data.img == "icons/svg/item-bag.svg")
this.updateSource({ img: "systems/wfrp4e/icons/blank.png" });
if (this.isOwned) {
@@ -415,10 +415,11 @@ export default class ItemWfrp4e extends Item {
*
* @param {Object} htmlOptions Currently unused - example: show secrets?
*/
- getExpandData(htmlOptions) {
+ async getExpandData(htmlOptions) {
+ htmlOptions.async = true;
const data = this[`_${this.type}ExpandData`]();
data.description.value = data.description.value || "";
- data.description.value = TextEditor.enrichHTML(data.description.value, htmlOptions);
+ data.description.value = await TextEditor.enrichHTML(data.description.value, htmlOptions);
data.targetEffects = this.effects.filter(e => e.application == "apply")
data.invokeEffects = this.effects.filter(e => e.trigger == "invoke")
return data;
diff --git a/modules/system/combat.js b/modules/system/combat.js
index 9026c192c..4077fe3f6 100644
--- a/modules/system/combat.js
+++ b/modules/system/combat.js
@@ -352,11 +352,11 @@ export default class CombatHelpers {
if (game.settings.get("wfrp4e","useGroupAdvantage")) {
await WFRP_Utility.updateGroupAdvantage({players : 0, enemies : 0})
- } else {
- for (let turn of combat.turns) {
- turn.actor.update({ "system.status.advantage.value": 0 })
- turn.actor.runEffects("endCombat", combat)
- }
+ }
+
+ for (let turn of combat.turns) {
+ turn.actor.update({ "system.status.advantage.value": 0 }, {skipGroupAdvantage: true})
+ turn.actor.runEffects("endCombat", combat)
}
}
diff --git a/modules/system/overrides.js b/modules/system/overrides.js
index 54daa15ed..4e124461f 100644
--- a/modules/system/overrides.js
+++ b/modules/system/overrides.js
@@ -64,25 +64,6 @@ export default function () {
}
- // Since IDs are maintained in WFRP4e, we have to clean actor imports from their IDs
- function WFRP4eImportFromJson(json) {
- const data = JSON.parse(json);
- delete data._id
- if (data.prototypeToken)
- delete data.prototypeToken.actorId
- this.updateSource(data, {recursive: false});
- return this.update(this.toJSON(), {diff: false, recursive: false});
- }
-
- // keep old functions
- CONFIG.Scene.documentClass.prototype.importFromJSON = WFRP4eImportFromJson;
- CONFIG.JournalEntry.documentClass.prototype.importFromJSON = WFRP4eImportFromJson;
- CONFIG.Actor.documentClass.prototype.importFromJSON = WFRP4eImportFromJson;
- CONFIG.Item.documentClass.prototype.importFromJSON = WFRP4eImportFromJson;
- CONFIG.RollTable.documentClass.prototype.importFromJSON = WFRP4eImportFromJson;
-
-
-
// Modify the initiative formula depending on whether the actor has ranks in the Combat Reflexes talent
Combatant.prototype._getInitiativeFormula = function () {
const actor = this.actor;
diff --git a/modules/system/passengerRender.js b/modules/system/passengerRender.js
index 377a065af..b947b1795 100644
--- a/modules/system/passengerRender.js
+++ b/modules/system/passengerRender.js
@@ -15,8 +15,8 @@ canvas.tokens.placeables.forEach(token => {
rowSize = 4;
colSize = 4;
}
- passengerIconSize *= token.width
- for (let img of token.actor.passengers.map(p => p.actor?.prototypeToken?.img))
+ passengerIconSize *= token.document.width
+ for (let img of token.actor.passengers.map(p => p.actor?.prototypeToken?.texture.src))
{
if (!img)
continue
diff --git a/static/css/wfrp4e.css b/static/css/wfrp4e.css
index 48e810049..1580116b8 100644
--- a/static/css/wfrp4e.css
+++ b/static/css/wfrp4e.css
@@ -1003,9 +1003,6 @@
/* background: grey; */
}
- .sidebar-popout {
- width: 330px;
- }
.sidebar-popout button,
.sidebar-tab .directory-footer button,
#macros .directory-footer button,
@@ -1029,6 +1026,10 @@
font-weight: 500;
text-shadow: 0px 0px 1px #00000063;
}
+
+ .sidebar-popout button i{
+ display:none
+ }
#sidebar .header-actions i,
button i {
font-size: 16px
@@ -1420,7 +1421,7 @@
}
/* ==================== (D) SIDEBAR (COMBAT TRACKER) ========== */
- #combat-popout .combat-tracker-header , #sidebar #combat .combat-tracker-header {
+ .combat-sidebar .combat-tracker-header {
flex: 0 0 64px;
min-height: 73px;
max-height: 73px;
@@ -1432,7 +1433,7 @@
font-weight: 500;
text-shadow: 0px 0px 1px #00000063;
}
- #combat-popout .combat-tracker-header .encounters h4 , #sidebar #combat .combat-tracker-header .encounters h4 {
+ .combat-sidebar .combat-tracker-header .encounters h4 {
flex: 1;
margin: 0;
padding: 0px;
@@ -1445,26 +1446,11 @@
font-size: 17px;
font-weight: var(--actor-input-font-weight);
}
- #combat-popout .combat-tracker-header h3 , #sidebar #combat .combat-tracker-header h3 {
- flex: 1;
- margin: 0px 30px;
- padding: 0px;
- height: 34px;
- font-size: 23px;
- text-align: center;
- line-height: normal;
- color: #d6d6d6;
+ .combat-sidebar .combat-tracker-header h3 {
border: 3px double #5d513e;
background: #080808;
- box-shadow: 0px 0px 10px inset black;
- border-radius: 0px;
- opacity: 1;
- text-shadow: 1px 1px 5px #000000;
}
- #combat-popout .combat-tracker-header .encounters h3 {
- font-size: 19px;
- }
- #combat-popout .combat-tracker-header .combat-cycle , #sidebar #combat .combat-tracker-header .combat-cycle {
+ .combat-sidebar .combat-tracker-header .combat-cycle {
padding: 0px;
margin: 0px;
width: 30px;
@@ -1473,14 +1459,14 @@
position: relative;
top: 0px;
}
- #combat .advantage-groups {
+ .combat-sidebar .advantage-groups {
display : flex;
flex: unset;
justify-content: center;
text-align: center;
}
- #combat .advantage-group {
+ .combat-sidebar .advantage-group {
display : flex;
flex-direction: column;
flex: 1;
@@ -1493,7 +1479,7 @@
background: #290a0ad9;
}
- #combat .advantage-group input {
+ .combat-sidebar .advantage-group input {
box-shadow: 0 0 6px #000 inset;
background: #00000038;
border: 1px solid #564d3a;
@@ -1501,12 +1487,12 @@
}
- #combat-popout #combat-tracker , #sidebar #combat #combat-tracker {
+ .combat-sidebar #combat-tracker {
height: calc(100% - 73px - 50px);
padding: 1px 0;
color: #feffefd6;
}
- #combat-popout .directory-list .directory-item , #sidebar #combat .directory-list .directory-item {
+ .combat-sidebar .directory-list .directory-item {
padding: 1px 3px;
border: 3px groove #564d3a;
box-shadow: 0 0 6px #000 inset;
@@ -1517,7 +1503,7 @@
font-weight: var(--actor-input-font-weight);
color: #dadada;
}
- #combat-popout li.combatant .roll , #sidebar #combat li.combatant .roll {
+ .combat-sidebar li.combatant .roll {
display: block;
width: 40px;
height: 48px;
@@ -1526,10 +1512,10 @@
margin: 0 0.5em;
opacity: 1.0;
}
- #combat-popout li.combatant .roll:hover , #sidebar #combat li.combatant .roll:hover {
+ .combat-sidebar li.combatant .roll:hover {
background-image: url(../ui/buttons/d10-highlight.webp);
}
- #combat-popout li.combatant .token-initiative , #sidebar #combat li.combatant .token-initiative {
+ .combat-sidebar li.combatant .token-initiative {
flex: 0 0 48px;
min-width: 48px;
text-align: center;
@@ -1538,17 +1524,17 @@
font-weight: var(--actor-input-font-weight);
color: #feffefd6;
}
- #combat li.combatant.active .initiative {
+ .combat-sidebar li.combatant.active .initiative {
font-weight: normal;
}
- #combat-popout #combat-controls , #sidebar #combat #combat-controls {
+ .combat-sidebar #combat-controls {
margin: 7px 0px 0px 0px;
border-top: none;
min-height: 50px;
max-height: 50px;
}
- #combat-popout #combat-controls a , #sidebar #combat #combat-controls a {
+ .combat-sidebar #combat-controls a {
margin: 0 2%;
padding: 2px 0px 0px 0px;
height: 34px;
@@ -1556,26 +1542,21 @@
border-image: url(../ui/footer-button.webp) 10 repeat;
border-image-width: 4px;
border-image-outset: 0px;
- box-shadow: 4px 4px 1px #00000085;
background: url(../ui/sidebar_button-background_red.webp) repeat;
- background-origin: padding-box;
- color: #dadada;
font-family: CaslonAntique;
- font-size: var(--font-size-20);
- font-weight: 500;
- text-shadow: 0px 0px 1px #00000063;
+ font-size: var(--font-size-18);
}
- #combat-popout #combat-controls a:hover , #sidebar #combat #combat-controls a:hover {
+ .combat-sidebar #combat-controls a:hover {
box-shadow: 0 0 5px #ff9f00 !important;
}
- #combat-popout #combat-controls .combat-control i , #sidebar #combat #combat-controls .combat-control i {
+ .combat-sidebar #combat-controls .combat-control i {
/* display: contents; */
color: #d0d0d0;
}
- #combat-popout #combat-controls a[title="End Combat"] , #sidebar #combat #combat-controls a[title="End Combat"] {
+ .combat-sidebar #combat-controls a[title="End Combat"] {
padding: 0px 0px 0px 0px;
}
- #combat-popout #combat-controls a[title="Begin Combat"] , #sidebar #combat #combat-controls a[title="Begin Combat"] {
+ .combat-sidebar #combat-controls a[title="Begin Combat"] {
padding: 0px 0px 0px 0px;
}
@@ -12134,6 +12115,7 @@ font-family: var(--actor-input-font-family);
form .form-group span.units {
color: #91908af7;
}
+ .token-sheet .detection-modes header.detection-mode,
.app.window-app .form-group label {
font-family: var(--actor-input-font-family);
font-size: var(--actor-input-font-size);
@@ -12163,6 +12145,8 @@ font-family: var(--actor-input-font-family);
min-width: 30px;
}
+ .token-sheet .detection-modes select,
+ .token-sheet .detection-modes input,
#module-management .list-filters input,
.app.window-app .form-group input {
padding: 1px 3px;
@@ -13247,7 +13231,7 @@ font-family: var(--actor-input-font-family);
}
- .window-app.app.journal-sheet .editor-menu button {
+ .window-app.app .prosemirror .editor-menu button {
width: unset;
margin: unset;
border-image: unset;
@@ -13264,7 +13248,8 @@ font-family: var(--actor-input-font-family);
border-image-outset: 0px;
}
- .window-app.app.journal-sheet button.reveal {
+ .window-app.app .editor-content button.reveal,
+ .window-app.app.journal-sheet button.reveal {
margin: unset;
margin-top: 8px;
padding: 2px 16px 0px 16px;
@@ -13281,6 +13266,11 @@ font-family: var(--actor-input-font-family);
opacity: 0.8;
}
+ .window-app.app .editor-content .revealed button.reveal,
+ .window-app.app.journal-sheet .revealed button.reveal {
+ background: url(../ui/sidebar_button-background_cyan.webp) repeat;
+ }
+
.journal-sheet .directory .directory-header .action-button {
position: unset;
height: unset;
@@ -14051,6 +14041,10 @@ font-style : normal;
right: 34px;
}
+ .compendium-sidebar .browser-btn {
+ flex: 0 0 50px;
+ }
+
.app.window-app.sheet.item-sheet .configure-sheet {
background: url(../ui/buttons/button-configure-sheet.webp);
diff --git a/static/lang/en.json b/static/lang/en.json
index 4eefb0398..43e5f2b29 100644
--- a/static/lang/en.json
+++ b/static/lang/en.json
@@ -504,13 +504,14 @@
"Players": "Players",
"Enemies": "Enemies",
- "BROWSER.Button" : "Browser",
+ "BROWSER.Button" : "Item Browser",
"BROWSER.ItemCategories" : "Item Categories",
"BROWSER.IncludeWorld" : "Include World Items?",
"BROWSER.FilterOptions" : "Filter Options",
"BROWSER.ModifiesDamage" : "Modifies Damage",
"BROWSER.ModifiesRange" : "Modifies Range",
"BROWSER.ItemList" : "Item List",
+ "BROWSER.LoadingBrowser" : "Loading Browser...",
"On Completion": "On Completion",
"ExtendedTest.None" : "None",
diff --git a/static/templates/apps/table-config.html b/static/templates/apps/table-config.html
deleted file mode 100644
index aba22ce28..000000000
--- a/static/templates/apps/table-config.html
+++ /dev/null
@@ -1,152 +0,0 @@
-
\ No newline at end of file
diff --git a/static/templates/browser/browser.html b/static/templates/browser/browser.html
index 8f22fa088..7d4356894 100644
--- a/static/templates/browser/browser.html
+++ b/static/templates/browser/browser.html
@@ -490,9 +490,9 @@ {{localize "BROWSER.ItemList"}}
{{item.name}}
{{#if item.compendium}}
-
+
{{else}}
-
+
{{/if}}
diff --git a/static/templates/chat/chargen/species-select.html b/static/templates/chat/chargen/species-select.html
index ceb54c8e6..b5fbf3aa2 100644
--- a/static/templates/chat/chargen/species-select.html
+++ b/static/templates/chat/chargen/species-select.html
@@ -8,7 +8,7 @@ {{localize "Species"}}
{{/each}}
{{#if roll}}
-{{localize "Roll"}}: {{roll.roll}} - {{roll.name}}
+{{localize "Roll"}}: {{roll.roll}} - {{roll.result}}
{{/if}}
diff --git a/system.json b/system.json
index a7194a2c0..bbd6e8314 100644
--- a/system.json
+++ b/system.json
@@ -42,7 +42,7 @@
}
],
"initiative": "@characteristics.i.value + @characteristics.ag.value/100",
- "background" : "./WFRP-Header.jpg",
+ "background" : "systems/wfrp4e/WFRP-Header.jpg",
"gridDistance": 2,
"gridUnits": "yd",
"primaryTokenAttribute": "status.wounds",