added spell tab and sorted tabs

This commit is contained in:
Gesina Schwalbe 2021-01-09 23:39:35 +01:00
parent 7d04ad2309
commit 884327b156
9 changed files with 122 additions and 21 deletions

View file

@ -1,12 +1,13 @@
{ {
"DS4.UserInteractionAddItem": "Add item", "DS4.UserInteractionAddItem": "Add item",
"DS4.NotOwned": "No owner", "DS4.NotOwned": "No owner",
"DS4.HeadingDescription": "Description", "DS4.HeadingBiography": "Biography",
"DS4.HeadingDetails": "Details", "DS4.HeadingDetails": "Details",
"DS4.HeadingEffects": "Effects", "DS4.HeadingEffects": "Effects",
"DS4.HeadingInventory": "Inventory", "DS4.HeadingInventory": "Inventory",
"DS4.HeadingProfile": "Profile", "DS4.HeadingProfile": "Profile",
"DS4.HeadingTalents": "Talents & Abilities", "DS4.HeadingTalents": "Talents & Abilities",
"DS4.HeadingSpells": "Spells",
"DS4.AttackType": "Attack Type", "DS4.AttackType": "Attack Type",
"DS4.AttackTypeAbbr": "AT", "DS4.AttackTypeAbbr": "AT",
"DS4.WeaponBonus": "Weapon Bonus", "DS4.WeaponBonus": "Weapon Bonus",
@ -20,6 +21,7 @@
"DS4.PriceGold": "Price (Gold)", "DS4.PriceGold": "Price (Gold)",
"DS4.StorageLocation": "Stored at", "DS4.StorageLocation": "Stored at",
"DS4.ItemEquipped": "Equipped", "DS4.ItemEquipped": "Equipped",
"DS4.ItemEquippedAbbr": "E",
"DS4.ItemOwner": "Owner", "DS4.ItemOwner": "Owner",
"DS4.ItemAvailability": "Availability", "DS4.ItemAvailability": "Availability",
"DS4.ItemAvailabilityHamlet": "Hamlet", "DS4.ItemAvailabilityHamlet": "Hamlet",
@ -75,6 +77,7 @@
"DS4.ArmorMaterialTypePlate": "Plate", "DS4.ArmorMaterialTypePlate": "Plate",
"DS4.ArmorMaterialTypePlateAbbr": "Plate", "DS4.ArmorMaterialTypePlateAbbr": "Plate",
"DS4.SpellType": "Spell Type", "DS4.SpellType": "Spell Type",
"DS4.SpellTypeAbbr": "T",
"DS4.SpellTypeSpellcasting": "Spellcasting", "DS4.SpellTypeSpellcasting": "Spellcasting",
"DS4.SpellTypeTargetedSpell": "Targeted Spell", "DS4.SpellTypeTargetedSpell": "Targeted Spell",
"DS4.SpellCategory": "Category", "DS4.SpellCategory": "Category",
@ -86,6 +89,7 @@
"DS4.SpellCategoryMindAffecting": "Mind Affecting", "DS4.SpellCategoryMindAffecting": "Mind Affecting",
"DS4.SpellCategoryElectricity": "Electricity", "DS4.SpellCategoryElectricity": "Electricity",
"DS4.SpellBonus": "Spell Bonus", "DS4.SpellBonus": "Spell Bonus",
"DS4.SpellBonusAbbr": "SB",
"DS4.SpellMaxDistance": "Range", "DS4.SpellMaxDistance": "Range",
"DS4.SpellEffectRadius": "Radius", "DS4.SpellEffectRadius": "Radius",
"DS4.SpellDuration": "Duration", "DS4.SpellDuration": "Duration",
@ -147,6 +151,6 @@
"DS4.UnitMetersAbbr": "m", "DS4.UnitMetersAbbr": "m",
"DS4.UnitKilometers": "Kilometers", "DS4.UnitKilometers": "Kilometers",
"DS4.UnitKilometersAbbr": "km", "DS4.UnitKilometersAbbr": "km",
"DS4.UnitCustom": "Custom", "DS4.UnitCustom": "Custom Unit",
"DS4.UnitCustomAbbr": "-" "DS4.UnitCustomAbbr": " "
} }

View file

