Added back attack and movement functions, missionData is now part of units

This commit is contained in:
Pax1601
2023-01-17 22:17:20 +01:00
parent 280799b27a
commit b77f271183
18 changed files with 388 additions and 225 deletions

View File

@@ -1,4 +1,4 @@
import { setActiveCoalition } from "..";
import { getActiveCoalition, setActiveCoalition } from "..";
import { deg2rad } from "../other/utils";
export class SelectionWheel
@@ -57,6 +57,22 @@ export class SelectionWheel
}
button.appendChild(image);
}
/* Hide the coalition switch if required */
var switchContainer = <HTMLElement> this.#container.querySelector("#coalition-switch-container");
if (showCoalition == false)
{
switchContainer.style.display = "none";
document.documentElement.style.setProperty('--active-coalition-color', getComputedStyle(this.#container).getPropertyValue("--neutral-coalition-color"));
}
else
{
switchContainer.style.display = "block";
if (getActiveCoalition() == "blue")
document.documentElement.style.setProperty('--active-coalition-color', getComputedStyle(this.#container).getPropertyValue("--blue-coalition-color"));
else
document.documentElement.style.setProperty('--active-coalition-color', getComputedStyle(this.#container).getPropertyValue("--red-coalition-color"));
}
}
}