fix: placement boutons Tarot/Actions/Épreuve dans le chat FVTT v14
- insertion en haut de #chat (avant sidebar-tab-core) au lieu d'insérer avant #chat-controls (caché par le scroll en v14) - remplacement inline styles → classes CSS .hamalron-chat-tools/.hamalron-chat-btn - CSS externalisé dans chat.less
This commit is contained in:
@@ -3151,6 +3151,31 @@ i.fvtt-hamalron {
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 2px;
|
letter-spacing: 2px;
|
||||||
}
|
}
|
||||||
|
/* Chat sidebar tools (Tarot, Actions, Épreuve) */
|
||||||
|
.hamalron-chat-tools {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
display: flex;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 4px 8px;
|
||||||
|
border-bottom: 1px solid #444;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
.hamalron-chat-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 3px 8px;
|
||||||
|
background: #2a2a4a;
|
||||||
|
color: #e0e0e0;
|
||||||
|
border: 1px solid #555;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 11px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.hamalron-chat-btn:hover {
|
||||||
|
background: #3a3a6a;
|
||||||
|
}
|
||||||
.application.dialog.fvtt-hamalron {
|
.application.dialog.fvtt-hamalron {
|
||||||
color: var(--color-dark-1);
|
color: var(--color-dark-1);
|
||||||
background-color: var(--color-light-1);
|
background-color: var(--color-light-1);
|
||||||
|
|||||||
+10
-7
@@ -210,22 +210,19 @@ Hooks.on("getSceneControlButtons", (controls) => {
|
|||||||
|
|
||||||
// Add system buttons to the chat sidebar
|
// Add system buttons to the chat sidebar
|
||||||
function addChatTools() {
|
function addChatTools() {
|
||||||
const controls = document.querySelector("#chat-controls")
|
const chatEl = document.querySelector("#chat")
|
||||||
if (!controls || controls.querySelector(".hamalron-chat-tools")) return
|
if (!chatEl || chatEl.querySelector(".hamalron-chat-tools")) return
|
||||||
|
|
||||||
const tools = document.createElement("div")
|
const tools = document.createElement("div")
|
||||||
tools.className = "hamalron-chat-tools"
|
tools.className = "hamalron-chat-tools"
|
||||||
tools.style.cssText = "display:flex;gap:4px;padding:4px 8px;border-bottom:1px solid #444;margin-bottom:2px;flex-wrap:wrap"
|
|
||||||
|
|
||||||
const addBtn = (icon, label, title, onClick) => {
|
const addBtn = (icon, label, title, onClick) => {
|
||||||
const btn = document.createElement("button")
|
const btn = document.createElement("button")
|
||||||
btn.type = "button"
|
btn.type = "button"
|
||||||
btn.style.cssText = "display:flex;align-items:center;gap:4px;padding:3px 8px;background:#2a2a4a;color:#e0e0e0;border:1px solid #555;border-radius:4px;cursor:pointer;font-size:11px;white-space:nowrap"
|
btn.className = "hamalron-chat-btn"
|
||||||
btn.innerHTML = `<i class="${icon}"></i> <span>${label}</span>`
|
btn.innerHTML = `<i class="${icon}"></i> <span>${label}</span>`
|
||||||
btn.title = title
|
btn.title = title
|
||||||
btn.addEventListener("click", onClick)
|
btn.addEventListener("click", onClick)
|
||||||
btn.addEventListener("mouseenter", () => { btn.style.background = "#3a3a6a" })
|
|
||||||
btn.addEventListener("mouseleave", () => { btn.style.background = "#2a2a4a" })
|
|
||||||
tools.appendChild(btn)
|
tools.appendChild(btn)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -244,7 +241,13 @@ function addChatTools() {
|
|||||||
await HamalronTirageTarot.promptEpreuve(actor)
|
await HamalronTirageTarot.promptEpreuve(actor)
|
||||||
})
|
})
|
||||||
|
|
||||||
controls.parentNode.insertBefore(tools, controls)
|
// Insérer en haut de #chat (avant le sidebar-tab-core)
|
||||||
|
const firstChild = chatEl.firstElementChild
|
||||||
|
if (firstChild) {
|
||||||
|
chatEl.insertBefore(tools, firstChild)
|
||||||
|
} else {
|
||||||
|
chatEl.appendChild(tools)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Hooks.on("renderChatLog", () => setTimeout(addChatTools, 0))
|
Hooks.on("renderChatLog", () => setTimeout(addChatTools, 0))
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
MANIFEST-000006
|
MANIFEST-000011
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -959,3 +959,31 @@
|
|||||||
letter-spacing: 2px;
|
letter-spacing: 2px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Chat sidebar tools (Tarot, Actions, Épreuve) */
|
||||||
|
.hamalron-chat-tools {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
display: flex;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 4px 8px;
|
||||||
|
border-bottom: 1px solid #444;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hamalron-chat-btn {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
padding: 3px 8px;
|
||||||
|
background: #2a2a4a;
|
||||||
|
color: #e0e0e0;
|
||||||
|
border: 1px solid #555;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 11px;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: #3a3a6a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user