00bcc775fe
- calendrier impérial : fenêtre compacte (260px), affichage date - commande /cal, auto-ouverture paramétrable dans les settings - socket calendarSync : mise à jour temps réel pour les joueurs - config MJ : année, jour (label live), heure:minute, planète - boutons +1 jour et +1 heure (report 24h→jour, 365→1) - conversions : Solomani, Vilani, Zhodani (Olympiade), Aslan, K'Kree, Hiver - formules wiki.travellerrpg.com/Date_Conversion, section repliable - fix: renderChatInput /cal trop large → exact match - fix: fenêtre refermable (onClose nullifie la référence) - fix: socket joueur lit data direct au lieu de readCalendar()
37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
const MODULE_ID = 'mgt2-compendium-amiral-denisov';
|
||
const STARTUP_NOTICE_FLAG = `${MODULE_ID}.startupNoticePosted`;
|
||
|
||
function isNoticeOwner() {
|
||
if (!game.user?.isGM) return false;
|
||
const activeGM = game.users?.activeGM;
|
||
return !activeGM || activeGM.id === game.user.id;
|
||
}
|
||
|
||
function buildStartupNoticeHtml() {
|
||
return `
|
||
<div style="padding:6px 8px;border-left:4px solid #c9a227;background:#f5f0e8;color:#2c2c3e;line-height:1.45;">
|
||
<strong>MgT2e – outils</strong>
|
||
<span style="color:#6a5422;">·</span>
|
||
<code>/cal</code> <code>/commerce</code> <code>/pnj</code> <code>/rencontre</code> <code>/mission</code> <code>/sector</code>
|
||
<div style="margin-top:2px;font-size:0.92em;color:#6a5422;">
|
||
par <a href="https://www.uberwald.me" target="_blank" rel="noopener noreferrer">LeRatierBretonnien / Uberwald</a>
|
||
</div>
|
||
</div>
|
||
`;
|
||
}
|
||
|
||
Hooks.once('ready', async () => {
|
||
if (!isNoticeOwner()) return;
|
||
if (globalThis[STARTUP_NOTICE_FLAG]) return;
|
||
|
||
globalThis[STARTUP_NOTICE_FLAG] = true;
|
||
|
||
await ChatMessage.create({
|
||
speaker: {
|
||
alias: 'MgT2e - Compendium Amiral Denisov',
|
||
},
|
||
content: buildStartupNoticeHtml(),
|
||
style: CONST.CHAT_MESSAGE_STYLES.OTHER,
|
||
});
|
||
});
|