initial commit

This commit is contained in:
CPTN Cosmo 2026-01-23 20:06:09 +01:00
commit 4ebe86ee8c
No known key found for this signature in database
8 changed files with 1006 additions and 0 deletions

27
templates/importer.hbs Normal file
View file

@ -0,0 +1,27 @@
<div class="dh-wrapper">
{{#if isInput}}
<div class="form-group">
<label>Import Type</label>
<select name="type">
{{#each types as |label key|}}
<option value="{{key}}">{{label}}</option>
{{/each}}
</select>
</div>
<div class="form-group" style="flex: 1;">
<label>Paste Statblocks</label>
<textarea name="text" placeholder="Paste data here..."></textarea>
</div>
<div class="action-footer">
<button type="button" data-action="parse"><i class="fas fa-search"></i> Review Data</button>
</div>
{{/if}}
{{#if isPreview}}
{{> "modules/dh-importer/templates/preview.hbs"}}
{{/if}}
</div>

51
templates/preview.hbs Normal file
View file

@ -0,0 +1,51 @@
<div class="dh-importer-preview">
<div class="actor-list">
{{#each parsedData as |actor idx|}}
<div class="actor-preview">
<h3>
<span>{{actor.name}}</span>
<small>Tier {{actor.system.tier}} {{actor.system.type}}</small>
</h3>
<div class="stats">
{{#if actor.system.resources.hitPoints.max}}<span><strong>HP:</strong>
{{actor.system.resources.hitPoints.max}}</span>{{/if}}
{{#if actor.system.resources.stress.max}}<span><strong>Stress:</strong>
{{actor.system.resources.stress.max}}</span>{{/if}}
<span><strong>Difficulty:</strong> {{actor.system.difficulty}}</span>
</div>
<div class="features-list">
<h4>Features</h4>
<ul>
{{#each actor.items as |item itemIdx|}}
{{#if (eq item.type "feature")}}
<li class="feature-item">
<strong>{{item.name}}</strong>
{{#if (lookup ../foundFeatures item.name)}}
<div class="feature-match">
<label>
<input type="checkbox" name="useFeatures.{{actor.name}}.{{item.name}}"
value="{{lookup (lookup ../foundFeatures item.name) 'uuid'}}" checked>
Use found in <strong>{{lookup (lookup ../foundFeatures item.name) 'pack'}}</strong>
</label>
</div>
{{else}}
<span class="new-tag">New</span>
{{/if}}
<div class="desc">{{{item.system.description}}}</div>
</li>
{{/if}}
{{/each}}
</ul>
</div>
</div>
{{/each}}
</div>
<div class="action-footer">
<button type="button" data-action="back"><i class="fas fa-arrow-left"></i> Back</button>
<button type="button" data-action="import"><i class="fas fa-file-import"></i> Confirm Import</button>
</div>
</div>