diff --git a/README.md b/README.md index 4abe526..2e20253 100644 --- a/README.md +++ b/README.md @@ -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* @@ -58,6 +58,8 @@ module.json - Japanese by touge - German by brockhaus - Portuguese by vithort +- Italian by GregoryWarn +- French by rectulo ## Support diff --git a/changelog.md b/changelog.md index 2ec6eff..a397205 100644 --- a/changelog.md +++ b/changelog.md @@ -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. diff --git a/languages/de.json b/languages/de.json index 2f7c71e..0552e62 100644 --- a/languages/de.json +++ b/languages/de.json @@ -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\"" } } } diff --git a/languages/en.json b/languages/en.json index 02a0b22..10b03dd 100644 --- a/languages/en.json +++ b/languages/en.json @@ -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." } } } diff --git a/languages/fr.json b/languages/fr.json new file mode 100644 index 0000000..9ae2bd9 --- /dev/null +++ b/languages/fr.json @@ -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." + } + } +} diff --git a/languages/it.json b/languages/it.json index 2d4c56e..7d5a952 100644 --- a/languages/it.json +++ b/languages/it.json @@ -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." } } } diff --git a/languages/ja.json b/languages/ja.json index f6a5a77..801eb1f 100644 --- a/languages/ja.json +++ b/languages/ja.json @@ -28,7 +28,9 @@ "existingPlayerValues": "次のプレイヤーは変更がないためスキップされます:", "updatedPlayer": "次のプレイヤーの設定を更新しました:{name}", "noChanges": "現在のワールド設定とインポートした設定に差異がありません。", - "showSettings": "{count} の設定を表示" + "showSettings": "{count} の設定を表示", + "warning": "警告", + "warningMessage": "選択したモジュールをインポートしないことを選択しました。これが意図しない場合は、上記の「core.moduleConfiguration」値を有効にしてください。" } } } diff --git a/languages/pt.json b/languages/pt.json index 3913e1c..a06c4ba 100644 --- a/languages/pt.json +++ b/languages/pt.json @@ -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." } } } diff --git a/module.json b/module.json index 393caa7..5fbb775 100644 --- a/module.json +++ b/module.json @@ -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" diff --git a/scripts/core.js b/scripts/core.js index f155a76..be6e71d 100755 --- a/scripts/core.js +++ b/scripts/core.js @@ -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, @@ -117,6 +122,7 @@ export default class Core extends FormApplication { notChangedPlayers: this.notChangedPlayers, notFoundPlayers: this.notFoundPlayers, selectedProperties: this.selectedProperties, + shouldShowCoreModuleWarning: this.shouldShowCoreModuleWarning(), }; } @@ -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); }); diff --git a/styles/module.css b/styles/module.css index ece6637..b7ad418 100644 --- a/styles/module.css +++ b/styles/module.css @@ -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%; @@ -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; +} diff --git a/templates/settings.html b/templates/settings.html index 9d3c888..47db3ec 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -1,5 +1,5 @@ -
-

{{localize 'forien-copy-environment.intro'}}

+ +

{{localize 'forien-copy-environment.intro'}}

{{#if hasWorldSettings}} @@ -113,7 +113,11 @@

{{localize 'forien-copy-environment.intro'}}

{{/unless}}
-
+
+

{{localize 'forien-copy-environment.import.warning'}}: {{localize 'forien-copy-environment.import.warningMessage'}}

+
+ +
{{#if hasChanges}}{{/if}}