Skip to content

Commit

Permalink
v2.1.5
Browse files Browse the repository at this point in the history
- Allow non-GM users to use the module.
  - Fixes [#32](#32)
  - Users will see errors for any settings they do not have permission to update.
- Removed deprecated fields in module manifest.
  - Fixes [#33](#33)
  • Loading branch information
sneat authored Oct 17, 2022
2 parents b9379ba + 1fd4031 commit f8fe14b
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 48 deletions.
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## v2.1.5

- Allow non-GM users to use the module.
- Fixes [#32](https://github.com/League-of-Foundry-Developers/foundryvtt-forien-copy-environment/issues/32)
- Users will see errors for any settings they do not have permission to update.
- Removed deprecated fields in module manifest.
- Fixes [#33](https://github.com/League-of-Foundry-Developers/foundryvtt-forien-copy-environment/issues/33)

## v2.1.4

- Added timestamp to file export.
Expand Down
6 changes: 2 additions & 4 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"flags": {
"allowBugReporter": true
},
"version": "2.1.4",
"version": "2.1.5",
"minimumCoreVersion": "0.6.0",
"compatibleCoreVersion": "10",
"compatibility": {
"minimum": "0.6.0",
"verified": "10.270"
"verified": "10.288"
},
"scripts": [],
"esmodules": [
Expand All @@ -54,8 +54,6 @@
}
],
"packs": [],
"system": [],
"dependencies": [],
"socket": false,
"manifest": "https://github.com/League-of-Foundry-Developers/foundryvtt-forien-copy-environment/releases/latest/download/module.json",
"download": "https://github.com/League-of-Foundry-Developers/foundryvtt-forien-copy-environment/releases/latest/download/module.zip",
Expand Down
86 changes: 42 additions & 44 deletions scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,52 +15,50 @@ Hooks.once('devModeReady', ({registerPackageDebugFlag}) => {
});

Hooks.on('renderSettings', function (app, html, data) {
if (game.user.isGM) {
new ContextMenu(html, 'div.game-system, ul#game-details', [
{
name: game.i18n.localize('forien-copy-environment.menu.copy'),
icon: '<i class="far fa-copy"></i>',
callback: () => {
try {
Core.copyAsText();
} catch (e) {
console.error('Copy Environment | Error copying game settings to clipboard', e);
}
},
new ContextMenu(html, 'div.game-system, ul#game-details', [
{
name: game.i18n.localize('forien-copy-environment.menu.copy'),
icon: '<i class="far fa-copy"></i>',
callback: () => {
try {
Core.copyAsText();
} catch (e) {
console.error('Copy Environment | Error copying game settings to clipboard', e);
}
},
{
name: game.i18n.localize('forien-copy-environment.menu.save'),
icon: '<i class="fas fa-copy"></i>',
callback: () => {
try {
Core.saveSummaryAsJSON();
} catch (e) {
console.error('Copy Environment | Error copying game settings to JSON', e);
}
},
},
{
name: game.i18n.localize('forien-copy-environment.menu.save'),
icon: '<i class="fas fa-copy"></i>',
callback: () => {
try {
Core.saveSummaryAsJSON();
} catch (e) {
console.error('Copy Environment | Error copying game settings to JSON', e);
}
},
{
name: game.i18n.localize('forien-copy-environment.menu.export'),
icon: '<i class="fas fa-file-export"></i>',
callback: () => {
try {
Core.exportGameSettings();
} catch (e) {
console.error('Copy Environment | Error exporting game settings', e);
}
},
},
{
name: game.i18n.localize('forien-copy-environment.menu.export'),
icon: '<i class="fas fa-file-export"></i>',
callback: () => {
try {
Core.exportGameSettings();
} catch (e) {
console.error('Copy Environment | Error exporting game settings', e);
}
},
{
name: game.i18n.localize('forien-copy-environment.menu.import'),
icon: '<i class="fas fa-file-import"></i>',
callback: () => {
try {
Core.importGameSettingsQuick();
} catch (e) {
console.error('Copy Environment | Error importing game settings', e);
}
},
},
{
name: game.i18n.localize('forien-copy-environment.menu.import'),
icon: '<i class="fas fa-file-import"></i>',
callback: () => {
try {
Core.importGameSettingsQuick();
} catch (e) {
console.error('Copy Environment | Error importing game settings', e);
}
},
]);
}
},
]);
});

0 comments on commit f8fe14b

Please sign in to comment.