added spell sheet; reverted side-prop style change

This commit is contained in:
Gesina Schwalbe 2021-01-09 18:26:17 +01:00
parent 4de9d42ee3
commit 7d04ad2309
2 changed files with 85 additions and 1 deletions

View file

@ -9,12 +9,13 @@
.side-property {
margin: 2px 0;
display: grid;
grid-template-columns: minmax(30%, auto) auto;
grid-template-columns: 40% auto;
justify-content: left;
label {
line-height: $default-input-height;
font-weight: bold;
padding-right: 3pt;
}
input,
@ -30,6 +31,17 @@
height: 100%;
margin: 0px;
}
.unit-data-pair {
display: flex;
flex-direction: row;
select {
width: 4em;
}
input {
max-width: 7em;
}
}
}
}

View file

@ -0,0 +1,72 @@
{{!-- ======================================================================== --}}
{{!-- INLINE PARTIAL DEFINITIONS --}}
{{!-- ======================================================================== --}}
{{#*inline "unitDatum" }}
<div class="side-property">
<label>{{localize localizeString}}</label>
<div class="unit-data-pair">
<input class="item-num-val" type="text" data-dtype="String"
name="data.{{property}}.value" value="{{lookup (lookup data property) 'value'}}" />
<select name="data.{{property}}.unit" data-type="String">
{{#select (lookup (lookup data property) 'unit')}}
{{#if (eq unitType 'temporal')}}
{{#each (lookup config 'temporalUnitsAbbr') as |value key|}}<option value="{{key}}">{{value}}</option>{{/each}}
{{else}}
{{#each (lookup config 'distanceUnitsAbbr') as |value key|}}<option value="{{key}}">{{value}}</option>{{/each}}
{{/if}}
{{/select}}
</select>
</div>
</div>
{{/inline}}
{{!-- ======================================================================== --}}
<form class="{{cssClass}}" autocomplete="off">
{{#> systems/ds4/templates/item/partials/sheet-header.hbs}}
<div class="grid grid-4col basic-properties">
<div class="basic-property">
<label for="data.spellType">{{localize "DS4.SpellType"}}</label>
<select name="data.spellType" data-type="String">
{{#select data.spellType}}
{{#each config.spellTypes as |value key|}}
<option value="{{key}}">{{value}}</option>
{{/each}}
{{/select}}
</select>
</div>
<div class="basic-property">
<label for="data.bonus">{{localize "DS4.SpellBonus"}}</label>
<input type="number" name="data.bonus" value="{{data.bonus}}" placeholder="0" data-dtype="Number" />
</div>
</div>
{{/systems/ds4/templates/item/partials/sheet-header.hbs}}
{{!-- Common Item body --}}
{{#> systems/ds4/templates/item/partials/body.hbs}}
<div class="side-property">
<label for="data.spellCategory">{{localize "DS4.SpellCategory"}}</label>
<select name="data.spellCategory" data-type="String">
{{#select data.spellCategory}}
{{#each config.spellCategories as |value key|}}
<option value="{{key}}">{{value}}</option>
{{/each}}
{{/select}}
</select>
</div>
{{> unitDatum data=data property='maxDistance' localizeString='DS4.SpellMaxDistance' unitType='distance' }}
{{> unitDatum data=data property='effectRadius' localizeString='DS4.SpellEffectRadius' unitType='distance' }}
{{> unitDatum data=data property='duration' localizeString='DS4.SpellDuration' unitType='temporal' }}
{{> unitDatum data=data property='cooldownDurationj' localizeString='DS4.SpellCooldownDuration' unitType='temporal' }}
<div class="side-property">
<label for="data.scrollPrice">{{localize "DS4.SpellScrollPriceGold"}}</label>
<input type="number" min="0" max="9999" step="0.01" data-dtype="Number"
name="data.scrollPrice" value="{{data.scrollPrice}}" />
</div>
{{/systems/ds4/templates/item/partials/body.hbs}}
</form>