@ -32,7 +32,7 @@ export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor, DS4Ite
template: "systems/ds4/templates/actor/actor-sheet.hbs", template: "systems/ds4/templates/actor/actor-sheet.hbs",
width: 725, width: 725,
height: 600, height: 600,
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description" }], tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "inventory" }],
}); });
} }

View file

@ -26,6 +26,14 @@ export const DS4 = {
ranged: "systems/ds4/assets/official/DS4-RAT.png", ranged: "systems/ds4/assets/official/DS4-RAT.png",
}, },
/**
* Define the file paths to icon images
*/
spellTypesIcons: {
spellcasting: "systems/ds4/assets/official/DS4-SPC.png",
targetedSpell: "systems/ds4/assets/official/DS4-TSC.png",
},
/** /**
* Define the set of item availabilties * Define the set of item availabilties
*/ */

View file

@ -48,6 +48,7 @@ async function registerHandlebarsPartials() {
"systems/ds4/templates/item/partials/body.hbs", "systems/ds4/templates/item/partials/body.hbs",
"systems/ds4/templates/actor/partials/items-overview.hbs", "systems/ds4/templates/actor/partials/items-overview.hbs",
"systems/ds4/templates/actor/partials/talents-overview.hbs", "systems/ds4/templates/actor/partials/talents-overview.hbs",
"systems/ds4/templates/actor/partials/spells-overview.hbs",
"systems/ds4/templates/actor/partials/overview-add-button.hbs", "systems/ds4/templates/actor/partials/overview-add-button.hbs",
"systems/ds4/templates/actor/partials/overview-control-buttons.hbs", "systems/ds4/templates/actor/partials/overview-control-buttons.hbs",
"systems/ds4/templates/actor/partials/attributes-traits.hbs", "systems/ds4/templates/actor/partials/attributes-traits.hbs",

View file

@ -58,26 +58,30 @@
{{!-- Sheet Tab Navigation --}} {{!-- Sheet Tab Navigation --}}
<nav class="sheet-tabs tabs" data-group="primary"> <nav class="sheet-tabs tabs" data-group="primary">
<a class="item" data-tab="description">{{localize 'DS4.HeadingDescription'}}</a> <a class="item" data-tab="inventory">{{localize 'DS4.HeadingInventory'}}</a>
<a class="item" data-tab="spells">{{localize 'DS4.HeadingSpells'}}</a>
<a class="item" data-tab="talents">{{localize 'DS4.HeadingTalents'}}</a> <a class="item" data-tab="talents">{{localize 'DS4.HeadingTalents'}}</a>
<a class="item" data-tab="profile">{{localize "DS4.HeadingProfile"}}</a> <a class="item" data-tab="profile">{{localize "DS4.HeadingProfile"}}</a>
<a class="item" data-tab="inventory">{{localize 'DS4.HeadingInventory'}}</a> <a class="item" data-tab="biography">{{localize 'DS4.HeadingBiography'}}</a>
</nav> </nav>
{{!-- Sheet Body --}} {{!-- Sheet Body --}}
<section class="sheet-body"> <section class="sheet-body">
{{!-- Biography Tab --}} {{!-- Items Tab --}}
<div class="tab biography" data-group="primary" data-tab="description"> {{> systems/ds4/templates/actor/partials/items-overview.hbs}}
{{editor content=data.biography target="data.biography" button=true owner=owner editable=editable}}
</div>
{{! Profile Tab --}} {{!-- Spells Tab --}}
{{> systems/ds4/templates/actor/partials/profile.hbs}} {{> systems/ds4/templates/actor/partials/spells-overview.hbs}}
{{!-- Talents Tab --}} {{!-- Talents Tab --}}
{{> systems/ds4/templates/actor/partials/talents-overview.hbs}} {{> systems/ds4/templates/actor/partials/talents-overview.hbs}}
{{!-- Items Tab --}} {{! Profile Tab --}}
{{> systems/ds4/templates/actor/partials/items-overview.hbs}} {{> systems/ds4/templates/actor/partials/profile.hbs}}
{{!-- Biography Tab --}}
<div class="tab biography" data-group="primary" data-tab="biography">
{{editor content=data.biography target="data.biography" button=true owner=owner editable=editable}}
</div>
</section> </section>
</form> </form>

View file

@ -37,7 +37,7 @@
<li class="item flexrow item-header"> <li class="item flexrow item-header">
{{!-- equipped --}} {{!-- equipped --}}
{{#if (ne dataType 'equipment')}} {{#if (ne dataType 'equipment')}}
<div class="flex05" title="{{localize 'DS4.ItemEquipped'}}">E</div> <div class="flex05" title="{{localize 'DS4.ItemEquipped'}}">{{localize 'DS4.ItemEquippedAbbr'}}</div>
{{/if}} {{/if}}
{{!-- image --}} {{!-- image --}}
<div class="flex05 item-image"></div> <div class="flex05 item-image"></div>
@ -78,10 +78,10 @@
</div> </div>
{{!-- amount --}} {{!-- amount --}}
<input class="flex05 item-num-val item-change" type="number" min="0" step="1" value="{{item.data.data.quantity}}" data-dtype="Number" <input class="flex05 item-num-val item-change" type="number" min="0" step="1" value="{{item.data.data.quantity}}" data-dtype="Number"
data-property="data.quantity" title="{{localize 'DS4.Quantity'}}"> data-property="data.quantity" title="{{localize 'DS4.Quantity'}}" />
{{!-- name --}} {{!-- name --}}
<input class="flex3 item-name item-change" type="text" value="{{item.name}}" data-dtype="String" <input class="flex3 item-name item-change" type="text" value="{{item.name}}" data-dtype="String"
data-property="name" title="{{localize 'DS4.ItemName'}}"> data-property="name" title="{{localize 'DS4.ItemName'}}" />
{{!-- item type specifics --}} {{!-- item type specifics --}}
{{> @partial-block}} {{> @partial-block}}
{{!-- description --}} {{!-- description --}}

View file

@ -0,0 +1,86 @@
{{!-- ======================================================================== --}}
{{!-- INLINE PARTIAL DEFINITIONS --}}
{{!-- ======================================================================== --}}
{{!--
!-- Two templates for displaying values with unit.
!-- @param unitDatum: the object to display; must have a value and a unit attribute
!-- @param localizationString
!-- @param config: the config object
--}}
{{#*inline "temporalUnit"}}
<div class="unit-data-pair item-num-val"
title="{{localize localizationString}} [{{lookup config.temporalUnits unitDatum.unit}}]" >
{{unitDatum.value}}{{lookup config.temporalUnitsAbbr unitDatum.unit}}
</div>
{{/inline}}
{{#*inline "distanceUnit"}}
<div class="unit-data-pair item-num-val"
title="{{localize localizationString}} [{{lookup config.distanceUnits unitDatum.unit}}]" >
{{unitDatum.value}}{{lookup config.distanceUnitsAbbr unitDatum.unit}}
</div>
{{/inline}}
{{!-- ======================================================================== --}}
<div class="tab items" data-group="primary" data-tab="spells">
<ol class="items-list">
<li class="item flexrow item-header">
{{!-- equipped --}}
<div class="flex05 item-image" title="{{localize 'DS4.ItemEquipped'}}">{{localize 'DS4.ItemEquippedAbbr'}}</div>
{{!-- image --}}
<div class="flex05 item-image"></div>
{{!-- name --}}
<div class="flex2 item-name">{{localize 'DS4.ItemName'}}</div>
{{!-- spell type --}}
<div class="item-image" title="{{localize 'DS4.SpellType'}}">{{localize 'DS4.SpellTypeAbbr'}}</div>
{{!-- spell bonus --}}
<div class="item-num-val" title="{{localize 'DS4.SpellBonus'}}">{{localize 'DS4.SpellBonusAbbr'}}</div>
{{!-- max. distance --}}
<div class="item-num-val" title="{{localize 'DS4.SpellMaxDistance'}}"><i class="fas fa-ruler"></i></div>
{{!-- duration --}}
<div class="item-num-val" title="{{localize 'DS4.SpellDuration'}}"><i class="far fa-clock"></i></div>
{{!-- cooldown duration --}}
<div class="item-num-val" title="{{localize 'DS4.SpellCooldownDuration'}}"><i class="fas fa-hourglass-half"></i></div>
{{!-- description --}}
{{!-- <div class="flex3">{{localize 'DS4.HeadingDescription'}}</div> --}}
{{!-- add button --}}
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType='spell' }}
</li>
{{#each itemsByType.spell as |item id|}}
<li class="item flexrow" data-item-id="{{item._id}}">
<input class="flex05 item-image item-change" type="checkbox" {{checked item.data.data.equipped}} data-dtype="Boolean"
data-property="data.equipped" title="{{localize 'DS4.ItemEquipped'}}">
{{!-- image --}}
<div class="flex05 item-image">
<img src="{{item.img}}" title="{{item.name}}" width="24" height="24" />
</div>
{{!-- name --}}
<input class="flex2 item-name item-change" type="text" value="{{item.name}}" data-dtype="String"
data-property="name" title="{{localize 'DS4.ItemName'}}" />
{{!-- spell type --}}
<div class="flex05 item-image">
<img src="{{lookup ../config.spellTypesIcons item.data.data.spellType}}"
title="{{lookup ../config.spellTypes item.data.data.spellType}}" width="24" height="24" />
</div>
{{!-- spell bonus --}}
<input class="item-num-val item-change" type="text" data-dtype="String"
data-property="data.bonus" value="{{item.data.data.bonus}}" title="{{localize 'DS4.SpellBonus'}}" />
{{!-- max. distance --}}
{{> distanceUnit localizationString='DS4.SpellMaxDistance' unitDatum=item.data.data.maxDistance config=../config}}
{{!-- duration --}}
{{> temporalUnit localizationString='DS4.SpellDuration' unitDatum=item.data.data.duration config=../config}}
{{!-- cooldown duration --}}
{{> temporalUnit localizationString='DS4.SpellCooldownDuration' unitDatum=item.data.data.cooldownDuration config=../config}}
{{!-- description --}}
{{!-- <div class="flex3 item-description">{{{item.data.data.description}}}</div> --}}
{{!-- control buttons --}}
{{> systems/ds4/templates/actor/partials/overview-control-buttons.hbs }}
</li>
{{/each}}
</ol>
</div>

View file

@ -1,8 +1,6 @@
{{!-- ======================================================================== --}} {{!-- ======================================================================== --}}
{{!-- INLINE PARTIAL DEFINITIONS --}} {{!-- INLINE PARTIAL DEFINITIONS --}}
{{!-- ======================================================================== --}} {{!-- ======================================================================== --}}
{{!-- TODO: remove duplicate add and delete button definition --}}
{{!-- {{!--

View file

@ -41,7 +41,7 @@
</div> </div>
<div class="basic-property"> <div class="basic-property">
<label for="data.bonus">{{localize "DS4.SpellBonus"}}</label> <label for="data.bonus">{{localize "DS4.SpellBonus"}}</label>
<input type="number" name="data.bonus" value="{{data.bonus}}" placeholder="0" data-dtype="Number" /> <input type="text" name="data.bonus" value="{{data.bonus}}" data-dtype="String" />
</div> </div>
</div> </div>
{{/systems/ds4/templates/item/partials/sheet-header.hbs}} {{/systems/ds4/templates/item/partials/sheet-header.hbs}}
@ -61,7 +61,7 @@
{{> unitDatum data=data property='maxDistance' localizeString='DS4.SpellMaxDistance' unitType='distance' }} {{> unitDatum data=data property='maxDistance' localizeString='DS4.SpellMaxDistance' unitType='distance' }}
{{> unitDatum data=data property='effectRadius' localizeString='DS4.SpellEffectRadius' 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='duration' localizeString='DS4.SpellDuration' unitType='temporal' }}
{{> unitDatum data=data property='cooldownDurationj' localizeString='DS4.SpellCooldownDuration' unitType='temporal' }} {{> unitDatum data=data property='cooldownDuration' localizeString='DS4.SpellCooldownDuration' unitType='temporal' }}
<div class="side-property"> <div class="side-property">
<label for="data.scrollPrice">{{localize "DS4.SpellScrollPriceGold"}}</label> <label for="data.scrollPrice">{{localize "DS4.SpellScrollPriceGold"}}</label>
<input type="number" min="0" max="9999" step="0.01" data-dtype="Number" <input type="number" min="0" max="9999" step="0.01" data-dtype="Number"