Skip to content

Commit

Permalink
Version 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
346184 committed Jul 2, 2021
1 parent e0977d3 commit 42a5af6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ The module also depends on [Babele](https://foundryvtt.com/packages/babele) for

Also see the [releases page](https://github.com/League-of-Foundry-Developers/foundryvtt-dnd5e-lang-de/releases).

### Version 1.0.1
- update the Module to Foundry Version 0.8.6 and DND 5E system version 1.3.3
- include sorted alphabetically for D&D 5e OGL Character Sheet. [Project page](https://foundryvtt.com/packages/5e-ogl-character-sheet)
- new option to active the alphabetically sorted for 5e OGL Character Sheet
### Version 1.1.0

- Update to Foundry Version 0.8.8 and D&D 5E system version 1.3.6
- Support skill sorting for the [D&D 5e OGL Character Sheet](https://foundryvtt.com/packages/5e-ogl-character-sheet). (thanks @stilldev)
- Small translation improvements/fixes

### Version 1.0.0

Expand Down
25 changes: 13 additions & 12 deletions dnd5e-de.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,19 @@ Hooks.once('init', () => {
});
Converters(module_id);
}

// Sort skills alphabetically
// Thanks to Elvis Pereira for the polish translation
// Fixed in upstream 1.3.0 (https://gitlab.com/foundrynet/dnd5e/-/issues/1070)
if (!isNewerVersion(game.system.data.version, '1.3.3')) {
async function sortSkillsAlpha() {
if (game.i18n.lang === module_lang &&
game.system.id === module_sys &&
(!isNewerVersion(game.system.data.version, '1.2.4') ||
game.modules.get('5e-ogl-character-sheet')?.active)) {
// Activate sorting if correct system and language AND
// either using a system version <= 1.2.4, where sorting wasn't
// done correctly in translations OR if using the OGL sheet

async function sortSkillsAlpha() {
const lists = document.getElementsByClassName('skills-list');
for (let list of lists) {
const competences = list.childNodes;
Expand All @@ -58,17 +65,11 @@ Hooks.once('init', () => {
}

Hooks.on('renderActorSheet', async function () {
// Sort the skills from 5e OGL Character Sheet
if (game.modules.get('5e-ogl-character-sheet')?.active &&
game.i18n.lang === module_lang &&
game.system.id === module_sys &&
game.settings.get(module_id, 'oglOverrideSkillSortAlpha')) {
sortSkillsAlpha();
}

if (game.i18n.lang === module_lang &&
game.system.id === module_sys &&
game.settings.get(module_id, 'overrideSkillSortAlpha')) {
(game.settings.get(module_id, 'overrideSkillSortAlpha') ||
game.modules.get('5e-ogl-character-sheet')?.active &&
game.settings.get(module_id, 'oglOverrideSkillSortAlpha'))) {
sortSkillsAlpha();
}
});
Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "FoundryVTT-dnd5e-DE",
"title": "DnD5e German Translation (Deutsch)",
"description": "German language support for the D&D5e system",
"version": "1.0.1",
"version": "1.1.0",
"minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.8.6",
"compatibleCoreVersion": "0.8.8",
"author": "Fallayn#6414, Hydroxi#0366, Smicman#1404, ThoGri#6692, Morvar#0915, crash#7509",
"esmodules": [
"dnd5e-de.js"
Expand Down
5 changes: 2 additions & 3 deletions src/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default [
{
name: 'overrideSkillSortAlpha',
onlyUntilSystemVersionIncluding: '1.3.3',
onlyUntilSystemVersionIncluding: '1.2.4',
data: {
name: 'Fertigkeiten alphabetisch sortieren',
hint: 'Sortiert die Fertigkeitenliste alphabetisch.',
Expand All @@ -13,9 +13,8 @@ export default [
},
{
name: 'oglOverrideSkillSortAlpha',
onlyUntilSystemVersionIncluding: '1.3.3',
data: {
name: 'Fertigkeiten alphabetisch sortieren im 5e OGL Character Sheet',
name: 'Fertigkeiten alphabetisch sortieren (5e OGL Character Sheet)',
hint: 'Sortiert die Fertigkeitenliste alphabetisch.',
scope: 'client',
type: Boolean,
Expand Down
3 changes: 3 additions & 0 deletions src/converters.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ var types = {
}

function convertType(t) {
if (!t) {
return t;
}
return types[t.toString().toLowerCase()] ? types[t.toString().toLowerCase()] : t;
}

Expand Down

0 comments on commit 42a5af6

Please sign in to comment.