Comparing version 1.0.9 to 1.0.10
{ | ||
"name": "squishjs", | ||
"version": "1.0.9", | ||
"version": "1.0.10", | ||
"description": "squish & unsquish stuff", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -15,2 +15,3 @@ const ASSET_TYPE = 1; | ||
this.assets = {}; | ||
this.playerSettings = {}; | ||
@@ -118,3 +119,2 @@ this.customBottomLayer = customBottomLayer; | ||
if (playerIdFilter.size > 0) { | ||
let playerIdsToRemove = new Set(); | ||
@@ -127,3 +127,11 @@ for (let playerId of playerIdFilter) { | ||
if (node.node.playerIds.length === 0 || node.node.playerIds.findIndex(i => Number(i) === Number(playerId)) >= 0) { | ||
playerMap[playerId].push(squished); | ||
if (node.node.asset) { | ||
const assetInfo = this.gameAssets[Object.keys(node.node.asset)[0]]?.info; | ||
if (assetInfo.type === 'audio' && !this.playerSettings[playerId]?.SOUND?.ENABLED) { | ||
} else { | ||
playerMap[playerId].push(squished); | ||
} | ||
} else { | ||
playerMap[playerId].push(squished); | ||
} | ||
} else { | ||
@@ -141,3 +149,11 @@ playerIdsToRemove.add(playerId); | ||
} | ||
playerMap[playerId].push(squished); | ||
if (node.node.asset) { | ||
const assetInfo = this.gameAssets[Object.keys(node.node.asset)[0]]?.info; | ||
if (assetInfo.type === 'audio' && this.playerSettings[playerId]?.SOUND && !this.playerSettings[playerId].SOUND.enabled) { | ||
} else { | ||
playerMap[playerId].push(squished); | ||
} | ||
} else { | ||
playerMap[playerId].push(squished); | ||
} | ||
}) | ||
@@ -177,2 +193,3 @@ } | ||
const gameAssets = gameMetadata && gameMetadata.assets ? gameMetadata.assets : {}; | ||
this.gameAssets = gameAssets; | ||
@@ -268,4 +285,13 @@ if (this.customBottomLayer && this.customBottomLayer.assets) { | ||
updatePlayerSettings(playerId, settings) { | ||
const currentSettings = Object.assign(this.playerSettings[playerId] || {}, settings); | ||
this.playerSettings[playerId] = currentSettings; | ||
} | ||
deletePlayerSettings(playerId) { | ||
delete this.playerSettings[playerId]; | ||
} | ||
} | ||
module.exports = Squisher; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
147288
2948