Skip to content

Commit

Permalink
v32.3.0
Browse files Browse the repository at this point in the history
🎃
fixed memory leaks
  • Loading branch information
sh4rkman committed Oct 20, 2024
1 parent cc2c160 commit 1ea2472
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 147 deletions.
196 changes: 103 additions & 93 deletions CHANGELOG.md

Large diffs are not rendered by default.

57 changes: 29 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@

<div align="center">
<a href="https://discord.gg/BNPAc5kEJP">
<img src="https://img.shields.io/badge/Discord-111111?style=for-the-badge&logo=discord&logoColor=white" alt="Uptime"></a>
<a href="https://buymeacoffee.com/sharkman">
<img src="https://img.shields.io/badge/COFEE-b12222?style=for-the-badge&logo=buy-me-a-coffee&logoColor=white" alt="Uptime"></a>
<img src="https://img.shields.io/badge/Discord-111?style=for-the-badge&logo=discord&logoColor=white" alt="discord"></a>
<a href="https://github.com/sh4rkman/SquadCalc/blob/master/CHANGELOG.md">
<img src="https://img.shields.io/badge/CHANGELOG-111?style=for-the-badge&logo=github&logoColor=white" alt="changelog"></a>
<a href="https://github.com/sh4rkman/SquadCalc/wiki/Translating-SquadCalc">
<img src="https://img.shields.io/badge/TRANSLATE-111?style=for-the-badge&logo=google-translate&logoColor=white" alt="translate"></a>
<a href="https://github.com/sh4rkman/SquadCalc/wiki">
<img src="https://img.shields.io/badge/WIKI-111?style=for-the-badge&logo=github&logoColor=white" alt="wiki"></a>
</div>

<div align="center">
<a href="https://github.com/sh4rkman/SquadCalc/issues/new">🪳 Report a Bug</a> &nbsp;&bull;&nbsp;
<a href="https://github.com/sh4rkman/SquadCalc/wiki/Translating-SquadCalc"> 📜 Help to Translate</a> &nbsp;&bull;&nbsp;
<a href="https://github.com/sh4rkman/SquadCalc/wiki">📖 Wiki</a> &nbsp;&bull;&nbsp;
<a href="https://github.com/sh4rkman/SquadCalc/blob/master/CHANGELOG.md">🆕 ChangeLog</a>
</div>

</br>
</br>
Expand All @@ -27,6 +25,7 @@
</br>

# <div align="center">Table of Contents</div>

