Adds mod management (WIP)
This commit is contained in:
@@ -1,31 +1,77 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<img class="item-img" src="{{item.img}}" data-edit="img" title="{{item.name}}" />
|
||||
<h1><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1>
|
||||
</header>
|
||||
<div class="sheet-content">
|
||||
<table>
|
||||
<tr>
|
||||
<th>{{localize "midgard5.item-quantity"}}</th>
|
||||
<th>{{localize "midgard5.item-value"}}</th>
|
||||
<th>{{localize "midgard5.item-onbody"}}</th>
|
||||
<th>{{localize "midgard5.item-ismagic"}}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input name="data.quantity" type="text" value="{{data.quantity}}" data-dtype="Number" />
|
||||
</td>
|
||||
<td>
|
||||
<input name="data.value" type="text" value="{{data.value}}" data-dtype="Number" />
|
||||
</td>
|
||||
<td>
|
||||
<input name="data.onbody" type="checkbox" {{checked data.onbody}} />
|
||||
</td>
|
||||
<td>
|
||||
<input name="data.magic" type="checkbox" {{checked data.magic}} />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
<form class="{{cssClass}} m5item-item" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<img class="item-img" src="{{item.img}}" data-edit="img" title="{{item.name}}" />
|
||||
<h1><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1>
|
||||
</header>
|
||||
<div class="sheet-content">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<input id="data.magic" type="checkbox" name="data.magic" {{checked data.magic}}>
|
||||
<label for="data.magic">{{localize "midgard5.magic"}}</label>
|
||||
</td>
|
||||
<td>
|
||||
<div class="flexrow">
|
||||
<span>{{localize "midgard5.item-value"}}</span>
|
||||
<input name="data.value" type="text" value="{{data.value}}" data-dtype="Number" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Mods</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th><button class="add-mod">+</button></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each data.mods as |mod modId|}}
|
||||
<tr>
|
||||
<td>
|
||||
<select class="select-mod-type" name="data.mods.{{modId}}.type" data-type="String">
|
||||
{{#select mod.type}}
|
||||
<option value="attribute">{{localize "midgard5.attribute"}}</option>
|
||||
<option value="stat">{{localize "midgard5.bonus"}}</option>
|
||||
<option value="skill">{{localize "midgard5.skill"}}</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<select class="select-id" name="data.mods.{{modId}}.id" data-type="String">
|
||||
{{#select mod.id}}
|
||||
{{#each (lookup ../data.calc.mods modId) as |name key|}}
|
||||
<option value="{{key}}">{{name}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<select class="select-mod-operation" name="data.mods.{{modId}}.operation" data-type="String">
|
||||
{{#select mod.operation}}
|
||||
{{#if (eq mod.type "attribute")}}
|
||||
<option value="add100">{{localize "midgard5.mod-operation-add100"}}</option>
|
||||
{{/if}}
|
||||
<option value="add">{{localize "midgard5.mod-operation-add"}}</option>
|
||||
<option value="set">{{localize "midgard5.mod-operation-set"}}</option>
|
||||
<option value="fixed">{{localize "midgard5.mod-operation-fixed"}}</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<input name="data.mods.{{modId}}.value" type="text" value="{{mod.value}}" data-dtype="Number" />
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
</form>
|
||||
@@ -0,0 +1,60 @@
|
||||
<form class="{{cssClass}}" autocomplete="off">
|
||||
<header class="sheet-header">
|
||||
<img class="item-img" src="{{item.img}}" data-edit="img" title="{{item.name}}" />
|
||||
<h1><input name="name" type="text" value="{{item.name}}" placeholder="Name" /></h1>
|
||||
</header>
|
||||
<div class="sheet-content">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{localize "midgard5.mod-type"}}</td>
|
||||
<td>
|
||||
<select class="select-mod-type" name="data.type" data-type="String">
|
||||
{{#select data.type}}
|
||||
<option value="attribute">{{localize "midgard5.attribute"}}</option>
|
||||
<option value="stat">{{localize "midgard5.bonus"}}</option>
|
||||
<option value="skill">{{localize "midgard5.skill"}}</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{{localize "midgard5.mod-id"}}</td>
|
||||
<td>
|
||||
<select class="select-id" name="data.id" data-type="String">
|
||||
{{#select data.id}}
|
||||
{{#each data.calc.ids as |name key|}}
|
||||
<option value="{{key}}">{{name}}</option>
|
||||
{{/each}}
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{{localize "midgard5.mod-operation"}}</td>
|
||||
<td>
|
||||
<select class="select-mod-operation" name="data.operation" data-type="String">
|
||||
{{#select data.operation}}
|
||||
{{#if (eq data.type "attribute")}}
|
||||
<option value="add100">{{localize "midgard5.mod-operation-add100"}}</option>
|
||||
{{/if}}
|
||||
<option value="add">{{localize "midgard5.mod-operation-add"}}</option>
|
||||
<option value="set">{{localize "midgard5.mod-operation-set"}}</option>
|
||||
<option value="fixed">{{localize "midgard5.mod-operation-fixed"}}</option>
|
||||
{{/select}}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>{{localize "midgard5.mod-value"}}</td>
|
||||
<td><input name="data.value" type="text" value="{{data.value}}" data-dtype="Number" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{{editor content=data.description target="data.description" button=true owner=owner editable=editable}}
|
||||
</div>
|
||||
</form>
|
||||
Reference in New Issue
Block a user