Skip to content

Commit

Permalink
Adjustments to support autohide
Browse files Browse the repository at this point in the history
  • Loading branch information
saif-ellafi committed Jul 7, 2023
1 parent 5ef9a03 commit faab272
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions modules/component/hotbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ export default class MinimalUIHotbar {

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

static cssHotbarWinControlsModBottom = '33px';
static cssHotbarWinControlsModTop = '1px';
static cssHotbarAutoHideHeightWinTop = '1px';

static cssHotbarLeftControlsLineHeight = '24px';
static cssHotbarRightControlsLineHeight = '12px';
Expand Down Expand Up @@ -123,12 +121,8 @@ export default class MinimalUIHotbar {
static configureHotbar() {
if (game.modules.get('window-controls')?.active &&
game.settings.get('window-controls', 'organizedMinimize') === 'persistentBottom') {
rootStyle.setProperty('--hotbarypos', MinimalUIHotbar.cssHotbarWinControlsModBottom);
rootStyle.setProperty('--hotbarhv', MinimalUIHotbar.cssHotbarWinControlsModBottom);
} else if (game.modules.get('window-controls')?.active &&
game.settings.get('window-controls', 'organizedMinimize') === 'persistentTop') {
rootStyle.setProperty('--hotbarypos', MinimalUIHotbar.cssHotbarWinControlsModTop);
rootStyle.setProperty('--hotbarhv', MinimalUIHotbar.cssHotbarWinControlsModTop);
rootStyle.setProperty('--hotbarypos', MinimalUIHotbar.cssHotbarPlayerBottomWinBottom);
rootStyle.setProperty('--hotbarhv', MinimalUIHotbar.cssHotbarPlayerBottomWinBottom);
} 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);
Expand All @@ -139,7 +133,11 @@ export default class MinimalUIHotbar {
}
rootStyle.setProperty('--hotbarmg', MinimalUIHotbar.cssHotbarControlsMargin);
rootStyle.setProperty('--hotbarhh', MinimalUIHotbar.cssHotbarControlsAutoHideHeight);
rootStyle.setProperty('--hotbarhv', MinimalUIHotbar.cssHotbarAutoHideHeight);
if (game.modules.get('window-controls')?.active &&
game.settings.get('window-controls', 'organizedMinimize') === 'persistentTop')
rootStyle.setProperty('--hotbarhv', MinimalUIHotbar.cssHotbarAutoHideHeightWinTop);
else
rootStyle.setProperty('--hotbarhv', MinimalUIHotbar.cssHotbarAutoHideHeight);
rootStyle.setProperty('--hotbarshp', MinimalUIHotbar.cssHotbarAutoHideShadow);
$("#hotbar-directory-controls").append(MinimalUIHotbar.htmlHotbarLockButton);
$("#macro-directory").click(function () {
Expand Down

0 comments on commit faab272

Please sign in to comment.