Added ability to force coalition unit in IADS spawner

This commit is contained in:
Pax1601
2023-12-10 20:33:13 +01:00
parent 6c6117aee3
commit 0329e27713
6 changed files with 41 additions and 8 deletions

View File

@@ -66,8 +66,9 @@ export class CoalitionAreaContextMenu extends ContextMenu {
document.addEventListener("contextMenuCreateIads", (e: any) => {
const area = this.getCoalitionArea();
const forceCoalition = (this.getContainer()?.querySelector("#force-coalition")?.querySelector("input") as HTMLInputElement).checked;
if (area)
getApp().getUnitsManager().createIADS(area, getCheckboxOptions(this.#iadsTypesDropdown), getCheckboxOptions(this.#iadsErasDropdown), getCheckboxOptions(this.#iadsRangesDropdown), this.#iadsDensitySlider.getValue(), this.#iadsDistributionSlider.getValue());
getApp().getUnitsManager().createIADS(area, getCheckboxOptions(this.#iadsTypesDropdown), getCheckboxOptions(this.#iadsErasDropdown), getCheckboxOptions(this.#iadsRangesDropdown), this.#iadsDensitySlider.getValue(), this.#iadsDistributionSlider.getValue(), forceCoalition);
this.hide();
});
this.hide();