Skip to content

Commit

Permalink
Merge pull request #3 from ForgeVTT/v1.11.3-from-private
Browse files Browse the repository at this point in the history
v1.11.3-from-private
  • Loading branch information
kakaroto authored Jul 21, 2021
2 parents 9684e15 + e05561d commit 8b36be2
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 14 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,7 @@ dist
.pnp.*

# Foundry
foundry.js
foundry.js

# Module lock file
forge-vtt.lock
3 changes: 2 additions & 1 deletion assets-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
29 changes: 19 additions & 10 deletions forgevtt-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = $(`<button class="forge-vtt" data-action="forgevtt" title="Go to ${this.FORGE_URL}"><img class="forge-vtt-icon" src="https://forge-vtt.com/images/the-forge-logo-200x200.png"> Go to The Forge</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
});
}
}
}

Expand Down Expand Up @@ -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();
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "forge-vtt",
"title": "The Forge",
"description": "<p>This module allows players to browse their Forge Assets Library from their local games, if needed.</p><p>This module is automatically enabled for users on The Forge and is therefore not required when running your games on The Forge website.</p><p><strong>To use it, you will need to generate an API Key from your account page.</strong></p>",
"version": "1.11.2",
"version": "1.11.3",
"author": "KaKaRoTo (forge-vtt.com)",
"authors": [
{
Expand All @@ -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"
Expand Down
13 changes: 13 additions & 0 deletions styles/forgevtt.css
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down

0 comments on commit 8b36be2

Please sign in to comment.