feat: batch NPC import, ally/enemy gen, map sync, UI shortcuts

- batch NPC creator: import images from dir → actors (dedup, folder)
- ally/enemy generator: data tables, D66 specials, tests (39 pass)
- sector map sync: DialogV2 player view, socket v13/v14, sync click pos
- actor/scene directory: shortcut buttons (Commerce, PNJ, Map, Sync vue)
- closeImagePopout: GM closes player portraits via socket
- canvasSync: force same canvas view on all players
- FilePicker: v14 folder picker support with v13 fallback
- cleanup: debug logs, template dedup, return guards
This commit is contained in:
2026-07-09 07:49:12 +02:00
parent bfe24812bd
commit 7fc8d2c09c
10 changed files with 337 additions and 84 deletions
+14 -27
View File
@@ -1,48 +1,35 @@
<form class="mgt2-npc-form mgt2-batch-npc-form">
<h3><i class="fas fa-users"></i> Création de PNJs par lots</h3>
<p class="npc-intro">Crée un PNJ pour chaque image trouvée dans un répertoire.</p>
<fieldset>
<legend>Répertoire source</legend>
<div class="form-group-row">
<div class="form-group">
<label for="batch-directory">Chemin du répertoire</label>
<fieldset style="padding:8px 10px;margin:0 0 6px">
<div class="form-group-row" style="gap:8px">
<div class="form-group" style="flex:1;min-width:0">
<label for="batch-directory" style="font-size:0.88em">Répertoire des images</label>
<div class="input-group">
<input id="batch-directory" name="batch.directory" type="text" value="{{batch.directory}}" placeholder="worlds/mon-monde/images/pnjs">
<button type="button" class="btn-small" data-action="browse-directory" title="Parcourir">
<i class="fas fa-folder-open"></i>
</button>
<input id="batch-directory" name="batch.directory" type="text" value="{{batch.directory}}" placeholder="worlds/mon-monde/images">
<button type="button" class="btn-small" data-action="browse-directory" title="Parcourir" style="flex:0 0 28px;padding:2px 4px"><i class="fas fa-folder-open"></i></button>
</div>
<div class="hint">Dans vos données Foundry (Data), ex: <code>worlds/mon-monde/images/pnjs</code></div>
</div>
</div>
</fieldset>
<fieldset>
<legend>Organisation</legend>
<div class="form-group-row">
<div class="form-group">
<label for="batch-folderName">Nom du dossier Acteur</label>
<div class="form-group" style="flex:0 0 180px">
<label for="batch-folderName" style="font-size:0.88em">Dossier Acteur</label>
<input id="batch-folderName" name="batch.folderName" type="text" value="{{batch.folderName}}" placeholder="PNJs importés">
<div class="hint">Les PNJs créés seront rangés dans ce dossier.</div>
</div>
</div>
</fieldset>
<div class="form-group checkbox-group">
<div class="form-group checkbox-group" style="margin:0 0 6px;padding:0 10px">
<label>
<input type="checkbox" name="batch.openSheets" {{#if batch.openSheets}}checked{{/if}}>
Ouvrir la dernière fiche créée
Ouvrir la dernière fiche
</label>
</div>
<div id="batch-progress" class="batch-progress" style="display:none">
<div id="batch-progress" class="batch-progress" style="display:none;margin:0 10px 6px">
<div class="batch-progress-bar"><div class="batch-progress-fill" id="batch-progress-fill"></div></div>
<div class="batch-progress-text" id="batch-progress-text">Initialisation...</div>
<div class="batch-progress-text" id="batch-progress-text" style="font-size:0.78em">Initialisation...</div>
</div>
<div class="form-footer">
<button type="button" class="btn-calculate" data-action="batch-create">
<div class="form-footer" style="padding:6px 10px">
<button type="button" class="btn-calculate" data-action="batch-create" style="padding:4px 12px;font-size:0.85em">
<i class="fas fa-dice-d6"></i> Créer les PNJs
</button>
</div>
+3
View File
@@ -0,0 +1,3 @@
<div style="display:flex;flex-direction:column;height:100%;padding:0;overflow:hidden">
<iframe src="{{url}}" width="100%" height="100%" style="border:none" allow="clipboard-write" referrerpolicy="no-referrer"></iframe>
</div>