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', () => {
|
||||
|
||||
Reference in New Issue
Block a user