Skip to content

Commit

Permalink
Bring windows to top if already opened somewhere
Browse files Browse the repository at this point in the history
  • Loading branch information
saif-ellafi committed Nov 14, 2021
1 parent ce9dfd8 commit 74d4b06
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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"
}
5 changes: 4 additions & 1 deletion modules/patch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -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=.",
Expand Down

0 comments on commit 74d4b06

Please sign in to comment.