From 74d4b0640432677a0dfe9fa39d68a06f99600d2b Mon Sep 17 00:00:00 2001 From: Saif Addin Date: Sun, 14 Nov 2021 19:34:22 +0100 Subject: [PATCH] Bring windows to top if already opened somewhere --- CHANGELOG.md | 3 +++ README.md | 6 ++++++ module.json | 4 ++-- modules/patch.js | 5 ++++- package-lock.json | 4 ++-- package.json | 6 +++--- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 626e05d..4766518 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 1.1.5 +* Enhancement: Patched foundry so already opened windows are brought to the front if they are behind other windows when reopened + ### 1.1.4 * Bugfix: Default setting for opacity was not correctly set (5am coding is not healthy) diff --git a/README.md b/README.md index 7384d89..990fce8 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,12 @@ Note: Since Foundry 0.8.x Scene Navigation Preview is on a separate module, look * Define Transparency when moving the mouse over components! * Check the settings to customize your experience! +## Patches to Foundry +These are bugs in FoundryVTT that are not currently addressed, Minimal UI fixes them because they are more obvious here +* When clicking on a sidebar menu that was opened but then closed, clicking on it will open it again instead of doing nothing +* If a window is minimized, when reopened, it would be maximized instead of doing nothing +* If a window is open, but behind other windows, it would be brought ot the front when reopened, instead doing of nothing + ## By JeansenVaars ![JVLogo](logo-small-black.png) diff --git a/module.json b/module.json index 5f7cd83..7d19658 100644 --- a/module.json +++ b/module.json @@ -3,7 +3,7 @@ "title": "Minimal UI", "author": "JeansenVaars#2857", "description": "Minimal UI allows customizing Foundry interface, by hiding, collapsing or resizing specific parts.", - "version": "1.1.4", + "version": "1.15", "minimumCoreVersion": "0.8.9", "compatibleCoreVersion": "0.8.9", "dependencies": [ @@ -30,5 +30,5 @@ ], "url": "https://github.com/saif-ellafi/foundryvtt-minimal-ui.git", "manifest": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/releases/latest/download/module.json", - "download": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/releases/download/1.1.4/foundryvtt-minimal-ui_1.1.4.zip" + "download": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/releases/download/1.15/foundryvtt-minimal-ui_1.15.zip" } diff --git a/modules/patch.js b/modules/patch.js index b677b32..403d320 100644 --- a/modules/patch.js +++ b/modules/patch.js @@ -7,7 +7,10 @@ export default class MinimalUIPatch { static initHooks() { Hooks.on('changeSidebarTab', function (app) { const target = Object.values(ui.windows).find(a => a.tabName === app.tabName); - if (target && target._minimized) target.maximize(); + if (target && target._minimized) + target.maximize(); + else if (target) + target.bringToTop(); }); Hooks.once('ready', async function () { diff --git a/package-lock.json b/package-lock.json index 6685116..66c3c3b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "foundryvtt-minimal-ui", - "version": "1.1.4", + "version": "1.15", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "foundryvtt-minimal-ui", - "version": "1.1.4", + "version": "1.15", "license": "MIT", "dependencies": { "@rollup/plugin-json": "^4.1.0", diff --git a/package.json b/package.json index 5c44128..7a36272 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "foundryvtt-minimal-ui", - "version": "1.1.4", + "version": "1.15", "description": "Minimal UI allows customizing Foundry interface, by hiding, collapsing or resizing specific parts.", "main": "minimalui.js", "scripts": { - "copy": "cp ./module.json dist/ && cp ./THANKS.txt dist/ && cp -r ./lang dist/", - "copyWin": "copy module.json dist && copy THANKS.txt dist && xcopy /Y /I lang dist\\lang", + "copy": "cp ./module.json dist/ && cp ./THANKS.txt dist/ && cp ./LICENSE.md.txt dist/ && cp ./README.md dist/ && cp -r ./lang dist/", + "copyWin": "copy module.json dist && copy THANKS.txt dist && copy LICENSE.md dist && copy README.md dist && xcopy /Y /I lang dist\\lang", "build": "rollup --config ./rollup.config.js && npm run copy", "buildWin": "rollup --config ./rollup.config.js && npm run copyWin", "zip": "npm-build-zip --source=dist --destination=.",