Skip to content

Commit fa0412c

Browse files
committed
add support for ose
1 parent ec5c5fc commit fa0412c

6 files changed

Lines changed: 62 additions & 0 deletions

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+
## [3.0.22](https://github.com/jendave/token-note-hover/blob/main/CHANGELOG.md) (2025-10-xx)
6+
7+
* Added support for [Old-School Essentials](https://foundryvtt.com/packages/ose).
8+
59
## [3.0.21](https://github.com/jendave/token-note-hover/blob/main/CHANGELOG.md) (2025-08-31)
610

711
* Fixed notes for [Draw Steel](https://foundryvtt.com/packages/draw-steel).

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ FoundryVTT v13 only unless otherwise noted.
3434
* [GURPS 4th Edition Game Aid (Unofficial)](https://foundryvtt.com/packages/gurps).
3535
* [Ironsworn/Starforged](https://foundryvtt.com/packages/foundry-ironsworn). FoundryVTT v12 and v13.
3636
* [Level Up: Advanced 5th Edition](https://foundryvtt.com/packages/a5e). FoundryVTT v12 only.
37+
* [Old-School Essentials](https://foundryvtt.com/packages/ose).
3738
* [Pathfinder 1](https://foundryvtt.com/packages/pf1).
3839
* [Pathfinder 2e](https://foundryvtt.com/packages/pf2e). FoundryVTT v12 and v13.
3940
* [Powered by the Apocalpypse](https://foundryvtt.com/packages/pbta).
@@ -249,6 +250,15 @@ https://github.com/jendave/token-note-hover/releases/download/2.1.17/module.json
249250
| **Player Character** | Notes |
250251
| **Non-Player Character** | Notes & Private Notes (GM only) |
251252

253+
### Old-School Essentials
254+
255+
![Screenshot](https://github.com/jendave/token-note-hover/blob/main/docs/screenshot_ose.jpg?raw=true)
256+
257+
| Actor Type | Note Location |
258+
| ------------- | ----------- |
259+
| **Character** | Notes |
260+
| **Monster** | Notes |
261+
252262
### Pathfinder 1st Edition
253263

254264
![Screenshot](https://github.com/jendave/token-note-hover/blob/main/docs/screenshot_pf1.jpg?raw=true)

docs/screenshot_ose.jpg

25.4 KB
Loading

src/module.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,15 @@
294294
"minimum": "1.1.21",
295295
"verified": "1.1"
296296
}
297+
},
298+
{
299+
"id": "ose",
300+
"type": "system",
301+
"manifest": "https://github.com/NecroticGnome/ose-foundry-core/releases/latest/download/system.json",
302+
"compatibility": {
303+
"minimum": "2.1.8",
304+
"verified": "2.1"
305+
}
297306
}
298307
],
299308
"requires": [],

src/scripts/TokenNoteHoverHUD.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import { forbiddenlands } from './systems/forbiddenlands.js';
2626
import { deltagreen } from './systems/deltagreen.js';
2727
import { bladesInTheDark } from './systems/bladesInTheDark.js';
2828
import { pbta } from './systems/pbta.js';
29+
import { ose } from './systems/ose.js';
2930

3031
/**
3132
* A HUD extension that shows the Note preview
@@ -150,6 +151,8 @@ export default class TokenNoteHoverHUD extends foundry.applications.hud.BasePlac
150151
tempContent = await bladesInTheDark(actor, displayImages);
151152
} else if (game.data.system.id === 'pbta') {
152153
tempContent = await pbta(actor, displayImages);
154+
} else if (game.data.system.id === 'ose') {
155+
tempContent = await ose(actor, displayImages);
153156
}
154157

155158
this.contentAvailable = tempContent !== null && tempContent !== '';

src/scripts/systems/ose.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import CONSTANTS from '../constants.js';
2+
import { processNotes } from "../textUtil.js";
3+
4+
export async function ose(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 "character":
14+
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayPC')) {
15+
return await getCharacterNotes(displayImages, actor, actorIsOwner);
16+
} else {
17+
return null;
18+
}
19+
case "monster":
20+
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayNPC')) {
21+
return await getMonsterNotes(displayImages, actor, actorIsOwner);
22+
} else {
23+
return null;
24+
}
25+
default:
26+
return null;
27+
}
28+
}
29+
30+
async function getCharacterNotes(displayImages, actor, actorIsOwner) {
31+
return await processNotes(actor.system?.details?.notes, actorIsOwner, displayImages);
32+
}
33+
34+
async function getMonsterNotes(displayImages, actor, actorIsOwner) {
35+
return await processNotes(actor.system?.details?.biography, actorIsOwner, displayImages);
36+
}

0 commit comments

Comments
 (0)