Skip to content

Commit

Permalink
changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
sh4rkman committed Jan 15, 2025
1 parent b38de30 commit 033a856
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 15 deletions.
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
# <img src="https://img.shields.io/badge/-major%20release-b22222?style=for-the-badge"> **36.0.0** *(2025-01-15)*

<img src="https://img.shields.io/badge/-new-green"> **Squad Map Markers:** Right-click on the map to open a context menu that lets you place markers, helping you strategize for future games.

<img src="https://img.shields.io/badge/-new-green"> **Auto-Copy Targets:** Enable this setting to automatically copy the calculations of the most recently placed or moved target to the clipboard, making it easy to share them in-game using Ctrl+V.

<img src="https://img.shields.io/badge/-new-green"> **Auto-Copy Next Flags:** Enable this setting to automatically copy the name of the next flag when clicking a flag in a RAAS/Invasion layer, making it easy to share in-game using Ctrl+V.

<img src="https://img.shields.io/badge/-new-green"> **Display Low & High Angles:** Enable this setting to display both low- and high-angle solutions on the marker for weapons that support both. (Thanks, Matador, for the suggestion. Fix #258)

<img src="https://img.shields.io/badge/-new-green"> **Flags Distance:** In AAS/RAAS/Invasion, a new setting allows you to show or hide the distance between flags.

<img src="https://img.shields.io/badge/-%20improv%20-orange"> HD maps (8k × 8k) are now tiled for better performance and efficiency.

<img src="https://img.shields.io/badge/-%20improv%20-orange"> Added various tooltips to settings.

<img src="https://img.shields.io/badge/-%20improv%20-orange"> Added various animations.

<img src="https://img.shields.io/badge/-%20fix%20-b22"> Fixed Yehorivka heightmaps being twice the size they should be. (Fix #259)

<img src="https://img.shields.io/badge/-%20fix%20-b22"> The heatmap is no longer redrawn each time the layer is changed on the same map.

<img src="https://img.shields.io/badge/-%20fix%20-b22"> Fixed flag numbers being off-center on rectangular flags.

<img src="https://img.shields.io/badge/-%20fix%20-b22"> Fixed seconds being displayed as meters in some languages.



</br></br><!-- CHANGELOG SPLIT MARKER -->


# <img src="https://img.shields.io/badge/-major%20release-b22222?style=for-the-badge"> **35.0.0** *(2025-01-02)*

<img src="https://img.shields.io/badge/-new-green"> **Custom font size:** you can now change the size of the texts appearing on the map to your liking (Fixes [#254](https://github.com/sh4rkman/SquadCalc/issues/254))
Expand Down
76 changes: 61 additions & 15 deletions src/js/squadMarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { targetIcon1, targetIconAnimated, targetIconDisabled, targetIconMinimal,
import SquadSimulation from "./squadSimulation.js";
import SquadFiringSolution from "./squadFiringSolution.js";
import i18next from "i18next";
import { sendMarkerData, sendTargetData, sendFOBData } from "./squadCalcAPI.js";
import { sendMarkerData, sendTargetData } from "./squadCalcAPI.js";
import { animateCSS } from "./animations.js";


Expand Down Expand Up @@ -1252,12 +1252,12 @@ export var squadStratMarker = squadMarker.extend({


// Report marker to squadcalc API
sendFOBData({
lat: this._latlng.lat,
lng: this._latlng.lng,
weapon: "FOB",
map: App.minimap.activeMap.name,
});
// sendFOBData({
// lat: this._latlng.lat,
// lng: this._latlng.lng,
// weapon: "FOB",
// map: App.minimap.activeMap.name,
// });

// Custom events handlers
//this.on("click", this._handleClick, this);
Expand Down Expand Up @@ -1290,6 +1290,24 @@ export var squadStratMarker = squadMarker.extend({
},

_handleContextMenu: function(e){

// Avoid other target keeping fading
clearTimeout(this.mouseOverTimeout);

// If they already faded, switch them back
this.map.activeTargetsMarkers.eachLayer((target) => {
target.on("mouseover", target._handleMouseOver, target);
target.on("mouseout", target._handleMouseOut, target);
target.setOpacity(1);
target.calcMarker1.openOn(this.map);
if (this.map.activeWeaponsMarkers.getLayers()[1]) target.calcMarker2.openOn(this.map);
target.updateSpread();
target.updateDamageRadius();
});

// Reset layer opacity
if (this.map.layer) this.map.layer._setOpacity(1);

this.delete(e);
},

Expand Down Expand Up @@ -1327,18 +1345,18 @@ export var squadStratMarker = squadMarker.extend({
this.map.on("mousemove", this.map._handleMouseMove);
}


this.isDragging = false;
this.posPopUp.close();

this.map.updateTargets();
//this.map.updateTargets();

// Report marker to squadcalc API
sendFOBData({
lat: this._latlng.lat,
lng: this._latlng.lng,
weapon: "FOB",
map: App.minimap.activeMap.name,
});
// sendFOBData({
// lat: this._latlng.lat,
// lng: this._latlng.lng,
// weapon: "FOB",
// map: App.minimap.activeMap.name,
// });

},

Expand All @@ -1347,13 +1365,41 @@ export var squadStratMarker = squadMarker.extend({
this.constructionRange.addTo(this.map.markersGroup);
this.exclusionRange.addTo(this.map.markersGroup);
}

this.mouseOverTimeout = setTimeout(() => {

// Hide the layer
if (this.map.layer) this.map.layer._setOpacity(0.5);

// Hide other targets
if (!this.isDragging){
this.map.activeTargetsMarkers.eachLayer((target) => {
if (target != this) {
target.off("mouseover");
target.off("mouseout");
target.setOpacity(0.65);
target.calcMarker1.close();
target.calcMarker2.close();
target.disableSpreadRadii();
target.disableDamageRadii();
target.twentyFiveDamageRadius.setStyle({ opacity: 0 });
}
});
}
}, 500);
},

_handleMouseOut: function(){
if (this.options.circlesOnHover){
this.constructionRange.removeFrom(this.map.markersGroup);
this.exclusionRange.removeFrom(this.map.markersGroup);
}

// Cancel the timeout if the user moves the mouse out before 1 second
clearTimeout(this.mouseOverTimeout);

// Show the layer
if (this.map.layer) this.map.layer._setOpacity(1);
}

});

0 comments on commit 033a856

Please sign in to comment.