diff --git a/src/assets/icons/game-icons/alarm-clock.svg b/src/assets/icons/game-icons/alarm-clock.svg
new file mode 100644
index 0000000..26a4024
--- /dev/null
+++ b/src/assets/icons/game-icons/alarm-clock.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/awareness.svg b/src/assets/icons/game-icons/awareness.svg
new file mode 100644
index 0000000..e39fcf0
--- /dev/null
+++ b/src/assets/icons/game-icons/awareness.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/biceps.svg b/src/assets/icons/game-icons/biceps.svg
new file mode 100644
index 0000000..18c0c44
--- /dev/null
+++ b/src/assets/icons/game-icons/biceps.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/bookshelf.svg b/src/assets/icons/game-icons/bookshelf.svg
new file mode 100644
index 0000000..3e0cfc1
--- /dev/null
+++ b/src/assets/icons/game-icons/bookshelf.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/campfire.svg b/src/assets/icons/game-icons/campfire.svg
new file mode 100644
index 0000000..2edc022
--- /dev/null
+++ b/src/assets/icons/game-icons/campfire.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/card-exchange.svg b/src/assets/icons/game-icons/card-exchange.svg
new file mode 100644
index 0000000..9de4a14
--- /dev/null
+++ b/src/assets/icons/game-icons/card-exchange.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/cash.svg b/src/assets/icons/game-icons/cash.svg
new file mode 100644
index 0000000..883cb3e
--- /dev/null
+++ b/src/assets/icons/game-icons/cash.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/cavalry.svg b/src/assets/icons/game-icons/cavalry.svg
new file mode 100644
index 0000000..6c578bf
--- /dev/null
+++ b/src/assets/icons/game-icons/cavalry.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/charm.svg b/src/assets/icons/game-icons/charm.svg
new file mode 100644
index 0000000..2e7a4d9
--- /dev/null
+++ b/src/assets/icons/game-icons/charm.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/deer-track.svg b/src/assets/icons/game-icons/deer-track.svg
new file mode 100644
index 0000000..c1c55ba
--- /dev/null
+++ b/src/assets/icons/game-icons/deer-track.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/discussion.svg b/src/assets/icons/game-icons/discussion.svg
new file mode 100644
index 0000000..99c39fd
--- /dev/null
+++ b/src/assets/icons/game-icons/discussion.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/hidden.svg b/src/assets/icons/game-icons/hidden.svg
new file mode 100644
index 0000000..65007db
--- /dev/null
+++ b/src/assets/icons/game-icons/hidden.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/jump-across.svg b/src/assets/icons/game-icons/jump-across.svg
new file mode 100644
index 0000000..d80da97
--- /dev/null
+++ b/src/assets/icons/game-icons/jump-across.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/lever.svg b/src/assets/icons/game-icons/lever.svg
new file mode 100644
index 0000000..9b1eb17
--- /dev/null
+++ b/src/assets/icons/game-icons/lever.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/magnifying-glass.svg b/src/assets/icons/game-icons/magnifying-glass.svg
new file mode 100644
index 0000000..140fdbf
--- /dev/null
+++ b/src/assets/icons/game-icons/magnifying-glass.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/mountain-climbing.svg b/src/assets/icons/game-icons/mountain-climbing.svg
new file mode 100644
index 0000000..71a7565
--- /dev/null
+++ b/src/assets/icons/game-icons/mountain-climbing.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/mute.svg b/src/assets/icons/game-icons/mute.svg
new file mode 100644
index 0000000..21bbb11
--- /dev/null
+++ b/src/assets/icons/game-icons/mute.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/padlock-open.svg b/src/assets/icons/game-icons/padlock-open.svg
new file mode 100644
index 0000000..af907af
--- /dev/null
+++ b/src/assets/icons/game-icons/padlock-open.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/poison-bottle.svg b/src/assets/icons/game-icons/poison-bottle.svg
new file mode 100644
index 0000000..a350ee7
--- /dev/null
+++ b/src/assets/icons/game-icons/poison-bottle.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/pool-dive.svg b/src/assets/icons/game-icons/pool-dive.svg
new file mode 100644
index 0000000..83a4607
--- /dev/null
+++ b/src/assets/icons/game-icons/pool-dive.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/robber-hand.svg b/src/assets/icons/game-icons/robber-hand.svg
new file mode 100644
index 0000000..0181390
--- /dev/null
+++ b/src/assets/icons/game-icons/robber-hand.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/rune-stone.svg b/src/assets/icons/game-icons/rune-stone.svg
new file mode 100644
index 0000000..8508581
--- /dev/null
+++ b/src/assets/icons/game-icons/rune-stone.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/shield.svg b/src/assets/icons/game-icons/shield.svg
new file mode 100644
index 0000000..595de04
--- /dev/null
+++ b/src/assets/icons/game-icons/shield.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/sparkles.svg b/src/assets/icons/game-icons/sparkles.svg
new file mode 100644
index 0000000..7260362
--- /dev/null
+++ b/src/assets/icons/game-icons/sparkles.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/two-coins.svg b/src/assets/icons/game-icons/two-coins.svg
new file mode 100644
index 0000000..28f0bb7
--- /dev/null
+++ b/src/assets/icons/game-icons/two-coins.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/uncertainty.svg b/src/assets/icons/game-icons/uncertainty.svg
new file mode 100644
index 0000000..5b0625b
--- /dev/null
+++ b/src/assets/icons/game-icons/uncertainty.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/virus.svg b/src/assets/icons/game-icons/virus.svg
new file mode 100644
index 0000000..1ef38f4
--- /dev/null
+++ b/src/assets/icons/game-icons/virus.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/assets/icons/game-icons/wolf-trap.svg b/src/assets/icons/game-icons/wolf-trap.svg
new file mode 100644
index 0000000..a2c545f
--- /dev/null
+++ b/src/assets/icons/game-icons/wolf-trap.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/src/lang/de.json b/src/lang/de.json
index aef5b49..8e1a9d3 100644
--- a/src/lang/de.json
+++ b/src/lang/de.json
@@ -197,12 +197,14 @@
"DS4.ErrorWrongItemType": "Ein Item vom Type '{expectedType}' wurde erwartet aber das Item '{name}' ({id}) ist vom Typ '{actualType}'.",
"DS4.ErrorUnexpectedAttackType": "Unerwartete Angriffsart '{actualType}', erwartete Angriffarten: {expectedTypes}",
"DS4.ErrorCanvasIsNotInitialized": "Canvas ist noch nicht initialisiert.",
+ "DS4.ErrorCannotDragMissingCheck": "Die Probe '{check}' per Drag & Drop zu ziehen ist nicht möglich, denn sie existiert nicht.",
"DS4.WarningItemMustBeEquippedToBeRolled": "Um für das Item '{name}' ({id}) vom Typ '{type}' zu würfeln, muss es ausgerüstet sein.",
"DS4.WarningMustControlActorToUseRollItemMacro": "Um ein Item-Würfel-Makro zu nutzen muss ein Aktor kontrolliert werden.",
"DS4.WarningMustControlActorToUseRollCheckMacro": "Um ein Proben-Würfel-Makro zu nutzen muss ein Aktor kontrolliert werden.",
"DS4.WarningControlledActorDoesNotHaveItem": "Der kontrollierte Aktor '{actorName}' ({actorId}) hat kein Item mit der ID '{itemId}'.",
"DS4.WarningItemIsNotRollable": "Für das Item '{name}' ({id}) vom Typ '{type}' kann nicht gewürfelt werden.",
"DS4.WarningMacrosCanOnlyBeCreatedForOwnedItems": "Makros können nur für besessene Items angelegt werden.",
+ "DS4.WarningInvalidCheckDropped": "Eine ungültige Probe wurde auf die Hotbar gezogen.",
"DS4.InfoManuallyEnterSpellBonus": "Der korrekte Wert für den Zauberbonus '{spellBonus}' des Zaubers '{name}' musss manuell angegeben werden.",
"DS4.InfoSystemUpdateStart": "Aktualisiere DS4 System von Migrationsversion {currentVersion} auf {targetVersion}. Bitte haben Sie etwas Geduld, schließen Sie nicht das Spiel und fahren Sie nicht den Server herunter.",
"DS4.InfoSystemUpdateCompleted": "Aktualisierung des DS4 Systems von Migrationsversion {currentVersion} auf {targetVersion} erfolgreich!",
@@ -261,7 +263,7 @@
"DS4.ChecksRide": "Reiten",
"DS4.ChecksSearch": "Suchen",
"DS4.ChecksSenseMagic": "Magie Erspüren",
- "DS4.ChecksSneak": "Sneak",
+ "DS4.ChecksSneak": "Schleichen",
"DS4.ChecksStartFire": "Feuer Machen",
"DS4.ChecksSwim": "Schwimmen",
"DS4.ChecksWakeUp": "Erwachen",
diff --git a/src/lang/en.json b/src/lang/en.json
index fc75409..68b2dc4 100644
--- a/src/lang/en.json
+++ b/src/lang/en.json
@@ -197,12 +197,14 @@
"DS4.ErrorWrongItemType": "Expected an item of type '{expectedType}' but item '{name}' ({id}) is of type '{actualType}'.",
"DS4.ErrorUnexpectedAttackType": "Unexpected attack type '{actualType}', expected it to be one of: {expectedTypes}",
"DS4.ErrorCanvasIsNotInitialized": "Canvas is not initialized yet.",
+ "DS4.ErrorCannotDragMissingCheck": "Trying to drag the check '{check}' but no such check exists.",
"DS4.WarningItemMustBeEquippedToBeRolled": "To roll for item '{name}' ({id}) of type '{type}', it needs to be equipped.",
"DS4.WarningMustControlActorToUseRollItemMacro": "You must control an actor to be able to use a roll item macro.",
"DS4.WarningMustControlActorToUseRollCheckMacro": "You must control an actor to be able to use a roll check macro.",
"DS4.WarningControlledActorDoesNotHaveItem": "Your controlled actor '{actorName}' ({actorId}) does not have any item with the id '{itemId}'.",
"DS4.WarningItemIsNotRollable": "Item '{name}' ({id}) of type '{type}' is not rollable.",
"DS4.WarningMacrosCanOnlyBeCreatedForOwnedItems": "Macros can only be created for owned items.",
+ "DS4.WarningInvalidCheckDropped": "An invalid check was dropped on the Hotbar.",
"DS4.InfoManuallyEnterSpellBonus": "The correct value of the spell bonus '{spellBonus}' of the spell '{name}' needs to be entered by manually.",
"DS4.InfoSystemUpdateStart": "Migrating DS4 system from migration version {currentVersion} to {targetVersion}. Please be patient and do not close your game or shut down your server.",
"DS4.InfoSystemUpdateCompleted": "Migration of DS4 system from migration version {currentVersion} to {targetVersion} successful!",
diff --git a/src/module/actor/actor-prepared-data.ts b/src/module/actor/actor-prepared-data.ts
index 85080da..ab23163 100644
--- a/src/module/actor/actor-prepared-data.ts
+++ b/src/module/actor/actor-prepared-data.ts
@@ -58,6 +58,10 @@ interface DS4ActorPreparedDataDataRolling {
export type Check = keyof typeof DS4.i18n.checks;
+export function isCheck(value: string): value is Check {
+ return Object.keys(DS4.i18n.checks).includes(value);
+}
+
type DS4ActorPreparedDataDataChecks = {
[key in Check]: number;
};
diff --git a/src/module/actor/sheets/actor-sheet.ts b/src/module/actor/sheets/actor-sheet.ts
index 72857ce..bbdd8ff 100644
--- a/src/module/actor/sheets/actor-sheet.ts
+++ b/src/module/actor/sheets/actor-sheet.ts
@@ -1,9 +1,11 @@
import { ModifiableDataBaseTotal } from "../../common/common-data";
import { DS4 } from "../../config";
+import { getCanvas } from "../../helpers";
import { DS4Item } from "../../item/item";
import { DS4ItemData } from "../../item/item-data";
import notifications from "../../ui/notifications";
import { DS4Actor } from "../actor";
+import { isCheck } from "../actor-prepared-data";
/**
* The base Sheet class for all DS4 Actors
@@ -27,6 +29,10 @@ export class DS4ActorSheet extends ActorSheet> {
".special-creature-abilities",
],
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "values" }],
+ dragDrop: [
+ { dragSelector: ".item-list .item", dropSelector: null },
+ { dragSelector: ".ds4-check", dropSelector: null },
+ ],
width: 650,
});
}
@@ -240,6 +246,27 @@ export class DS4ActorSheet extends ActorSheet> {
this.actor.rollCheck(check);
}
+ /** @override */
+ _onDragStart(event: DragEvent): void {
+ const target = event.currentTarget as HTMLElement;
+ if (!(target instanceof HTMLElement)) return super._onDragStart(event);
+
+ const check = target.dataset.check;
+ if (!check) return super._onDragStart(event);
+
+ if (!isCheck(check)) throw new Error(game.i18n.format("DS4.ErrorCannotDragMissingCheck", { check }));
+
+ const dragData = {
+ actorId: this.actor.id,
+ sceneId: this.actor.isToken ? getCanvas().scene?.id : null,
+ tokenId: this.actor.isToken ? this.actor.token?.id : null,
+ type: "Check",
+ data: check,
+ };
+
+ event.dataTransfer?.setData("text/plain", JSON.stringify(dragData));
+ }
+
/** @override */
protected async _onDropItem(
event: DragEvent,
diff --git a/src/module/config.ts b/src/module/config.ts
index 2b314cd..8b21668 100644
--- a/src/module/config.ts
+++ b/src/module/config.ts
@@ -334,6 +334,40 @@ export const DS4 = {
spellcasting: "systems/ds4/assets/icons/official/combat-values/spellcasting.png",
targetedSpellcasting: "systems/ds4/assets/icons/official/combat-values/targeted-spellcasting.png",
},
+
+ /**
+ * Define the file paths to check images
+ */
+ checks: {
+ appraise: "systems/ds4/assets/icons/game-icons/two-coins.svg",
+ changeSpell: "systems/ds4/assets/icons/game-icons/card-exchange.svg",
+ climb: "systems/ds4/assets/icons/game-icons/mountain-climbing.svg",
+ communicate: "systems/ds4/assets/icons/game-icons/discussion.svg",
+ decipherScript: "systems/ds4/assets/icons/game-icons/rune-stone.svg",
+ defend: "systems/ds4/assets/icons/game-icons/shield.svg",
+ defyPoison: "systems/ds4/assets/icons/game-icons/poison-bottle.svg",
+ disableTraps: "systems/ds4/assets/icons/game-icons/wolf-trap.svg",
+ featOfStrength: "systems/ds4/assets/icons/game-icons/biceps.svg",
+ flirt: "systems/ds4/assets/icons/game-icons/charm.svg",
+ haggle: "systems/ds4/assets/icons/game-icons/cash.svg",
+ hide: "systems/ds4/assets/icons/game-icons/hidden.svg",
+ identifyMagic: "systems/ds4/assets/icons/game-icons/uncertainty.svg",
+ jump: "systems/ds4/assets/icons/game-icons/jump-across.svg",
+ knowledge: "systems/ds4/assets/icons/game-icons/bookshelf.svg",
+ openLock: "systems/ds4/assets/icons/game-icons/padlock-open.svg",
+ perception: "systems/ds4/assets/icons/game-icons/awareness.svg",
+ pickPocket: "systems/ds4/assets/icons/game-icons/robber-hand.svg",
+ readTracks: "systems/ds4/assets/icons/game-icons/deer-track.svg",
+ resistDisease: "systems/ds4/assets/icons/game-icons/virus.svg",
+ ride: "systems/ds4/assets/icons/game-icons/cavalry.svg",
+ search: "systems/ds4/assets/icons/game-icons/magnifying-glass.svg",
+ senseMagic: "systems/ds4/assets/icons/game-icons/sparkles.svg",
+ sneak: "systems/ds4/assets/icons/game-icons/mute.svg",
+ startFire: "systems/ds4/assets/icons/game-icons/campfire.svg",
+ swim: "systems/ds4/assets/icons/game-icons/pool-dive.svg",
+ wakeUp: "systems/ds4/assets/icons/game-icons/alarm-clock.svg",
+ workMechanism: "systems/ds4/assets/icons/game-icons/lever.svg",
+ },
},
/**
diff --git a/src/module/hooks/hotbar-drop.ts b/src/module/hooks/hotbar-drop.ts
index 8263181..725b870 100644
--- a/src/module/hooks/hotbar-drop.ts
+++ b/src/module/hooks/hotbar-drop.ts
@@ -1,5 +1,7 @@
+import { isCheck } from "../actor/actor-prepared-data";
import { DS4Item } from "../item/item";
import { DS4ItemData } from "../item/item-data";
+import { createRollCheckMacro } from "../macros/roll-check";
import { createRollItemMacro } from "../macros/roll-item";
import notifications from "../ui/notifications";
@@ -21,7 +23,13 @@ export default function registerForHotbarDropHook(): void {
}),
);
}
- await createRollItemMacro(itemData, slot);
+ return createRollItemMacro(itemData, slot);
+ }
+ case "Check": {
+ if (!("data" in data) || typeof data.data !== "string" || !isCheck(data.data)) {
+ return notifications.warn(game.i18n.localize("DS4.WarningInvalidCheckDropped"));
+ }
+ return createRollCheckMacro(data.data, slot);
}
}
});
diff --git a/src/module/macros/roll-check.ts b/src/module/macros/roll-check.ts
index e6d191b..f40ad75 100644
--- a/src/module/macros/roll-check.ts
+++ b/src/module/macros/roll-check.ts
@@ -29,7 +29,7 @@ async function getOrCreateRollCheckMacro(check: Check): Promise {
command,
name: DS4.i18n.checks[check],
type: "script",
- // TODO: img, should be addressed in https://git.f3l.de/dungeonslayers/ds4/-/issues/79
+ img: DS4.icons.checks[check],
flags: { "ds4.checkMacro": true },
},
{ displaySheet: false },