diff --git a/fvtt-hamalron.mjs b/fvtt-hamalron.mjs
index 07387a0..fd2bc70 100644
--- a/fvtt-hamalron.mjs
+++ b/fvtt-hamalron.mjs
@@ -208,6 +208,48 @@ Hooks.on("getSceneControlButtons", (controls) => {
}
})
+// Add system buttons to the chat log
+Hooks.on("renderChatLog", (chatLog, html) => {
+ const form = html[0]?.querySelector("#chat-form")
+ if (!form || form.querySelector(".hamalron-chat-tools")) return
+
+ const tools = document.createElement("div")
+ tools.className = "hamalron-chat-tools"
+ tools.style.cssText = "display:flex;gap:4px;padding:4px 0;border-bottom:1px solid #333;margin-bottom:4px"
+
+ const addBtn = (icon, label, title, onClick) => {
+ const btn = document.createElement("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"
+ btn.innerHTML = ` ${label}`
+ btn.title = title
+ btn.addEventListener("click", onClick)
+ btn.addEventListener("mouseenter", () => { btn.style.background = "#3a3a6a" })
+ btn.addEventListener("mouseleave", () => { btn.style.background = "#2a2a4a" })
+ tools.appendChild(btn)
+ }
+
+ if (game.user.isGM) {
+ addBtn("fas fa-cards", "Tarot", game.i18n.localize("HAMALRON.TarotDeck.Title"), () => {
+ game.system.api.openTarotDeckManager()
+ })
+ addBtn("fas fa-tasks", "Actions", game.i18n.localize("HAMALRON.ActionComplexe.Title"), () => {
+ game.system.api.openActionComplexe()
+ })
+ }
+ addBtn("fas fa-wand-magic-sparkles", "Sort", "Lancer un sort", () => {
+ const actor = game.user?.character || game.actors?.find(a => a.type === "personnage")
+ if (actor) {
+ const spell = actor.items.find(i => i.type === "sortilege")
+ if (spell) {
+ import("./module/applications/sortilege-casting.mjs").then(m => m.default.prompt(spell, actor))
+ }
+ }
+ })
+
+ form.parentNode.insertBefore(tools, form)
+})
+
// Store card info from initiative rolls for the chat hook
globalThis._initiativeCardMap = new Map()
Hooks.on("createChatMessage", async (message, options, userId) => {