Auto-import PNJ3

This commit is contained in:
2026-07-07 21:01:57 +02:00
parent 746f9e23bb
commit bfe24812bd
10 changed files with 18 additions and 26 deletions
+4 -3
View File
@@ -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', () => {