diff --git a/package.json b/package.json index 14b1cbf..bbd58b8 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { "name": "boltobserv", - "version": "1.5.0", + "version": "1.5.1", "_whatisthis": "Older versions of Boltobserv used this file to check for updates, so it can't be deleted. The real package.json is in /src" } diff --git a/src/config/config.json5 b/src/config/config.json5 index 118481c..1a1efe7 100644 --- a/src/config/config.json5 +++ b/src/config/config.json5 @@ -4,7 +4,7 @@ // without making changes here. This makes your config a lot more portable. { - "_version": "1.3.0", + "_version": "1.5.1", // Settings related to the Boltobserv window "window": { @@ -99,6 +99,8 @@ "playerSmoothing": 13, // Frames to smooth out flying projectile movement "projectileSmoothing": 5, + // Opacity between 0 and 1 of the dead player crosses, set to 0 to fully hide + "tombstoneOpacity": 0.4, // Amount of scaling to apply to player dots on the radar // Values above 1 might be blurry diff --git a/src/css/map.css b/src/css/map.css index 8ef27bc..a91f04a 100644 --- a/src/css/map.css +++ b/src/css/map.css @@ -1,3 +1,8 @@ +:root { + --config-tombstone-opacity: .4; + --config-bomb-dot-scale: .7; +} + body { overflow: hidden; } @@ -120,11 +125,11 @@ div.dot.flashed.active { } div.dot.dead { - opacity: .4; color: transparent; text-shadow: none; border-radius: 0; clip-path: polygon(20% 0%, 0% 20%, 30% 50%, 0% 80%, 20% 100%, 50% 70%, 80% 100%, 100% 80%, 70% 50%, 100% 20%, 80% 0%, 50% 30%); + opacity: var(--config-tombstone-opacity); z-index: 13 !important; filter: none; } @@ -186,7 +191,7 @@ div.label span { width: 2.2vmin; bottom: -30%; left: -30%; - transform: translate(-50%, 50%); + transform: scale(var(--config-bomb-dot-scale)) translate(-50%, 50%); transform-origin: bottom left; } diff --git a/src/gsi.js b/src/gsi.js index d5e2aef..7278de8 100644 --- a/src/gsi.js +++ b/src/gsi.js @@ -177,10 +177,9 @@ function handleRequest(req, res) { for (var i = 0; i < flamesNum; i++) { let pos = Object.values(nade.flames)[i].split(", ") flamesPos.push({ - // BUG: CS2 has the coords doubled for some reason - x: parseFloat(pos[0]) / 2, - y: parseFloat(pos[1]) / 2, - z: parseFloat(pos[2]) / 2 + x: parseFloat(pos[0]), + y: parseFloat(pos[1]), + z: parseFloat(pos[2]) }) } diff --git a/src/package-lock.json b/src/package-lock.json index 291e1c2..630f246 100644 --- a/src/package-lock.json +++ b/src/package-lock.json @@ -1,6 +1,6 @@ { "name": "boltobserv", - "version": "1.4.0", + "version": "1.5.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3188,9 +3188,9 @@ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "ws": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", - "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==" + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==" }, "xmlbuilder": { "version": "15.1.1", diff --git a/src/package.json b/src/package.json index 7739369..6b36d1d 100644 --- a/src/package.json +++ b/src/package.json @@ -1,6 +1,6 @@ { "name": "boltobserv", - "version": "1.5.0", + "version": "1.5.1", "description": "External radar for CSGO observers", "main": "index.js", "homepage": "https://github.com/boltgolt/boltobserv/", @@ -21,6 +21,6 @@ "express": "^4.18.2", "json5": "^2.2.3", "steam-game-path": "^2.2.0", - "ws": "^7.5.9" + "ws": "^7.5.10" } } diff --git a/src/renderers/_init.js b/src/renderers/_init.js index 7a655a5..21edcc6 100644 --- a/src/renderers/_init.js +++ b/src/renderers/_init.js @@ -52,11 +52,13 @@ socket.element.addEventListener("welcome", event => { } } - // Do the same for the bomb icon - document.getElementById("bomb").style.transform = `scale(${event.data.config.radar.bombDotScale}) translate(-50%, 50%)` + // Insert stylesheet into head to apply some CSS setings from config + document.documentElement.style.setProperty("--config-tombstone-opacity", event.data.config.radar.tombstoneOpacity) + document.documentElement.style.setProperty("--config-bomb-dot-scale", event.data.config.radar.bombDotScale) }) -if(socket.native && socket.native.readyNumber === 1){ - socket.native.send("requestWelcome"); + +if (socket.native && socket.native.readyNumber === 1) { + socket.native.send("requestWelcome") } window.addEventListener("DOMContentLoaded", () => { diff --git a/src/renderers/projectiles.js b/src/renderers/projectiles.js index a38ddad..2aa4983 100644 --- a/src/renderers/projectiles.js +++ b/src/renderers/projectiles.js @@ -58,8 +58,8 @@ socket.element.addEventListener("projectiles", event => { if (projectile.type == 'frag') { // Get the previous coords from the let trailParts = trailElement.getAttributeNS(null, "d").split(" ") - // True if more than two packets are known and nade stationary - let isStationary = trailParts.length > 6 + // True if more than three packets are known and nade stationary + let isStationary = trailParts.length > 9 // Go through each nade position from last to newest, max last 5 for (let i = trailParts.length - 1; i > 2 && trailParts.length - i < 5 * 3; i -= 3) { diff --git a/src/renderers/smokes.js b/src/renderers/smokes.js index b76fe65..4f6435a 100644 --- a/src/renderers/smokes.js +++ b/src/renderers/smokes.js @@ -98,8 +98,8 @@ socket.element.addEventListener("explosion", event => { gapElement.id = "gap" + event.data.id // Calculate gap position within smoke - gapElement.style.left = (smokeX - pos.x) / smokeSize * 100 + "%" - gapElement.style.bottom = (smokeY - pos.y) / smokeSize * 100 + "%" + gapElement.style.left = (pos.x - smokeX) / smokeSize * 100 + "%" + gapElement.style.bottom = (pos.y - smokeY) / smokeSize * 100 + "%" // Insert gap into smoke smokeElement.appendChild(gapElement)