From 1b24d0223a5963c46b953cb565a9ea1b4eefe5ec Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Mon, 3 Aug 2026 06:38:54 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20publicit=C3=A9=20des=20modules=20premiu?= =?UTF-8?q?m=20en=20tchat=20quand=20ils=20ne=20sont=20pas=20activ=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/bol.css | 24 +++++++++++++++--------- lang/de.json | 3 ++- lang/en.json | 3 ++- lang/es.json | 3 ++- lang/fr.json | 3 ++- module/bol.js | 7 ++++--- styles/global/chat.less | 27 +++++++++++++++++---------- templates/chat/chat-welcome.hbs | 5 ++++- 8 files changed, 48 insertions(+), 27 deletions(-) diff --git a/css/bol.css b/css/bol.css index f486856..96a3b21 100644 --- a/css/bol.css +++ b/css/bol.css @@ -1512,6 +1512,21 @@ h2.bad { .bol-welcome-card .welcome-body a { color: darkred; } +.bol-welcome-card .welcome-body .welcome-premium { + margin-top: 6px; + padding: 6px 10px; + font-size: 0.8rem; + color: #191813; + background: linear-gradient(135deg, #fdf7e6, #f6e8c8); + border: 1px solid #c9a227; + border-left: 4px solid #c9a227; + border-radius: 3px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); +} +.bol-welcome-card .welcome-body .welcome-premium a { + color: #7a5c00; + font-weight: bold; +} .bol-welcome-card .welcome-footer { margin-top: 8px; padding: 4px 10px; @@ -1522,15 +1537,6 @@ h2.bad { border-radius: 4px; letter-spacing: 0.5px; } -.bol-welcome-card .welcome-warning { - margin-top: 6px; - padding: 4px 8px; - font-size: 0.8rem; - color: #7a0000; - background: #fff3f3; - border: 1px solid #e57373; - border-radius: 3px; -} /* Component Styles */ /* ----------------------------------------- */ /* Common Sheet Styles */ diff --git a/lang/de.json b/lang/de.json index 4073b05..d9e879e 100644 --- a/lang/de.json +++ b/lang/de.json @@ -469,7 +469,8 @@ "BOL.chat.welcome4": "Im Discord findet ihr Support für die FoundryVTT-Implementierung dieses Systems: https://discord.gg/pPSDNJk", "BOL.chat.welcome5": "Auf ein gutes Spiel in Lemuria!", "BOL.chat.welcome6": "", - "BOL.chat.bolRulebookMessage": "Don't miss the full Rulebook module (including Sagas) available at : https://www.ludospherik-editions.com/en_gb/ !", + "BOL.chat.bolRulebookMessage": "Don't miss the premium Rulebook module (including Sagas), available on the Foundry website : https://foundryvtt.com/packages/bol-rulebook", + "BOL.chat.bolChroniclesMessage": "Discover the premium Chronicles of Lemuria module (vol. 1), available on the Foundry website : https://foundryvtt.com/packages/bol-chronicles-1", "BOL.settings.rollArmor": "Roll for armor", "BOL.settings.rollArmorTooltip": "Roll for armor value, fixed value if unchecked", diff --git a/lang/en.json b/lang/en.json index 8358eca..fb0a668 100644 --- a/lang/en.json +++ b/lang/en.json @@ -545,7 +545,8 @@ "BOL.chat.criticalbuttonjournal": "Legendary/Heroic Success", "BOL.chat.nodamage": "Do not apply damages", "BOL.chat.armorRoll": "Armor roll", - "BOL.chat.bolRulebookMessage": "Don't miss the full Rulebook module (including Sagas) available at : https://www.ludospherik-editions.com/en_gb/ !", + "BOL.chat.bolRulebookMessage": "Don't miss the premium Rulebook module (including Sagas), available on the Foundry website : https://foundryvtt.com/packages/bol-rulebook", + "BOL.chat.bolChroniclesMessage": "Discover the premium Chronicles of Lemuria module (vol. 1), available on the Foundry website : https://foundryvtt.com/packages/bol-chronicles-1", "BOL.dialog.soeasy": "So easy (+4)", "BOL.dialog.soeasy3": "So easy (+3)", diff --git a/lang/es.json b/lang/es.json index 414eb5b..ac59a14 100644 --- a/lang/es.json +++ b/lang/es.json @@ -535,7 +535,8 @@ "BOL.chat.criticalinfo": "¡Esto es un éxito Asombroso o Legendario! Escoge tus opciones y efectos", "BOL.chat.criticalbuttonjournal": "Éxito Asombroso/Legendario", "BOL.chat.armorRoll": "Tirada de Armadura", - "BOL.chat.bolRulebookMessage": "Don't miss the full Rulebook module (including Sagas) available at : https://www.ludospherik-editions.com/en_gb/ !", + "BOL.chat.bolRulebookMessage": "Don't miss the premium Rulebook module (including Sagas), available on the Foundry website : https://foundryvtt.com/packages/bol-rulebook", + "BOL.chat.bolChroniclesMessage": "Discover the premium Chronicles of Lemuria module (vol. 1), available on the Foundry website : https://foundryvtt.com/packages/bol-chronicles-1", "BOL.dialog.soeasy": "Demasiado fácil (+4)", "BOL.dialog.veryeasy": "Muy fácil (+2)", diff --git a/lang/fr.json b/lang/fr.json index b97b47e..36c37f0 100644 --- a/lang/fr.json +++ b/lang/fr.json @@ -571,7 +571,8 @@ "BOL.chat.criticalinfo": "C'est un succès Héroïque ! Choisissez vos options et effets !", "BOL.chat.criticallegendaryinfo": "C'est un succès Légendaire ! Choisissez vos options et effets !", "BOL.chat.criticalbuttonjournal": "Succès Héroïque/Légendaire", - "BOL.chat.bolRulebookMessage": "N'oubliez pas le module complet du Livre de Règle et des Sagas disponible ici : https://www.ludospherik-editions.com !", + "BOL.chat.bolRulebookMessage": "N'oubliez pas le module premium du Livre de Règle et des Sagas, disponible sur le site Foundry : https://foundryvtt.com/packages/bol-rulebook", + "BOL.chat.bolChroniclesMessage": "Découvrez le module premium des Chroniques de Lémurie (vol. 1), disponible sur le site Foundry : https://foundryvtt.com/packages/bol-chronicles-1", "BOL.chat.losshp": "{name} a perdu {lossHP} points de Vitalité. Si il se repose quelques minutes, il peut récupérer {recupHP} points de Vitalité.", "BOL.chat.applyrecup": "Récupérer pendant quelques minutes (+{recupHP} Vitalité)", "BOL.chat.inforecup": "{name} vient de récupérer {recupHP} points de Vitalité après quelques minutes de repos.", diff --git a/module/bol.js b/module/bol.js index 2d00ccf..c035d8c 100644 --- a/module/bol.js +++ b/module/bol.js @@ -112,14 +112,15 @@ Hooks.once("babele.init", (babele) => { /* -------------------------------------------- */ async function welcomeMessage() { - const noRulebook = !game.modules.find(m => m.id === "bol-rulebook") + const noRulebook = !game.modules.get("bol-rulebook")?.active + const noChronicles = !game.modules.get("bol-chronicles-1")?.active const content = await foundry.applications.handlebars.renderTemplate( "systems/bol/templates/chat/chat-welcome.hbs", - { noRulebook } + { noRulebook, noChronicles } ) ChatMessage.create({ user: game.user.id, whisper: [game.user.id], content }) - if (game.user.isGM && game.i18n.lang == 'en' && !game.modules.find(m => m.id == "babele")) { + if (game.user.isGM && game.i18n.lang == 'en' && !game.modules.get("babele")?.active) { ChatMessage.create({ user: game.user.id, whisper: [game.user.id], diff --git a/styles/global/chat.less b/styles/global/chat.less index 0e51b66..fea32e0 100644 --- a/styles/global/chat.less +++ b/styles/global/chat.less @@ -900,6 +900,23 @@ h2.bad { } a { color: darkred; } + + .welcome-premium { + margin-top: 6px; + padding: 6px 10px; + font-size: 0.8rem; + color: #191813; + background: linear-gradient(135deg, #fdf7e6, #f6e8c8); + border: 1px solid #c9a227; + border-left: 4px solid #c9a227; + border-radius: 3px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); + + a { + color: #7a5c00; + font-weight: bold; + } + } } .welcome-footer { @@ -912,14 +929,4 @@ h2.bad { border-radius: 4px; letter-spacing: 0.5px; } - - .welcome-warning { - margin-top: 6px; - padding: 4px 8px; - font-size: 0.8rem; - color: #7a0000; - background: #fff3f3; - border: 1px solid #e57373; - border-radius: 3px; - } } diff --git a/templates/chat/chat-welcome.hbs b/templates/chat/chat-welcome.hbs index da48d25..f513a26 100644 --- a/templates/chat/chat-welcome.hbs +++ b/templates/chat/chat-welcome.hbs @@ -14,7 +14,10 @@

{{{localize "BOL.chat.welcome5"}}}

{{#if noRulebook}} -

{{{localize "BOL.chat.bolRulebookMessage"}}}

+

⚔️ {{{localize "BOL.chat.bolRulebookMessage"}}}

+ {{/if}} + {{#if noChronicles}} +

📜 {{{localize "BOL.chat.bolChroniclesMessage"}}}

{{/if}}