Update to dnd 0.98 Core with some fixes

Updated to 0.98 core for 0.7.x compatability (untested)

Class Skills are pulling in automatically on class item drop to character sheet.

TODO: Expand automated skill drop for Archetypes

KNOWN ISSUE: init.value is being converted to a string causing some NaN errors on the html.  Initiative was changed to a number instead of a string in 0.98 likely some place is assuming it is still a string.  I had to use Number() on the value because it was forcing other vales to be a string because the value is "".  Maybe someone can fix this
This commit is contained in:
supervj 2020-10-08 02:20:12 -04:00
parent 4bed1d1869
commit 44312146a7
132 changed files with 748 additions and 1010 deletions

View file

@ -17,8 +17,7 @@
{{#unless disableExperience}}
<div class="experience flexrow">
<input name="data.details.xp.value" type="text" value="{{data.details.xp.value}}"
data-dtype="Number" placeholder="0"/>
<input name="data.details.xp.value" type="text" value="{{data.details.xp.value}}" placeholder="0" data-dtype="Number"/>
<span class="sep">/</span>
<span class="max">{{data.details.xp.max}}</span>
</div>
@ -49,17 +48,15 @@
<li class="attribute health">
<h4 class="attribute-name box-title">{{ localize "SW5E.Health" }}</h4>
<div class="attribute-value multiple">
<input name="data.attributes.hp.value" type="text" value="{{data.attributes.hp.value}}"
data-dtype="Number" placeholder="10"/>
<input name="data.attributes.hp.value" type="text" value="{{data.attributes.hp.value}}" placeholder="10" data-dtype="Number"/>
<span class="sep"> / </span>
<input name="data.attributes.hp.max" type="text" value="{{data.attributes.hp.max}}"
data-dtype="Number" placeholder="10"/>
<input name="data.attributes.hp.max" type="text" value="{{data.attributes.hp.max}}" placeholder="10" data-dtype="Number"/>
</div>
<footer class="attribute-footer">
<input name="data.attributes.hp.temp" type="text" class="temphp" placeholder="+{{ localize 'SW5E.Temp' }}"
value="{{data.attributes.hp.temp}}" data-dtype="{{data.attributes.hp.type}}"/>
value="{{data.attributes.hp.temp}}" data-dtype="Number"/>
<input name="data.attributes.hp.tempmax" type="text" class="temphp" placeholder="+{{ localize 'SW5E.Max' }}"
value="{{data.attributes.hp.tempmax}}" data-dtype="{{data.attributes.hp.type}}"/>
value="{{data.attributes.hp.tempmax}}" data-dtype="Number"/>
</footer>
</li>
@ -77,8 +74,7 @@
<li class="attribute">
<h4 class="attribute-name box-title">{{ localize "SW5E.ArmorClass" }}</h4>
<div class="attribute-value">
<input name="data.attributes.ac.value" type="text" value="{{data.attributes.ac.value}}"
data-dtype="Number" placeholder="10"/>
<input name="data.attributes.ac.value" type="number" value="{{data.attributes.ac.value}}" placeholder="10"/>
</div>
<footer class="attribute-footer">
<span class="power-dc">{{localize "SW5E.PowerDC"}} {{data.attributes.powerdc}}</span>
@ -104,7 +100,7 @@
</div>
<footer class="attribute-footer">
<span>{{ localize "SW5E.Modifier" }}</span>
<input name="data.attributes.init.value" type="text" placeholder="0" data-dtype="Number"
<input name="data.attributes.init.value" type="number" placeholder="0"
value="{{numberFormat data.attributes.init.value decimals=0 sign=true}}"/>
</footer>
</li>
@ -131,7 +127,7 @@
{{#each data.abilities as |ability id|}}
<li class="ability {{#if ability.proficient}}proficient{{/if}}" data-ability="{{id}}">
<h4 class="ability-name box-title rollable">{{ability.label}}</h4>
<input class="ability-score" name="data.abilities.{{id}}.value" type="text" value="{{ability.value}}" data-dtype="Number" placeholder="10"/>
<input class="ability-score" name="data.abilities.{{id}}.value" type="number" value="{{ability.value}}" placeholder="10"/>
<div class="ability-modifiers flexrow">
<span class="ability-mod" title="Modifier">{{numberFormat ability.mod decimals=0 sign=true}}</span>
<input type="hidden" name="data.abilities.{{id}}.proficient" value="{{ability.proficient}}" data-dtype="Number"/>
@ -171,11 +167,9 @@
{{ localize "SW5E.AbbreviationSR" }} <input name="data.resources.{{res.name}}.sr" type="checkbox" {{checked res.sr}}/>
</label>
<input name="data.resources.{{res.name}}.value" type="text" value="{{res.value}}"
data-dtype="Number" placeholder="0"/>
<input name="data.resources.{{res.name}}.value" type="number" value="{{res.value}}" placeholder="0"/>
<span class="sep"> / </span>
<input name="data.resources.{{res.name}}.max" type="text" value="{{res.max}}"
data-dtype="Number" placeholder="0"/>
<input name="data.resources.{{res.name}}.max" type="number" value="{{res.max}}" placeholder="0"/>
<label class="recharge checkbox">
{{ localize "SW5E.AbbreviationLR" }} <input name="data.resources.{{res.name}}.lr" type="checkbox" {{checked res.lr}}/>
@ -191,17 +185,17 @@
<h4 class="death-save rollable">{{ localize "SW5E.DeathSave" }}</h4>
<div class="counter-value">
<i class="fas fa-check"></i>
<input type="text" name="data.attributes.death.success" data-dtype="Number" placeholder="0"
<input name="data.attributes.death.success" type="number" placeholder="0"
value="{{data.attributes.death.success}}"/>
<i class="fas fa-times"></i>
<input type="text" name="data.attributes.death.failure" data-dtype="Number" placeholder="0"
<input name="data.attributes.death.failure" type="number" placeholder="0"
value="{{data.attributes.death.failure}}"/>
</div>
</div>
<div class="counter flexrow exhaustion">
<h4>{{ localize "SW5E.Exhaustion" }}</h4>
<div class="counter-value">
<input type="text" name="data.attributes.exhaustion" data-dtype="Number" placeholder="0"
<input name="data.attributes.exhaustion" type="number" placeholder="0"
value="{{data.attributes.exhaustion}}" />
</div>
</div>
@ -237,15 +231,15 @@
{{!-- Biography Tab --}}
<div class="tab flexrow" data-group="primary" data-tab="biography">
<div class="characteristics flexcol">
<label>Appearance</label>
<label>{{ localize "SW5E.Appearance" }}</label>
<textarea name="data.details.appearance">{{data.details.appearance}}</textarea>
<label>Personality Traits</label>
<label>{{ localize "SW5E.PersonalityTraits" }}</label>
<textarea name="data.details.trait">{{data.details.trait}}</textarea>
<label>Ideals</label>
<label>{{ localize "SW5E.Ideals" }}</label>
<textarea name="data.details.ideal">{{data.details.ideal}}</textarea>
<label>Bonds</label>
<label>{{ localize "SW5E.Bonds" }}</label>
<textarea name="data.details.bond">{{data.details.bond}}</textarea>
<label>Flaws</label>
<label>{{ localize "SW5E.Flaws" }}</label>
<textarea name="data.details.flaw">{{data.details.flaw}}</textarea>
</div>
<div class="biography">

View file

@ -40,11 +40,9 @@
<li class="attribute health">
<h4 class="attribute-name box-title rollable">{{ localize "SW5E.Health" }}</h4>
<div class="attribute-value multiple">
<input name="data.attributes.hp.value" type="text" value="{{data.attributes.hp.value}}"
data-dtype="Number" placeholder="10"/>
<input name="data.attributes.hp.value" type="text" value="{{data.attributes.hp.value}}" placeholder="10" data-dtype="Number"/>
<span class="sep"> / </span>
<input name="data.attributes.hp.max" type="text" value="{{data.attributes.hp.max}}"
data-dtype="Number" placeholder="10"/>
<input name="data.attributes.hp.max" type="text" value="{{data.attributes.hp.max}}" placeholder="10" data-dtype="Number"/>
</div>
<footer class="attribute-footer">
<input name="data.attributes.hp.formula" class="hpformula" type="text" placeholder="{{ localize 'SW5E.HealthFormula' }}"
@ -55,8 +53,7 @@
<li class="attribute">
<h4 class="attribute-name box-title">{{ localize "SW5E.ArmorClass" }}</h4>
<div class="attribute-value">
<input name="data.attributes.ac.value" type="text" value="{{data.attributes.ac.value}}"
data-dtype="Number" placeholder="10"/>
<input name="data.attributes.ac.value" type="number" value="{{data.attributes.ac.value}}" placeholder="10"/>
</div>
<footer class="attribute-footer">
<span>{{ localize "SW5E.Proficiency" }}</span>
@ -96,7 +93,7 @@
{{#each data.abilities as |ability id|}}
<li class="ability {{#if ability.proficient}}proficient{{/if}}" data-ability="{{id}}">
<h4 class="ability-name box-title rollable">{{ability.label}}</h4>
<input class="ability-score" name="data.abilities.{{id}}.value" type="text" value="{{ability.value}}" data-dtype="Number" placeholder="10"/>
<input class="ability-score" name="data.abilities.{{id}}.value" type="number" value="{{ability.value}}" placeholder="10"/>
<div class="ability-modifiers flexrow">
<span class="ability-mod" title="Modifier">{{numberFormat ability.mod decimals=0 sign=true}}</span>
<input type="hidden" name="data.abilities.{{id}}.proficient" value="{{ability.proficient}}" data-dtype="Number"/>
@ -128,21 +125,17 @@
<div class="counter flexrow legendary">
<h4>{{ localize "SW5E.LegAct" }}</h4>
<div class="counter-value">
<input type="text" name="data.resources.legact.value" data-dtype="Number" placeholder="0"
value="{{data.resources.legact.value}}"/>
<input name="data.resources.legact.value" type="number" value="{{data.resources.legact.value}}" placeholder="0"/>
<span class="sep">/</span>
<input type="text" name="data.resources.legact.max" data-dtype="Number" placeholder="0"
value="{{data.resources.legact.max}}"/>
<input name="data.resources.legact.max" type="number" value="{{data.resources.legact.max}}" placeholder="0"/>
</div>
</div>
<div class="counter flexrow legendary">
<h4>{{ localize "SW5E.LegRes" }}</h4>
<div class="counter-value">
<input type="text" name="data.resources.legres.value" data-dtype="Number" placeholder="0"
value="{{data.resources.legres.value}}"/>
<input name="data.resources.legres.value" type="number" value="{{data.resources.legres.value}}" placeholder="0"/>
<span class="sep">/</span>
<input type="text" name="data.resources.legres.max" data-dtype="Number" placeholder="0"
value="{{data.resources.legres.max}}"/>
<input name="data.resources.legres.max" type="number" value="{{data.resources.legres.max}}" placeholder="0"/>
</div>
</div>
<div class="counter flexrow lair">
@ -150,8 +143,7 @@
<div class="counter-value">
<input name="data.resources.lair.value" type="checkbox" value="{{data.resources.lair.value}}"
data-dtype="Boolean" {{checked data.resources.lair.value}}/>
<input name="data.resources.lair.initiative" type="text" value="{{data.resources.lair.initiative}}"
data-dtype="Number" placeholder="Init."/>
<input name="data.resources.lair.initiative" type="number" value="{{data.resources.lair.initiative}}" placeholder="20"/>
</div>
</div>
</div>

View file

@ -0,0 +1,28 @@
<ol class="inventory-list">
{{#each effects as |section sid|}}
<li class="inventory-header flexrow">
<h3 class="effect-name flexrow">{{localize section.label}}</h3>
<div class="effect-source">Source</div>
<div class="effect-source">Duration</div>
<div class="effect-controls"></div>
</li>
<ol class="effects-list item-list">
{{#each section.effects as |effect|}}
<li class="effect flexrow" data-effect-id="{{effect.id}}">
<div class="effect-name flexrow">
<img class="effect-icon" src="{{effect.data.icon}}"/>
<h4>{{effect.data.label}}</h4>
</div>
<div class="effect-source">{{effect.sourceName}}</div>
<div class="effect-duration">{{effect.duration.label}}</div>
<div class="effect-controls">
<a class="effect-control" data-action="toggle"><i class="fas fa-circle-notch"></i></a>
<a class="effect-control" data-action="edit"><i class="fas fa-edit"></i></a>
<a class="effect-control" data-action="delete"><i class="fas fa-trash"></i></a>
</div>
</li>
{{/each}}
</ol>
{{/each}}
</ol>

View file

@ -59,6 +59,21 @@
{{/if}}
</div>
{{else if section.isSpecies}}
<div class="item-detail player-species">
</div>
{{else if section.isArchetype}}
<div class="item-detail player-archetype">
{{item.data.name}}
</div>
{{else if section.isClassfeatures}}
<div class="item-detail player-classfeatures">
{{item.data.name}}
</div>
{{else if section.isClass}}
<div class="item-detail player-class">
{{item.data.subclass}}