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 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. 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/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" 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; }