Skip to content

Commit

Permalink
Hide player cameras
Browse files Browse the repository at this point in the history
  • Loading branch information
saif-ellafi committed Apr 1, 2021
1 parent 7a40c61 commit d41e873
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 12 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 0.5.1
* Enhancement: New setting to hide player cameras (Fan service for MarceloCortezz :))
* Bugfix: Added slightly more space between left bar columns in small size

### 0.5.0
* Enhancement: Macro Hotbar has 3 sizes: 3-6-10 Slots!
* Enhancement: Macro Hotbar collapse button in auto-hide mode removed
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ This includes hiding Foundry's Logo, Players List, Scene Navigation and Macro Ba
* Can be made clickable to toggle show/hide HUD (Including chat or not)

### Player List
* Scenes, Player list and left side controls customized for minimalism by default
* Players list may be hidden completely, shown on hover or shown normally
* Players list may be hidden completely, shown on mouse over or shown normally

### Scene Navigation
* Scene Navigation allows preview the map on mouse over (GM Only)
Expand All @@ -26,8 +25,12 @@ This includes hiding Foundry's Logo, Players List, Scene Navigation and Macro Ba
* 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

### Camera/Audio Controls
* Allows hiding player boxes, showing only GMs

### Customization
* Default settings target a balance between gaining space and functionality
* Colors of borders and shadows and their strength customizable
* Position of elements in the UI can be modified

Expand Down
46 changes: 37 additions & 9 deletions minimalui.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ class MinimalUI {
static cssLeftBarHiddenPositionSmall = '-62px';
static cssLeftBarHiddenPositionStandard = '-72px';

static cssLeftBarSubMenuSmall = '50px';
static cssLeftBarSubMenuSmall = '58px';
static cssLeftBarSubMenuStandard = '60px';
static cssLeftBarSubMenuDndUi = '65px';

static cssLeftBarPaddingDefault = '7px';
static cssLeftBarPaddingSmall = '26px';
static cssLeftBarPaddingStandard = '20px';

static cssLeftBarSmallWidth = '25px';
static cssLeftBarSmallHeight = '28px';
static cssLeftBarSmallLineHeight = '30px';
static cssLeftBarSmallFontSize = '15px';

static cssLeftBarVerticalPositionTop = '8vmin';
static cssLeftBarVerticalPositionCenter = '20vmin';
static cssLeftBarVerticalPositionLower = '30vmin';
static cssLeftBarVerticalPositionBottom = '40vmin';

static cssHotbarHidden = '-48px';
static cssHotbarReveal = '1px';
static cssHotbarShown = '10px';
Expand Down Expand Up @@ -155,6 +155,18 @@ class MinimalUI {

Hooks.on('init', () => {

game.settings.register("minimal-ui", "shadowStrength", {
name: "Shadow Strength",
hint: "How gloomy and shadow are the borders? Default: 10",
scope: "world",
config: true,
default: "10",
type: String,
onChange: lang => {
window.location.reload()
}
});

game.settings.register('minimal-ui', 'foundryLogoSize', {
name: "Foundry Logo Size",
hint: "Foundry logo visibility and size",
Expand Down Expand Up @@ -380,13 +392,17 @@ Hooks.on('init', () => {
}
});

game.settings.register("minimal-ui", "shadowStrength", {
name: "Shadow Strength",
hint: "How gloomy and shadow are the borders? Default: 10",
game.settings.register("minimal-ui", "hidePlayerCameras", {
name: "Hide Player Cameras",
hint: "For player camera/audio, whether only to show GMs",
scope: "world",
config: true,
default: "10",
default: "default",
type: String,
choices: {
"default": "Default view",
"hidden": "Hide camera/audio box of players"
},
onChange: lang => {
window.location.reload()
}
Expand Down Expand Up @@ -435,6 +451,18 @@ Hooks.once('ready', async function() {

});

Hooks.on('renderCameraViews', async function() {
switch(game.settings.get('minimal-ui', 'hidePlayerCameras')) {
case 'hidden': {
$("#camera-views > div").each(function(i, box) {
if (!game.users.get($(box).attr("data-user")).isGM) {
$(box).remove();
}
});
}
}
});

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

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.5.0",
"version": "0.5.1",
"minimumCoreVersion": "0.7.9",
"compatibleCoreVersion": "0.7.9",
"esmodules": [ "lib/colorsettings/colorSetting.js" ],
Expand Down

0 comments on commit d41e873

Please sign in to comment.