Skip to content

Commit

Permalink
Refactoring, Changelog and version
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrinkmann committed Apr 23, 2024
1 parent 103afd9 commit 4660f95
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 26 deletions.
11 changes: 7 additions & 4 deletions Changelog.MD
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# 1.1.5
- Disables playlist-, ambience- and interface sounds for Sheet-Only clients

# 1.1.4
* Pops up character sheet after initial choice of character
* Closes actor list when selecting new character
* Hides canvas instead of disabling it
* Adds settings button for player
- Pops up character sheet after initial choice of character
- Closes actor list when selecting new character
- Hides canvas instead of disabling it
- Adds settings button for player

# 1.1.3
- Internal code to improve targeting in sheet-only-plus
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "sheet-only",
"title": "Sheet Only",
"version": "1.1.4",
"version": "1.1.5",
"compatibility": {
"minimum": "11",
"verified": "11"
Expand Down
37 changes: 22 additions & 15 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,6 @@ CONFIG.debug.hooks = false;
let currentSheet = null; // Track the currently open sheet
export let currentActor; // The currently selected actor

async function setupClient() {
let shouldReload = false;

let isCanvasDisabled = await game.settings.get("core", "noCanvas");

if (isCanvasDisabled) {
await game.settings.set('core', 'noCanvas', false)
shouldReload = true;
}

if (shouldReload) {
foundry.utils.debouncedReload();
}
}

Hooks.on('setup', async () => {

if (isSheetOnly()) {
Expand Down Expand Up @@ -96,6 +81,28 @@ Hooks.once('closeUserConfig', async () => {
popupSheet(game.user)
});

async function setupClient() {
disableSounds();

let shouldReload = false;
let isCanvasDisabled = await game.settings.get("core", "noCanvas");

if (isCanvasDisabled) {
await game.settings.set('core', 'noCanvas', false)
shouldReload = true;
}

if (shouldReload) {
foundry.utils.debouncedReload();
}
}

function disableSounds() {
game.settings.set("core", "globalPlaylistVolume", 0.0)
game.settings.set("core", "globalAmbientVolume", 0.0)
game.settings.set("core", "globalInterfaceVolume", 0.0)
}

function isActorOwnedByUser(actor) {
return actor.ownership[game.user.id] === 3;

Expand Down
6 changes: 0 additions & 6 deletions scripts/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,3 @@ class PlayerSelectionMenu extends FormApplication {


}

Hooks.once('ready', async () => {
game.settings.set("core", "globalPlaylistVolume", 0.0)
game.settings.set("core", "globalAmbientVolume", 0.0)
game.settings.set("core", "globalInterfaceVolume", 0.0)
});

0 comments on commit 4660f95

Please sign in to comment.