Merge branch 'quality-of-life-improvements' into 'master'

Quality of life improvements

Closes #62

See merge request dungeonslayers/ds4!66
This commit is contained in:
Gesina Schwalbe 2021-01-26 20:36:25 +01:00
commit 452ef2add6
10 changed files with 67 additions and 38 deletions

View file

@ -144,9 +144,9 @@
"DS4.CharacterProfileBirthday": "Geburtstag", "DS4.CharacterProfileBirthday": "Geburtstag",
"DS4.CharacterProfileBirthplace": "Geburtsort", "DS4.CharacterProfileBirthplace": "Geburtsort",
"DS4.CharacterProfileAge": "Alter", "DS4.CharacterProfileAge": "Alter",
"DS4.CharacterProfileHeight": "Größe", "DS4.CharacterProfileHeight": "Größe [cm]",
"DS4.CharacterProfileHairColor": "Haarfarbe", "DS4.CharacterProfileHairColor": "Haarfarbe",
"DS4.CharacterProfileWeight": "Gewicht", "DS4.CharacterProfileWeight": "Gewicht [kg]",
"DS4.CharacterProfileEyeColor": "Augenfarbe", "DS4.CharacterProfileEyeColor": "Augenfarbe",
"DS4.CharacterProfileSpecialCharacteristics": "Besondere Eigenschaften", "DS4.CharacterProfileSpecialCharacteristics": "Besondere Eigenschaften",
"DS4.CharacterCurrencyGold": "Gold", "DS4.CharacterCurrencyGold": "Gold",

View file

@ -144,9 +144,9 @@
"DS4.CharacterProfileBirthday": "Birthday", "DS4.CharacterProfileBirthday": "Birthday",
"DS4.CharacterProfileBirthplace": "Birthplace", "DS4.CharacterProfileBirthplace": "Birthplace",
"DS4.CharacterProfileAge": "Age", "DS4.CharacterProfileAge": "Age",
"DS4.CharacterProfileHeight": "Height", "DS4.CharacterProfileHeight": "Height [m]",
"DS4.CharacterProfileHairColor": "Hair Color", "DS4.CharacterProfileHairColor": "Hair Color",
"DS4.CharacterProfileWeight": "Weight", "DS4.CharacterProfileWeight": "Weight [kg]",
"DS4.CharacterProfileEyeColor": "Eye Color", "DS4.CharacterProfileEyeColor": "Eye Color",
"DS4.CharacterProfileSpecialCharacteristics": "Special Characteristics", "DS4.CharacterProfileSpecialCharacteristics": "Special Characteristics",
"DS4.CharacterCurrencyGold": "Gold", "DS4.CharacterCurrencyGold": "Gold",

View file

@ -133,3 +133,21 @@ Hooks.once("setup", function () {
Hooks.once("ready", function () { Hooks.once("ready", function () {
migration.migrate(); migration.migrate();
}); });
/**
* Select the text of input elements in given sheets via onfocus listener.
* The hook names are of the form "render"+sheet_superclassname and are called within
* the render() method of the foundry Application class.
* Note: The render hooks of all classes in the class hierarchy are called,
* so e.g. for a Dialog, both "renderDialog" and "renderApplication" are called
* (in this order).
*/
["renderApplication", "renderActorSheet", "renderItemSheet"].forEach((hookName: string) => {
Hooks.on(hookName, (app: Dialog, html: JQueryStatic, data: any) => {
$(html)
.find("input")
.on("focus", (ev: JQuery.FocusEvent<HTMLInputElement>) => {
ev.currentTarget.select();
});
});
});

View file

@ -84,7 +84,9 @@
<a class="item" data-tab="biography">{{localize 'DS4.HeadingBiography'}}</a> <a class="item" data-tab="biography">{{localize 'DS4.HeadingBiography'}}</a>
</nav> </nav>
{{!-- Sheet Body --}} <!-- beautify ignore:start -->
<!-- prettier-ignore-start -->
{{!-- Sheet Body (remove indentation to avoid annoying Handlebars auto-indent) --}}
<section class="sheet-body"> <section class="sheet-body">
{{!-- Items Tab --}} {{!-- Items Tab --}}
{{> systems/ds4/templates/actor/partials/character-inventory.hbs}} {{> systems/ds4/templates/actor/partials/character-inventory.hbs}}
@ -104,4 +106,6 @@
editable=editable}} editable=editable}}
</div> </div>
</section> </section>
<!-- prettier-ignore-end -->
<!-- beautify ignore:end -->
</form> </form>

