Skip to content

Commit

Permalink
Merge pull request #78 from boltgolt/dev
Browse files Browse the repository at this point in the history
 Version 1.3.0
  • Loading branch information
boltgolt authored May 6, 2023
2 parents b2312cc + c0ca5c6 commit 2d45af1
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 24 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.2.2",
"version": "1.3.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"
}
16 changes: 10 additions & 6 deletions 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.2.0",
"_version": "1.3.0",

// Settings related to the Boltobserv window
"window": {
Expand All @@ -17,7 +17,7 @@
// Make the background of the window transparent
"transparent": false,

// Change the background color of the window even with transparency
// Change the background color of the window with optional transparency
// The color should be in hexadecimal color code
// like #FFF or #FFFFFF to normal color and #80FFFFFF to color with transparency
"backgroundColor": "#000000",
Expand Down Expand Up @@ -59,14 +59,18 @@
}
},

// Settings that will change the way the radar will be displayed
// Settings that will change the way the radar is displayed
"radar": {
// Hide advisories on the radar
"hideAdvisories": false,
// When true, players higher on the map will show over lower ones
// If false, the player slot number determines the stacking order
// The spectated player is always visible on top of everything
"highestPlayerOnTop": true,
// Show the buyzones on the map, or only when players can buy
// Can either be "never", "buytime" or "always"
// Only works on SimpleRadar maps, can either be "never", "buytime" or "always"
"showBuyzones": "buytime",
// Show Boltobserv and Simple Radar logos
// Show Boltobserv, Simple Radar and Lexogrine logos
"showLogos": true,

// Show muzzle flashes for players shooting
Expand Down Expand Up @@ -127,7 +131,7 @@
"game": {
// Seconds of inactivity before considering a connection to the game client as lost
// Set to -1 to never timeout
"connectionTimout": 30,
"connectionTimout": 90,

// The port GSI will try to connect to
"networkPort": 36363,
Expand Down
6 changes: 3 additions & 3 deletions src/css/map.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ div.dot.bomb {
}

div.dot.active {
z-index: 16;
z-index: 7000 !important;
box-shadow: 0 0 0 .2vmin rgba(0, 0, 0, .9), 0 0 0 1vmin rgba(255, 255, 255, .9), 0 0 2.4vmin 1.2vmin rgba(255, 255, 255, .2);
}

Expand All @@ -125,7 +125,7 @@ div.dot.dead {
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%);
z-index: 13;
z-index: 13 !important;
filter: none;
}

Expand Down Expand Up @@ -157,7 +157,7 @@ div.label {
}

div.label.active {
z-index: 16;
z-index: 7000 !important;
font-size: 5vmin;
}

Expand Down
6 changes: 3 additions & 3 deletions src/css/waiting.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ body {

#container > div:first-child section {
position: absolute;
width: 80%;
left: 10%;
width: 90%;
left: 5%;
top: 4.4rem;
text-align: center;
font-size: .8rem;
cursor: pointer;
z-index: 2000;
-webkit-app-region: no-drag;
color: #333;
color: #555;
}

#container > div:first-child section a {
Expand Down
6 changes: 4 additions & 2 deletions src/html/waiting.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

<section id="donate">
Has Boltobserv been useful to you?
<a href="https://ko-fi.com/boltgolt" target="_blank">Please consider donating towards continued development, thank you!</a>
<a href="https://ko-fi.com/boltgolt" target="_blank">Please consider donating towards continued development at ko-fi.com/boltgolt</a>
Thank you!
</section>
</div>

Expand Down Expand Up @@ -132,7 +133,8 @@
// If electron, make the donate button open a browser tab and not a window
document.getElementById("donate").querySelector("a").href = ""
document.getElementById("donate").querySelector("a").target = ""
document.getElementById("donate").addEventListener("click", () => {
document.getElementById("donate").addEventListener("click", event => {
event.preventDefault()
electron.shell.openExternal("https://ko-fi.com/boltgolt")
})
}
Expand Down
26 changes: 23 additions & 3 deletions src/loadconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,27 @@ const path = require("path")
const util = require("util")
const pack = require("./package.json")

let cachedConfig = false
/**
* Copy deep object values into target object
* @param {Object} core Target object
* @param {Object} override Source object
*/
function deepCopyObject(core, override) {
// For each core property
for (let prop in core) {
// Check if the prop is an deeper object, run this function recursively on it if it is
if (typeof core[prop] == "object") {
deepCopyObject(core[prop], override[prop])
continue
}

// Otherwise, if the prop is set in both the core and overwrite, set it to the overwrite value
if (typeof override[prop] != 'undefined') {
core[prop] = override[prop]
}
}
}

// Load the default config
let loadedConfig = JSON5.parse(fs.readFileSync(path.join(__dirname, "config", "config.json5"), "utf8"))

Expand All @@ -16,8 +36,8 @@ if (pack.version != loadedConfig._version) {
if (fs.existsSync(path.join(__dirname, "config", "config.override.json5"))) {
// Read the overwrite file
let override = JSON5.parse(fs.readFileSync(path.join(__dirname, "config", "config.override.json5"), "utf8"))
// Merge the configs
Object.assign(loadedConfig, override)
// Set any settings in the core config to the override ones
deepCopyObject(loadedConfig, override)
}

// Show config in console if enabled
Expand Down
8 changes: 4 additions & 4 deletions src/maps/de_ancient/meta.json5
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"version": {
// The version of this meta file
"radar": 1,
"radar": 2,
// The object format version this file is using
"format": 3
},

// The amount of in-game units per pixel of the 1024px radar image
"resolution": 4.19,
"resolution": 4.26,

// How many in-game units is the origin (0,0) of the map from the bottom left point of the radar
"offset": {
"x": 2520,
"y": 2660
"x": 2590,
"y": 2520
},

// Contains any special map splits
Expand Down
Binary file modified src/maps/de_ancient/overlay_buyzones.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/maps/de_ancient/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.2.2",
"version": "1.3.0",
"description": "External radar for CSGO observers",
"main": "index.js",
"homepage": "https://github.com/boltgolt/boltobserv/",
Expand Down
6 changes: 5 additions & 1 deletion src/renderers/loopFast.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,14 @@ function step() {
// If the scale indicator is enabled
else if (global.config.vertIndicator.type == "scale") {
// Scale the dot by height multiplied by the configured delta
// scale *= (perc + 0.5) * global.config.vertIndicator.scaleDelta
scale *= ((perc - 0.5) / 2 + 1) * global.config.vertIndicator.scaleDelta
global.playerLabels[num].style.transform = `scale(${scale}) translate(-50%, 50%)`
}

if (global.config.radar.highestPlayerOnTop) {
global.playerDots[num].style.zIndex = Math.round(global.playerPos[num].z + 2500)
global.playerLabels[num].style.zIndex = Math.round(global.playerPos[num].z + 2500)
}
}
}

Expand Down

0 comments on commit 2d45af1

Please sign in to comment.