1. [Screenshots](#screenshots)
2. [Features](#features)
- [Elevations Calculations](#elevations-calculations)
Expand All @@ -36,6 +35,7 @@
- [Advanced Customisation](#advanced-customisation)
3. [Squad Mortar Overlay Compatibility](#squad-mortar-overlay-compatibility)
4. [Weapons Support](#weapons-support)
4. [Support the project](#support-the-project)


</br>
Expand All @@ -45,13 +45,11 @@
</br>

<div align="center">

![image](./src/img/github/desktop_ui_1.webp)
![image](./src/img/github/desktop_ui_2.webp)
![image](./src/img/github/desktop_ui_3.webp)
![image](./src/img/github/desktop_ui_4.webp)
![image](./src/img/github/desktop_ui_0.webp)

<picture><img src="./src/img/github/desktop_ui_1.webp" alt="classic preview"></picture>
<picture><img src="./src/img/github/desktop_ui_2.webp" alt="topographic preview"></picture>
<picture><img src="./src/img/github/desktop_ui_3.webp" alt="weapon information preview"></picture>
<picture><img src="./src/img/github/desktop_ui_4.webp" alt="calculations information preview"></picture>
<picture><img src="./src/img/github/desktop_ui_0.webp" alt="legacy preview"></picture>
</div>

</br></br>
Expand All @@ -67,9 +65,7 @@ SquadCalc utilizes heightmaps extracted from the Squad SDK to precisely compute
## **Map Layers**

<div align="center">
<picture>
<img src="./src/img/github/layers.webp" alt="base map">
</picture>
<picture><img src="./src/img/github/layers.webp" alt="map layers"></picture>
</div>

### Base map :
Expand All @@ -89,9 +85,7 @@ A mix of bump map, contour map with a touch of hypsometric colors for a complete
If you're having trouble finding a good spot to place your mortar or weapons, activate the 'Frequent Locations' feature to see where other players commonly set theirs!

<div align="center">
<picture>
<img src="./src/img/github/heatmap.webp" alt="target information">
</picture>
<picture><img src="./src/img/github/heatmap.webp" alt="commonly used spots"></picture>
</div>

## **Advanced informations & Simulation**
Expand All @@ -115,7 +109,7 @@ Rather have a minimalist/non-clustered map ? you can too. Hop in settings to cus

<div align="center">
<picture>
<img src="./src/img/github/settings.webp">
<img src="./src/img/github/settings.webp" alt="settings">
</picture>
</div>

Expand All @@ -130,14 +124,12 @@ It allows :
* Having ingame markers automatically merged into SquadCalc map to quickly place the right targets
* Having an ingame overlay with the current SquadCalc calculations displayed in front of Squad

### [>> Download Squad Mortar Overlay last current version here <<](https://github.com/Devil4ngle/SquadMortarOverlay/releases)
### [>> Download Squad Mortar Overlay last version <<](https://github.com/Devil4ngle/SquadMortarOverlay/releases)

</br>

<div align="center">
<picture>
<img src="./src/img/github/squadmortaroverlay.webp">
</picture>
<picture><img src="./src/img/github/squadmortaroverlay.webp" alt="squad mortar overlay">></picture>
</div>


Expand All @@ -155,4 +147,13 @@ It allows :
|<img height="30" src="./src/img/icons/ub32_white.png">| Technicals/BRDM UB-32 | 2245m |
|<img height="35" src="./src/img/icons/mlrs_white.png">| BM-21 Grad | 2045m |
|<img height="35" src="./src/img/icons/m113a3_white.png">| M1064-A3 120mm | 2062m |
|<img height="35" src="./src/img/icons/mk19_rws_white.png">| MK-19 RWS *(Experimental)* | 5647m |
|<img height="35" src="./src/img/icons/mk19_rws_white.png">| MK-19 RWS *(Experimental)* | 5647m |


</br></br>
# Support the project
</br>

[![buy me a coffee](https://img.shields.io/badge/BUY%20ME%20A%20COFFEE-b12222?style=for-the-badge&logo=buy-me-a-coffee&logoColor=white)](https://buymeacoffee.com/sharkman)

[![help to translate](https://img.shields.io/badge/HELP%20TO%20TRANSLATE-111?style=for-the-badge&logo=google-translate&logoColor=white)](https://buymeacoffee.com/sharkman)
2 changes: 1 addition & 1 deletion src/components/shared/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Colors
$mainColor: #b22222;
$mainColor: #ef7800;
$mainBGColor: #111;
$mainTxtColor: #fff;
$newColor: green;
Expand Down
Binary file modified src/img/icons/marker_target_disabled.webp
Binary file not shown.
Binary file modified src/img/icons/marker_target_enabled.webp
Binary file not shown.
2 changes: 1 addition & 1 deletion src/js/libs/readme
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This folder contains external JavaScript libraries that were manually added because they were not available via package managers, or because i need to slightly adapt/patch bugs.
This folder contains external JavaScript libraries that were manually added because they were not available via package managers, or because i needed to slightly adapt/patch bugs.
10 changes: 4 additions & 6 deletions src/js/squadCalcAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,15 @@ export async function fetchMarkersByMap(mapName, weapon) {
const url = `${process.env.API_URL}/get/weapons?map=${encodeURIComponent(mapName)}&weapon=${encodeURIComponent(weapon)}`;

try {

const response = await fetch(url, {
headers: { "X-App-Version": packageInfo.version },
});

if (!response.ok) {
throw new Error("Network response was not ok");
}


if (!response.ok) { throw new Error("Network response was not ok"); }
const data = await response.json();
console.debug(`${mapName} data successfully fetched`);
return data;

} catch (error) {
console.debug("Error fetching marker data:", error);
throw error;
Expand Down
40 changes: 24 additions & 16 deletions src/js/squadMarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ export var squadWeaponMarker = squadMarker.extend({
*/
delete: function(){

// Unbind all custom event handlers
this.off();

this.removeFrom(this.map.activeWeaponsMarkers);

if (this.map.activeWeaponsMarkers.getLayers().length === 0) {
Expand All @@ -174,12 +177,12 @@ export var squadWeaponMarker = squadMarker.extend({
}

// Delete the weapon marker and everything tied to it
this.minRangeMarker.removeFrom(this.map.markersGroup).remove();
this.rangeMarker.removeFrom(this.map.markersGroup).remove();
this.miniCircle.removeFrom(this.map.markersGroup).remove();
this.posPopUp.removeFrom(this.map.markersGroup).remove();
this.removeFrom(this.map.markersGroup).removeFrom(this.map.activeWeaponsMarkers);
this.remove();
this.removeFrom(this.map.activeWeaponsMarkers);
this.minRangeMarker.remove();
this.rangeMarker.remove();
this.miniCircle.remove();
this.posPopUp.remove();

// Update remaining targets if they exists
this.map.updateTargets();
Expand Down Expand Up @@ -498,21 +501,26 @@ export var squadTargetMarker = squadMarker.extend({
* Remove the target marker and every object tied
*/
delete: function(){
this.spreadMarker1.remove();
this.spreadMarker2.remove();
this.calcMarker1.remove();
this.calcMarker2.remove();
this.miniCircle.remove();
this.hundredDamageRadius.remove();
this.twentyFiveDamageRadius.remove();
this.posPopUp.remove();
this.removeFrom(this.map.activeTargetsMarkers);
this.removeFrom(this.map.markersGroup);
this.remove();

// Unbind all custom event handlers
this.off();

// Remove everything attached from the map
this.spreadMarker1.removeFrom(this.map.markersGroup).remove();
this.spreadMarker2.removeFrom(this.map.markersGroup).remove();
this.calcMarker1.removeFrom(this.map.markersGroup).remove();
this.calcMarker2.removeFrom(this.map.markersGroup).remove();
this.miniCircle.removeFrom(this.map.markersGroup).remove();
this.hundredDamageRadius.removeFrom(this.map.markersGroup).remove();
this.twentyFiveDamageRadius.removeFrom(this.map.markersGroup).remove();
this.posPopUp.removeFrom(this.map.markersGroup).remove();
this.removeFrom(this.map.markersGroup).removeFrom(this.map.activeTargetsMarkers);
this.remove();

if (this.map.activeTargetsMarkers.getLayers().length === 0) {
$(".btn-delete").hide();
}

},

getContent: function(firingSolution, angleType){
Expand Down
4 changes: 2 additions & 2 deletions src/js/squadMinimap.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ export var squadMinimap = Map.extend({
}
else {
if (this.heatmap) {
this.removeLayer(this.heatmap); // Remove the heatmap layer from the map
this.heatmap = null; // Clear the reference to the heatmap
this.removeLayer(this.heatmap);
this.heatmap = null;
}
}
},
Expand Down

0 comments on commit 1ea2472

Please sign in to comment.