fix(templates): complete revision of actor templates to remove duplicates and fix inconsistencies
- Fixed grid-2 to grid-2col CSS class usage
- Replaced improper <p><a> tags with <div><a> in item lists (actor-weapons, actor-defenses, group-items, group-vehicles)
- Fixed typos: smarttlk -> smarttl, compétence -> Compétence
- Fixed duplicate class attributes
- Standardized HTML comments to Handlebars comments ({{!-- --}})
- Added missing localizations for Character and Skills headers
- Removed orphan {{/if}} tag in character-id.hbs
- Created npc-skill-category.hbs partial to eliminate 150+ lines of duplicated skill category code in actor-npc-sheet.hbs
- Created item-list.hbs partial for reusable item list display
- Fixed html.find(...).forEach error in roll.mjs by ensuring jQuery object
- Added .history/ to .gitignore
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -8,7 +8,7 @@ export const registerHooks = function () {
|
||||
/**
|
||||
* Ready hook loads tables, and override's foundry's entity link functions to provide extension to pseudo entities
|
||||
*/
|
||||
CONFIG.debug.hooks = true;
|
||||
CONFIG.debug.hooks = false;
|
||||
Hooks.once('diceSoNiceReady', async (dice3d) => {
|
||||
const vermineSystem = new DiceSystem('Vermine2047', 'Vermine 2047', "preferred", 'totem')
|
||||
dice3d.addSystem(vermineSystem);
|
||||
@@ -66,7 +66,7 @@ export const registerHooks = function () {
|
||||
|
||||
});
|
||||
|
||||
// changement de la pause
|
||||
// changement de la pause
|
||||
Hooks.on("renderPause", async function () {
|
||||
if ($("#pause").attr("class") !== "paused") return;
|
||||
$(".paused img").attr("src", 'systems/vermine2047/assets/images/ui/vermine_pause.webp');
|
||||
@@ -129,7 +129,7 @@ export const registerHooks = function () {
|
||||
Hooks.on("createCombatant", function (combatant) {
|
||||
if (game.user.isGM) {
|
||||
let actor = combatant.actor;
|
||||
|
||||
|
||||
console.log('create combatant', actor);
|
||||
}
|
||||
});*/
|
||||
|
||||
+12
-9
@@ -363,25 +363,28 @@ export class VermineUtils {
|
||||
* @param {HTMLElement} html - The HTML element containing chat events.
|
||||
*/
|
||||
static async chatListenners(html) {
|
||||
// Ensure html is a jQuery object
|
||||
const $html = $(html);
|
||||
|
||||
// Get reroll count
|
||||
const rerollCountElement = html.find('#allowed_reroll')[0];
|
||||
const rerollCountElement = $html.find('#allowed_reroll')[0];
|
||||
const rerollCount = rerollCountElement?.innerText;
|
||||
|
||||
// Enable/disable rerolls based on count
|
||||
if (!rerollCount || parseInt(rerollCount, 10) < 1) {
|
||||
// Disable rerolls for all dice
|
||||
html.find('.die').each(function() {
|
||||
$html.find('.die').each(function() {
|
||||
this.classList.remove("rerollable");
|
||||
});
|
||||
} else {
|
||||
// Enable rerolls for all dice
|
||||
html.find('.die').each(function() {
|
||||
$html.find('.die').each(function() {
|
||||
this.classList.add("rerollable");
|
||||
});
|
||||
}
|
||||
|
||||
// Add click event for rerollable dice
|
||||
html.find('.rerollable').click(async (ev) => {
|
||||
$html.find('.rerollable').click(async (ev) => {
|
||||
ev.preventDefault();
|
||||
const msgId = ev.currentTarget.closest("li.message")?.dataset?.messageId;
|
||||
if (msgId) {
|
||||
@@ -391,17 +394,17 @@ export class VermineUtils {
|
||||
});
|
||||
|
||||
// Update granted reroll label
|
||||
html.find("#effort-reroll").change(ev => {
|
||||
const label = html.find("#granted-reroll")[0];
|
||||
$html.find("#effort-reroll").change(ev => {
|
||||
const label = $html.find("#granted-reroll")[0];
|
||||
if (label) {
|
||||
label.innerText = ev.currentTarget.value;
|
||||
}
|
||||
});
|
||||
|
||||
// Add click event for granting rerolls
|
||||
html.find("button.grant-reroll").click(async (ev) => {
|
||||
const grantedRerollElement = html.find('#granted-reroll')[0];
|
||||
const allowedRerollElement = html.find("#allowed_reroll")[0];
|
||||
$html.find("button.grant-reroll").click(async (ev) => {
|
||||
const grantedRerollElement = $html.find('#granted-reroll')[0];
|
||||
const allowedRerollElement = $html.find("#allowed_reroll")[0];
|
||||
|
||||
if (grantedRerollElement && allowedRerollElement) {
|
||||
allowedRerollElement.innerText = grantedRerollElement.innerText;
|
||||
|
||||
Reference in New Issue
Block a user