[#25] Ensure resource attribute values are clamped between their min and max. Ensure token attribute update deltas are applied correctly to resource attributes. Draw attribute bars appropriately when attribute min is non-zero.

This commit is contained in:
fyorl 2022-01-12 21:03:22 +00:00
parent abc9e949a7
commit d799fb1c56
No known key found for this signature in database
GPG key ID: 3A4E57DAE36AC3C4
5 changed files with 72 additions and 3 deletions

View file

@ -10,7 +10,7 @@ import { SimpleItemSheet } from "./item-sheet.js";
import { SimpleActorSheet } from "./actor-sheet.js";
import { preloadHandlebarsTemplates } from "./templates.js";
import { createWorldbuildingMacro } from "./macro.js";
import { SimpleTokenDocument } from "./simpletokendocument.js";
import { SimpleToken, SimpleTokenDocument } from "./token.js";
/* -------------------------------------------- */
/* Foundry VTT Initialization */
@ -40,9 +40,8 @@ Hooks.once("init", async function() {
// Define custom Document classes
CONFIG.Actor.documentClass = SimpleActor;
CONFIG.Item.documentClass = SimpleItem;
// Update TokenDocument with overrided getBarAttribute method
CONFIG.Token.documentClass = SimpleTokenDocument;
CONFIG.Token.objectClass = SimpleToken;
// Register sheet application classes
Actors.unregisterSheet("core", ActorSheet);