Closed itteerde closed 5 months ago
Hooks.on("renderActorSheet5eCharacter2", (app, [html]) => { if (!app.document.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OBSERVER)) return; const spellTab = html.querySelector(".items-list.spells-list").querySelectorAll(".item-list"); for (const list of spellTab) { const spells = list.querySelectorAll(".item"); for (const spell of spells) { const item = app.document.items.get(spell.dataset.itemId); const uses = item.system.uses; if (uses.max > 0 && uses.per) { const per = (uses.per === "lr" || uses.per === "sr") ? uses.per : ""; const newHTML = ` <div class="item-detail item-range item-casts"> <span class="value">${uses.value}/${uses.max}</span> <span class="unit">${per}</span> </div> `; spell.querySelector(".item-school").insertAdjacentHTML("beforebegin", newHTML); }; }; }; });
https://github.com/foundryvtt/dnd5e/issues/2773
for tonight: works as a player in console, too
Not sure if it is dnd5e already, but certainly is there with the Sidebar improving Module we are currently using (from which's pre-alpha the hotfix code was, too)