diff --git a/css/fvtt-prism-rpg.css b/css/fvtt-prism-rpg.css index ea9fbd9..93ec45d 100644 --- a/css/fvtt-prism-rpg.css +++ b/css/fvtt-prism-rpg.css @@ -4941,14 +4941,14 @@ i.prismrpg { background: linear-gradient(135deg, #dcedfc 0%, #b0d0f0 100%); border-color: #3a5a7a; } -.palette.status-effects .status-separator { +.status-separator { grid-column: 1 / -1; + display: block; width: 100%; height: 2px; border: none; border-top: 2px solid rgba(255, 255, 255, 0.35); margin: 5px 0; - position: relative; } .application.dialog.prismrpg { color: var(--color-dark-1); diff --git a/hud-test.png b/hud-test.png new file mode 100644 index 0000000..27bddcf Binary files /dev/null and b/hud-test.png differ diff --git a/module/config/effects.mjs b/module/config/effects.mjs index 2c9ac85..f109a24 100644 --- a/module/config/effects.mjs +++ b/module/config/effects.mjs @@ -4,51 +4,51 @@ */ export const AFFLICTIONS = [ // ── Mundane ──────────────────────────────────────────────────────────────── - { id: "aff-alkalized", name: "PRISMRPG.Status.Alkalized", img: "icons/svg/acid.svg", category: "affliction", typing: "mundane" }, - { id: "aff-bleed", name: "PRISMRPG.Status.Bleed", img: "icons/svg/blood.svg", category: "affliction", typing: "mundane" }, - { id: "aff-blind", name: "PRISMRPG.Status.Blind", img: "icons/svg/blind.svg", category: "affliction", typing: "mundane" }, - { id: "aff-deaf", name: "PRISMRPG.Status.Deaf", img: "icons/svg/deaf.svg", category: "affliction", typing: "mundane" }, - { id: "aff-diseased", name: "PRISMRPG.Status.Diseased", img: "icons/svg/biohazard.svg", category: "affliction", typing: "mundane" }, - { id: "aff-distracted", name: "PRISMRPG.Status.Distracted", img: "icons/svg/daze.svg", category: "affliction", typing: "mundane" }, - { id: "aff-exhaustion", name: "PRISMRPG.Status.Exhaustion", img: "icons/svg/sleep.svg", category: "affliction", typing: "mundane" }, - { id: "aff-frightened", name: "PRISMRPG.Status.Frightened", img: "icons/svg/terror.svg", category: "affliction", typing: "mundane" }, - { id: "aff-marked", name: "PRISMRPG.Status.Marked", img: "icons/svg/target.svg", category: "affliction", typing: "both" }, - { id: "aff-mute", name: "PRISMRPG.Status.Mute", img: "icons/svg/silenced.svg", category: "affliction", typing: "mundane" }, - { id: "aff-paralyzed", name: "PRISMRPG.Status.Paralyzed", img: "icons/svg/paralysis.svg", category: "affliction", typing: "mundane" }, - { id: "aff-petrified", name: "PRISMRPG.Status.Petrified", img: "icons/svg/frozen.svg", category: "affliction", typing: "mundane" }, - { id: "aff-poison", name: "PRISMRPG.Status.Poison", img: "icons/svg/poison.svg", category: "affliction", typing: "mundane" }, - { id: "aff-prone", name: "PRISMRPG.Status.Prone", img: "icons/svg/falling.svg", category: "affliction", typing: "mundane" }, - { id: "aff-rage", name: "PRISMRPG.Status.Rage", img: "icons/svg/fire.svg", category: "affliction", typing: "mundane" }, - { id: "aff-sealed", name: "PRISMRPG.Status.Sealed", img: "icons/svg/net.svg", category: "affliction", typing: "mundane" }, - { id: "aff-staggered", name: "PRISMRPG.Status.Staggered", img: "icons/svg/daze.svg", category: "affliction", typing: "mundane" }, - { id: "aff-stunned", name: "PRISMRPG.Status.Stunned", img: "icons/svg/stun.svg", category: "affliction", typing: "mundane" }, - { id: "aff-taunt", name: "PRISMRPG.Status.Taunt", img: "icons/svg/eye.svg", category: "affliction", typing: "mundane" }, - { id: "aff-unconscious",name: "PRISMRPG.Status.Unconscious",img: "icons/svg/unconscious.svg", category: "affliction", typing: "mundane" }, - { id: "aff-wounded", name: "PRISMRPG.Status.Wounded", img: "icons/svg/degen.svg", category: "affliction", typing: "mundane" }, + { id: "aff-alkalized", name: "PRISMRPG.Status.Alkalized", img: "icons/svg/acid.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-bleed", name: "PRISMRPG.Status.Bleed", img: "icons/svg/blood.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-blind", name: "PRISMRPG.Status.Blind", img: "icons/svg/blind.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-deaf", name: "PRISMRPG.Status.Deaf", img: "icons/svg/deaf.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-diseased", name: "PRISMRPG.Status.Diseased", img: "icons/svg/biohazard.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-distracted", name: "PRISMRPG.Status.Distracted", img: "icons/svg/daze.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-exhaustion", name: "PRISMRPG.Status.Exhaustion", img: "icons/svg/sleep.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-frightened", name: "PRISMRPG.Status.Frightened", img: "icons/svg/terror.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-marked", name: "PRISMRPG.Status.Marked", img: "icons/svg/target.svg", category: "affliction", group: "afflictions", order: 1, typing: "both" }, + { id: "aff-mute", name: "PRISMRPG.Status.Mute", img: "icons/svg/silenced.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-paralyzed", name: "PRISMRPG.Status.Paralyzed", img: "icons/svg/paralysis.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-petrified", name: "PRISMRPG.Status.Petrified", img: "icons/svg/frozen.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-poison", name: "PRISMRPG.Status.Poison", img: "icons/svg/poison.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-prone", name: "PRISMRPG.Status.Prone", img: "icons/svg/falling.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-rage", name: "PRISMRPG.Status.Rage", img: "icons/svg/fire.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-sealed", name: "PRISMRPG.Status.Sealed", img: "icons/svg/net.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-staggered", name: "PRISMRPG.Status.Staggered", img: "icons/svg/daze.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, +{ id: "aff-stunned", name: "PRISMRPG.Status.Stunned", img: "icons/svg/explosion.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-taunt", name: "PRISMRPG.Status.Taunt", img: "icons/svg/eye.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-unconscious",name: "PRISMRPG.Status.Unconscious",img: "icons/svg/unconscious.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, + { id: "aff-wounded", name: "PRISMRPG.Status.Wounded", img: "icons/svg/degen.svg", category: "affliction", group: "afflictions", order: 1, typing: "mundane" }, // ── Magic ────────────────────────────────────────────────────────────────── - { id: "aff-banished", name: "PRISMRPG.Status.Banished", img: "icons/svg/wing.svg", category: "affliction", typing: "magic" }, - { id: "aff-seep", name: "PRISMRPG.Status.Seep", img: "icons/svg/acid.svg", category: "affliction", typing: "magic" }, - { id: "aff-sightless", name: "PRISMRPG.Status.Sightless", img: "icons/svg/blind.svg", category: "affliction", typing: "magic" }, - { id: "aff-cursed", name: "PRISMRPG.Status.Cursed", img: "icons/svg/sun.svg", category: "affliction", typing: "magic" }, - { id: "aff-soundless", name: "PRISMRPG.Status.Soundless", img: "icons/svg/deaf.svg", category: "affliction", typing: "magic" }, - { id: "aff-plagued", name: "PRISMRPG.Status.Plagued", img: "icons/svg/biohazard.svg", category: "affliction", typing: "magic" }, - { id: "aff-compulsed", name: "PRISMRPG.Status.Compulsed", img: "icons/svg/eye.svg", category: "affliction", typing: "magic" }, - { id: "aff-fatigue", name: "PRISMRPG.Status.Fatigue", img: "icons/svg/sleep.svg", category: "affliction", typing: "magic" }, - { id: "aff-horror", name: "PRISMRPG.Status.Horror", img: "icons/svg/terror.svg", category: "affliction", typing: "magic" }, - { id: "aff-madness", name: "PRISMRPG.Status.Madness", img: "icons/svg/daze.svg", category: "affliction", typing: "magic" }, - { id: "aff-silenced", name: "PRISMRPG.Status.Silenced", img: "icons/svg/silenced.svg", category: "affliction", typing: "magic" }, - { id: "aff-locked", name: "PRISMRPG.Status.Locked", img: "icons/svg/net.svg", category: "affliction", typing: "magic" }, - { id: "aff-dazed", name: "PRISMRPG.Status.Dazed", img: "icons/svg/daze.svg", category: "affliction", typing: "magic" }, - { id: "aff-numbed", name: "PRISMRPG.Status.Numbed", img: "icons/svg/frozen.svg", category: "affliction", typing: "magic" }, - { id: "aff-comatose", name: "PRISMRPG.Status.Comatose", img: "icons/svg/unconscious.svg", category: "affliction", typing: "magic" }, - { id: "aff-shattered", name: "PRISMRPG.Status.Shattered", img: "icons/svg/blood.svg", category: "affliction", typing: "magic" }, + { id: "aff-banished", name: "PRISMRPG.Status.Banished", img: "icons/svg/wing.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-seep", name: "PRISMRPG.Status.Seep", img: "icons/svg/acid.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-sightless", name: "PRISMRPG.Status.Sightless", img: "icons/svg/blind.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-cursed", name: "PRISMRPG.Status.Cursed", img: "icons/svg/sun.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-soundless", name: "PRISMRPG.Status.Soundless", img: "icons/svg/deaf.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-plagued", name: "PRISMRPG.Status.Plagued", img: "icons/svg/biohazard.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-compulsed", name: "PRISMRPG.Status.Compulsed", img: "icons/svg/eye.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-fatigue", name: "PRISMRPG.Status.Fatigue", img: "icons/svg/sleep.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-horror", name: "PRISMRPG.Status.Horror", img: "icons/svg/terror.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-madness", name: "PRISMRPG.Status.Madness", img: "icons/svg/daze.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-silenced", name: "PRISMRPG.Status.Silenced", img: "icons/svg/silenced.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-locked", name: "PRISMRPG.Status.Locked", img: "icons/svg/net.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-dazed", name: "PRISMRPG.Status.Dazed", img: "icons/svg/daze.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-numbed", name: "PRISMRPG.Status.Numbed", img: "icons/svg/frozen.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-comatose", name: "PRISMRPG.Status.Comatose", img: "icons/svg/unconscious.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-shattered", name: "PRISMRPG.Status.Shattered", img: "icons/svg/blood.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, // ── Elemental (Magic) ────────────────────────────────────────────────────── - { id: "aff-burning", name: "PRISMRPG.Status.Burning", img: "icons/svg/fire.svg", category: "affliction", typing: "magic" }, - { id: "aff-chilled", name: "PRISMRPG.Status.Chilled", img: "icons/svg/frozen.svg", category: "affliction", typing: "magic" }, - { id: "aff-corroded", name: "PRISMRPG.Status.Corroded", img: "icons/svg/acid.svg", category: "affliction", typing: "magic" }, - { id: "aff-necrosis", name: "PRISMRPG.Status.Necrosis", img: "icons/svg/degen.svg", category: "affliction", typing: "magic" }, - { id: "aff-radiated", name: "PRISMRPG.Status.Radiated", img: "icons/svg/lightning.svg", category: "affliction", typing: "magic" }, - { id: "aff-shocked", name: "PRISMRPG.Status.Shocked", img: "icons/svg/lightning.svg", category: "affliction", typing: "magic" }, + { id: "aff-burning", name: "PRISMRPG.Status.Burning", img: "icons/svg/fire.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-chilled", name: "PRISMRPG.Status.Chilled", img: "icons/svg/frozen.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-corroded", name: "PRISMRPG.Status.Corroded", img: "icons/svg/acid.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-necrosis", name: "PRISMRPG.Status.Necrosis", img: "icons/svg/degen.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-radiated", name: "PRISMRPG.Status.Radiated", img: "icons/svg/lightning.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, + { id: "aff-shocked", name: "PRISMRPG.Status.Shocked", img: "icons/svg/lightning.svg", category: "affliction", group: "afflictions", order: 1, typing: "magic" }, ] /** @@ -57,33 +57,33 @@ export const AFFLICTIONS = [ */ export const IMBUEMENTS = [ // ── Mundane ──────────────────────────────────────────────────────────────── - { id: "imb-aided", name: "PRISMRPG.Status.Aided", img: "icons/svg/upgrade.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-alert", name: "PRISMRPG.Status.Alert", img: "icons/svg/eye.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-alkalized", name: "PRISMRPG.Status.Alkalized", img: "icons/svg/acid.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-bestowed", name: "PRISMRPG.Status.Bestowed", img: "icons/svg/angel.svg", category: "imbuement", typing: "both" }, - { id: "imb-concealed", name: "PRISMRPG.Status.Concealed", img: "icons/svg/invisible.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-enhance", name: "PRISMRPG.Status.Enhance", img: "icons/svg/upgrade.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-inspired", name: "PRISMRPG.Status.Inspired", img: "icons/svg/regen.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-keen", name: "PRISMRPG.Status.Keen", img: "icons/svg/eye.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-life-drain", name: "PRISMRPG.Status.LifeDrain", img: "icons/svg/regen.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-madness", name: "PRISMRPG.Status.Madness", img: "icons/svg/daze.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-prepared", name: "PRISMRPG.Status.Prepared", img: "icons/svg/upgrade.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-rage", name: "PRISMRPG.Status.Rage", img: "icons/svg/fire.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-reinforced", name: "PRISMRPG.Status.Reinforced", img: "icons/svg/mage-shield.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-renewed", name: "PRISMRPG.Status.Renewed", img: "icons/svg/regen.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-supplied", name: "PRISMRPG.Status.Supplied", img: "icons/svg/upgrade.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-surged", name: "PRISMRPG.Status.Surged", img: "icons/svg/lightning.svg", category: "imbuement", typing: "mundane" }, - { id: "imb-trance", name: "PRISMRPG.Status.Trance", img: "icons/svg/sleep.svg", category: "imbuement", typing: "mundane" }, + { id: "imb-aided", name: "PRISMRPG.Status.Aided", img: "icons/svg/upgrade.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-alert", name: "PRISMRPG.Status.Alert", img: "icons/svg/eye.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-alkalized", name: "PRISMRPG.Status.Alkalized", img: "icons/svg/acid.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-bestowed", name: "PRISMRPG.Status.Bestowed", img: "icons/svg/angel.svg", category: "imbuement", group: "imbuements", order: 2, typing: "both" }, + { id: "imb-concealed", name: "PRISMRPG.Status.Concealed", img: "icons/svg/invisible.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-enhance", name: "PRISMRPG.Status.Enhance", img: "icons/svg/upgrade.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-inspired", name: "PRISMRPG.Status.Inspired", img: "icons/svg/regen.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-keen", name: "PRISMRPG.Status.Keen", img: "icons/svg/eye.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-life-drain", name: "PRISMRPG.Status.LifeDrain", img: "icons/svg/regen.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-madness", name: "PRISMRPG.Status.Madness", img: "icons/svg/daze.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-prepared", name: "PRISMRPG.Status.Prepared", img: "icons/svg/upgrade.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-rage", name: "PRISMRPG.Status.Rage", img: "icons/svg/fire.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-reinforced", name: "PRISMRPG.Status.Reinforced", img: "icons/svg/mage-shield.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-renewed", name: "PRISMRPG.Status.Renewed", img: "icons/svg/regen.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-supplied", name: "PRISMRPG.Status.Supplied", img: "icons/svg/upgrade.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-surged", name: "PRISMRPG.Status.Surged", img: "icons/svg/lightning.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, + { id: "imb-trance", name: "PRISMRPG.Status.Trance", img: "icons/svg/sleep.svg", category: "imbuement", group: "imbuements", order: 2, typing: "mundane" }, // ── Magic ────────────────────────────────────────────────────────────────── - { id: "imb-blessed", name: "PRISMRPG.Status.Blessed", img: "icons/svg/angel.svg", category: "imbuement", typing: "magic" }, - { id: "imb-anchored", name: "PRISMRPG.Status.Anchored", img: "icons/svg/net.svg", category: "imbuement", typing: "magic" }, - { id: "imb-saturated", name: "PRISMRPG.Status.Saturated", img: "icons/svg/regen.svg", category: "imbuement", typing: "magic" }, - { id: "imb-invisible", name: "PRISMRPG.Status.Invisible", img: "icons/svg/invisible.svg", category: "imbuement", typing: "magic" }, - { id: "imb-enchanted", name: "PRISMRPG.Status.Enchanted", img: "icons/svg/mage-shield.svg", category: "imbuement", typing: "magic" }, - { id: "imb-heroism", name: "PRISMRPG.Status.Heroism", img: "icons/svg/upgrade.svg", category: "imbuement", typing: "magic" }, - { id: "imb-mana-drain", name: "PRISMRPG.Status.ManaDrain", img: "icons/svg/regen.svg", category: "imbuement", typing: "magic" }, - { id: "imb-fury", name: "PRISMRPG.Status.Fury", img: "icons/svg/fire.svg", category: "imbuement", typing: "magic" }, - { id: "imb-warded", name: "PRISMRPG.Status.Warded", img: "icons/svg/holy-shield.svg", category: "imbuement", typing: "magic" }, - { id: "imb-regeneration", name: "PRISMRPG.Status.Regeneration", img: "icons/svg/regen.svg", category: "imbuement", typing: "magic" }, - { id: "imb-haste", name: "PRISMRPG.Status.Haste", img: "icons/svg/wingfoot.svg", category: "imbuement", typing: "magic" }, + { id: "imb-blessed", name: "PRISMRPG.Status.Blessed", img: "icons/svg/angel.svg", category: "imbuement", group: "imbuements", order: 2, typing: "magic" }, + { id: "imb-anchored", name: "PRISMRPG.Status.Anchored", img: "icons/svg/net.svg", category: "imbuement", group: "imbuements", order: 2, typing: "magic" }, + { id: "imb-saturated", name: "PRISMRPG.Status.Saturated", img: "icons/svg/regen.svg", category: "imbuement", group: "imbuements", order: 2, typing: "magic" }, + { id: "imb-invisible", name: "PRISMRPG.Status.Invisible", img: "icons/svg/invisible.svg", category: "imbuement", group: "imbuements", order: 2, typing: "magic" }, + { id: "imb-enchanted", name: "PRISMRPG.Status.Enchanted", img: "icons/svg/mage-shield.svg", category: "imbuement", group: "imbuements", order: 2, typing: "magic" }, + { id: "imb-heroism", name: "PRISMRPG.Status.Heroism", img: "icons/svg/upgrade.svg", category: "imbuement", group: "imbuements", order: 2, typing: "magic" }, + { id: "imb-mana-drain", name: "PRISMRPG.Status.ManaDrain", img: "icons/svg/regen.svg", category: "imbuement", group: "imbuements", order: 2, typing: "magic" }, + { id: "imb-fury", name: "PRISMRPG.Status.Fury", img: "icons/svg/fire.svg", category: "imbuement", group: "imbuements", order: 2, typing: "magic" }, + { id: "imb-warded", name: "PRISMRPG.Status.Warded", img: "icons/svg/holy-shield.svg", category: "imbuement", group: "imbuements", order: 2, typing: "magic" }, + { id: "imb-regeneration", name: "PRISMRPG.Status.Regeneration", img: "icons/svg/regen.svg", category: "imbuement", group: "imbuements", order: 2, typing: "magic" }, + { id: "imb-haste", name: "PRISMRPG.Status.Haste", img: "icons/svg/wingfoot.svg", category: "imbuement", group: "imbuements", order: 2, typing: "magic" }, ] diff --git a/prism-rpg.mjs b/prism-rpg.mjs index 811f7ed..3bb7212 100644 --- a/prism-rpg.mjs +++ b/prism-rpg.mjs @@ -280,18 +280,52 @@ Hooks.on("updateCombat", async (combat, change, _options, _userId) => { }) /** - * Inject a visual separator between Afflictions and Imbuements in the Token HUD status tray + * Inject a visual separator between Afflictions and Imbuements in the Token HUD status tray. + * Supports V11 (jQuery html, .palette.status-effects), V12 (.token-hud .status-effects), + * and V14+ (ApplicationV2, possible restructured DOM). */ -Hooks.on("renderTokenHUD", (_app, html) => { - const tray = html.querySelector(".status-effects") - if (!tray) return +function _injectStatusSeparator(root) { + const tray = ( + root.querySelector(".status-effects") + || root.querySelector(".palette.status-effects") + || root.querySelector("[data-application-part='status-effects']") + || root.querySelector("section.status-effects") + || (root.id === "token-hud" && root.querySelector(".status-effects")) + ) + if (!tray) return false const firstImb = tray.querySelector("[data-status-id^='imb-']") - if (!firstImb) return + if (!firstImb) return false + if (tray.querySelector(".status-separator")) return true const sep = document.createElement("div") sep.className = "status-separator" firstImb.before(sep) + return true +} + +Hooks.on("renderTokenHUD", (app, html) => { + const root = html instanceof jQuery ? html[0] : html + console.log("PRISM HUD hook", {id: root?.id, class: root?.className, trayFound: !!root?.querySelector?.(".status-effects")}) + _injectStatusSeparator(root) }) +// V14 may render effects asynchronously / swap them without re-triggering +// renderTokenHUD; use a MutationObserver on #token-hud as safety net +{ + let observed = false + const obs = new MutationObserver((mutations, self) => { + const hud = document.getElementById("token-hud") + if (!hud) return + if (!observed) { + observed = true + // once the HUD exists, watch its subtree for dynamic effect swaps + const inner = new MutationObserver(() => _injectStatusSeparator(hud)) + inner.observe(hud, { childList: true, subtree: true }) + _injectStatusSeparator(hud) + } + }) + obs.observe(document.body, { childList: true, subtree: true }) +} + /** * Create a macro when dropping an entity on the hotbar * Item - open roll dialog diff --git a/styles/chat.less b/styles/chat.less index 0c2972d..0b63698 100644 --- a/styles/chat.less +++ b/styles/chat.less @@ -624,14 +624,12 @@ } // Token HUD — separator between Afflictions and Imbuements -.palette.status-effects { - .status-separator { - grid-column: 1 / -1; - width: 100%; - height: 2px; - border: none; - border-top: 2px solid rgba(255, 255, 255, 0.35); - margin: 5px 0; - position: relative; - } +.status-separator { + grid-column: 1 / -1; + display: block; + width: 100%; + height: 2px; + border: none; + border-top: 2px solid rgba(255, 255, 255, 0.35); + margin: 5px 0; }