Skip to content

Commit

Permalink
Merge pull request #104 from boltgolt/dev
Browse files Browse the repository at this point in the history
version 1.5.1
  • Loading branch information
boltgolt authored Sep 11, 2024
2 parents f77c50c + f056f88 commit 310d7ae
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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"
}
4 changes: 3 additions & 1 deletion src/config/config.json5
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions src/css/map.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
:root {
--config-tombstone-opacity: .4;
--config-bomb-dot-scale: .7;
}

body {
overflow: hidden;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}

Expand Down
7 changes: 3 additions & 4 deletions src/gsi.js
Original file line number Diff line number Diff line change
Expand Up @@ -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])
})
}

Expand Down
8 changes: 4 additions & 4 deletions src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/package.json
Original file line number Diff line number Diff line change
@@ -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/",
Expand All @@ -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"
}
}
10 changes: 6 additions & 4 deletions src/renderers/_init.js
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down
4 changes: 2 additions & 2 deletions src/renderers/projectiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/renderers/smokes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 310d7ae

Please sign in to comment.