diff --git a/client/plugins/controltips/index.js b/client/plugins/controltips/index.js
index 6874f995..bf3bcaad 100644
--- a/client/plugins/controltips/index.js
+++ b/client/plugins/controltips/index.js
@@ -71,6 +71,9 @@ class ControlTipsPlugin {
}
__classPrivateFieldGet(this, _ControlTipsPlugin_instances, "m", _ControlTipsPlugin_updateTips).call(this);
});
+ document.addEventListener("mouseup", (ev) => {
+ __classPrivateFieldGet(this, _ControlTipsPlugin_instances, "m", _ControlTipsPlugin_updateTips).call(this);
+ });
__classPrivateFieldGet(this, _ControlTipsPlugin_instances, "m", _ControlTipsPlugin_updateTips).call(this);
__classPrivateFieldGet(this, _ControlTipsPlugin_app, "f").getMap().addVisibilityOption(SHOW_CONTROL_TIPS, true);
return true;
@@ -135,21 +138,27 @@ _ControlTipsPlugin_element = new WeakMap(), _ControlTipsPlugin_app = new WeakMap
"showIfUnitSelected": true,
"unitsMustBeControlled": true
},
- {
- "key": "CTRL+Mouse2",
- "action": "Add waypoint",
- "showIfUnitSelected": true,
- "showIfHoveringOverAirbase": false,
- "unitsMustBeControlled": true
- },
{
"key": `Mouse2 (hold)`,
- "action": `Point operations`,
+ "action": `Interact (ground)`,
"showIfUnitSelected": true,
"showIfHoveringOverAirbase": false,
"showIfHoveringOverUnit": false,
"unitsMustBeControlled": true
},
+ {
+ "key": `Shift`,
+ "action": " in formation...",
+ "showIfUnitSelected": true,
+ "minSelectedUnits": 2
+ },
+ {
+ "key": "CTRL",
+ "action": " ... more",
+ "showIfUnitSelected": true,
+ "showIfHoveringOverAirbase": false,
+ "unitsMustBeControlled": true
+ },
{
"key": "CTRL",
"action": " Pin tool",
@@ -166,18 +175,12 @@ _ControlTipsPlugin_element = new WeakMap(), _ControlTipsPlugin_app = new WeakMap
"unitsMustBeControlled": true
},
{
- "key": `Delete`,
- "action": `Delete unit`,
- "showIfHoveringOverAirbase": false,
- "showIfUnitSelected": true
- },
- {
- "key": `mouse1`,
+ "key": `Mouse1`,
"action": "Toggle Blue/Red",
"mouseoverSelector": "#coalition-switch .ol-switch-fill"
},
{
- "key": `mouse2`,
+ "key": `Mouse2`,
"action": "Set Neutral",
"mouseoverSelector": "#coalition-switch .ol-switch-fill"
}
@@ -204,15 +207,30 @@ _ControlTipsPlugin_element = new WeakMap(), _ControlTipsPlugin_app = new WeakMap
"key": `Mouse2`,
"action": `Add waypoint`,
"showIfHoveringOverAirbase": false,
+ "showIfHoveringOverUnit": false,
"showIfUnitSelected": true,
"unitsMustBeControlled": true
},
{
"key": `Mouse2`,
- "action": `Airbase menu`,
+ "action": `Interact (airbase)`,
"showIfHoveringOverAirbase": true,
"showIfUnitSelected": true,
"unitsMustBeControlled": true
+ },
+ {
+ "key": `Mouse2`,
+ "action": `Interact (unit)`,
+ "showIfHoveringOverAirbase": false,
+ "showIfHoveringOverUnit": true,
+ "showIfUnitSelected": true,
+ "unitsMustBeControlled": true
+ },
+ {
+ "key": `Shift`,
+ "action": " in formation...",
+ "showIfUnitSelected": true,
+ "minSelectedUnits": 2
}
]
},
@@ -220,8 +238,35 @@ _ControlTipsPlugin_element = new WeakMap(), _ControlTipsPlugin_app = new WeakMap
"keys": ["ShiftLeft"],
"tips": [
{
- "key": `mouse1+drag`,
- "action": "Box select"
+ "key": `Mouse1+drag`,
+ "action": "Box select",
+ "showIfUnitSelected": false
+ },
+ {
+ "key": `Mouse2`,
+ "action": "Set first formation waypoint",
+ "showIfUnitSelected": true,
+ "minSelectedUnits": 2
+ },
+ {
+ "key": "CTRL",
+ "action": " ... more",
+ "minSelectedUnits": 2,
+ "showIfUnitSelected": true,
+ "showIfHoveringOverAirbase": false,
+ "unitsMustBeControlled": true
+ },
+ ]
+ },
+ {
+ "keys": ["ControlLeft", "ShiftLeft"],
+ "tips": [
+ {
+ "key": `Mouse2`,
+ "action": "Add formation waypoint",
+ "showIfUnitSelected": true,
+ "minSelectedUnits": 2,
+ "unitsMustBeControlled": true
}
]
}
@@ -230,11 +275,13 @@ _ControlTipsPlugin_element = new WeakMap(), _ControlTipsPlugin_app = new WeakMap
const element = this.getElement();
element.innerHTML = "";
let numSelectedUnits = 0;
+ let numSelectedControlledUnits = 0;
let unitSelectionContainsControlled = false;
if (__classPrivateFieldGet(this, _ControlTipsPlugin_app, "f").getUnitsManager()) {
let selectedUnits = Object.values(__classPrivateFieldGet(this, _ControlTipsPlugin_app, "f").getUnitsManager().getSelectedUnits());
numSelectedUnits = selectedUnits.length;
- unitSelectionContainsControlled = selectedUnits.some((unit) => unit.getControlled());
+ numSelectedControlledUnits = selectedUnits.filter((unit) => unit.getControlled()).length;
+ unitSelectionContainsControlled = numSelectedControlledUnits > 0;
}
const tipsIncludesActiveMouseover = (currentCombo.tips.some((tip) => {
if (!tip.mouseoverSelector) {
@@ -256,6 +303,9 @@ _ControlTipsPlugin_element = new WeakMap(), _ControlTipsPlugin_app = new WeakMap
if (tip.unitsMustBeControlled === true && unitSelectionContainsControlled === false) {
return false;
}
+ if (typeof tip.minSelectedUnits === "number" && numSelectedControlledUnits < tip.minSelectedUnits) {
+ return false;
+ }
}
if (numSelectedUnits === 0 && tip.showIfUnitSelected === true) {
return false;
@@ -276,8 +326,6 @@ _ControlTipsPlugin_element = new WeakMap(), _ControlTipsPlugin_app = new WeakMap
if (!tipsIncludesActiveMouseover && typeof tip.mouseoverSelector === "string") {
return false;
}
- return true;
- }).forEach((tip) => {
element.innerHTML += `
${tip.key}${tip.action}
`;
});
};
diff --git a/client/plugins/controltips/src/controltipsplugin.ts b/client/plugins/controltips/src/controltipsplugin.ts
index 1f6e7033..bcfa1506 100644
--- a/client/plugins/controltips/src/controltipsplugin.ts
+++ b/client/plugins/controltips/src/controltipsplugin.ts
@@ -70,6 +70,10 @@ export class ControlTipsPlugin implements OlympusPlugin {
this.#updateTips();
});
+ document.addEventListener( "mouseup", ( ev: MouseEvent ) => {
+ this.#updateTips();
+ });
+
this.#updateTips();
this.#app.getMap().addVisibilityOption(SHOW_CONTROL_TIPS, true);
@@ -137,21 +141,27 @@ export class ControlTipsPlugin implements OlympusPlugin {
"showIfUnitSelected": true,
"unitsMustBeControlled": true
},
- {
- "key": "CTRL+Mouse2",
- "action": "Add waypoint",
- "showIfUnitSelected": true,
- "showIfHoveringOverAirbase": false,
- "unitsMustBeControlled": true
- },
{
"key": `Mouse2 (hold)`,
- "action": `Point operations`,
+ "action": `Interact (ground)`,
"showIfUnitSelected": true,
"showIfHoveringOverAirbase": false,
"showIfHoveringOverUnit": false,
"unitsMustBeControlled": true
},
+ {
+ "key": `Shift`,
+ "action": " in formation...",
+ "showIfUnitSelected": true,
+ "minSelectedUnits": 2
+ },
+ {
+ "key": "CTRL",
+ "action": " ... more",
+ "showIfUnitSelected": true,
+ "showIfHoveringOverAirbase": false,
+ "unitsMustBeControlled": true
+ },
{
"key": "CTRL",
"action": " Pin tool",
@@ -168,18 +178,12 @@ export class ControlTipsPlugin implements OlympusPlugin {
"unitsMustBeControlled": true
},
{
- "key": `Delete`,
- "action": `Delete unit`,
- "showIfHoveringOverAirbase": false,
- "showIfUnitSelected": true
- },
- {
- "key": `mouse1`,
+ "key": `Mouse1`,
"action": "Toggle Blue/Red",
"mouseoverSelector": "#coalition-switch .ol-switch-fill"
},
{
- "key": `mouse2`,
+ "key": `Mouse2`,
"action": "Set Neutral",
"mouseoverSelector": "#coalition-switch .ol-switch-fill"
}
@@ -206,15 +210,30 @@ export class ControlTipsPlugin implements OlympusPlugin {
"key": `Mouse2`,
"action": `Add waypoint`,
"showIfHoveringOverAirbase": false,
+ "showIfHoveringOverUnit": false,
"showIfUnitSelected": true,
"unitsMustBeControlled": true
},
{
"key": `Mouse2`,
- "action": `Airbase menu`,
+ "action": `Interact (airbase)`,
"showIfHoveringOverAirbase": true,
"showIfUnitSelected": true,
"unitsMustBeControlled": true
+ },
+ {
+ "key": `Mouse2`,
+ "action": `Interact (unit)`,
+ "showIfHoveringOverAirbase": false,
+ "showIfHoveringOverUnit": true,
+ "showIfUnitSelected": true,
+ "unitsMustBeControlled": true
+ },
+ {
+ "key": `Shift`,
+ "action": " in formation...",
+ "showIfUnitSelected": true,
+ "minSelectedUnits": 2
}
]
},
@@ -222,8 +241,35 @@ export class ControlTipsPlugin implements OlympusPlugin {
"keys": ["ShiftLeft"],
"tips": [
{
- "key": `mouse1+drag`,
- "action": "Box select"
+ "key": `Mouse1+drag`,
+ "action": "Box select",
+ "showIfUnitSelected": false
+ },
+ {
+ "key": `Mouse2`,
+ "action": "Set first formation waypoint",
+ "showIfUnitSelected": true,
+ "minSelectedUnits": 2
+ },
+ {
+ "key": "CTRL",
+ "action": " ... more",
+ "minSelectedUnits": 2,
+ "showIfUnitSelected": true,
+ "showIfHoveringOverAirbase": false,
+ "unitsMustBeControlled": true
+ },
+ ]
+ },
+ {
+ "keys": ["ControlLeft", "ShiftLeft"],
+ "tips": [
+ {
+ "key": `Mouse2`,
+ "action": "Add formation waypoint",
+ "showIfUnitSelected": true,
+ "minSelectedUnits": 2,
+ "unitsMustBeControlled": true
}
]
}
@@ -236,12 +282,14 @@ export class ControlTipsPlugin implements OlympusPlugin {
element.innerHTML = "";
let numSelectedUnits = 0;
+ let numSelectedControlledUnits = 0;
let unitSelectionContainsControlled = false;
if (this.#app.getUnitsManager()) {
let selectedUnits = Object.values(this.#app.getUnitsManager().getSelectedUnits());
- numSelectedUnits = selectedUnits.length;
- unitSelectionContainsControlled = selectedUnits.some((unit: any) => unit.getControlled());
+ numSelectedUnits = selectedUnits.length;
+ numSelectedControlledUnits = selectedUnits.filter((unit: any) => unit.getControlled()).length;
+ unitSelectionContainsControlled = numSelectedControlledUnits > 0;
}
const tipsIncludesActiveMouseover = ( currentCombo.tips.some( ( tip:any ) => {
@@ -269,6 +317,10 @@ export class ControlTipsPlugin implements OlympusPlugin {
if (tip.unitsMustBeControlled === true && unitSelectionContainsControlled === false) {
return false;
}
+
+ if ( typeof tip.minSelectedUnits === "number" && numSelectedControlledUnits < tip.minSelectedUnits ) {
+ return false;
+ }
}
if (numSelectedUnits === 0 && tip.showIfUnitSelected === true) {
@@ -295,10 +347,8 @@ export class ControlTipsPlugin implements OlympusPlugin {
return false;
}
- return true;
+ element.innerHTML += `${tip.key}${tip.action}
`;
- }).forEach( (tip:any) => {
- element.innerHTML += `${tip.key}${tip.action}
`
});
}
}
\ No newline at end of file
diff --git a/client/public/stylesheets/leaflet/leaflet.css b/client/public/stylesheets/leaflet/leaflet.css
index 1981009f..9ade8dc4 100644
--- a/client/public/stylesheets/leaflet/leaflet.css
+++ b/client/public/stylesheets/leaflet/leaflet.css
@@ -60,6 +60,11 @@
padding: 0;
}
+.leaflet-container img.leaflet-tile {
+ /* See: https://bugs.chromium.org/p/chromium/issues/detail?id=600120 */
+ mix-blend-mode: plus-lighter;
+}
+
.leaflet-container.leaflet-touch-zoom {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
@@ -646,7 +651,7 @@ svg.leaflet-image-layer.leaflet-interactive path {
}
/* Printing */
-
+
@media print {
/* Prevent printers from removing background-images of controls. */
.leaflet-control {
diff --git a/client/routes/plugins.js b/client/routes/plugins.js
index 1ed9511f..fd3ad0af 100644
--- a/client/routes/plugins.js
+++ b/client/routes/plugins.js
@@ -16,7 +16,6 @@ function listDirectories(source) {
router.get('/list', function (req, res) {
var directories = listDirectories(pluginsDirectory);
- console.log(directories)
res.send(directories.filter(directory => fs.existsSync(path.join(pluginsDirectory, directory))));
});