fix: Dice So Nice import v14 compat, override Foundry text colors for readability
Release Creation / build (release) Failing after 1m28s

- hooks.mjs: replace static dice-so-nice import with dynamic import
  using game.modules.get('dice-so-nice').id (path removed in v14)
- hooks.mjs: fix permission condition (|| -> &&), jQuery -> vanilla JS
- less/base.less: override --color-text-* and --button-text-color
  for both .themed.theme-dark (AppV2) and body.theme-dark (legacy apps)
- target #settings-config buttons + labels + hints for dark grays
This commit is contained in:
2026-07-12 22:05:45 +02:00
parent dcc24b47ec
commit 90de66d668
44 changed files with 516 additions and 4305 deletions
+15 -9
View File
@@ -1,6 +1,5 @@
import RollDialog from "./dialogs/rollDialog.mjs";
import { initUserDice } from "./dice3d.mjs";
import { DiceSystem } from '../../../../modules/dice-so-nice/api.js';
import { VermineUtils } from "./roll.mjs";
import { registerTours } from "./tour.mjs";
@@ -10,6 +9,9 @@ export const registerHooks = function () {
*/
CONFIG.debug.hooks = false;
Hooks.once('diceSoNiceReady', async (dice3d) => {
const dsnModule = game.modules.get('dice-so-nice');
if (!dsnModule?.active) return;
const { DiceSystem } = await import(`/modules/${dsnModule.id}/api.js`);
const vermineSystem = new DiceSystem('Vermine2047', 'Vermine 2047', "preferred", 'totem')
dice3d.addSystem(vermineSystem);
@@ -43,7 +45,7 @@ export const registerHooks = function () {
if (rerollTitle) {
rerollTitle.addEventListener("click", () => { html.querySelector(".reroll").classList.toggle('visible') })
}
if (message.author?._id != game.user._id || !game.user.isGM) {
if (message.author?._id !== game.user._id && !game.user.isGM) {
// désactiver les inputs pour les joueurs non-auteurs du message
html.querySelectorAll("input").forEach(inp => inp.disabled = true);
//cacher le boutton reroll
@@ -61,17 +63,21 @@ export const registerHooks = function () {
}
})
Hooks.once("ready", async () => {
console.info("Vermine 2047 | System Initialized.");
// System initialized
//await registerTours();
});
// 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');
$(".paused img").css({ "opacity": 1 });
$("#pause.paused figcaption").text("Communauté endormie...");
const pauseEl = document.getElementById("pause");
if (!pauseEl || pauseEl.className !== "paused") return;
pauseEl.querySelectorAll("img").forEach(img => {
img.src = 'systems/vermine2047/assets/images/ui/vermine_pause.webp';
img.style.opacity = 1;
});
const caption = pauseEl.querySelector("figcaption");
if (caption) caption.textContent = "Communauté endormie...";
});
/**
@@ -107,7 +113,7 @@ export const registerHooks = function () {
/* -------------------------------------------- */
Hooks.on("preCreateActor", function (actor) {
console.log('pre create actor', actor.img);
// pre create actor
if (actor.img == "icons/svg/mystery-man.svg") {
actor.updateSource({ "img": `systems/vermine2047/assets/icons/actors/${actor.type}.webp` });
}
@@ -138,7 +144,7 @@ export const registerHooks = function () {
if (game.user.isGM) {
let combatant = (game.combat.combatant) ? game.combat.combatant.actor : "";
console.log('update combat', game.combat);
// update combat
/*if (combatant.type == "marker" && combatant.system.settings.general.isCounter == true) {
let step = (!combatant.system.settings.general.counting) ? -1 : combatant.system.settings.general.counting;