UI: Move the status effect indicators to the right

As the token square is already busy due to the border, the
status effect indicators get hidden.
Move them entirely to the right of the token, so they don't
conflict anymore.

Do it only for PCs, as NPC tokens do not have the border and
the GM will probably have their token UI open more often, which
would hide the status effect indicators.
This commit is contained in:
trotFunky 2025-06-10 23:00:08 +01:00
parent 3914c979b2
commit b1bde69a7d
4 changed files with 13 additions and 5 deletions

View file

@ -21,6 +21,8 @@ Hooks.once("setup", () => {
/** Padding above and below the token, percentage of a grid square. */
const top_bot_padding = 5;
/** Padding left and right the token, percentage of a grid square. */
const left_right_padding = 5;
Hooks.on("drawToken", (drawn_token) => {
/*
@ -49,5 +51,9 @@ Hooks.once("setup", () => {
base_refreshNameplate()
drawn_token.nameplate.position.set(token_width/2, -(padding + drawn_token.nameplate.height))
}
if (drawn_token.document.hasPlayerOwner)
drawn_token.effects.position.x += drawn_token.getSize().width +
drawn_token.scene.grid.size * (left_right_padding/100);
})
})