Skip to content

Commit

Permalink
New hotbar functions
Browse files Browse the repository at this point in the history
  • Loading branch information
saif-ellafi committed Dec 27, 2021
1 parent 934573c commit f65526a
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 15 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### 1.4.0
* Enhancement: Achieve a new level of minimalism with new Minimal UI defaults and settings
* Enhancement: New Setting "Extreme Default" (Default) position for Macro, pushes the players list above it
* Enhancement: Hotbar controls now have border radius and color as the rest of minimal ui components
* Default: Hotbar is now by default set to "collapsed" mode
* Default: Left Side Controls now by default set to "Auto-Hide Plus" mode
* Compatibility: Monk Hotbar's Expansion disables hotbar functionality for compatibility's sake

### 1.3.3
* Compatibility: For V9 compatibility with Custom-Hotbar, Raise your Hand

Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ This includes hiding Foundry's Logo, Players List, Scene Navigation and Macro Ba
#### [This module was made for free, with joy, hard work, to be shared with a wonderful community, and tons of Coffee :D!](https://ko-fi.com/jeansenvaars)
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/V7V14D3AH)

(The following image is the default look and feel for upcoming Foundry V9)
![Example Image](./example16.png)
![Example](example17.png)

## Compatibility issues?

Expand Down
Binary file removed example16.png
Binary file not shown.
Binary file added example17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"MinimalUI.HotbarPositionName": "Position Makro Hotbar",
"MinimalUI.HotbarPositionHint": "Horizontale Position der Makro Hotbar",
"MinimalUI.HotbarPositionMaxLeft": "Links (Standard in Foundry)",
"MinimalUI.HotbarPositionExtremeLeft": "Ganz links",
"MinimalUI.HotbarPositionCenterLeft": "Links zentriert",
"MinimalUI.HotbarPositionCenter": "Zentriert",
"MinimalUI.HotbarPositionCenterRight": "Rechts zentriert",
Expand Down
1 change: 1 addition & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"MinimalUI.HotbarStyleHint": "Customize Hotbar UI. Auto-Hide Ignored when using Custom Hotbar module.",
"MinimalUI.HotbarPositionName": "Macro Hotbar Position",
"MinimalUI.HotbarPositionHint": "Horizontal position of the Macro Hotbar",
"MinimalUI.HotbarPositionExtremeLeft": "Extreme Left",
"MinimalUI.HotbarPositionMaxLeft": "Left (Foundry Default)",
"MinimalUI.HotbarPositionCenterLeft": "Center Left",
"MinimalUI.HotbarPositionCenter": "Center",
Expand Down
1 change: 1 addition & 0 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"MinimalUI.HotbarPositionName": "Posición de la barra de macros",
"MinimalUI.HotbarPositionHint": "Posición horizontal de la barra de macros",
"MinimalUI.HotbarPositionMaxLeft": "A la izquierda (Por defecto en Foundry)",
"MinimalUI.HotbarPositionExtremeLeft": "Extremo a la izquierda",
"MinimalUI.HotbarPositionCenterLeft": "Centrado a la izquierda",
"MinimalUI.HotbarPositionCenter": "Centrado",
"MinimalUI.HotbarPositionCenterRight": "Centrado a la derecha",
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.3.3",
"version": "1.4.0",
"minimumCoreVersion": "9.233",
"compatibleCoreVersion": "9.238",
"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.3.3/foundryvtt-minimal-ui_1.3.3.zip"
"download": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/releases/download/1.4.0/foundryvtt-minimal-ui_1.4.0.zip"
}
2 changes: 1 addition & 1 deletion modules/component/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default class MinimalUIControls {
"autohide-plus": game.i18n.localize("MinimalUI.SettingsAutoHidePlus"),
"visible": game.i18n.localize("MinimalUI.SettingsAlwaysVisible")
},
default: "autohide",
default: "autohide-plus",
onChange: debouncedReload
});
};
Expand Down
19 changes: 14 additions & 5 deletions modules/component/hotbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class MinimalUIHotbar {
static cssHotbarRightControlsLineHeight = '12px';
static cssHotbarRightControlsLineHeightDnDUi = '10px';
static cssHotbarControlsAutoHideHeight = '100%';
static cssHotbarAutoHideHeight = '-5px';
static cssHotbarAutoHideHeight = '-8px';
static cssHotbarAutoHideShadow = '-1px';
static cssHotbarControlsMargin = '0px';
static cssHotbarCustomHotbarCompatHover = '10px';
Expand Down Expand Up @@ -49,6 +49,13 @@ export default class MinimalUIHotbar {
rootStyle.setProperty('--hotbarxpos', '220px');
break;
}
case 'extremeLeft': {
if (!(game.modules.get("custom-hotbar")?.active) && !(game.modules.get('monks-hotbar-expansion')?.active)) {
rootStyle.setProperty('--hotbarxpos', '5px');
rootStyle.setProperty('--playerbot', '55px');
}
break;
}
case 'left': {
rootStyle.setProperty('--hotbarxpos', ((availableWidth / 2.5) - (availableWidth / 9) - (availableWidth / 9)) + 'px');
break;
Expand All @@ -75,7 +82,7 @@ export default class MinimalUIHotbar {
break;
}
case 'autohide': {
if (!(game.modules.get("custom-hotbar")?.active)) {
if (!(game.modules.get("custom-hotbar")?.active) && !(game.modules.get('monks-hotbar-expansion')?.active)) {
rootStyle.setProperty('--hotbarypos', MinimalUIHotbar.cssHotbarHidden);
rootStyle.setProperty('--hotbarlh1', MinimalUIHotbar.cssHotbarLeftControlsLineHeight);
rootStyle.setProperty('--hotbarlh2', MinimalUIHotbar.cssHotbarRightControlsLineHeight);
Expand Down Expand Up @@ -121,7 +128,7 @@ export default class MinimalUIHotbar {
"onlygm": game.i18n.localize("MinimalUI.SettingsOnlyGM"),
"hidden": game.i18n.localize("MinimalUI.SettingsHide")
},
default: "autohide",
default: "collapsed",
onChange: debouncedReload
});

Expand All @@ -133,12 +140,13 @@ export default class MinimalUIHotbar {
type: String,
choices: {
"default": game.i18n.localize("MinimalUI.HotbarPositionMaxLeft"),
"extremeLeft": game.i18n.localize("MinimalUI.HotbarPositionExtremeLeft"),
"left": game.i18n.localize("MinimalUI.HotbarPositionCenterLeft"),
"center": game.i18n.localize("MinimalUI.HotbarPositionCenter"),
"right": game.i18n.localize("MinimalUI.HotbarPositionCenterRight"),
"manual": game.i18n.localize("MinimalUI.HotbarPositionManual")
},
default: "default",
default: "extremeLeft",
onChange: MinimalUIHotbar.positionHotbar
});

Expand Down Expand Up @@ -171,7 +179,8 @@ export default class MinimalUIHotbar {
ui.hotbar.element.show();
});

Hooks.once('renderHotbar', function () {
// Needs to be .on so changing hotbar pages also applies
Hooks.on('renderHotbar', function () {
MinimalUIHotbar.configureHotbar();
if (game.modules.get('custom-hotbar')?.active)
rootStyle.setProperty('--hotbarhv', MinimalUIHotbar.cssHotbarCustomHotbarCompatHover);
Expand Down
2 changes: 1 addition & 1 deletion modules/component/players.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import '../../styles/component/players.css';

export default class MinimalUIPlayers {

static cssPlayersHiddenWidth = '28px';
static cssPlayersHiddenWidth = '32px';
static cssPlayersSmallFontSize = '12px';
static cssPlayersSmallWidth = '175px';
static cssPlayersStandardFontSize = 'inherit';
Expand Down
2 changes: 1 addition & 1 deletion 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.3.3",
"version": "1.4.0",
"description": "Minimal UI allows customizing Foundry interface, by hiding, collapsing or resizing specific parts.",
"main": "minimalui.js",
"scripts": {
Expand Down
9 changes: 9 additions & 0 deletions styles/component/hotbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
background: #191919;
height: var(--hotbarhh);
margin: var(--hotbarmg) 2px;
box-shadow: 0 var(--hotbarshp) var(--shadowstrength) 2px var(--shadowcolor);
border: 1px solid var(--bordercolor);
border-radius: 5px;
}

#hotbar .bar-controls a.page-control {
Expand Down Expand Up @@ -61,4 +64,10 @@

#hotbar #hotbar-directory-controls a {
line-height: var(--hotbarlh1);
}

#hotbar-page-controls, #hotbar-directory-controls {
box-shadow: 0 var(--hotbarshp) var(--shadowstrength) 2px var(--shadowcolor);
border: 1px solid var(--bordercolor);
border-radius: 5px;
}
4 changes: 2 additions & 2 deletions styles/component/players.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
}

#players ol li.player {
padding: 1px 6px;
padding: 1px 10px;
line-height: var(--playerslh);
}

Expand All @@ -50,7 +50,7 @@
}

#players h3 {
margin: 0 -2px;
margin: 0 1px;
border-bottom: 0;
width: var(--playerh3w);
}
Expand Down

0 comments on commit f65526a

Please sign in to comment.