Skip to content

Commit

Permalink
Merge pull request #99 from boltgolt/dev
Browse files Browse the repository at this point in the history
version 1.5.0
  • Loading branch information
boltgolt authored Jun 15, 2024
2 parents b477492 + 57e8383 commit f77c50c
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 14 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.4.0",
"version": "1.5.0",
"_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"
}
8 changes: 8 additions & 0 deletions src/config/config.json5
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@
// Show Boltobserv, Simple Radar and Lexogrine logos
"showLogos": true,

// Show the player name on the dot, options are:
// "never" only show the spec number (observer slot)
// "both" show the name of the player under the dot
// "always" replace the spec number by the player name
"showName": "never",
// Truncate the name of the player after this many characters
"maxNameLength": 8,

// Show muzzle flashes for players shooting
"shooting": true,
// Show red indicators on player dots when their health gets lower
Expand Down
15 changes: 14 additions & 1 deletion src/css/map.css
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ div.dot.dead > div {

div.label {
background: none;
text-align: center;
display: flex;
justify-content: center;
color: black;
font-weight: bold;
text-shadow: 0 0 1.2vmin rgba(255, 255, 255, .2);
Expand All @@ -165,6 +166,18 @@ div.label.dead {
display: none;
}

div.label span {
display: block;
position: absolute;
left: 50%;
top: 100%;
transform: translateX(-50%);
font-size: .7em;
color: #FFF;
text-shadow: 0 0 .3em #000;
opacity: .85;
}

#bomb {
position: absolute;
background-image: url("../img/bomb-dropped.webp");
Expand Down
1 change: 1 addition & 0 deletions src/gsi.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function handleRequest(req, res) {
playerArr.push({
id: id,
num: player.observer_slot,
name: player.name,
team: player.team,
health: player.state.health,
active: isActive,
Expand Down
20 changes: 10 additions & 10 deletions src/html/map.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@
<div id="bomb"></div>

<div id="dot1" class="dot"><div id="height1"></div></div>
<div id="label1" class="label">1</div>
<div id="label1" class="label">2<span></span></div>
<div id="dot2" class="dot"><div id="height2"></div></div>
<div id="label2" class="label">2</div>
<div id="label2" class="label">3<span></span></div>
<div id="dot3" class="dot"><div id="height3"></div></div>
<div id="label3" class="label">3</div>
<div id="label3" class="label">4<span></span></div>
<div id="dot4" class="dot"><div id="height4"></div></div>
<div id="label4" class="label">4</div>
<div id="label4" class="label">5<span></span></div>
<div id="dot5" class="dot"><div id="height5"></div></div>
<div id="label5" class="label">5</div>
<div id="label5" class="label">6<span></span></div>
<div id="dot6" class="dot"><div id="height6"></div></div>
<div id="label6" class="label">6</div>
<div id="label6" class="label">7<span></span></div>
<div id="dot7" class="dot"><div id="height7"></div></div>
<div id="label7" class="label">7</div>
<div id="label7" class="label">8<span></span></div>
<div id="dot8" class="dot"><div id="height8"></div></div>
<div id="label8" class="label">8</div>
<div id="label8" class="label">9<span></span></div>
<div id="dot9" class="dot"><div id="height9"></div></div>
<div id="label9" class="label">9</div>
<div id="label9" class="label">0<span></span></div>
<div id="dot0" class="dot"><div id="height0"></div></div>
<div id="label0" class="label">0</div>
<div id="label0" class="label">1<span></span></div>


<div id="advisory" class="none">
Expand Down
Binary file modified src/maps/de_vertigo/radar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "boltobserv",
"version": "1.4.0",
"version": "1.5.0",
"description": "External radar for CSGO observers",
"main": "index.js",
"homepage": "https://github.com/boltgolt/boltobserv/",
Expand Down
5 changes: 4 additions & 1 deletion src/renderers/advisory.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ function updateAdvisory() {
for (let name in advisories) {
if (advisories[name] != -1) {
document.getElementById("advisory").className = name
document.getElementById("advisory").children[0].innerHTML = idToNum[advisories[name]]
document.getElementById("advisory").children[0].innerHTML = idToNum[advisories[name]] + 1
if (document.getElementById("advisory").children[0].innerHTML == 10) {
document.getElementById("advisory").children[0].innerHTML = 0
}
return
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/renderers/playerPosition.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ socket.element.addEventListener("players", event => {

// Set the player alive attribute (used in autozoom)
global.playerPos[player.num].alive = player.health > 0

if (global.config.radar.showName == "both") {
playerLabel.children[0].textContent = player.name.substring(0, global.config.radar.maxNameLength)
}
if (global.config.radar.showName == "always") {
playerLabel.textContent = player.name.substring(0, global.config.radar.maxNameLength)
}
}
})

Expand Down

0 comments on commit f77c50c

Please sign in to comment.