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.10](https://github.com/jendave/token-note-hover/blob/main/CHANGELOG.md) (2026-03-23)

* Added support for [LANCER](https://foundryvtt.com/packages/lancer).

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

* Updated *Group* Actor type for [D&D 5E](https://foundryvtt.com/packages/dnd5e).
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Many systems are directly supported by [Token Note Hover](https://foundryvtt.com
* [Forbidden Lands](#forbidden-lands)
* [GURPS 4th Edition Game Aid (Unofficial)](#gurps-4th-edition-game-aid-unofficial)
* [Ironsworn/Starforged](#ironswornstarforged)
* [LANCER](https://foundryvtt.com/packages/lancer)
* [Level Up: Advanced 5th Edition](#level-up-advanced-5th-edition)
* [Mutant Year Zero](#mutant-year-zero)
* [Old-School Essentials](#old-school-essentials)
Expand Down Expand Up @@ -377,6 +378,19 @@ Then in a Character Actor, use the Template with the following fields:
| **Starship** | Notes |
| **Location** | Text entry area |

### LANCER

[LANCER](https://foundryvtt.com/packages/lancer)

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

| Actor Type | Note Location |
| -------------- | ------------- |
| **Deployable** | Details |
| **Mech** | [None] |
| **NPC** | Notes |
| **Pilot** | Notes |

### Level Up: Advanced 5th Edition

[Level Up: Advanced 5th Edition](https://foundryvtt.com/packages/a5e)
Expand Down
Binary file added docs/screenshot_lancer.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 @@ -36,6 +36,7 @@ import { wod5e } from './systems/wod5e.js';
import { universalTabletopSystem } from './systems/universal-tabletop-system.js';
import { starwarsffg } from './systems/starwarsffg.js';
import { sandbox } from './systems/sandbox.js';
import { lancer } from './systems/lancer.js';

/**
* A HUD extension that shows the Note preview
Expand Down Expand Up @@ -180,6 +181,8 @@ export default class TokenNoteHoverHUD extends foundry.applications.hud.BasePlac
tempContent = await starwarsffg(actor, displayImages);
} else if (game.data.system.id === 'sandbox') {
tempContent = await sandbox(actor, displayImages);
} else if (game.data.system.id === 'lancer') {
tempContent = await lancer(actor, displayImages);
}


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

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

const actorIsOwner = actor.isOwner ?? true;

switch (actor.type) {
case "pilot":
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayPC')) {
return await getCharacterNotes(displayImages, actor, actorIsOwner);
} else {
return null;
}
case "deployable":
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayPC')) {
return await getDeployableNotes(displayImages, actor, actorIsOwner);
} else {
return null;
}
case "mech":
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayPC')) {
return await getMechNotes(displayImages, actor, actorIsOwner);
} else {
return null;
}
case "npc":
if (game.settings.get(CONSTANTS.MODULE_ID, 'displayNPC')) {
return await getNpcNotes(displayImages, actor, actorIsOwner);
} else {
return null;
}
default:
return null;
}
}

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

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

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

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

if (!game.settings.get(CONSTANTS.MODULE_ID, 'hidePrivateNotes') && game.user.isGM && privateNotes) {
notes += "<div class=\"token-note-hover-hud-h3\">GM Notes</div>";
notes += privateNotes;
}

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