diff --git a/model/armor.html b/model/armor.html
index 459fec33..41fd321f 100644
--- a/model/armor.html
+++ b/model/armor.html
@@ -11,7 +11,7 @@
diff --git a/model/character.html b/model/character.html
index 397f282b..06dffcc3 100644
--- a/model/character.html
+++ b/model/character.html
@@ -61,7 +61,7 @@
diff --git a/model/gear.html b/model/gear.html
index 7360bef1..ca5c6c1c 100644
--- a/model/gear.html
+++ b/model/gear.html
@@ -11,7 +11,7 @@
diff --git a/model/tab/main.html b/model/tab/main.html
index 57056aed..1e59508d 100644
--- a/model/tab/main.html
+++ b/model/tab/main.html
@@ -2,21 +2,24 @@
@@ -24,22 +27,22 @@ {{localize "HEADER.ATTRIBUTES"}}
{{localize "HEADER.CONDITION"}}
diff --git a/model/weapon.html b/model/weapon.html
index abb3ddf2..ac4e3d50 100644
--- a/model/weapon.html
+++ b/model/weapon.html
@@ -12,7 +12,7 @@
diff --git a/script/hooks/migration.js b/script/hooks/migration.js
index 754fa72a..3efb1dd7 100644
--- a/script/hooks/migration.js
+++ b/script/hooks/migration.js
@@ -224,5 +224,8 @@ const migrateSettings = async function (worldSchemaVersion) {
game.settings.set("forbidden-lands", "showDescriptionField", true);
game.settings.set("forbidden-lands", "showDrawbackField", true);
game.settings.set("forbidden-lands", "showAppearanceField", true);
- }
+ }
+ if (worldSchemaVersion <= 4) {
+ game.settings.set("forbidden-lands", "alternativeSkulls", false);
+ }
};
diff --git a/script/init.js b/script/init.js
index 371157a1..3d473445 100644
--- a/script/init.js
+++ b/script/init.js
@@ -29,6 +29,14 @@ Hooks.once("init", () => {
default: 0,
type: Number,
});
+ game.settings.register("forbidden-lands", "alternativeSkulls", {
+ name: "Alternative Sheet Interaction",
+ hint: "Changes the look and interaction of Attribute/Bonus/Willpower radio buttons in the Character, Monster and Item sheets.",
+ scope: "world",
+ config: true,
+ default: false,
+ type: Boolean,
+ });
game.settings.register("forbidden-lands", "showCraftingFields", {
name: "Show crafting fields",
hint: "Used to show or hide crafting related fields on item sheets.",
diff --git a/script/sheet/actor.js b/script/sheet/actor.js
index 7ac67eac..98400941 100644
--- a/script/sheet/actor.js
+++ b/script/sheet/actor.js
@@ -2,24 +2,22 @@ import { RollDialog } from "../dialog/roll-dialog.js";
import DiceRoller from "../components/dice-roller.js";
export class ForbiddenLandsActorSheet extends ActorSheet {
+ altInteraction = game.settings.get("forbidden-lands", "alternativeSkulls");
diceRoller = new DiceRoller();
/**
* @override
* Extends the sheet drop handler for system specific usages
*/
- async _onDrop(event)
- {
+ async _onDrop(event) {
let dragData = JSON.parse(event.dataTransfer.getData("text/plain"));
// To be extended if future features add more drop functionality
- if (dragData.type === "itemDrop")
- this.actor.createEmbeddedEntity("OwnedItem", dragData.item)
- else // Call base _onDrop for normal FVTT drop handling
- super._onDrop(event)
+ if (dragData.type === "itemDrop") this.actor.createEmbeddedEntity("OwnedItem", dragData.item);
+ // Call base _onDrop for normal FVTT drop handling
+ else super._onDrop(event);
}
-
activateListeners(html) {
super.activateListeners(html);
@@ -28,9 +26,9 @@ export class ForbiddenLandsActorSheet extends ActorSheet {
const attributeName = $(ev.currentTarget).data("attribute");
const attribute = this.actor.data.data.attribute[attributeName];
let value = attribute.value;
- if (ev.type === "click") {
+ if ((ev.type === "click" && !this.altInteraction) || (ev.type === "contextmenu" && this.altInteraction)) {
value = Math.max(value - 1, 0);
- } else if (ev.type === "contextmenu") {
+ } else if ((ev.type === "contextmenu" && !this.altInteraction) || (ev.type === "click" && this.altInteraction)) {
value = Math.min(value + 1, attribute.max);
}
this.actor.update({
@@ -42,9 +40,9 @@ export class ForbiddenLandsActorSheet extends ActorSheet {
html.find(".change-willpower").on("click contextmenu", (ev) => {
const attribute = this.actor.data.data.bio.willpower;
let value = attribute.value;
- if (ev.type === "click") {
+ if ((ev.type === "click" && !this.altInteraction) || (ev.type === "contextmenu" && this.altInteraction)) {
value = Math.max(value - 1, 0);
- } else if (ev.type === "contextmenu") {
+ } else if ((ev.type === "contextmenu" && !this.altInteraction) || (ev.type === "click" && this.altInteraction)) {
value = Math.min(value + 1, attribute.max);
}
this.actor.update({ "data.bio.willpower.value": value });
@@ -70,9 +68,9 @@ export class ForbiddenLandsActorSheet extends ActorSheet {
const itemId = $(ev.currentTarget).data("itemId");
const item = this.actor.getOwnedItem(itemId);
let value = item.data.data.bonus.value;
- if (ev.type === "click") {
+ if ((ev.type === "click" && !this.altInteraction) || (ev.type === "contextmenu" && this.altInteraction)) {
value = Math.max(value - 1, 0);
- } else if (ev.type === "contextmenu") {
+ } else if ((ev.type === "contextmenu" && !this.altInteraction) || (ev.type === "click" && this.altInteraction)) {
value = Math.min(value + 1, item.data.data.bonus.max);
}
item.update({
@@ -240,7 +238,10 @@ export class ForbiddenLandsActorSheet extends ActorSheet {
});
return modifiers;
}
-
+ async _renderInner(data, options) {
+ data.alternativeSkulls = game.settings.get("forbidden-lands", "alternativeSkulls");
+ return super._renderInner(data, options);
+ }
computerItemEncumbrance(data) {
switch (data.type) {
case "armor":
@@ -254,20 +255,8 @@ export class ForbiddenLandsActorSheet extends ActorSheet {
return 0.5;
case "heavy":
return 2;
- case "3":
- return 3;
- case "4":
- return 4;
- case "5":
- return 5;
- case "6":
- return 6;
- case "7":
- return 7;
- case "8":
- return 8;
default:
- return 1;
+ return data.data.weight || 1;
}
case "rawMaterial":
return 1;
diff --git a/script/sheet/item.js b/script/sheet/item.js
index f799624a..0ea8449a 100644
--- a/script/sheet/item.js
+++ b/script/sheet/item.js
@@ -70,9 +70,10 @@ export class ForbiddenLandsItemSheet extends ItemSheet {
html.find(".change-bonus").on("click contextmenu", (ev) => {
const bonus = this.object.data.data.bonus;
let value = bonus.value;
- if (ev.type === "click") {
+ const altInteraction = game.settings.get("forbidden-lands", "alternativeSkulls");
+ if ((ev.type === "click" && !altInteraction) || (ev.type === "contextmenu" && altInteraction)) {
value = Math.max(value - 1, 0);
- } else if (ev.type === "contextmenu") {
+ } else if ((ev.type === "contextmenu" && !altInteraction) || (ev.type === "click" && altInteraction)) {
value = Math.min(value + 1, bonus.max);
}
this.object.update({
@@ -109,6 +110,7 @@ export class ForbiddenLandsItemSheet extends ItemSheet {
}
async _renderInner(data, options) {
+ data.alternativeSkulls = game.settings.get("forbidden-lands", "alternativeSkulls");
data.data.customRollModifiers = await this.getCustomRollModifiers();
data.showCraftingFields = game.settings.get("forbidden-lands", "showCraftingFields");
data.showCostField = game.settings.get("forbidden-lands", "showCostField");
diff --git a/style/common.css b/style/common.css
index 6e23a11c..8b306da3 100644
--- a/style/common.css
+++ b/style/common.css
@@ -448,3 +448,26 @@ button,
.forbidden-lands .pre-wrap {
white-space: pre-wrap;
}
+
+.fas.fa-circle,
+.far.fa-circle,
+.far.fa-times-circle,
+.far.fa-check-circle {
+ font-size: 14px;
+ color: #333;
+}
+
+.forbidden-lands .broken {
+ color: #a00;
+}
+
+.broken .fas.fa-circle,
+.broken .far.fa-circle,
+.broken .far.fa-times-circle,
+.condition .far.fa-times-circle,
+.broken .far.fa-check-circle {
+ color: #a00;
+}
+.broken .change-willpower .far.fa-circle {
+ color: #333;
+}