From eb717e744b715a1db105a1c7dc020fb4e38d4f7f Mon Sep 17 00:00:00 2001 From: eclarke12 <42503461+eclarke12@users.noreply.github.com> Date: Tue, 20 Jul 2021 09:21:13 -0700 Subject: [PATCH 1/4] Fix EEXIST error handling in asset sync createDirectory --- assets-sync.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets-sync.js b/assets-sync.js index ceb3b6c..6790778 100644 --- a/assets-sync.js +++ b/assets-sync.js @@ -706,7 +706,8 @@ return true; } catch (error) { - if (error.message?.includes("EEXIST:")) { + const message = error.message ?? error; + if (message.includes("EEXIST:")) { // There might be a case where the folder already exists, especially in the case of Windows // where the case sensitivity could cause folder `music` to be created and `Music` to fail because // it already exists. From f55f8223749f6bdef4b944df19e64a69fb1dc89c Mon Sep 17 00:00:00 2001 From: eclarke12 <42503461+eclarke12@users.noreply.github.com> Date: Tue, 20 Jul 2021 09:21:49 -0700 Subject: [PATCH 2/4] Add Go To The Forge button in Settings sidebar --- forgevtt-module.js | 29 +++++++++++++++++++---------- styles/forgevtt.css | 13 +++++++++++++ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/forgevtt-module.js b/forgevtt-module.js index 7858b4b..6b51eac 100644 --- a/forgevtt-module.js +++ b/forgevtt-module.js @@ -200,16 +200,25 @@ class ForgeVTT { Hooks.on('canvasInit', () => this._onServerActivityEvent()); // Start the activity checker to track player usage and prevent people from idling forever this._checkForActivity(); - } else if (typeof(ForgeAssetSyncApp) !== "undefined") { - /* If we're not running on the Forge, then add the assets sync button */ - game.settings.registerMenu("forge-vtt", "assetSyncApp", { - name: "Asset Sync (Beta)", - label: "Open Asset Sync", - icon: "fas fa-sync", - hint: "Open the Forge Asset Sync app to sync Forge Assets to this Foundry server", - restricted: true, - type: ForgeAssetSyncApp + } else { + Hooks.on('renderSettings', (app, html, data) => { + const forgevtt_button = $(``); + forgevtt_button.click(() => window.location = `${this.FORGE_URL}/`); + const logoutButton = html.find("button[data-action=logout]"); + logoutButton.after(forgevtt_button); }); + + if (typeof(ForgeAssetSyncApp) !== "undefined") { + /* If we're not running on the Forge, then add the assets sync button */ + game.settings.registerMenu("forge-vtt", "assetSyncApp", { + name: "Asset Sync (Beta)", + label: "Open Asset Sync", + icon: "fas fa-sync", + hint: "Open the Forge Asset Sync app to sync Forge Assets to this Foundry server", + restricted: true, + type: ForgeAssetSyncApp + }); + } } } @@ -1160,4 +1169,4 @@ FilePicker.LAST_BROWSED_DIRECTORY = this.usingTheForge ? this.ASSETS_LIBRARY_URL Hooks.on('init', () => ForgeVTT.init()); Hooks.on('ready', () => ForgeVTT.ready()); -ForgeVTT.setupForge(); +ForgeVTT.setupForge(); \ No newline at end of file diff --git a/styles/forgevtt.css b/styles/forgevtt.css index e099a65..59fb06d 100644 --- a/styles/forgevtt.css +++ b/styles/forgevtt.css @@ -1,3 +1,16 @@ +button.forge-vtt { + display: flex; + align-items: center; + justify-content: center; +} + +button img.forge-vtt-icon { + width: 20px; + height: 20px; + border: none; + margin-right: 0.25em; +} + #forgevtt-asset-sync { min-width: 500px; } From c6e40df87101077f58f2c331f8a108138b268535 Mon Sep 17 00:00:00 2001 From: eclarke12 <42503461+eclarke12@users.noreply.github.com> Date: Tue, 20 Jul 2021 09:22:09 -0700 Subject: [PATCH 3/4] Add module lock file to gitignore --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4a94073..cf2ea5a 100644 --- a/.gitignore +++ b/.gitignore @@ -117,4 +117,7 @@ dist .pnp.* # Foundry -foundry.js \ No newline at end of file +foundry.js + +# Module lock file +forge-vtt.lock \ No newline at end of file From e05561d5ae3ac913e6fa6d9c4d56bcf6991ba78b Mon Sep 17 00:00:00 2001 From: eclarke12 <42503461+eclarke12@users.noreply.github.com> Date: Tue, 20 Jul 2021 09:22:34 -0700 Subject: [PATCH 4/4] Update manifest to v1.11.3 and fvtt 0.8.8 compatibility --- module.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module.json b/module.json index 4502bd7..232d816 100644 --- a/module.json +++ b/module.json @@ -2,7 +2,7 @@ "name": "forge-vtt", "title": "The Forge", "description": "
This module allows players to browse their Forge Assets Library from their local games, if needed.
This module is automatically enabled for users on The Forge and is therefore not required when running your games on The Forge website.
To use it, you will need to generate an API Key from your account page.
", - "version": "1.11.2", + "version": "1.11.3", "author": "KaKaRoTo (forge-vtt.com)", "authors": [ { @@ -29,7 +29,7 @@ ], "packs": [], "minimumCoreVersion": "0.6.0", - "compatibleCoreVersion": "0.8.7", + "compatibleCoreVersion": "0.8.8", "url": "https://forge-vtt.com", "manifest": "https://github.com/ForgeVTT/fvtt-module-forge-vtt/releases/latest/download/module.json", "download": "https://github.com/ForgeVTT/fvtt-module-forge-vtt/releases/latest/download/module.zip"