View file

@ -15,9 +15,8 @@
{{#*inline "ifHasItemOfType"}} {{#*inline "ifHasItemOfType"}}
{{#if (and (ne itemsArray undefined) (gt itemsArray.length 0))}} {{#if (and (ne itemsArray undefined) (gt itemsArray.length 0))}}
{{> @partial-block}} {{> @partial-block}}
{{else}}
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }}
{{/if}} {{/if}}
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }}
{{/inline}} {{/inline}}
@ -48,8 +47,8 @@
{{> @partial-block }} {{> @partial-block }}
{{!-- description --}} {{!-- description --}}
<div class="flex4">{{localize 'DS4.Description'}}</div> <div class="flex4">{{localize 'DS4.Description'}}</div>
{{!-- add button --}} {{!-- control buttons placeholder --}}
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }} <div></div>
</li> </li>
{{/inline}} {{/inline}}

View file

@ -1,7 +1,7 @@
<div class="tab profile" data-group="primary" data-tab="profile"> <div class="tab profile" data-group="primary" data-tab="profile">
<div class="grid grid-2col"> <div class="grid grid-2col">
{{#each data.profile as |profile-data-value profile-data-key|}} {{#each data.profile as |profile-data-value profile-data-key|}}
{{#if (ne profile-data-key 'biography')}} {{#if (and (ne profile-data-key 'biography') (ne profile-data-key 'specialCharacteristics'))}}
<div class="profile-entry"> <div class="profile-entry">
<label for="data.profile.{{profile-data-key}}"> <label for="data.profile.{{profile-data-key}}">
{{lookup ../config.characterProfile profile-data-key}} {{lookup ../config.characterProfile profile-data-key}}
@ -11,5 +11,11 @@
</div> </div>
{{/if}} {{/if}}
{{/each}} {{/each}}
<div>
<label for="data.profile.specialCharacteristics">
{{lookup config.characterProfile 'specialCharacteristics'}}
</label>
<textarea name="data.profile.specialCharacteristics" data-dtype="String" rows="4">{{data.profile.specialCharacteristics}}</textarea>
</div>
</div> </div>
</div> </div>

View file

@ -42,8 +42,8 @@
<div class="flex1 item-name">{{localize 'DS4.ItemName'}}</div> <div class="flex1 item-name">{{localize 'DS4.ItemName'}}</div>
{{!-- description --}} {{!-- description --}}
<div class="flex3">{{localize 'DS4.Description'}}</div> <div class="flex3">{{localize 'DS4.Description'}}</div>
{{!-- add button --}} {{!-- control buttons placeholder --}}
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }} <div></div>
</li> </li>
{{/inline}} {{/inline}}
@ -58,4 +58,5 @@
{{> baseItemListEntry item=item}} {{> baseItemListEntry item=item}}
{{/each}} {{/each}}
</ol> </ol>
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType='specialCreatureAbility' }}
</div> </div>

View file

@ -13,7 +13,7 @@
<div class="unit-data-pair item-num-val" <div class="unit-data-pair item-num-val"
title="{{localize localizationString}} [{{lookup unitNames unitDatum.unit}}]" > title="{{localize localizationString}} [{{lookup unitNames unitDatum.unit}}]" >
{{#if unitDatum.value }} {{#if unitDatum.value }}
{{unitDatum.value}}{{lookup unitAbbrs unitDatum.unit}} {{unitDatum.value}}&thinsp;{{lookup unitAbbrs unitDatum.unit}}
{{else}}-{{/if}} {{else}}-{{/if}}
</div> </div>
{{/inline}} {{/inline}}
@ -55,8 +55,8 @@
<div class="item-num-val" title="{{localize 'DS4.SpellCooldownDuration'}}"><i class="fas fa-hourglass-half"></i></div> <div class="item-num-val" title="{{localize 'DS4.SpellCooldownDuration'}}"><i class="fas fa-hourglass-half"></i></div>
{{!-- description --}} {{!-- description --}}
{{!-- <div class="flex3">{{localize 'DS4.Description'}}</div> --}} {{!-- <div class="flex3">{{localize 'DS4.Description'}}</div> --}}
{{!-- add button --}} {{!-- control buttons placeholder --}}
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType='spell' }} <div></div>
</li> </li>
{{#each itemsByType.spell as |item id|}} {{#each itemsByType.spell as |item id|}}
<li class="item flexrow" data-item-id="{{item._id}}"> <li class="item flexrow" data-item-id="{{item._id}}">
@ -90,4 +90,6 @@
</li> </li>
{{/each}} {{/each}}
</ol> </ol>
{{!-- add button --}}
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType='spell' }}
</div> </div>

