From 039028a2431fc9ea313a522b8df02fbf02aeb226 Mon Sep 17 00:00:00 2001 From: Saif Addin Date: Fri, 26 Nov 2021 22:13:57 +0100 Subject: [PATCH] Partially visible left controls behavior --- CHANGELOG.md | 3 +++ README.md | 2 +- lang/de.json | 1 + lang/en.json | 1 + lang/es.json | 1 + module.json | 4 ++-- modules/component/controls.js | 17 +++++++++++++++-- package.json | 2 +- styles/component/controls.css | 2 ++ 9 files changed, 27 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db0da26..c30f82b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 1.1.8 +* Enhancement: New Left Controls Behavior - Partially Visible, hides the second column of left side buttons + ### 1.1.7 * Bugfix: Fixed Macro Hotbar forgetting position after setting change broken in 1.1.6 diff --git a/README.md b/README.md index decd462..f4de018 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,8 @@ Note: Since Foundry 0.8.x Scene Navigation Preview is on a separate module, look * Macro Bar may be repositioned along the X-Axis ## Left Side Control Buttons +* May be shown normally, partially visible or auto-hide mode on mouse over * Left controls may be collapsed into a single column (or not) -* May be shown normally or auto-hide mode on mouse over * Left controls may be standard or small size * Left controls may be repositioned along the Y-Axis diff --git a/lang/de.json b/lang/de.json index 9bb9087..d0cee49 100644 --- a/lang/de.json +++ b/lang/de.json @@ -4,6 +4,7 @@ "MinimalUI.SettingsAlwaysVisible": "Immer sichtbar", "MinimalUI.SettingsStartVisible": "Starte sichtbar", + "MinimalUI.SettingsPartiallyVisible": "Teilweise sichtbar", "MinimalUI.SettingsAutoHide": "Automatisch verstecken", "MinimalUI.SettingsCollapsed": "Starte eingeklappt", "MinimalUI.SettingsOnlyGM": "Nur für die SL sichtbar", diff --git a/lang/en.json b/lang/en.json index e13b86a..7349fbc 100644 --- a/lang/en.json +++ b/lang/en.json @@ -4,6 +4,7 @@ "MinimalUI.SettingsAlwaysVisible": "Always Visible", "MinimalUI.SettingsStartVisible": "Start Visible", + "MinimalUI.SettingsPartiallyVisible": "Partially Visible", "MinimalUI.SettingsAutoHide": "Auto-Hide", "MinimalUI.SettingsCollapsed": "Start Collapsed", "MinimalUI.SettingsOnlyGM": "Visible to GM Only", diff --git a/lang/es.json b/lang/es.json index 1c0cb25..2a918e5 100644 --- a/lang/es.json +++ b/lang/es.json @@ -4,6 +4,7 @@ "MinimalUI.SettingsAlwaysVisible": "Siempre visible", "MinimalUI.SettingsStartVisible": "Iniciar Visible", + "MinimalUI.SettingsPartiallyVisible": "Parcialmente Visible", "MinimalUI.SettingsAutoHide": "Auto-ocultar", "MinimalUI.SettingsCollapsed": "Iniciar plegado", "MinimalUI.SettingsOnlyGM": "Visible solo al DM", diff --git a/module.json b/module.json index 9329762..acf3759 100644 --- a/module.json +++ b/module.json @@ -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.1.7", + "version": "1.1.8", "minimumCoreVersion": "0.8.9", "compatibleCoreVersion": "0.8.9", "dependencies": [ @@ -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.1.7/foundryvtt-minimal-ui_1.1.7.zip" + "download": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/releases/download/1.1.8/foundryvtt-minimal-ui_1.1.8.zip" } diff --git a/modules/component/controls.js b/modules/component/controls.js index 062ad8b..cb91e9c 100644 --- a/modules/component/controls.js +++ b/modules/component/controls.js @@ -36,14 +36,24 @@ export default class MinimalUIControls { } static revealControlTools() { + const controlSettings = game.settings.get('minimal-ui', 'controlsBehaviour'); if (game.settings.get('minimal-ui', 'controlsSize') === 'small') { - rootStyle.setProperty('--controlssubleft', MinimalUIControls.cssControlsSubMenuSmall); + if (controlSettings === 'partial') + rootStyle.setProperty('--controlssubleft', MinimalUIControls.cssControlsHiddenPositionSmall); + else + rootStyle.setProperty('--controlssubleft', MinimalUIControls.cssControlsSubMenuSmall); + rootStyle.setProperty('--controlssubsubleft', MinimalUIControls.cssControlsSubMenuSmall); } else { - rootStyle.setProperty('--controlssubleft', MinimalUIControls.cssControlsSubMenuStandard); + if (controlSettings === 'partial') + rootStyle.setProperty('--controlssubleft', MinimalUIControls.cssControlsHiddenPositionStandard); + else + rootStyle.setProperty('--controlssubleft', MinimalUIControls.cssControlsSubMenuStandard); + rootStyle.setProperty('--controlssubsubleft', MinimalUIControls.cssControlsSubMenuStandard); } // Special compatibility DnD-UI if (game.modules.get('dnd-ui') && game.modules.get('dnd-ui').active) { rootStyle.setProperty('--controlssubleft', MinimalUIControls.cssControlsSubMenuDndUi); + rootStyle.setProperty('--controlssubsubleft', MinimalUIControls.cssControlsSubMenuDndUi); } // --- } @@ -60,8 +70,10 @@ export default class MinimalUIControls { static hideControlTools() { if (game.settings.get('minimal-ui', 'controlsSize') === 'small') { rootStyle.setProperty('--controlssubleft', MinimalUIControls.cssControlsHiddenPositionSmall); + rootStyle.setProperty('--controlssubsubleft', MinimalUIControls.cssControlsHiddenPositionSmall); } else { rootStyle.setProperty('--controlssubleft', MinimalUIControls.cssControlsHiddenPositionStandard); + rootStyle.setProperty('--controlssubsubleft', MinimalUIControls.cssControlsHiddenPositionStandard); } } @@ -154,6 +166,7 @@ export default class MinimalUIControls { type: String, choices: { "always": game.i18n.localize("MinimalUI.SettingsAlwaysVisible"), + "partial": game.i18n.localize("MinimalUI.SettingsPartiallyVisible"), "autohide": game.i18n.localize("MinimalUI.SettingsAutoHide") }, default: "autohide", diff --git a/package.json b/package.json index 471cbb9..4956275 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "foundryvtt-minimal-ui", - "version": "1.1.7", + "version": "1.1.8", "description": "Minimal UI allows customizing Foundry interface, by hiding, collapsing or resizing specific parts.", "main": "minimalui.js", "scripts": { diff --git a/styles/component/controls.css b/styles/component/controls.css index e888f0c..96b6aef 100644 --- a/styles/component/controls.css +++ b/styles/component/controls.css @@ -8,6 +8,7 @@ --controlslh: 30px; --controlsfs: 24px; --controlssubleft: 60px; + --controlssubsubleft: 60px; --controlssubstyle: contents; } @@ -83,5 +84,6 @@ } #controls:hover .active .control-tools { + left: var(--controlssubsubleft); display: var(--controlssubstyle); }