Skip to content

Commit

Permalink
Hotbar adjusted
Browse files Browse the repository at this point in the history
  • Loading branch information
saif-ellafi committed Jun 23, 2023
1 parent 43fa073 commit 305e973
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 24 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 1.6.3
* Bugfix: Adjusted hotbar (again) and Window Controls support

### 1.6.2
* Bugfix: Adjusted hotbar positioning and starfinder support

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.2",
"version": "1.6.3",
"compatibility": {
"minimum": "10",
"verified": "11.302",
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.2/foundryvtt-minimal-ui_1.6.2.zip",
"download": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/releases/download/1.6.3/foundryvtt-minimal-ui_1.6.3.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
40 changes: 23 additions & 17 deletions modules/component/hotbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,21 @@ export default class MinimalUIHotbar {
static hotbarLocked = false;

static cssHotbarHidden = '-50px';
static cssHotbarAutoHideHeight = '-5px';

static cssHotbarWinControlsMod = '35px';

static cssHotbarLeftControlsLineHeight = '24px';
static cssHotbarRightControlsLineHeight = '12px';
static cssHotbarRightControlsLineHeightDnDUi = '10px';
static cssHotbarControlsAutoHideHeight = '100%';
static cssHotbarAutoHideHeight = '-5px';
static cssHotbarAutoHideShadow = '-1px';
static cssHotbarControlsMargin = '0px';
static cssHotbarCustomHotbarCompatHover = '10px';

static cssHotbarPlayerBottom = '-5px';
static cssHotbarPlayerBottomAdj = '55px'

static htmlHotbarLockButton =
`
<a class="minui-lock" id="bar-lock">
Expand Down Expand Up @@ -51,63 +56,64 @@ export default class MinimalUIHotbar {
case 'default': {
rootStyle.setProperty('--hotbarxpos', (330 - webtrcAdjust)+'px');
if (game.webrtc?.mode === 0 || ui.webrtc?.hidden)
rootStyle.setProperty('--playerbot', '-5px');
rootStyle.setProperty('--playerbot', MinimalUIHotbar.cssHotbarPlayerBottom);
else
rootStyle.setProperty('--playerbot', '55px');
rootStyle.setProperty('--playerbot', MinimalUIHotbar.cssHotbarPlayerBottomAdj);
break;
}
case 'extremeLeft': {
if (
!(game.modules.get("custom-hotbar")?.active) &&
availableWidth >= 1200
) {
if (game.system.id === 'sfrpg')
rootStyle.setProperty('--hotbarxpos', '-93px');
else
rootStyle.setProperty('--hotbarxpos', '-102px');
rootStyle.setProperty('--hotbarxpos', '8px');
if (!(game.modules.get('sidebar-macros')?.active && game.settings.get('sidebar-macros', 'hideMacroHotbar')))
rootStyle.setProperty('--playerbot', '55px');
rootStyle.setProperty('--playerbot', MinimalUIHotbar.cssHotbarPlayerBottomAdj);
}
break;
}
case 'left': {
rootStyle.setProperty('--hotbarxpos', ((availableWidth / 2.5) - (availableWidth / 9) - (availableWidth / 9) - webtrcAdjust) + 'px');
if (game.webrtc?.mode === 0 || ui.webrtc?.hidden)
rootStyle.setProperty('--playerbot', '-5px');
rootStyle.setProperty('--playerbot', MinimalUIHotbar.cssHotbarPlayerBottom);
else
rootStyle.setProperty('--playerbot', '55px');
rootStyle.setProperty('--playerbot', MinimalUIHotbar.cssHotbarPlayerBottomAdj);
break;
}
case 'center': {
rootStyle.setProperty('--hotbarxpos', ((availableWidth / 2.5) - (availableWidth / 9) - webtrcAdjust) + 'px');
if (game.webrtc?.mode === 0 || ui.webrtc?.hidden)
rootStyle.setProperty('--playerbot', '-5px');
rootStyle.setProperty('--playerbot', MinimalUIHotbar.cssHotbarPlayerBottom);
else
rootStyle.setProperty('--playerbot', '55px');
rootStyle.setProperty('--playerbot', MinimalUIHotbar.cssHotbarPlayerBottomAdj);
break;
}
case 'right': {
rootStyle.setProperty('--hotbarxpos', ((availableWidth / 2.5) - webtrcAdjust) + 'px');
if (game.webrtc?.mode === 0 || ui.webrtc?.hidden)
rootStyle.setProperty('--playerbot', '-5px');
rootStyle.setProperty('--playerbot', MinimalUIHotbar.cssHotbarPlayerBottom);
else
rootStyle.setProperty('--playerbot', '55px');
rootStyle.setProperty('--playerbot', MinimalUIHotbar.cssHotbarPlayerBottomAdj);
break;
}
case 'manual': {
rootStyle.setProperty('--hotbarxpos', (game.settings.get('minimal-ui', 'hotbarPixelPosition') - webtrcAdjust) + 'px');
if (game.webrtc?.mode === 0 || ui.webrtc?.hidden)
rootStyle.setProperty('--playerbot', '-5px');
rootStyle.setProperty('--playerbot', MinimalUIHotbar.cssHotbarPlayerBottom);
else
rootStyle.setProperty('--playerbot', '55px');
rootStyle.setProperty('--playerbot', MinimalUIHotbar.cssHotbarPlayerBottomAdj);
break;
}
}

}

static configureHotbar() {
if (game.settings.get('minimal-ui', 'hotbar') === 'autohide') {
if (game.modules.get('window-controls')?.active &&
game.settings.get('window-controls', 'organizedMinimize') === 'persistentBottom') {
rootStyle.setProperty('--hotbarypos', MinimalUIHotbar.cssHotbarWinControlsMod);
rootStyle.setProperty('--hotbarhv', MinimalUIHotbar.cssHotbarWinControlsMod);
} else if (game.settings.get('minimal-ui', 'hotbar') === 'autohide') {
if (!(game.modules.get("custom-hotbar")?.active || game.modules.get('monks-hotbar-expansion')?.active)) {
rootStyle.setProperty('--hotbarypos', MinimalUIHotbar.cssHotbarHidden);
rootStyle.setProperty('--hotbarlh1', MinimalUIHotbar.cssHotbarLeftControlsLineHeight);
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.2",
"version": "1.6.3",
"description": "Minimal UI allows customizing Foundry interface, by hiding, collapsing or resizing specific parts.",
"main": "minimalui.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion styles/component/hotbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
visibility: var(--hotbarvis);
transition: 0.5s ease-out 0.5s;
opacity: var(--opacity);
position: relative;
position: fixed;
}

#hotbar .bar-controls {
Expand Down

0 comments on commit 305e973

Please sign in to comment.