Get the actor sheet read/writing the character's aspect data

This commit is contained in:
Oliver-Akins 2023-12-16 23:47:07 -07:00
parent 19a59692c4
commit 340f80c5b9
18 changed files with 342 additions and 230 deletions

View file

@ -1,24 +1,37 @@
<div class="skill">
<button
{{disabled false}}
class="skill__label skill__button"
aria-label="{{localize "dotdungeon.aria.skill.button.roll" skill=name}}"
>
{{localize (concat "dotdungeon.actor.pc.skill." name)}}
{{#with (dotdungeon-objectValue system (concat "stats." stat)) as | die |}}
{{#if die}}
({{die}})
{{/if}}
{{/with}}
</button>
<select
name="{{concat "system.skills." stat "." name}}"
class="skill__select"
aria-label="{{localize "dotdungeon.aria.skill.dropdown" skill=name}}"
>
{{#select (dotdungeon-objectValue system (concat "skills." stat "." name))}}
<option value="">Novice (+0)</option>
<option value="+2">Trained (+2)</option>
<option value="+4">Expert (+4)</option>
<option value="locked">Locked</option>
{{/select}}
</select>
<!--
<button class="skill__button" data-stat="{{stat}}" data-skill="{{name}}">
{{!--
This would be nice to get working at some point, but it's seeming not
super plausible at the moment due to context weirdness (probably because
of my "with" helper)
This would be nice to get working at some point, but it's not something
that is MVP
<img src="icons/dice/{{dotdungeon-objectValue system (concat "system.skills." stat "." name)}}black.svg">
--}}
R
Roll
</button>
<label class="skill__label">
{{localize (concat "dotdungeon.actor.pc.skill." name)}}
<select
class="skill__select"
aria-label="{{localize "dotdungeon.aria.skill-dropdown" skill=name}}"
>
<option value="">Novice (+0)</option>
<option value="locked">Locked</option>
<option value="+2">Trained (+2)</option>
<option value="+4">Expert (+4)</option>
</select>
</label>
-->
</div>

View file

@ -8,14 +8,12 @@
{{/each}}
{{/ dotdungeon.panel}}
{{#> dotdungeon.panel class="skills" title="dotdungeon.actor.pc.panel.skills"}}
{{#each system.skills}}
{{#each system.skills as |skills|}}
<div class="skill-group">
<h3 class="skill-group__label">{{localize (concat "dotdungeon.actor.pc.skills." @key)}}</h3>
{{#with @key as | stat |}}
{{#each ..}}
{{> dotdungeon.skill stat=stat name=@key value=this}}
{{/each}}
{{/with}}
{{#each skills as |skill|}}
{{> dotdungeon.skill system=../../system stat=@../key name=@key value=skill}}
{{/each}}
</div>
{{/each}}
{{/ dotdungeon.panel}}
@ -26,7 +24,39 @@
Sync
{{/ dotdungeon.panel}}
{{#> dotdungeon.panel class="aspect" title="dotdungeon.actor.pc.panel.aspect"}}
Aspect
<input
type="text"
class="aspect__name--input"
name="system.aspect.name"
value="{{system.aspect.name}}"
>
<label class="aspect__used--label">
Used
<input
type="checkbox"
class="aspect__used--input"
name="system.aspect.used"
{{checked system.aspect.used}}
>
</label>
<label class="aspect__duration--label">
Duration
{{#if system.aspect.deactivateAfter}}
<span class="friendly-duration aspect__duration--friendly">
({{dotdungeon-toFriendlyDuration system.aspect.deactivateAfter}})
</span>
{{/if}}
<input
type="number"
class="aspect__duration--input"
name="system.aspect.deactivateAfter"
value="{{system.aspect.deactivateAfter}}"
>
</label>
<textarea
class="aspect__description--input"
name="system.aspect.description"
>{{system.aspect.description}}</textarea>
{{/ dotdungeon.panel}}
{{#> dotdungeon.panel class="weapons" title="dotdungeon.actor.pc.panel.weapons"}}
Weapons