mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Lock flashes on protected robot interaction
This commit is contained in:
@@ -687,6 +687,19 @@ nav.ol-panel> :last-child {
|
|||||||
width:10px;
|
width:10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes lock-prompt {
|
||||||
|
100% {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
0% {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ol-navbar-buttons-group > .protectable > button[data-protected].lock.prompt svg {
|
||||||
|
animation: lock-prompt .25s alternate infinite;
|
||||||
|
}
|
||||||
|
|
||||||
.ol-navbar-buttons-group > .protectable > button.lock svg.locked * {
|
.ol-navbar-buttons-group > .protectable > button.lock svg.locked * {
|
||||||
fill:white !important;
|
fill:white !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,6 +260,10 @@ export class UnitsManager {
|
|||||||
if (options.showProtectionReminder === true && numProtectedUnits > selectedUnits.length && selectedUnits.length === 0) {
|
if (options.showProtectionReminder === true && numProtectedUnits > selectedUnits.length && selectedUnits.length === 0) {
|
||||||
const messageText = (numProtectedUnits === 1) ? `Unit is protected` : `All selected units are protected`;
|
const messageText = (numProtectedUnits === 1) ? `Unit is protected` : `All selected units are protected`;
|
||||||
(getApp().getPopupsManager().get("infoPopup") as Popup).setText(messageText);
|
(getApp().getPopupsManager().get("infoPopup") as Popup).setText(messageText);
|
||||||
|
// Cheap way for now until we use more locks
|
||||||
|
let lock = <HTMLElement>document.querySelector("#unit-visibility-control button.lock");
|
||||||
|
lock.classList.add("prompt");
|
||||||
|
setTimeout(() => lock.classList.remove("prompt"), 4000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.onlyOnePerGroup) {
|
if (options.onlyOnePerGroup) {
|
||||||
@@ -811,7 +815,7 @@ export class UnitsManager {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
selectedUnitsDelete(explosion: boolean = false, explosionType: string = "") {
|
selectedUnitsDelete(explosion: boolean = false, explosionType: string = "") {
|
||||||
var selectedUnits = this.getSelectedUnits({ excludeProtected: true }); /* Can be applied to humans too */
|
var selectedUnits = this.getSelectedUnits({ excludeProtected: true, showProtectionReminder: true }); /* Can be applied to humans too */
|
||||||
const selectionContainsAHuman = selectedUnits.some((unit: Unit) => {
|
const selectionContainsAHuman = selectedUnits.some((unit: Unit) => {
|
||||||
return unit.getHuman() === true;
|
return unit.getHuman() === true;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user