mirror of
https://github.com/RoY7x/worldbuilding.git
synced 2025-04-30 02:31:41 -04:00
- This commit adds a proof-of-concept for retrieving actor template types. These are actors using the `worldbuilding.isTemplate` flag set to true. If there are multiple actors with that flag set to true, clicking the create actor button will pull up a prompt to choose from one of those types, which will then create an actor by duplicating the template actor's data. The flag will be unset on the new actor.
41 lines
No EOL
2.2 KiB
HTML
41 lines
No EOL
2.2 KiB
HTML
<ol class="attributes-list">
|
|
{{#each attributes as |attr key|}}
|
|
<li class="attribute flexrow" data-attribute="{{key}}">
|
|
<input class="attribute-key" type="text" name="data.attributes.{{key}}.key" value="{{key}}"/>
|
|
{{!-- Handle booleans. --}}
|
|
{{#if attr.isCheckbox}}
|
|
<label class="attribute-value checkbox"><input type="checkbox" name="data.attributes.{{key}}.value" {{checked attr.value}}/></label>
|
|
{{else}}
|
|
{{!-- Handle resources. --}}
|
|
{{#if attr.isResource}}
|
|
<div class="attribute-group flexrow">
|
|
<span class="attribute-col flexcol">
|
|
<label for="data.attributes.{{key}}.min">{{localize "SIMPLE.ResourceMin"}}</label>
|
|
<input class="attribute-value" type="text" name="data.attributes.{{key}}.min" value="{{attr.min}}" data-dtype="{{attr.dtype}}"/>
|
|
</span>
|
|
<span class="attribute-col flexcol">
|
|
<label for="data.attributes.{{key}}.value">{{localize "SIMPLE.ResourceValue"}}</label>
|
|
<input class="attribute-value" type="text" name="data.attributes.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.dtype}}"/>
|
|
</span>
|
|
<span class="attribute-col flexcol">
|
|
<label for="data.attributes.{{key}}.max">{{localize "SIMPLE.ResourceMax"}}</label>
|
|
<input class="attribute-value" type="text" name="data.attributes.{{key}}.max" value="{{attr.max}}" data-dtype="{{attr.dtype}}"/>
|
|
</span>
|
|
</div>
|
|
{{!-- Handle other input types. --}}
|
|
{{else}}
|
|
<input class="attribute-value" type="text" name="data.attributes.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.dtype}}"/>
|
|
{{/if}}
|
|
{{/if}}
|
|
<input class="attribute-label" type="text" name="data.attributes.{{key}}.label" value="{{attr.label}}"/>
|
|
<select class="attribute-dtype" name="data.attributes.{{key}}.dtype">
|
|
{{#select attr.dtype}}
|
|
{{#each ../dtypes as |t|}}
|
|
<option value="{{t}}">{{t}}</option>
|
|
{{/each}}
|
|
{{/select}}
|
|
</select>
|
|
<a class="attribute-control" data-action="delete"><i class="fas fa-trash"></i></a>
|
|
</li>
|
|
{{/each}}
|
|
</ol> |