Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

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

## [4.0.6](https://github.com/jendave/token-note-hover/blob/main/CHANGELOG.md) (2026-03-xx)

* Added support for [Cyberpunk RED](https://foundryvtt.com/packages/cyberpunk-red-core)

## [4.0.5](https://github.com/jendave/token-note-hover/blob/main/CHANGELOG.md) (2026-02-25)

* Verified for Foundry v14.
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Many systems are directly supported by [Token Note Hover](https://foundryvtt.com
* [Cairn](#cairn)
* [Call of Cthulhu 7th edition](#call-of-cthulhu-7th-edition)
* [Custom System Builder](#custom-system-builder)
* [Cyberpunk RED](https://foundryvtt.com/packages/cyberpunk-red-core)
* [Cypher System](#cypher-system)
* [D\&D 5E](#dd-5e)
* [Daggerheart](#daggerheart)
Expand Down Expand Up @@ -232,6 +233,20 @@ Then in a Character Actor, use the Template with the following fields:
| **Character** | Notes |
| | Private Notes |

### Cyberpunk RED

[Cyberpunk RED](https://foundryvtt.com/packages/cyberpunk-red-core)

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

| Actor Type | Note Location |
| ---------------- | ---------------- |
| **Black ICE** | Notes |
| **Character** | Player Notes |
| **Container** | Item List |
| **Demon** | Notes |
| **Mook (NPC)** | Player Notes |

### Cypher System

[Cypher System](https://foundryvtt.com/packages/cyphersystem)
Expand Down
Binary file added docs/screenshot_cyberpunkred.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/scripts/TokenNoteHoverHUD.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { dcc } from './systems/dcc.js';
import { mutantyearzero } from './systems/mutant-year-zero.js';
import { wod5e } from './systems/wod5e.js';
import { universalTabletopSystem } from './systems/universal-tabletop-system.js';
import { cyberpunkRedCore } from './systems/cyberpunk-red-core.js';

/**
* A HUD extension that shows the Note preview
Expand Down Expand Up @@ -174,6 +175,8 @@ export default class TokenNoteHoverHUD extends foundry.applications.hud.BasePlac
tempContent = await wod5e(actor, displayImages);
} else if (game.data.system.id === 'universal-tabletop-system') {
tempContent = await universalTabletopSystem(actor, displayImages);
} else if (game.data.system.id === 'cyberpunk-red-core') {
tempContent = await cyberpunkRedCore(actor, displayImages);
}


Expand Down
79 changes: 79 additions & 0 deletions src/scripts/systems/cyberpunk-red-core.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import CONSTANTS from '../constants.js';
import { processNotes } from "../textUtil.js";

export async function cyberpunkRedCore(actor, displayImages) {
// Using a guard here looks cleaner
if (!actor) {
return null;
}

const actorIsOwner = actor.isOwner ?? true;

switch (actor.type) {
case "character":
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayPC')) {
return await getCharacterNotes(displayImages, actor, actorIsOwner);
} else {
return null;
}
case "container":
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayPC')) {
return await getContainerNotes(displayImages, actor, actorIsOwner);
} else {
return null;
}
case "demon":
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayPC')) {
return await getDemonNotes(displayImages, actor, actorIsOwner);
} else {
return null;
}
case "blackIce":
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayPC')) {
return await getDemonNotes(displayImages, actor, actorIsOwner);
} else {
return null;
}
case "mook":
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayNPC')) {
return await getCharacterNotes(displayImages, actor, actorIsOwner);
} else {
return null;
}
default:
return null;
}
}

async function getCharacterNotes(displayImages, actor, actorIsOwner) {
return await processNotes(actor.system?.information?.notes, actorIsOwner, displayImages);
}

async function getDemonNotes(displayImages, actor, actorIsOwner) {
return await processNotes(actor.system?.notes, actorIsOwner, displayImages);
}

async function getContainerNotes(displayImages, actor, actorIsOwner) {
let containerNote = "";
let test ="";
for (let i = 0; i < actor.items.contents.length; i += 1) {
containerNote = containerNote.concat("<div class=\"token-note-hover-hud-h3\">");
containerNote = containerNote.concat(actor.items.contents[i].name);
containerNote = containerNote.concat("</div>");
containerNote = containerNote.concat("<p>");
containerNote = containerNote.concat(actor.items.contents[i].type);
containerNote = containerNote.concat("</p>");
}
return await processNotes(containerNote, actorIsOwner, displayImages);
}

async function getNpcNotes(displayImages, actor, actorIsOwner) {
const privateNotes = actor.system?.information?.notes;
let notes = "";

if (!game.settings.get(CONSTANTS.MODULE_ID, 'hidePrivateNotes') && game.user.isGM && privateNotes) {
notes = privateNotes;
}

return await processNotes(notes, actorIsOwner, displayImages);
}