View file

@ -15,9 +15,8 @@
{{#*inline "ifHasItemOfType"}} {{#*inline "ifHasItemOfType"}}
{{#if (and (ne itemsArray undefined) (gt itemsArray.length 0))}} {{#if (and (ne itemsArray undefined) (gt itemsArray.length 0))}}
{{> @partial-block}} {{> @partial-block}}
{{else}}
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }}
{{/if}} {{/if}}
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }}
{{/inline}} {{/inline}}
@ -98,7 +97,7 @@
{{/inline}} {{/inline}}
{{!-- {{!--
!-- Render a list header for a base item list entries from a given item. !-- Render a list header for a base item list entry from a given item.
!-- The partial assumes a variable dataType to be given in the context. !-- The partial assumes a variable dataType to be given in the context.
!-- !--
!-- @param dataType: the string item type for the list !-- @param dataType: the string item type for the list
@ -111,8 +110,8 @@
<div class="flex1 item-name">{{localize 'DS4.ItemName'}}</div> <div class="flex1 item-name">{{localize 'DS4.ItemName'}}</div>
{{!-- description --}} {{!-- description --}}
<div class="flex3">{{localize 'DS4.Description'}}</div> <div class="flex3">{{localize 'DS4.Description'}}</div>
{{!-- add button --}} {{!-- control buttons placeholder --}}
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType=dataType }} <div></div>
</li> </li>
{{/inline}} {{/inline}}
@ -133,8 +132,8 @@
<div class="flex3">{{localize 'DS4.TalentRank'}}</div> <div class="flex3">{{localize 'DS4.TalentRank'}}</div>
{{!-- description --}} {{!-- description --}}
<div class="flex4">{{localize 'DS4.Description'}}</div> <div class="flex4">{{localize 'DS4.Description'}}</div>
{{!-- add button --}} {{!-- control buttons placeholder --}}
{{> systems/ds4/templates/actor/partials/overview-add-button.hbs dataType='talent' }} <div></div>
</li> </li>
{{#each itemsByType.talent as |item id|}} {{#each itemsByType.talent as |item id|}}
{{> talentListEntry item=item}} {{> talentListEntry item=item}}

View file

@ -2,7 +2,7 @@
<label for="ctv">{{localize "DS4.RollDialogTargetLabel"}}</label> <label for="ctv">{{localize "DS4.RollDialogTargetLabel"}}</label>
<input id="ctv" data-type="Number" type="number" name="ctv" value="{{checkTargetValue}}" /> <input id="ctv" data-type="Number" type="number" name="ctv" value="{{checkTargetValue}}" />
<label for="gmmod">{{localize "DS4.RollDialogModifierLabel"}}</label> <label for="gmmod">{{localize "DS4.RollDialogModifierLabel"}}</label>
<input id="gmmod" data-type="Number" type="number" name="gmmod" value="0" /> <input id="gmmod" data-type="Number" type="number" name="gmmod" value="0" autofocus />
<label for="maxcoup">{{localize "DS4.RollDialogCoupLabel"}}</label> <label for="maxcoup">{{localize "DS4.RollDialogCoupLabel"}}</label>
<input id="maxcoup" data-type="Number" type="number" name="maxcoup" value="{{maxCritSuccess}}" /> <input id="maxcoup" data-type="Number" type="number" name="maxcoup" value="{{maxCritSuccess}}" />
<label for="minfumble">{{localize "DS4.RollDialogFumbleLabel"}}</label> <label for="minfumble">{{localize "DS4.RollDialogFumbleLabel"}}</label>