From 885825e5cc90517befa61ea3eef19a1d48306ee9 Mon Sep 17 00:00:00 2001 From: PeekabooSteam Date: Wed, 6 Dec 2023 14:54:36 +0000 Subject: [PATCH 1/3] Fixed incorrect colour --- .../public/stylesheets/panels/mouseinfo.css | 145 +----------------- client/public/stylesheets/style/style.css | 4 +- 2 files changed, 3 insertions(+), 146 deletions(-) diff --git a/client/public/stylesheets/panels/mouseinfo.css b/client/public/stylesheets/panels/mouseinfo.css index bff03071..c82b25e4 100644 --- a/client/public/stylesheets/panels/mouseinfo.css +++ b/client/public/stylesheets/panels/mouseinfo.css @@ -107,147 +107,4 @@ #coordinates-tool[data-location-system="MGRS"] [data-location-system="MGRS"], #coordinates-tool[data-location-system="UTM"] [data-location-system="UTM"] { display:flex; -} - - -/* -#mouse-info-panel dl { - margin-bottom: 4px; - row-gap: 5px; -} - -#mouse-info-panel dt { - height: fit-content; - width: 30%; -} - -#mouse-info-panel dt::after, #coordinates-tool [data-label] { - align-items: center; - background-color: white; - border-radius: var(--border-radius-sm); - color: var(--background-steel); - display: flex; - font-size: 15.6px; - font-weight: bolder; - height: 16px; - justify-content: center; - line-height: 16px; - padding: 4px; - text-transform: uppercase; - width: 16px; -} - -#coordinates-tool [data-label] { - height:24px; - width:24px; -} - -#mouse-info-panel #measuring-tool dt { - height: 24px; - width: 24px; - background-color: var(--background-offwhite); - border-radius: var(--border-radius-sm); -} - -#mouse-info-panel #measuring-tool svg { - padding: 3px; - height: 100%; - width: 100%; -} - -#mouse-info-panel #measuring-tool dt svg>* { - fill: black; - stroke: black; -} - -#mouse-info-panel [data-label]::after { - content: attr(data-label); -} - -#mouse-info-panel dt[data-coalition="blue"]::after { - background-color: var(--primary-blue); -} - -#mouse-info-panel dt[data-coalition="red"]::after { - background-color: var(--primary-red); -} - -#mouse-info-panel [data-tooltip]:hover::before { - background-color: var(--background-grey); - border-radius: 5px; - content: attr(data-tooltip); - display: flex; - flex-wrap: nowrap; - padding: 5px; - position: absolute; - translate: calc(-100% - 15px) 0; - white-space: nowrap; -} - -#coordinates-tool[data-location-system] [data-location-system] { - display:none; - flex-direction: column; -} - -#coordinates-tool[data-location-system="LatLng"] [data-location-system="LatLng"], -#coordinates-tool[data-location-system="MGRS"] [data-location-system="MGRS"] { - display:flex; -} - -#coordinates-tool > * > * { - align-items: center; - display:flex; - flex-flow: row nowrap; -} - -#coordinates-tool > * > * > * { - display:table-cell; - width:fit-content; -} - -#coordinates-tool > * > * > :last-child { - text-align: right; - width:100%; -} - -.br-info::after { - content: attr(data-bearing) '\00B0 / ' attr(data-distance) " " attr(data-distance-units); - font-weight: bold; - font-size: 13px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - color: var(--background-offwhite); -} - -.br-info[data-coalition="blue"]::after { - color: var(--primary-blue) -} - -.br-info[data-coalition="red"]::after { - color: var(--primary-red) -} - -.br-info[data-message]::after { - content: attr(data-message); -} - -.coordinates::after { - content: attr(data-value); - font-weight: bold; - font-size: 13px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - color: var(--background-offwhite); -} - -.elevation::after { - content: attr(data-value); - font-weight: bold; - font-size: 13px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - color: var(--background-offwhite); -} */ \ No newline at end of file +} \ No newline at end of file diff --git a/client/public/stylesheets/style/style.css b/client/public/stylesheets/style/style.css index 6351a3ce..75d9fcb6 100644 --- a/client/public/stylesheets/style/style.css +++ b/client/public/stylesheets/style/style.css @@ -676,8 +676,8 @@ nav.ol-panel> :last-child { } .ol-navbar-buttons-group button.off svg * { - fill: white; - stroke: white; + fill: white !important; /* Higher price than the Soul Stone but inline styling is causing issues. */ + stroke: white !important; /* I'm sorry, daughter. */ } .ol-navbar-buttons-group button svg * { From 25edfc45e5c086571c1afca49f90bd57c8b8ccfa Mon Sep 17 00:00:00 2001 From: PeekabooSteam Date: Wed, 6 Dec 2023 15:03:15 +0000 Subject: [PATCH 2/3] Added coalition visibility tooltips --- client/views/toolbars/primary.ejs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/views/toolbars/primary.ejs b/client/views/toolbars/primary.ejs index ee9ddd06..b8438f4e 100644 --- a/client/views/toolbars/primary.ejs +++ b/client/views/toolbars/primary.ejs @@ -57,17 +57,17 @@
+ data-on-click-params='{ "coalition": "blue" }' title="Toggle Blue coalition visibility">
+ data-on-click-params='{ "coalition": "red" }' title="Toggle Red coalition visibility">
+ data-on-click-params='{ "coalition": "neutral" }' title="Toggle Neutral coalition visibility">
\ No newline at end of file From 0e78b7559bed42ea2c9a894af19eaecb74bce4ee Mon Sep 17 00:00:00 2001 From: PeekabooSteam Date: Wed, 6 Dec 2023 15:27:05 +0000 Subject: [PATCH 3/3] Robots are no longer considered for waypoints --- client/src/map/map.ts | 4 ++-- client/src/unit/unitsmanager.ts | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/client/src/map/map.ts b/client/src/map/map.ts index f6694b71..fac9be3f 100644 --- a/client/src/map/map.ts +++ b/client/src/map/map.ts @@ -791,7 +791,7 @@ export class Map extends L.Map { #showDestinationCursors() { const singleCursor = !this.#shiftKey; - const selectedUnitsCount = getApp().getUnitsManager().getSelectedUnits({ excludeHumans: true, onlyOnePerGroup: true }).length; + const selectedUnitsCount = getApp().getUnitsManager().getSelectedUnits({ excludeHumans: true, excludeProtected: true, onlyOnePerGroup: true }).length; if (singleCursor) { this.#hideDestinationCursors(); } @@ -817,7 +817,7 @@ export class Map extends L.Map { } #updateDestinationCursors() { - const selectedUnitsCount = getApp().getUnitsManager().getSelectedUnits({ excludeHumans: true, onlyOnePerGroup: true }).length; + const selectedUnitsCount = getApp().getUnitsManager().getSelectedUnits({ excludeHumans: true, excludeProtected: true, onlyOnePerGroup: true }).length; if (selectedUnitsCount > 1) { const groupLatLng = this.#computeDestinationRotation && this.#destinationRotationCenter != null ? this.#destinationRotationCenter : this.getMouseCoordinates(); if (this.#destinationPreviewCursors.length == 1) diff --git a/client/src/unit/unitsmanager.ts b/client/src/unit/unitsmanager.ts index 31c5059a..2f65986f 100644 --- a/client/src/unit/unitsmanager.ts +++ b/client/src/unit/unitsmanager.ts @@ -138,6 +138,10 @@ export class UnitsManager { return; const messageText = (numOfProtectedUnits === 1) ? `Unit is protected` : `All selected units are protected`; (getApp().getPopupsManager().get("infoPopup") as Popup).setText(messageText); + // Cheap way for now until we use more locks + let lock = document.querySelector("#unit-visibility-control button.lock"); + lock.classList.add("prompt"); + setTimeout(() => lock.classList.remove("prompt"), 4000); } /** Update the data of all the units. The data is directly decoded from the binary buffer received from the REST Server. This is necessary for performance and bandwidth reasons. @@ -301,13 +305,8 @@ export class UnitsManager { } } if (options) { - if (options.showProtectionReminder === true && numProtectedUnits > selectedUnits.length && selectedUnits.length === 0) { + if (options.showProtectionReminder === true && numProtectedUnits > selectedUnits.length && selectedUnits.length === 0) this.showProtectedUnitsPopup(numProtectedUnits); - // Cheap way for now until we use more locks - let lock = document.querySelector("#unit-visibility-control button.lock"); - lock.classList.add("prompt"); - setTimeout(() => lock.classList.remove("prompt"), 4000); - } if (options.onlyOnePerGroup) { var temp: Unit[] = []; @@ -1148,6 +1147,14 @@ export class UnitsManager { if (units === null) units = this.getSelectedUnits({ excludeHumans: true, excludeProtected: true, onlyOnePerGroup: true }); + const segregatedUnits = this.segregateUnits(units); + if (segregatedUnits.controllable.length === 0) { + this.showProtectedUnitsPopup(segregatedUnits.dcsProtected.length); + return {}; + } + + units = segregatedUnits.controllable; + if (units.length === 0) return {};