Skip to content

Commit

Permalink
Fixed custom positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
saif-ellafi committed Oct 25, 2023
1 parent 331cb47 commit 2ef04ac
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 30 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 1.6.7
* Enhancement: Improved setting change detection
* Bugfix: Fixed broken hotbar and navigation custom positioning (Thanks @GambetTV)

### 1.6.6
* Bugfix: Fixed several issues with Minimal UI when using Camera views
* Compatibility: Fixed player list overlapping with other mods in general
Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"description": "Minimal UI allows customizing Foundry interface, by hiding, collapsing or resizing specific parts.",
"version": "1.6.6",
"version": "1.6.7",
"compatibility": {
"minimum": "10",
"verified": "11.313",
Expand Down Expand Up @@ -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.6/foundryvtt-minimal-ui_1.6.6.zip",
"download": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/releases/download/1.6.7/foundryvtt-minimal-ui_1.6.7.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"
Expand Down
6 changes: 2 additions & 4 deletions modules/component/hotbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ export default class MinimalUIHotbar {
static cssHotbarControlsMargin = '0px';
static cssHotbarCustomHotbarCompatHover = '10px';

static cssHotbarBottomWinBottom = '33px'

static htmlHotbarLockButton =
`
<a class="minui-lock" id="bar-lock">
Expand Down Expand Up @@ -97,7 +95,7 @@ export default class MinimalUIHotbar {
break;
}
case 'manual': {
rootStyle.setProperty('--hotbarxpos', (game.settings.get('minimal-ui', 'hotbarPixelPosition') + webrtcAdjust) + 'px');
rootStyle.setProperty('--hotbarxpos', (parseInt(game.settings.get('minimal-ui', 'hotbarPixelPosition')) + webrtcAdjust) + 'px');
break;
}
}
Expand Down Expand Up @@ -207,7 +205,7 @@ export default class MinimalUIHotbar {
}
});

Hooks.on('renderCameraViews', function() {
Hooks.on('rtcSettingsChanged', function() {
MinimalUIHotbar.positionHotbar();
})

Expand Down
26 changes: 8 additions & 18 deletions modules/component/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@ import '../../styles/component/navigation.css';

export default class MinimalUINavigation {

static cssSceneNavNoLogoStart = '-9px';
static cssSceneNavNoLogoStartStarfinder = '-2px';
static cssSceneNavNoLogoStartRtc = '-115px';
static cssSceneNavNoLogoStart = 10;

static async collapseNavigation() {
await ui.nav.collapse();
}

static positionNav() {
let navixpos = game.settings.get('minimal-ui', 'foundryLogoSize') === 'hidden' ? MinimalUINavigation.cssSceneNavNoLogoStart : 120;
if (game.webrtc.mode > 0 && !ui.webrtc.element.hasClass('hidden'))
rootStyle.setProperty('--navixpos', MinimalUINavigation.cssSceneNavNoLogoStartRtc);
else if (game.system.id === 'sfrpg') // starfinder has something, ugly fix
rootStyle.setProperty('--navixpos', MinimalUINavigation.cssSceneNavNoLogoStartStarfinder);
else
rootStyle.setProperty('--navixpos', MinimalUINavigation.cssSceneNavNoLogoStart);
if (game.webrtc.settings.client.dockPosition === 'left')
navixpos += ui.webrtc.position.width;
rootStyle.setProperty('--navixpos', navixpos + 'px');
}

static initSettings() {
Expand All @@ -34,7 +31,7 @@ export default class MinimalUINavigation {
"hidden": game.i18n.localize("MinimalUI.SettingsHide")
},
default: "collapsed",
onChange: debouncedReload
onChange: MinimalUINavigation.positionNav
});

game.settings.register('minimal-ui', 'sceneNavigationSize', {
Expand Down Expand Up @@ -101,17 +98,10 @@ export default class MinimalUINavigation {
});

Hooks.on('renderSceneNavigation', async function () {

switch (game.settings.get('minimal-ui', 'foundryLogoSize')) {
case 'hidden': {
MinimalUINavigation.positionNav();
break;
}
}

MinimalUINavigation.positionNav();
});

Hooks.on('renderCameraViews', function () {
Hooks.on('rtcSettingsChanged', function () {
MinimalUINavigation.positionNav();
});

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "foundryvtt-minimal-ui",
"version": "1.6.6",
"version": "1.6.7",
"description": "Minimal UI allows customizing Foundry interface, by hiding, collapsing or resizing specific parts.",
"main": "minimalui.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions styles/component/navigation.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:root {
--navivis: hidden;
--navixpos: 100px;
--navixpos: 120px;
--navixmg: 75px;
--navilh: 20px;
--navifs: 14px;
Expand All @@ -13,7 +13,7 @@
visibility: var(--navivis);
opacity: var(--opacity);
transition: 0.5s ease-out 0.5s;
position: relative;
position: fixed;
margin: 5px 0 0 0;
}

Expand Down

0 comments on commit 2ef04ac

Please sign in to comment.