diff --git a/CHANGELOG.md b/CHANGELOG.md index c8252d0..39ef7fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### 1.3.1 +* Enhancement: New Left Controls Behavior (experimental) - Auto-Hide Plus hides all non-active sub controls +* Bugfix: Fixed FPS Indicator on the wrong position (Thanks GambitTV) +* Bugfix: Fixed Macro Hotbar position when not in auto hide mode + ### 1.3.0 * Enhancement: Adjusted all components to be closer to the edge of the screen * Enhancement: Revised defaults for a refreshing minimal look and feel (See Screenshot) diff --git a/lang/de.json b/lang/de.json index 5911e4c..3505894 100644 --- a/lang/de.json +++ b/lang/de.json @@ -6,6 +6,7 @@ "MinimalUI.SettingsStartVisible": "Starte sichtbar", "MinimalUI.SettingsPartiallyVisible": "Teilweise sichtbar", "MinimalUI.SettingsAutoHide": "Automatisch verstecken", + "MinimalUI.SettingsAutoHidePlus": "Automatisch verstecken Plus", "MinimalUI.SettingsCollapsed": "Starte eingeklappt", "MinimalUI.SettingsOnlyGM": "Nur für die SL sichtbar", "MinimalUI.SettingsHide": "Komplett versteckt", diff --git a/lang/en.json b/lang/en.json index 8920b19..c681d0c 100644 --- a/lang/en.json +++ b/lang/en.json @@ -6,6 +6,7 @@ "MinimalUI.SettingsStartVisible": "Start Visible", "MinimalUI.SettingsPartiallyVisible": "Partially Visible", "MinimalUI.SettingsAutoHide": "Auto-Hide", + "MinimalUI.SettingsAutoHidePlus": "Auto-Hide Plus", "MinimalUI.SettingsCollapsed": "Start Collapsed", "MinimalUI.SettingsOnlyGM": "Visible to GM Only", "MinimalUI.SettingsHide": "Hide Completely", diff --git a/lang/es.json b/lang/es.json index 9c396f8..ccc9a2f 100644 --- a/lang/es.json +++ b/lang/es.json @@ -6,6 +6,7 @@ "MinimalUI.SettingsStartVisible": "Iniciar Visible", "MinimalUI.SettingsPartiallyVisible": "Parcialmente Visible", "MinimalUI.SettingsAutoHide": "Auto-ocultar", + "MinimalUI.SettingsAutoHidePlus": "Auto-ocultar Plus", "MinimalUI.SettingsCollapsed": "Iniciar plegado", "MinimalUI.SettingsOnlyGM": "Visible solo al DM", "MinimalUI.SettingsHide": "Ocultar por completo", diff --git a/module.json b/module.json index c5737c9..1ab36b9 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.3.0", + "version": "1.3.1", "minimumCoreVersion": "9.233", "compatibleCoreVersion": "9.238", "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.3.0/foundryvtt-minimal-ui_1.3.0.zip" + "download": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/releases/download/1.3.1/foundryvtt-minimal-ui_1.3.1.zip" } diff --git a/modules/component/controls.js b/modules/component/controls.js index b1202a0..b2c5d0e 100644 --- a/modules/component/controls.js +++ b/modules/component/controls.js @@ -3,6 +3,8 @@ import '../../styles/component/controls.css'; export default class MinimalUIControls { + static delayedProcessing = false; + static cssControlsStandardWidth = '36px'; static cssControlsStandardHeight = '30px'; static cssControlsStandardLineHeight = '30px'; @@ -19,6 +21,8 @@ export default class MinimalUIControls { static showSubControls() { if (game.settings.get('minimal-ui', 'controlsSubHide') === 'autohide') { rootStyle.setProperty('--controlssubop', '0%'); + } else if (game.settings.get('minimal-ui', 'controlsSubHide') === 'autohide-plus') { + rootStyle.setProperty('--controlssubopna', '0%'); } } @@ -60,6 +64,7 @@ export default class MinimalUIControls { type: String, choices: { "autohide": game.i18n.localize("MinimalUI.SettingsAutoHide"), + "autohide-plus": game.i18n.localize("MinimalUI.SettingsAutoHidePlus"), "visible": game.i18n.localize("MinimalUI.SettingsAlwaysVisible") }, default: "autohide", @@ -72,15 +77,41 @@ export default class MinimalUIControls { MinimalUIControls.sizeControls(); }); Hooks.on('renderSceneControls', function() { - if (game.settings.get('minimal-ui', 'controlsSubHide') === 'autohide') { + function controlsSubHoverRefresh() { + setTimeout(() => { + const activeElement = $('#controls'); + if (activeElement.length && !activeElement.is(':hover') && game.settings.get('minimal-ui', 'controlsSubHide') === 'autohide-plus') { + rootStyle.setProperty('--controlssubdisna', 'none'); + MinimalUIControls.delayedProcessing = false; + } else controlsSubHoverRefresh(); + }, 6000) + } + function controlsSubClickRefresh() { + setTimeout(() => { + if (game.settings.get('minimal-ui', 'controlsSubHide') === 'autohide') + rootStyle.setProperty('--controlssubop', '0%'); + if (game.settings.get('minimal-ui', 'controlsSubHide') === 'autohide-plus') { + controlsSubHoverRefresh(); + } + rootStyle.setProperty('--opacitycontrols', game.settings.get("minimal-ui", "transparencyPercentage") + '%'); + }, 3000) + } + if (['autohide', 'autohide-plus'].includes(game.settings.get('minimal-ui', 'controlsSubHide'))) { $('#controls li').click(() => { rootStyle.setProperty('--controlssubop', '100%'); + rootStyle.setProperty('--controlssubopna', '100%'); rootStyle.setProperty('--opacitycontrols', '100%'); - setTimeout(() => { - rootStyle.setProperty('--controlssubop', '0%'); - rootStyle.setProperty('--opacitycontrols', game.settings.get("minimal-ui", "transparencyPercentage") + '%'); - }, 3000); + rootStyle.setProperty('--controlssubdisna', 'block'); + controlsSubClickRefresh(); }); + if (game.settings.get('minimal-ui', 'controlsSubHide') === 'autohide-plus') { + $('#controls li').hover(() => { + if (MinimalUIControls.delayedProcessing) return; + MinimalUIControls.delayedProcessing = true; + rootStyle.setProperty('--controlssubdisna', 'block'); + controlsSubHoverRefresh(); + }); + } } }); }; diff --git a/modules/component/sidebar.js b/modules/component/sidebar.js index ae11b7c..e09cabb 100644 --- a/modules/component/sidebar.js +++ b/modules/component/sidebar.js @@ -26,6 +26,7 @@ export default class MinimalUISidebar { sidebarElem.css('--sidebar-tab-height', newHeight + 'px'); switch (game.settings.get('minimal-ui', 'rightcontrolsBehaviour')) { case 'shown': { + rootStyle.setProperty('--fpsvis', 'unset'); rootStyle.setProperty('--controlsvis', 'visible'); break; } @@ -39,11 +40,21 @@ export default class MinimalUISidebar { break; } default: { + rootStyle.setProperty('--fpsvis', 'unset'); rootStyle.setProperty('--controlsvis', 'visible'); break; } } }); - + Hooks.on('collapseSidebar', function(_, isCollapsing) { + console.log(isCollapsing); + if (isCollapsing) { + rootStyle.setProperty('--fpsposx', '-5px'); + rootStyle.setProperty('--fpsvis', 'unset'); + } else { + rootStyle.setProperty('--fpsposx', '300px'); + rootStyle.setProperty('--fpsvis', 'unset'); + } + }); } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4b9f446..8c0444d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "foundryvtt-minimal-ui", - "version": "1.3.0", + "version": "1.3.1", "license": "MIT", "dependencies": { "@rollup/plugin-json": "^4.1.0", diff --git a/package.json b/package.json index 3988e7b..89e3e13 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "foundryvtt-minimal-ui", - "version": "1.3.0", + "version": "1.3.1", "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 8d02d7d..29443a6 100644 --- a/styles/component/controls.css +++ b/styles/component/controls.css @@ -6,6 +6,8 @@ --controlssubmargin: 0; --opacitycontrols: 75%; --controlssubop: 100%; + --controlssubopna: 100%; + --controlssubdisna: block; } #controls { @@ -33,15 +35,26 @@ border: 1px solid transparent; } +#controls ol .scene-control:not(.active), #controls ol .control-tool:not(.active) { + transition: 2s; + opacity: var(--controlssubopna); + display: var(--controlssubdisna); +} + +#controls:hover ol .scene-control:not(.active), #controls:hover ol .control-tool:not(.active) { + transition: 0.5s; + opacity: 100%; +} + #controls ol .scene-control.active, #controls ol .control-tool.active, #controls ol .scene-control:hover, #controls ol .control-tool:hover { border: 1px solid var(--bordercolor); box-shadow: 0 var(--hotbarshp) var(--shadowstrength) 2px var(--shadowcolor); } #controls ol.sub-controls.active { + opacity: var(--controlssubop); margin-left: var(--controlssubmargin); transition: 2s; - opacity: var(--controlssubop); display: grid; } diff --git a/styles/component/hotbar.css b/styles/component/hotbar.css index 9627750..65b1953 100644 --- a/styles/component/hotbar.css +++ b/styles/component/hotbar.css @@ -1,10 +1,10 @@ :root { --hotbarvis: hidden; - --hotbarypos: 10px; + --hotbarypos: -5px; --hotbarxpos: 400px; --hotbarlh1: 24px; --hotbarlh2: 8px; - --hotbarhv: 10px; + --hotbarhv: -5px; --hotbarmg: 0px; --hotbarhh: 100%; --hotbarshp: 0px; diff --git a/styles/component/sidebar.css b/styles/component/sidebar.css index 652031e..0e591a3 100644 --- a/styles/component/sidebar.css +++ b/styles/component/sidebar.css @@ -1,5 +1,6 @@ :root { --controlsvis: hidden; + --fpsvis: hidden; } #sidebar { @@ -37,3 +38,9 @@ #sidebar-tabs > a:nth-child(n):hover { text-shadow: 0 0 var(--shadowstrength) var(--bordercolor); } + +#fps { + position: absolute; + right: var(--fpsposx); + visibility: var(--fpsvis); +} \ No newline at end of file diff --git a/styles/customization/theme.css b/styles/customization/theme.css index bc6b631..2fef168 100644 --- a/styles/customization/theme.css +++ b/styles/customization/theme.css @@ -3,6 +3,7 @@ --shadowcolor: #ff4900bd; --shadowstrength: 10px; --opacity: 75%; + --fpsposx: 300px; } .minui-lock {