Skip to content

Commit

Permalink
v2.2.3
Browse files Browse the repository at this point in the history
- Made it clearer when modules will not be enabled due to the selected config settings.
  - This is one of the primary use cases of this module, so most of the time it is an accident to uncheck the setting.
  - Fixes #49 
- Added Italian translation by GregoryWarn.
- Added French translation by rectulo.
- Added machine translations for the new setting strings:
  - German
  - Japanese
  - Portuguese
  - Italian
  - French
  • Loading branch information
sneat authored Nov 9, 2024
2 parents 36fb4ec + bc45a95 commit 15ff0d1
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 15 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

**NOTE** This is an unofficial forked version of the module maintained by the League of Foundry Developers to provide module continuity while Forien is unavailable.

**[Compatibility]**: *FoundryVTT* 0.6.0 - 11.0+
**[Compatibility]**: *FoundryVTT* 0.6.0 - 12.0+

**[Systems]**: *any*

Expand Down Expand Up @@ -58,6 +58,8 @@ module.json
- Japanese by touge
- German by brockhaus
- Portuguese by vithort
- Italian by GregoryWarn
- French by rectulo

## Support

Expand Down
14 changes: 14 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## v2.2.3

- Made it clearer when modules will not be enabled due to the selected config settings.
- This is one of the primary use cases of this module, so most of the time it is an accident to uncheck the setting.
- See [issue #49](https://github.com/League-of-Foundry-Developers/foundryvtt-forien-copy-environment/issues/49).
- Added Italian translation by GregoryWarn.
- Added French translation by rectulo.
- Added machine translations for the new setting strings:
- German
- Japanese
- Portuguese
- Italian
- French

## v2.2.2

- Ignore "core.time" and "pf2e.worldClock.worldCreatedOn" values by default.
Expand Down
4 changes: 3 additions & 1 deletion languages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
"existingPlayerValues": "Bereits existierende Spieler, die unverändert sind und deshalb ausgelassen werden:",
"updatedPlayer": "Spieler Einstellungen angepasst für: {name}",
"noChanges": "Es gibt keinen Unterschied zwischen der aktuellen Welt und den zu importierenden Einstellungen.",
"showSettings": "{count} Einstellungen anzeigen"
"showSettings": "{count} Einstellungen anzeigen",
"warning": "Warnung",
"warningMessage": "Sie haben sich entschieden, die ausgewählten Module nicht zu importieren. Falls dies unbeabsichtigt war, aktivieren Sie den oben stehenden Wert \"core.moduleConfiguration\""
}
}
}
4 changes: 3 additions & 1 deletion languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
"existingPlayerValues": "Existing players that are unchanged and will be skipped:",
"updatedPlayer": "Updated player settings for: {name}",
"noChanges": "There are no differences between the current world and the imported settings.",
"showSettings": "Show {count} settings"
"showSettings": "Show {count} settings",
"warning": "Warning",
"warningMessage": "You have chosen not to import the selected modules. If this was unintentional, enable the \"core.moduleConfiguration\" value above."
}
}
}
36 changes: 36 additions & 0 deletions languages/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"forien-copy-environment": {
"menu": {
"copy": "Copier comme texte",
"save": "Copier comme JSON",
"export": "Exporter les réglages",
"import": "Importer les réglages"
},
"settings": {
"max-diff": "Nombre de caractères",
"max-diff-hint": "Nombre maximal de caractères pour montrer par différence. Régler à 0 pour tout montrer."
},
"title": "Importer les réglages",
"intro": "Ce formulaire vous permet de sélectionner les réglages du monde et des joueurs que vous souhaitez importer.",
"message": "Liste générée avec Forien's Copy Environment: https://github.com/League-of-Foundry-Developers/foundryvtt-forien-copy-environment",
"copiedToClipboard": "Données d'environnement copiées dans le presse-papier!",
"updatedReloading": "Réglages du monde mises à jour. Rechargement du monde dans 5 sec...",
"import": {
"title": "Réglages du monde",
"save": "Réglages d'importation",
"playerList": "Importer les réglages pour les joueurs suivants:",
"existing": "Importer un export existant:",
"property": "Propriété",
"newValue": "Nouvelle Valeur",
"currentValue": "Valeur actuelle",
"notFound": "Les utilisateurs suivants dans le fichier d'importation n'existent pas dans ce monde et seront ignorés.",
"existingValue": "Les valeurs existantes qui ne sont pas modifiées seront ignorées:",
"existingPlayerValues": "Les joueurs existants qui ne sont pas modifiés seront ignorés:",
"updatedPlayer": "Paramètre des joueurs mis à jour pour: {name}",
"noChanges": "Il n'y a pas de différences entre le monde actuel et les réglagess importés.",
"showSettings": "Afficher {count} paramètres",
"warning": "Avertissement",
"warningMessage": "Vous avez choisi de ne pas importer les modules sélectionnés. Si cela n’était pas intentionnel, activez la valeur \"core.moduleConfiguration\" ci-dessus."
}
}
}
4 changes: 3 additions & 1 deletion languages/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
"existingPlayerValues": "Giocatori esistenti che non sono cambiati e verranno ignorati:",
"updatedPlayer": "Impostazioni giocatore aggiornate per: {name}",
"noChanges": "Non ci sono differenze tra il mondo attuale e le impostazioni importate.",
"showSettings": "Mostra {count} impostazioni"
"showSettings": "Mostra {count} impostazioni",
"warning": "Avvertenza",
"warningMessage": "Hai scelto di non importare i moduli selezionati. Se questo non era intenzionale, abilita il valore \"core.moduleConfiguration\" sopra."
}
}
}
4 changes: 3 additions & 1 deletion languages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
"existingPlayerValues": "次のプレイヤーは変更がないためスキップされます:",
"updatedPlayer": "次のプレイヤーの設定を更新しました:{name}",
"noChanges": "現在のワールド設定とインポートした設定に差異がありません。",
"showSettings": "{count} の設定を表示"
"showSettings": "{count} の設定を表示",
"warning": "警告",
"warningMessage": "選択したモジュールをインポートしないことを選択しました。これが意図しない場合は、上記の「core.moduleConfiguration」値を有効にしてください。"
}
}
}
4 changes: 3 additions & 1 deletion languages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
"existingPlayerValues": "Jogadores existentes que permanecem inalterados e serão ignorados:",
"updatedPlayer": "Configurações do jogador atualizadas para: {name}",
"noChanges": "Não há diferenças entre o mundo atual e as configurações importadas.",
"showSettings": "Mostrar {count} configurações"
"showSettings": "Mostrar {count} configurações",
"warning": "Aviso",
"warningMessage": "Você escolheu não importar os módulos selecionados. Se isso não foi intencional, ative o valor \"core.moduleConfiguration\" acima."
}
}
}
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "12",
"version": "2.2.2",
"version": "2.2.3",
"compatibility": {
"minimum": "0.6.0",
"verified": "12"
Expand Down
18 changes: 15 additions & 3 deletions scripts/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ export default class Core extends FormApplication {
});
}

