Added feature: select unit payload at spawn and visibility.

This commit is contained in:
Davide Passoni
2022-12-30 17:43:20 +01:00
parent 92eab6fd41
commit 036f70db34
38 changed files with 14104 additions and 563 deletions

View File

@@ -184,17 +184,32 @@ class Map
this._selectionWheel = new SelectionWheel(e.originalEvent.x, e.originalEvent.y, options);
}
/* Show unit selection for ground units */
/* Show unit selection for air units */
_unitSelectAir(e)
{
this.removeSelectionWheel();
this.removeSelectionScroll();
var options = unitTypes.air;
options.sort();
this._selectionScroll = new SelectionScroll(e.originalEvent.x, e.originalEvent.y, options, (type) => {
this._selectionScroll = new SelectionScroll(e.originalEvent.x, e.originalEvent.y, options, (unitType) => {
this.removeSelectionWheel();
this.removeSelectionScroll();
spawnAirUnit(type, e.latlng, this._activeCoalition);
this._unitSelectPayload(unitType, e);
});
}
/* Show weapon selection for air units */
_unitSelectPayload(unitType, e)
{
this.removeSelectionWheel();
this.removeSelectionScroll();
var options = [];
options = payloadNames[unitType]
options.sort();
this._selectionScroll = new SelectionScroll(e.originalEvent.x, e.originalEvent.y, options, (payloadName) => {
this.removeSelectionWheel();
this.removeSelectionScroll();
spawnAirUnit(unitType, e.latlng, this._activeCoalition, payloadName);
});
}