Skip to content

Commit

Permalink
Thumb preview only for gms, fixed players list and bennies
Browse files Browse the repository at this point in the history
  • Loading branch information
saif-ellafi committed Mar 26, 2021
1 parent c00ef3d commit 81ff1c4
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 33 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### 0.4.3
* Compatibility: SWADE Bennies should always show on visible players list (Thanks SalieriC)
* Bugfix: Scene thumbnail preview is now only valid for GMs (Thanks CasualTerror)
* Bugfix: Players List auto-hide mode is now centered and properly spaced
* Bugfix: Fixed "glitchy" players list hover animation
* Bugfix: Fixed colors not applying on launch (Thanks SalieriC)
* Bugfix: Fixed colors wrong default values

### 0.4.2
* Compatibility: Fixed compatibility with libWrapper and colorsettings in Minimal UI

Expand Down
14 changes: 10 additions & 4 deletions minimalui.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

--playervis: hidden;
--playerfsize: 0px;
--playerwidth: 30px;
--playerwidth: 25px;
--playerslh: 20px;
--playerbennies: none;

--macrobarvis: hidden;
--macrobarypos: 10px;
Expand Down Expand Up @@ -98,19 +100,23 @@
#players:hover {
width: 150px;
font-size: 12px;
transition: 0.05s;
}

#players {
width: var(--playerwidth);
left: 5px;
bottom: 0px;
bottom: 2px;
font-size: var(--playerfsize);
visibility: var(--playervis);
}

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

#players:hover ol li.player {
line-height: 20px;
}

#players h3 {
Expand All @@ -119,7 +125,7 @@
}

.bennies-count {
display: none;
display: var(--playerbennies);
}

/** SCENE NAVIGATION **/
Expand Down
62 changes: 34 additions & 28 deletions minimalui.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,21 +305,39 @@ Hooks.on('init', () => {

Hooks.once('ready', async function() {

$("#players")[0].val = "";
});

Hooks.on('renderPlayerList', async function() {
let rootStyle = document.querySelector(':root').style;

// SWADE Special Compatibility
if (game.system.data.name == 'swade') {
$(".bennies-count").hide();
$("#players").hover(
function() {
$(".bennies-count").show();
},
function() {
$(".bennies-count").hide();
}
);
};
$("#players")[0].val = "";

switch(game.settings.get('minimal-ui', 'playerList')) {
case 'default': {
rootStyle.setProperty('--playerfsize', MinimalUI.cssPlayersDefaultFontSize);
rootStyle.setProperty('--playerwidth', MinimalUI.cssPlayersDefaultWidth);
rootStyle.setProperty('--playerbennies', 'inline');
rootStyle.setProperty('--playervis', 'visible');
break;
}
case 'autohide': {
rootStyle.setProperty('--playervis', 'visible');
rootStyle.setProperty('--playerbennies', 'none');
rootStyle.setProperty('--playerslh', '2px');
// SWADE Special Compatibility
if (game.system.data.name == 'swade') {
$("#players").hover(
function() {
$(".bennies-count").show();
},
function() {
$(".bennies-count").hide();
}
);
};
break;
}
}
});

Hooks.on('renderSceneNavigation', async function() {
Expand Down Expand Up @@ -405,19 +423,6 @@ Hooks.once('renderSceneNavigation', async function() {
break;
}
}

switch(game.settings.get('minimal-ui', 'playerList')) {
case 'default': {
rootStyle.setProperty('--playerfsize', MinimalUI.cssPlayersDefaultFontSize);
rootStyle.setProperty('--playerwidth', MinimalUI.cssPlayersDefaultWidth);
rootStyle.setProperty('--playervis', 'visible');
break;
}
case 'autohide': {
rootStyle.setProperty('--playervis', 'visible');
break;
}
}

});

Expand All @@ -441,14 +446,15 @@ Hooks.once('renderSceneControls', async function() {
hint: "Default: #ff4900bd",
label: "Color Picker",
scope: "world",
config: true,
default: "#ff4900bd",
defaultColor: "#ff4900bd",
type: String,
onChange: lang => {
rootStyle.setProperty('--shadowcolor', game.settings.get('minimal-ui', 'shadowColor'));
}
});

rootStyle.setProperty('--bordercolor', game.settings.get('minimal-ui', 'borderColor'));
rootStyle.setProperty('--shadowcolor', game.settings.get('minimal-ui', 'shadowColor'));
rootStyle.setProperty('--shadowstrength', game.settings.get('minimal-ui', 'shadowStrength') + 'px');

if (game.settings.get('minimal-ui', 'sidePanelSize') == 'small') {
Expand Down
2 changes: 1 addition & 1 deletion 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 reduces size of Foundry interface and allows hiding or collapsing specific parts.",
"version": "0.4.2",
"version": "0.4.3",
"minimumCoreVersion": "0.7.9",
"compatibleCoreVersion": "0.7.9",
"esmodules": [ "lib/colorsettings/colorSetting.js" ],
Expand Down

0 comments on commit 81ff1c4

Please sign in to comment.