fix: logo de pause — correction sélecteur CSS et hook v13
- Patch GamePause.prototype._prepareContext dans le hook init (hook renderPause n'existe pas en v13, classe = GamePause) - CSS : #pause img (non #pause figure img car #pause est lui-même le <figure>) - Taille 600px / 50vw, halo doré, figcaption masquée Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -35,6 +35,18 @@ Hooks.once("init", () => {
|
||||
console.log(ASCII)
|
||||
console.log(`${SYSTEM_ID} | Initializing Célestopol 1922 system`)
|
||||
|
||||
// Logo de pause : patch de GamePause._prepareContext pour remplacer l'icône
|
||||
const GamePause = foundry.applications.hud?.GamePause ?? globalThis.GamePause
|
||||
if (GamePause) {
|
||||
const _origCtx = GamePause.prototype._prepareContext
|
||||
GamePause.prototype._prepareContext = async function(options) {
|
||||
const ctx = await _origCtx.call(this, options)
|
||||
ctx.icon = "systems/fvtt-celestopol/assets/ui/logo_jeu.png"
|
||||
ctx.spin = false
|
||||
return ctx
|
||||
}
|
||||
}
|
||||
|
||||
// Expose SYSTEM constants in game.system namespace
|
||||
game.celestopol = { SYSTEM }
|
||||
|
||||
@@ -119,14 +131,6 @@ Hooks.once("init", () => {
|
||||
|
||||
/* ─── Ready hook ─────────────────────────────────────────────────────────── */
|
||||
|
||||
// Remplace le logo de pause par celui du jeu
|
||||
Hooks.on("renderPause", (_app, html) => {
|
||||
const root = html instanceof HTMLElement ? html : html[0]
|
||||
if (!root) return
|
||||
const img = root.tagName === "IMG" ? root : root.querySelector("img")
|
||||
if (img) img.src = "systems/fvtt-celestopol/assets/ui/logo_jeu.png"
|
||||
})
|
||||
|
||||
/* ─── Ready hook ─────────────────────────────────────────────────────────── */
|
||||
|
||||
Hooks.once("ready", () => {
|
||||
|
||||
Reference in New Issue
Block a user