// shouldShowCoreModuleWarning returns true if the core module configuration is not selected.
shouldShowCoreModuleWarning() {
return !this.selectedProperties['core.moduleConfiguration'];
}

getData() {
return {
settings: this.settings,
Expand All @@ -117,6 +122,7 @@ export default class Core extends FormApplication {
notChangedPlayers: this.notChangedPlayers,
notFoundPlayers: this.notFoundPlayers,
selectedProperties: this.selectedProperties,
shouldShowCoreModuleWarning: this.shouldShowCoreModuleWarning(),
};
}

Expand Down Expand Up @@ -189,9 +195,15 @@ export default class Core extends FormApplication {
}

console.log(`Setting ${el.target.name} to ${el.target.checked}`);
const selectedProperties = game.settings.get(name, 'selected-properties');
selectedProperties[el.target.name] = el.target.checked;
game.settings.set(name, 'selected-properties', selectedProperties);
this.selectedProperties[el.target.name] = el.target.checked;
game.settings.set(name, 'selected-properties', this.selectedProperties);

if (el.target.name === 'core.moduleConfiguration') {
// Update the warning visibility when the core module configuration setting changes.
$(el.target.closest('form'))
.find('.core-module-warning')
.toggleClass('hidden', !this.shouldShowCoreModuleWarning());
}

updateCheckboxStates(el.target);
});
Expand Down
6 changes: 4 additions & 2 deletions styles/module.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
vertical-align: top;
}
#forien-copy-environment-settings fieldset td:first-of-type {
min-width: 20%;
width: 21%;
}
#forien-copy-environment-settings form {
max-height: 100%;
Expand All @@ -23,7 +23,9 @@
cursor: pointer;
}
#forien-copy-environment-settings section.import-properties {
max-height: calc(100% - 82px);
overflow: auto;
margin-bottom: 10px;
}
#forien-copy-environment-settings .noflex {
flex: 0;
}
10 changes: 7 additions & 3 deletions templates/settings.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<form class="{{classes}}" autocomplete="off">
<h2>{{localize 'forien-copy-environment.intro'}}</h2>
<form class="flexcol {{classes}}" autocomplete="off">
<h2 class="noflex">{{localize 'forien-copy-environment.intro'}}</h2>

<section class="import-properties">
{{#if hasWorldSettings}}
Expand Down Expand Up @@ -113,7 +113,11 @@ <h2>{{localize 'forien-copy-environment.intro'}}</h2>
{{/unless}}
</section>

<div class="flexrow">
<div class="noflex core-module-warning {{#unless shouldShowCoreModuleWarning}}hidden{{/unless}}">
<p><strong>{{localize 'forien-copy-environment.import.warning'}}:</strong> {{localize 'forien-copy-environment.import.warningMessage'}}</p>
</div>

<div class="noflex">
{{#if hasChanges}}<button type="button" class="import"><i class="fas fa-save"></i>
{{localize 'forien-copy-environment.import.save'}}</button>{{/if}}
<button type="button" class="close"><i class="fas fa-close"></i> {{localize 'Close'}}</button>
Expand Down

0 comments on commit 15ff0d1

Please sign in to comment.