diff --git a/resources/ui/air_assets/unspecified_selected.svg b/resources/ui/air_assets/unspecified_selected.svg new file mode 100644 index 00000000..373cf7f1 --- /dev/null +++ b/resources/ui/air_assets/unspecified_selected.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/ui/map/map.js b/resources/ui/map/map.js index dbfafed0..7e7e2fba 100644 --- a/resources/ui/map/map.js +++ b/resources/ui/map/map.js @@ -108,16 +108,28 @@ class AirIcons { constructor() { this.icons = {}; for (const player of [true, false]) { - this.icons[player] = this.loadIcon("unspecified", player); + this.icons[player] = {}; + for (const selected of [true, false]) { + this.icons[player][selected] = this.loadIcon( + "unspecified", + player, + selected + ); + } } } - icon(_category, player, _state) { - return this.icons[player]; + icon(_category, player, selected) { + return this.icons[player][selected]; } - loadIcon(category, player) { - const color = player ? "blue" : "red"; + loadIcon(category, player, selected) { + var color; + if (selected) { + color = "selected"; + } else { + color = player ? "blue" : "red"; + } return new L.Icon({ iconUrl: `../air_assets/${category}_${color}.svg`, iconSize: [24, 24], @@ -849,7 +861,11 @@ class Flight { const position = this.flight.position; if (position.length > 0) { this.aircraft = L.marker(position, { - icon: Icons.AirIcons.icon("fighter", this.flight.blue), + icon: Icons.AirIcons.icon( + "fighter", + this.flight.blue, + this.flight.selected + ), }).addTo(aircraftLayer); } }