Skip to content

Commit

Permalink
Merge pull request #151 from Savantford/experimental
Browse files Browse the repository at this point in the history
3.1.2: Localization Backend Improvements
  • Loading branch information
Savantford committed Feb 21, 2024
2 parents 1bff913 + b2b5728 commit d6e4272
Show file tree
Hide file tree
Showing 34 changed files with 1,116 additions and 1,317 deletions.
1,910 changes: 856 additions & 1,054 deletions lang/en.json

Large diffs are not rendered by default.

200 changes: 100 additions & 100 deletions module/config.mjs

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions module/sheets/actor-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ export default class WWActorSheet extends ActorSheet {
context.dead = context.actor.dead;

// Prepare numbersArr, Level and Size
context.numbersArr = Object.entries(CONFIG.WW.dropdownNumbers).map(([k, v]) => ({key: k, label: v})).sort((a,b) => a.key - b.key);
context.level = CONFIG.WW.dropdownNumbers[context.system.stats.level];
context.size = CONFIG.WW.dropdownNumbers[context.system.stats.size];
context.numbersArr = Object.entries(CONFIG.WW.FRACTION_NUMBERS).map(([k, v]) => ({key: k, label: v})).sort((a,b) => a.key - b.key);
context.level = CONFIG.WW.FRACTION_NUMBERS[context.system.stats.level];
context.size = CONFIG.WW.FRACTION_NUMBERS[context.system.stats.size];

// Prepare hasEffect for use in templates
context.hasEffect = {};
Expand Down Expand Up @@ -652,8 +652,8 @@ export default class WWActorSheet extends ActorSheet {

async _onItemDelete(item, button) {
const confirm = await Dialog.confirm({
title: i18n('WW.Item.Delete.Title'),
content: i18n('WW.Item.Delete.Msg') + ' <b>' + item.name + '</b>. ' + i18n('WW.Item.Delete.Msg2') + '<p class="dialog-sure">' + i18n('WW.Item.Delete.Confirm') + " " + item.name + '?</p>'
title: i18n('WW.Item.Delete.Dialog.Title'),
content: i18n('WW.Item.Delete.Dialog.Msg') + ' <b>' + item.name + '</b>. ' + i18n('WW.Item.Delete.Dialog.Msg2') + '<p class="dialog-sure">' + i18n('WW.Item.Delete.Dialog.Confirm') + " " + item.name + '?</p>'
});

if (!confirm) return;
Expand Down
8 changes: 4 additions & 4 deletions module/sheets/item-sheet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export default class WWItemSheet extends ItemSheet {

// Add help button
buttons.splice(sheetIndex, 0, {
label: "WW.Help",
label: "WW.System.Help",
class: "help",
icon: "fas fa-question",
onclick: ev => this._onHelp(ev)
Expand Down Expand Up @@ -293,8 +293,8 @@ export default class WWItemSheet extends ItemSheet {

// Open a dialog to confirm
const confirm = await Dialog.confirm({
title: i18n('WW.CharOption.Reference.Remove.Title'),
content: `<p>${i18n('WW.CharOption.Reference.Remove.Msg')}</p><p class="dialog-sure">${i18n('WW.CharOption.Reference.Remove.Confirm')}</p>`
title: i18n('WW.CharOption.Reference.RemoveDialog.Title'),
content: `<p>${i18n('WW.CharOption.Reference.RemoveDialog.Msg')}</p><p class="dialog-sure">${i18n('WW.CharOption.Reference.RemoveDialog.Confirm')}</p>`
});

if (!confirm) return;
Expand Down Expand Up @@ -354,7 +354,7 @@ export default class WWItemSheet extends ItemSheet {
console.log(this.document.system.benefits)
console.log(arrPath)
console.log(oldArray)
const defaultName = (arrPath.includes('languages') && !oldArray.length) ? i18n('WW.Languages.Common') : i18n('WW.' + dataset.loc + '.New'),
const defaultName = (arrPath.includes('languages') && !oldArray.length) ? i18n('WW.Detail.Language.Common') : i18n('WW.Detail.' + dataset.loc + '.New'),
arr = [...oldArray, { name: defaultName }];

// Update document
Expand Down
2 changes: 1 addition & 1 deletion module/ui/quest-calendar.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const adv = (t) => game.time.advance(t),
hour = 3600,
rest = 21600, // 3600*8
rest = 21600, // 3600*6
day = 86400, // 3600*24
week = 604800, // 3600*24*7
month = 2419200, // 3600*24*7*4
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packs/armor/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-000504
MANIFEST-000510
6 changes: 3 additions & 3 deletions packs/armor/LOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2024/02/20-15:20:16.604 2784 Recovering log #503
2024/02/20-15:20:16.608 2784 Delete type=0 #503
2024/02/20-15:20:16.608 2784 Delete type=3 #502
2024/02/21-19:30:37.430 178 Recovering log #508
2024/02/21-19:30:37.435 178 Delete type=0 #508
2024/02/21-19:30:37.435 178 Delete type=3 #506
10 changes: 7 additions & 3 deletions packs/armor/LOG.old
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024/02/19-15:51:57.421 694 Recovering log #500
2024/02/19-15:51:57.426 694 Delete type=0 #500
2024/02/19-15:51:57.426 694 Delete type=3 #498
2024/02/21-17:06:49.492 4e0 Recovering log #505
2024/02/21-17:06:49.497 4e0 Delete type=0 #505
2024/02/21-17:06:49.497 4e0 Delete type=3 #504
2024/02/21-19:08:40.871 3b5c Level-0 table #509: started
2024/02/21-19:08:40.871 3b5c Level-0 table #509: 0 bytes OK
2024/02/21-19:08:40.874 3b5c Delete type=0 #507
2024/02/21-19:08:40.874 3b5c Manual compaction at level-0 from '!items!8kdTjI16oQxvcKow' @ 72057594037927935 : 1 .. '!items.effects!r7Vjowz8ZGGAbD3n.k1mHXJOIELUhGoM5' @ 0 : 0; will stop at (end)
Binary file not shown.
File renamed without changes.
2 changes: 1 addition & 1 deletion packs/docs/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-000136
MANIFEST-000142
6 changes: 3 additions & 3 deletions packs/docs/LOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2024/02/20-15:20:16.553 2784 Recovering log #135
2024/02/20-15:20:16.559 2784 Delete type=0 #135
2024/02/20-15:20:16.559 2784 Delete type=3 #134
2024/02/21-19:30:37.396 178 Recovering log #140
2024/02/21-19:30:37.401 178 Delete type=0 #140
2024/02/21-19:30:37.401 178 Delete type=3 #138
10 changes: 7 additions & 3 deletions packs/docs/LOG.old
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024/02/19-15:51:57.385 694 Recovering log #132
2024/02/19-15:51:57.391 694 Delete type=0 #132
2024/02/19-15:51:57.391 694 Delete type=3 #130
2024/02/21-17:06:49.443 4e0 Recovering log #137
2024/02/21-17:06:49.448 4e0 Delete type=0 #137
2024/02/21-17:06:49.448 4e0 Delete type=3 #136
2024/02/21-19:08:40.857 3b5c Level-0 table #141: started
2024/02/21-19:08:40.857 3b5c Level-0 table #141: 0 bytes OK
2024/02/21-19:08:40.859 3b5c Delete type=0 #139
2024/02/21-19:08:40.864 3b5c Manual compaction at level-0 from '!journal!0xYsAWtUJS591nz9' @ 72057594037927935 : 1 .. '!journal.pages!Lrr8Rl7mRIIoYeW1.thPe333HcfTJyiLv' @ 0 : 0; will stop at (end)
Binary file not shown.
File renamed without changes.
2 changes: 1 addition & 1 deletion packs/weapons/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-000501
MANIFEST-000507
6 changes: 3 additions & 3 deletions packs/weapons/LOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
2024/02/20-15:20:16.580 4a34 Recovering log #500
2024/02/20-15:20:16.585 4a34 Delete type=0 #500
2024/02/20-15:20:16.585 4a34 Delete type=3 #499
2024/02/21-19:30:37.417 3f60 Recovering log #505
2024/02/21-19:30:37.422 3f60 Delete type=0 #505
2024/02/21-19:30:37.422 3f60 Delete type=3 #503
10 changes: 7 additions & 3 deletions packs/weapons/LOG.old
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2024/02/19-15:51:57.407 3d78 Recovering log #497
2024/02/19-15:51:57.413 3d78 Delete type=0 #497
2024/02/19-15:51:57.413 3d78 Delete type=3 #495
2024/02/21-17:06:49.475 3fbc Recovering log #502
2024/02/21-17:06:49.479 3fbc Delete type=0 #502
2024/02/21-17:06:49.480 3fbc Delete type=3 #501
2024/02/21-19:08:40.866 3b5c Level-0 table #506: started
2024/02/21-19:08:40.866 3b5c Level-0 table #506: 0 bytes OK
2024/02/21-19:08:40.868 3b5c Delete type=0 #504
2024/02/21-19:08:40.874 3b5c Manual compaction at level-0 from '!items!0u3rLO1CFHSf8aJw' @ 72057594037927935 : 1 .. '!items.effects!qVKiDnaFCga0dvi5.VfIbYsXBjELx548J' @ 0 : 0; will stop at (end)
Binary file not shown.
18 changes: 6 additions & 12 deletions templates/actors/Character-sheet.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<div class="header-fields">
<div class="character-header-plate">
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="{{localize "WW.ActorName"}}"/></h1>
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="{{localize "WW.Actor.Name"}}"/></h1>

<div class="character-subtitle">{{localize "WW.Stats.Level"}} {{level}} {{system.details.ancestry}}{{#if system.details.novice}} {{system.details.novice}}{{/if}}</div>
</div>
Expand Down Expand Up @@ -140,16 +140,15 @@
<div>
<nav class="sheet-tabs tabs" data-group="primary">{{!-- Sheet Tab Navigation --}}
<div>
<a class="item" data-tab="summary">{{localize "WW.Stats.Summary"}}</a>
{{!--<a class="item" data-tab="stats">{{localize "WW.Stats"}}</a>--}}
<a class="item" data-tab="details">{{localize "WW.Details.Label"}}</a>
<a class="item" data-tab="equipment">{{localize "WW.Equipment.Label"}}</a>
<a class="item" data-tab="summary">{{localize "WW.Actor.Summary"}}</a>
<a class="item" data-tab="details">{{localize "WW.Actor.Details"}}</a>
<a class="item" data-tab="equipment">{{localize "WW.Equipment.Label"}}</a>
</div>

<div>
<a class="item" data-tab="talents">{{localize "WW.Talents.Label"}}</a>
<a class="item" data-tab="spells">{{localize "WW.Spells.Label"}}</a>
<a class="item" data-tab="effects">{{localize "WW.Effects.Label"}}</a>
<a class="item" data-tab="spells">{{localize "WW.Spells.Label"}}</a>
<a class="item" data-tab="effects">{{localize "WW.Effects.Label"}}</a>
</div>

</nav>
Expand All @@ -162,11 +161,6 @@
{{> "systems/weirdwizard/templates/actors/parts/Character-summary.hbs"}}
</div>

{{!-- Stats Tab --}}
{{!--<div class="tab stats" data-group="primary" data-tab="stats">
{{> "systems/weirdwizard/templates/actors/parts/Character-stats.hbs"}}
</div>--}}

{{!-- Details Tab --}}
<div class="tab details" data-group="primary" data-tab="details">
{{> "systems/weirdwizard/templates/actors/parts/Character-details.hbs"}}
Expand Down
16 changes: 4 additions & 12 deletions templates/actors/NPC-sheet.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,24 @@

<div class="header-fields npc">
{{!-- Character Name --}}
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="{{localize "WW.ActorName"}}"/></h1>
<h1 class="charname"><input name="name" type="text" value="{{actor.name}}" placeholder="{{localize "WW.Actor.Name"}}"/></h1>

{{!-- Disposition Toggle --}}
<a class="change-disposition{{#if (eq disposition 1)}} ally{{/if}}" title="{{localize "WW.Disposition.Tip"}}">
{{#if (eq disposition 1)}}{{localize "WW.Disposition.Ally"}}{{else}}{{localize "WW.Disposition.Enemy"}}{{/if}}
<a class="change-disposition{{#if (eq disposition 1)}} ally{{/if}}" title="{{localize "WW.Actor.Disposition.Tip"}}">
{{#if (eq disposition 1)}}{{localize "WW.Actor.Disposition.Ally"}}{{else}}{{localize "WW.Actor.Disposition.Enemy"}}{{/if}}
</a>

{{!-- Sheet Tabs --}}
<nav class="mt-2 sheet-tabs tabs npc-tabs" data-group="primary">{{!-- Sheet Tab Navigation --}}
<a class="item" data-tab="summary">{{localize "WW.Stats.Summary"}}</a>
<a class="item" data-tab="summary">{{localize "WW.Actor.Summary"}}</a>
<a class="item" data-tab="description">{{localize "WW.Item.Description"}}</a>
{{!--<a class="item" data-tab="stats">{{localize "WW.Stats"}}</a>--}}
<a class="item" data-tab="effects">{{localize "WW.Effects.Label"}}</a>
</nav>

</div>

</header>



<section class="sheet-body"> {{!-- Sheet Body --}}

{{!-- Description Tab --}}
Expand All @@ -40,11 +37,6 @@
{{> "systems/weirdwizard/templates/actors/parts/NPC-summary.hbs"}}
</div>

{{!-- Stats Tab --}}
{{!--<div class="tab stats" data-group="primary" data-tab="stats">
{{> "systems/weirdwizard/templates/actors/parts/NPC-stats.hbs"}}
</div>--}}

{{!-- Active Effects Tab --}}
<div class="tab effects flexcol" data-group="primary" data-tab="effects">
{{> "systems/weirdwizard/templates/actors/parts/Character-effects.hbs"}}
Expand Down
16 changes: 8 additions & 8 deletions templates/actors/parts/Character-details.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

{{!-- Left Column --}}
<div class="details-col flex-group-left">
<h1>{{localize "WW.Details.Identity"}}</h1>
<h1>{{localize "WW.Actor.Identity"}}</h1>

{{editor system.description.enriched target="system.description.value" button=true owner=owner editable=editable}}

<ol class="details-list">
<li class="detail">
<h2 class="detail-label">{{localize "WW.Details.Features"}}</h2>
<h2 class="detail-label">{{localize "WW.Actor.Features"}}</h2>
{{editor system.details.features.enriched target="system.details.features.value" button=true
owner=owner editable=editable}}
</li>

<li class="detail">
<h2 class="detail-label">{{localize "WW.Details.Personality"}}</h2>
<h2 class="detail-label">{{localize "WW.Actor.Personality"}}</h2>
{{editor system.details.personality.enriched target="system.details.personality.value" button=true
owner=owner editable=editable}}
</li>

<li class="detail">
<h2 class="detail-label">{{localize "WW.Details.Belief"}}</h2>
<h2 class="detail-label">{{localize "WW.Actor.Belief"}}</h2>
{{editor system.details.belief.enriched target="system.details.belief.value" button=true
owner=owner editable=editable}}
</li>
Expand All @@ -29,18 +29,18 @@

{{!-- Right Column --}}
<div class="details-col flex-group-left">
<h1>{{localize "WW.Details.Background"}}</h1>
<h1>{{localize "WW.Actor.Background"}}</h1>
<ol class="details-list">
<li class="detail">
<h2 class="detail-label">{{localize "WW.CharOptions.Ancestry"}}</h2>
{{editor system.details.bg_ancestry.enriched target="system.details.bg_ancestry.value" button=true
owner=owner editable=editable}}
</li>
<li class="detail">
<h2 class="detail-label">{{localize "WW.Details.Deeds"}}</h2>
<h2 class="detail-label">{{localize "WW.Actor.Deeds"}}</h2>

<div class="flex-row stat-inline flex-group-center">
<label>{{localize "WW.Details.Reputation"}}</label>
<label>{{localize "WW.Actor.Reputation"}}</label>

<input type="number" name="system.details.reputation"
value="{{system.details.reputation}}" min="0" data-dtype="Number" />
Expand All @@ -50,7 +50,7 @@
editable=editable}}
</li>
<li class="detail">
<h2 class="detail-label">{{localize "WW.Details.Information"}}</h2>
<h2 class="detail-label">{{localize "WW.Actor.Information"}}</h2>
{{editor system.details.information.enriched target="system.details.information.value" button=true
owner=owner editable=editable}}
</li>
Expand Down
2 changes: 1 addition & 1 deletion templates/actors/parts/Character-spells.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{!-- Traditions --}}
<div class="stat-inline mb-2 list-entries">

<label>{{localize "WW.Traditions.Label"}}</label>
<label>{{localize "WW.Detail.Tradition.Label"}}</label>

{{#each system.details.traditions as |detail id|}}
<span class="list-entry">
Expand Down

0 comments on commit d6e4272

Please sign in to comment.