Skip to content

Commit 784911c

Browse files
committed
add new world of darkness 5e system
1 parent 9ef61ea commit 784911c

4 files changed

Lines changed: 84 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
[Token Note Hover](https://foundryvtt.com/packages/token-note-hover)
44

5+
## [4.0.1](https://github.com/jendave/token-note-hover/blob/main/CHANGELOG.md) (2025-12-16)
6+
7+
* Added support for new system of [World of Darkness 5e](https://foundryvtt.com/packages/wod5e).
8+
59
## [4.0.0](https://github.com/jendave/token-note-hover/blob/main/CHANGELOG.md) (2025-12-15)
610

711
* Added hook API for custom content. Direct system support is no longer necessary. A system can use the hook to inject content into a hovered tooltip. Many thanks to [bithr](https://github.com/bithir) for the code contribution.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,8 @@ Then in a Character Actor, use the Template with the following fields:
577577
578578
### World of Darkness 5e
579579
580-
[World of Darkness 5e](https://foundryvtt.com/packages/vtm5e)
580+
[World of Darkness 5e (Archive)](https://foundryvtt.com/packages/vtm5e)
581+
[World of Darkness 5e](https://foundryvtt.com/packages/wod5e)
581582
582583
![Screenshot](https://github.com/jendave/token-note-hover/blob/main/docs/screenshot_vtm5e.jpg?raw=true)
583584

src/scripts/TokenNoteHoverHUD.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { cairn } from './systems/cairn.js';
3232
import { tormenta20 } from './systems/tormenta20.js';
3333
import { dcc } from './systems/dcc.js';
3434
import { mutantyearzero } from './systems/mutant-year-zero.js';
35+
import { wod5e } from './systems/wod5e.js';
3536

3637
/**
3738
* A HUD extension that shows the Note preview
@@ -168,6 +169,8 @@ export default class TokenNoteHoverHUD extends foundry.applications.hud.BasePlac
168169
tempContent = await dcc(actor, displayImages);
169170
} else if (game.data.system.id === 'mutant-year-zero') {
170171
tempContent = await mutantyearzero(actor, displayImages);
172+
} else if (game.data.system.id === 'wod5e') {
173+
tempContent = await wod5e(actor, displayImages);
171174
}
172175

173176

src/scripts/systems/wod5e.js

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import CONSTANTS from '../constants.js';
2+
import { processNotes } from "../textUtil.js";
3+
4+
export async function wod5e(actor, displayImages) {
5+
// Using a guard here looks cleaner
6+
if (!actor) {
7+
return null;
8+
}
9+
10+
const actorIsOwner = actor.isOwner ?? true;
11+
12+
switch (actor.type) {
13+
case "mortal":
14+
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayPC')) {
15+
return await getPrivateNotes(displayImages, actor, actorIsOwner);
16+
} else {
17+
return null;
18+
}
19+
case "ghoul":
20+
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayNPC')) {
21+
return await getPrivateNotes(displayImages, actor, actorIsOwner);
22+
} else {
23+
return null;
24+
}
25+
case "group":
26+
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayPC')) {
27+
return await getPrivateNotes(displayImages, actor, actorIsOwner);
28+
} else {
29+
return null;
30+
}
31+
case "hunter":
32+
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayPC')) {
33+
return await getPrivateNotes(displayImages, actor, actorIsOwner);
34+
} else {
35+
return null;
36+
}
37+
case "spc":
38+
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayNPC')) {
39+
return await getPrivateNotes(displayImages, actor, actorIsOwner);
40+
} else {
41+
return null;
42+
}
43+
case "vampire":
44+
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayPC')) {
45+
return await getPrivateNotes(displayImages, actor, actorIsOwner);
46+
} else {
47+
return null;
48+
}
49+
case "werewolf":
50+
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayPC')) {
51+
return await getPrivateNotes(displayImages, actor, actorIsOwner);
52+
} else {
53+
return null;
54+
}
55+
default:
56+
return null;
57+
}
58+
}
59+
60+
// async function getPublicNotes(displayImages, actor, actorIsOwner) {
61+
// return await processNotes(actor.system?.notes, actorIsOwner, displayImages);
62+
// }
63+
64+
async function getPrivateNotes(displayImages, actor, actorIsOwner) {
65+
const publicNotes = actor.system?.notes;
66+
const privateNotes = actor.system?.privatenotes;
67+
let notes = publicNotes;
68+
69+
if (!game.settings.get(CONSTANTS.MODULE_ID, 'hidePrivateNotes') && game.user.isOwner && privateNotes) {
70+
notes += "<div class=\"token-note-hover-hud-h3\">Private Notes</div>";
71+
notes += privateNotes;
72+
}
73+
74+
return await processNotes(notes, actorIsOwner, displayImages);
75+
}

0 commit comments

Comments
 (0)