Skip to content

Commit

Permalink
fix navigation with player list
Browse files Browse the repository at this point in the history
  • Loading branch information
saif-ellafi committed Jan 6, 2024
1 parent 656df27 commit b724f43
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 23 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.11
* Bugfix: Fixed scene navigation moving with players list

### 1.6.10
* Compatibility: Starfinder system navi fix

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.10",
"version": "1.6.11",
"compatibility": {
"minimum": "10",
"verified": "11.315",
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.10/foundryvtt-minimal-ui_1.6.10.zip",
"download": "https://github.com/saif-ellafi/foundryvtt-minimal-ui/releases/download/1.6.11/foundryvtt-minimal-ui_1.6.11.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
49 changes: 49 additions & 0 deletions modules/component/players.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,19 @@ export default class MinimalUIPlayers {
rootStyle.setProperty('--playerfsize', MinimalUIPlayers.cssPlayersSmallFontSize);
rootStyle.setProperty('--players-width', MinimalUIPlayers.cssPlayersSmallWidth);
rootStyle.setProperty('--playerwidthhv', MinimalUIPlayers.cssPlayersSmallWidth);
if (game.system.id === 'sfrpg')
rootStyle.setProperty('--topleft', '-184px');
else
rootStyle.setProperty('--topleft', '-175px');
} else {
rootStyle.setProperty('--playerfsize', MinimalUIPlayers.cssPlayersStandardFontSize);
rootStyle.setProperty('--playerfsizehv', MinimalUIPlayers.cssPlayersStandardFontSize);
rootStyle.setProperty('--players-width', MinimalUIPlayers.cssPlayersStandardWidth);
rootStyle.setProperty('--playerwidthhv', MinimalUIPlayers.cssPlayersStandardWidth);
if (game.system.id === 'sfrpg')
rootStyle.setProperty('--topleft', '-209px');
else
rootStyle.setProperty('--topleft', '-200px');
}
rootStyle.setProperty('--playervis', 'visible');
rootStyle.setProperty('--playerslh', '20px');
Expand Down Expand Up @@ -182,19 +190,43 @@ export default class MinimalUIPlayers {
);
}
// ---
if (game.settings.get('minimal-ui', 'controlsSize') === 'small')
rootStyle.setProperty('--topleft', '-90px');
else
if (game.system.id === 'sfrpg')
rootStyle.setProperty('--topleft', '-110px');
else
rootStyle.setProperty('--topleft', '-101px');
if (plSetting === 'autohide') {
players.hover(
() => {
players.css('width', 'var(--playerwidthhv)');
players.css('font-size', 'var(--playerfsizehv)');
players.css('opacity', '100%');
$("#players ol li.player").css('line-height', '20px');
if (plSize === 'small')
if (game.system.id === 'sfrpg')
rootStyle.setProperty('--topleft', '-184px');
else
rootStyle.setProperty('--topleft', '-175px');
else
if (game.system.id === 'sfrpg')
rootStyle.setProperty('--topleft', '-209px');
else
rootStyle.setProperty('--topleft', '-200px');
},
() => {
players.css('width', '');
players.css('font-size', 'var(--playerfsize)');
players.css('opacity', 'var(--opacity)');
$("#players ol li.player").css('line-height', '2px');
if (game.settings.get('minimal-ui', 'controlsSize') === 'small')
rootStyle.setProperty('--topleft', '-90px');
else
if (game.system.id === 'sfrpg')
rootStyle.setProperty('--topleft', '-110px');
else
rootStyle.setProperty('--topleft', '-101px');
})
} else {
players.css('transition', 'ease-out 0.5s');
Expand All @@ -206,6 +238,16 @@ export default class MinimalUIPlayers {
players.css('font-size', 'var(--playerfsizehv)');
players.css('opacity', '100%');
$("#players ol li.player").css('line-height', '20px');
if (plSize === 'small')
if (game.system.id === 'sfrpg')
rootStyle.setProperty('--topleft', '-184px');
else
rootStyle.setProperty('--topleft', '-175px');
else
if (game.system.id === 'sfrpg')
rootStyle.setProperty('--topleft', '-209px');
else
rootStyle.setProperty('--topleft', '-200px');
state = 1;
setTimeout(() => {if (state === 1 ) players.css('transition', 'ease-out 0.5s')}, 100);
} else {
Expand All @@ -214,6 +256,13 @@ export default class MinimalUIPlayers {
players.css('font-size', 'var(--playerfsize)');
players.css('opacity', 'var(--opacity)');
$("#players ol li.player").css('line-height', '2px');
if (game.settings.get('minimal-ui', 'controlsSize') === 'small')
rootStyle.setProperty('--topleft', '-90px');
else
if (game.system.id === 'sfrpg')
rootStyle.setProperty('--topleft', '-110px');
else
rootStyle.setProperty('--topleft', '-101px');
state = 0;
setTimeout(() => {if (state === 0 ) players.css('transition', 'ease-out 0.5s')}, 100);
}
Expand Down
40 changes: 20 additions & 20 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.10",
"version": "1.6.11",
"description": "Minimal UI allows customizing Foundry interface, by hiding, collapsing or resizing specific parts.",
"main": "minimalui.js",
"scripts": {
Expand Down
5 changes: 5 additions & 0 deletions styles/component/navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
--navibuttonsize: 23px;
--navileft: -10px;
--naviright: 0px;
--topleft: -200px;
}

#ui-top.offset {
margin-left: var(--topleft);
}

#navigation {
Expand Down

0 comments on commit b724f43

Please sign in to comment.