mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Colors the spawn button correctly in the airbase spawn menu (not for neutral airbases, still needs fixing)
This commit is contained in:
parent
2a60edcaec
commit
4e46819839
@ -117,7 +117,8 @@
|
||||
[data-active-coalition="blue"].unit-spawn-button:hover,
|
||||
[data-active-coalition="blue"].unit-spawn-button.is-open,
|
||||
[data-active-coalition="blue"]#active-coalition-label,
|
||||
[data-active-coalition="blue"].deploy-unit-button
|
||||
[data-active-coalition="blue"].deploy-unit-button,
|
||||
[data-active-coalition="blue"]#spawn-airbase-aircraft-button
|
||||
{
|
||||
background-color: var(--primary-blue)
|
||||
}
|
||||
@ -126,7 +127,8 @@
|
||||
[data-active-coalition="red"].unit-spawn-button:hover,
|
||||
[data-active-coalition="red"].unit-spawn-button.is-open,
|
||||
[data-active-coalition="red"]#active-coalition-label,
|
||||
[data-active-coalition="red"].deploy-unit-button
|
||||
[data-active-coalition="red"].deploy-unit-button,
|
||||
[data-active-coalition="red"]#spawn-airbase-aircraft-button
|
||||
{
|
||||
background-color: var(--primary-red)
|
||||
}
|
||||
|
||||
@ -13,20 +13,21 @@ export class AirbaseContextMenu extends ContextMenu {
|
||||
setAirbase(airbase: Airbase)
|
||||
{
|
||||
this.#airbase = airbase;
|
||||
this.setAirbaseName(airbase.getName());
|
||||
this.setAirbaseProperties(airbase.getProperties());
|
||||
this.setAirbaseParkings(airbase.getParkings());
|
||||
this.setName(airbase.getName());
|
||||
this.setProperties(airbase.getProperties());
|
||||
this.setParkings(airbase.getParkings());
|
||||
this.setCoalition(airbase.getCoalition());
|
||||
this.enableLandButton(getUnitsManager().getSelectedUnitsType() === "Aircraft" && (getUnitsManager().getSelectedUnitsCoalition() === airbase.getCoalition() || airbase.getCoalition() === "neutral"))
|
||||
}
|
||||
|
||||
setAirbaseName(airbaseName: string)
|
||||
setName(airbaseName: string)
|
||||
{
|
||||
var nameDiv = <HTMLElement>this.getContainer()?.querySelector("#airbase-name");
|
||||
if (nameDiv != null)
|
||||
nameDiv.innerText = airbaseName;
|
||||
}
|
||||
|
||||
setAirbaseProperties(airbaseProperties: string[])
|
||||
setProperties(airbaseProperties: string[])
|
||||
{
|
||||
this.getContainer()?.querySelector("#airbase-properties")?.replaceChildren(...airbaseProperties.map((property: string) => {
|
||||
var div = document.createElement("div");
|
||||
@ -35,7 +36,7 @@ export class AirbaseContextMenu extends ContextMenu {
|
||||
}));
|
||||
}
|
||||
|
||||
setAirbaseParkings(airbaseParkings: string[])
|
||||
setParkings(airbaseParkings: string[])
|
||||
{
|
||||
this.getContainer()?.querySelector("#airbase-parking")?.replaceChildren(...airbaseParkings.map((parking: string) => {
|
||||
var div = document.createElement("div");
|
||||
@ -44,6 +45,11 @@ export class AirbaseContextMenu extends ContextMenu {
|
||||
}));
|
||||
}
|
||||
|
||||
setCoalition(coalition: string)
|
||||
{
|
||||
(<HTMLElement>this.getContainer()?.querySelector("#spawn-airbase-aircraft-button")).dataset.activeCoalition = coalition;
|
||||
}
|
||||
|
||||
enableLandButton(enableLandButton: boolean)
|
||||
{
|
||||
this.getContainer()?.querySelector("#land-here-button")?.classList.toggle("hide", !enableLandButton);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user