Auto-import PNJ3
This commit is contained in:
@@ -198,17 +198,18 @@ class BatchNpcDialog extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||
|
||||
Hooks.on('renderActorDirectory', (app, html, data) => {
|
||||
if (!game.user?.isGM) return;
|
||||
if (html.find('.mgt2-batch-npc-btn').length) return;
|
||||
const $html = html instanceof jQuery ? html : $(html);
|
||||
if ($html.find('.mgt2-batch-npc-btn').length) return;
|
||||
|
||||
const btn = $(`<button class="mgt2-batch-npc-btn" style="margin:4px 8px;flex:0;background:#2c2c3e;color:#d9b24c;border:1px solid #c9a227;">
|
||||
<i class="fas fa-users"></i> Importer PNJs par lots
|
||||
</button>`);
|
||||
|
||||
const footer = html.find('.directory-footer');
|
||||
const footer = $html.find('.directory-footer');
|
||||
if (footer.length) {
|
||||
footer.append(btn);
|
||||
} else {
|
||||
html.find('.directory-header').after(btn);
|
||||
$html.find('.directory-header').after(btn);
|
||||
}
|
||||
|
||||
btn.on('click', () => {
|
||||
|
||||
@@ -12,7 +12,7 @@ function buildStartupNoticeHtml() {
|
||||
<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>/commerce</code> <code>/pnj</code> <code>/rencontre</code> <code>/mission</code>
|
||||
<code>/commerce</code> <code>/pnj</code> <code>/rencontre</code> <code>/mission</code> <code>/sector</code> <code>/subsector</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>
|
||||
|
||||
Reference in New Issue
Block a user