mirror of
https://github.com/RoY7x/worldbuilding.git
synced 2025-07-04 05:37:11 -04:00
12: Add resource attribute type
- Added a resource attribute type to both actors and items with the keys min, value, and max. - Added translation strings for the sublabels on resources.
This commit is contained in:
parent
9bb368d9e2
commit
50041d510c
7 changed files with 77 additions and 5 deletions
|
@ -77,10 +77,30 @@
|
|||
{{#each data.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}}
|
||||
<input class="attribute-value" type="text" name="data.attributes.{{key}}.value" value="{{attr.value}}" data-dtype="{{attr.dtype}}"/>
|
||||
{{!-- 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">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue