From b724f4376608b9f3a9fdda097cb68a951216d432 Mon Sep 17 00:00:00 2001 From: Saif Addin Date: Sat, 6 Jan 2024 01:52:51 +0100 Subject: [PATCH] fix navigation with player list --- CHANGELOG.md | 3 ++ module.json | 4 +-- modules/component/players.js | 49 +++++++++++++++++++++++++++++++++ package-lock.json | 40 +++++++++++++-------------- package.json | 2 +- styles/component/navigation.css | 5 ++++ 6 files changed, 80 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0c6639..8ed197e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 1.6.11 +* Bugfix: Fixed scene navigation moving with players list + ### 1.6.10 * Compatibility: Starfinder system navi fix diff --git a/module.json b/module.json index 7b5cef3..4e309bf 100644 --- a/module.json +++ b/module.json @@ -10,7 +10,7 @@ } ], "description": "Minimal UI allows customizing Foundry interface, by hiding, collapsing or resizing specific parts.", - "version": "1.6.10", + "version": "1.6.11", "compatibility": { "minimum": "10", "verified": "11.315", @@ -49,7 +49,7 @@ ], "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.6.10/foundryvtt-minimal-ui_1.6.10.zip", + "download": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/releases/download/1.6.11/foundryvtt-minimal-ui_1.6.11.zip", "readme": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/blob/main/README.md", "license": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/blob/main/LICENSE.md", "changelog": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/blob/main/CHANGELOG.md" diff --git a/modules/component/players.js b/modules/component/players.js index 6532fd7..1df6782 100644 --- a/modules/component/players.js +++ b/modules/component/players.js @@ -101,11 +101,19 @@ export default class MinimalUIPlayers { rootStyle.setProperty('--playerfsize', MinimalUIPlayers.cssPlayersSmallFontSize); rootStyle.setProperty('--players-width', MinimalUIPlayers.cssPlayersSmallWidth); rootStyle.setProperty('--playerwidthhv', MinimalUIPlayers.cssPlayersSmallWidth); + if (game.system.id === 'sfrpg') + rootStyle.setProperty('--topleft', '-184px'); + else + rootStyle.setProperty('--topleft', '-175px'); } else { rootStyle.setProperty('--playerfsize', MinimalUIPlayers.cssPlayersStandardFontSize); rootStyle.setProperty('--playerfsizehv', MinimalUIPlayers.cssPlayersStandardFontSize); rootStyle.setProperty('--players-width', MinimalUIPlayers.cssPlayersStandardWidth); rootStyle.setProperty('--playerwidthhv', MinimalUIPlayers.cssPlayersStandardWidth); + if (game.system.id === 'sfrpg') + rootStyle.setProperty('--topleft', '-209px'); + else + rootStyle.setProperty('--topleft', '-200px'); } rootStyle.setProperty('--playervis', 'visible'); rootStyle.setProperty('--playerslh', '20px'); @@ -182,6 +190,13 @@ export default class MinimalUIPlayers { ); } // --- + if (game.settings.get('minimal-ui', 'controlsSize') === 'small') + rootStyle.setProperty('--topleft', '-90px'); + else + if (game.system.id === 'sfrpg') + rootStyle.setProperty('--topleft', '-110px'); + else + rootStyle.setProperty('--topleft', '-101px'); if (plSetting === 'autohide') { players.hover( () => { @@ -189,12 +204,29 @@ export default class MinimalUIPlayers { players.css('font-size', 'var(--playerfsizehv)'); players.css('opacity', '100%'); $("#players ol li.player").css('line-height', '20px'); + if (plSize === 'small') + if (game.system.id === 'sfrpg') + rootStyle.setProperty('--topleft', '-184px'); + else + rootStyle.setProperty('--topleft', '-175px'); + else + if (game.system.id === 'sfrpg') + rootStyle.setProperty('--topleft', '-209px'); + else + rootStyle.setProperty('--topleft', '-200px'); }, () => { players.css('width', ''); players.css('font-size', 'var(--playerfsize)'); players.css('opacity', 'var(--opacity)'); $("#players ol li.player").css('line-height', '2px'); + if (game.settings.get('minimal-ui', 'controlsSize') === 'small') + rootStyle.setProperty('--topleft', '-90px'); + else + if (game.system.id === 'sfrpg') + rootStyle.setProperty('--topleft', '-110px'); + else + rootStyle.setProperty('--topleft', '-101px'); }) } else { players.css('transition', 'ease-out 0.5s'); @@ -206,6 +238,16 @@ export default class MinimalUIPlayers { players.css('font-size', 'var(--playerfsizehv)'); players.css('opacity', '100%'); $("#players ol li.player").css('line-height', '20px'); + if (plSize === 'small') + if (game.system.id === 'sfrpg') + rootStyle.setProperty('--topleft', '-184px'); + else + rootStyle.setProperty('--topleft', '-175px'); + else + if (game.system.id === 'sfrpg') + rootStyle.setProperty('--topleft', '-209px'); + else + rootStyle.setProperty('--topleft', '-200px'); state = 1; setTimeout(() => {if (state === 1 ) players.css('transition', 'ease-out 0.5s')}, 100); } else { @@ -214,6 +256,13 @@ export default class MinimalUIPlayers { players.css('font-size', 'var(--playerfsize)'); players.css('opacity', 'var(--opacity)'); $("#players ol li.player").css('line-height', '2px'); + if (game.settings.get('minimal-ui', 'controlsSize') === 'small') + rootStyle.setProperty('--topleft', '-90px'); + else + if (game.system.id === 'sfrpg') + rootStyle.setProperty('--topleft', '-110px'); + else + rootStyle.setProperty('--topleft', '-101px'); state = 0; setTimeout(() => {if (state === 0 ) players.css('transition', 'ease-out 0.5s')}, 100); } diff --git a/package-lock.json b/package-lock.json index 84b21cf..31f3d7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "foundryvtt-minimal-ui", - "version": "1.6.10", + "version": "1.6.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "foundryvtt-minimal-ui", - "version": "1.6.10", + "version": "1.6.11", "license": "MIT", "dependencies": { "@rollup/plugin-json": "^4.1.0", @@ -50,9 +50,9 @@ "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" }, "node_modules/ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true, "engines": { "node": ">=6" @@ -117,9 +117,9 @@ } }, "node_modules/async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, "dependencies": { "lodash": "^4.17.14" @@ -534,9 +534,9 @@ "dev": true }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "dependencies": { "brace-expansion": "^1.1.7" @@ -1023,9 +1023,9 @@ "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==" }, "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==", "dev": true }, "ansi-styles": { @@ -1078,9 +1078,9 @@ } }, "async": { - "version": "2.6.3", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", - "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", + "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", "dev": true, "requires": { "lodash": "^4.17.14" @@ -1404,9 +1404,9 @@ "dev": true }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dev": true, "requires": { "brace-expansion": "^1.1.7" diff --git a/package.json b/package.json index 5470ebc..cfc5be7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "foundryvtt-minimal-ui", - "version": "1.6.10", + "version": "1.6.11", "description": "Minimal UI allows customizing Foundry interface, by hiding, collapsing or resizing specific parts.", "main": "minimalui.js", "scripts": { diff --git a/styles/component/navigation.css b/styles/component/navigation.css index 5f9430d..bbd9974 100644 --- a/styles/component/navigation.css +++ b/styles/component/navigation.css @@ -8,6 +8,11 @@ --navibuttonsize: 23px; --navileft: -10px; --naviright: 0px; + --topleft: -200px; +} + +#ui-top.offset { + margin-left: var(--topleft); } #navigation {