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:
@@ -117,7 +117,8 @@
|
|||||||
[data-active-coalition="blue"].unit-spawn-button:hover,
|
[data-active-coalition="blue"].unit-spawn-button:hover,
|
||||||
[data-active-coalition="blue"].unit-spawn-button.is-open,
|
[data-active-coalition="blue"].unit-spawn-button.is-open,
|
||||||
[data-active-coalition="blue"]#active-coalition-label,
|
[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)
|
background-color: var(--primary-blue)
|
||||||
}
|
}
|
||||||
@@ -126,7 +127,8 @@
|
|||||||
[data-active-coalition="red"].unit-spawn-button:hover,
|
[data-active-coalition="red"].unit-spawn-button:hover,
|
||||||
[data-active-coalition="red"].unit-spawn-button.is-open,
|
[data-active-coalition="red"].unit-spawn-button.is-open,
|
||||||
[data-active-coalition="red"]#active-coalition-label,
|
[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)
|
background-color: var(--primary-red)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,20 +13,21 @@ export class AirbaseContextMenu extends ContextMenu {
|
|||||||
setAirbase(airbase: Airbase)
|
setAirbase(airbase: Airbase)
|
||||||
{
|
{
|
||||||
this.#airbase = airbase;
|
this.#airbase = airbase;
|
||||||
this.setAirbaseName(airbase.getName());
|
this.setName(airbase.getName());
|
||||||
this.setAirbaseProperties(airbase.getProperties());
|
this.setProperties(airbase.getProperties());
|
||||||
this.setAirbaseParkings(airbase.getParkings());
|
this.setParkings(airbase.getParkings());
|
||||||
|
this.setCoalition(airbase.getCoalition());
|
||||||
this.enableLandButton(getUnitsManager().getSelectedUnitsType() === "Aircraft" && (getUnitsManager().getSelectedUnitsCoalition() === airbase.getCoalition() || airbase.getCoalition() === "neutral"))
|
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");
|
var nameDiv = <HTMLElement>this.getContainer()?.querySelector("#airbase-name");
|
||||||
if (nameDiv != null)
|
if (nameDiv != null)
|
||||||
nameDiv.innerText = airbaseName;
|
nameDiv.innerText = airbaseName;
|
||||||
}
|
}
|
||||||
|
|
||||||
setAirbaseProperties(airbaseProperties: string[])
|
setProperties(airbaseProperties: string[])
|
||||||
{
|
{
|
||||||
this.getContainer()?.querySelector("#airbase-properties")?.replaceChildren(...airbaseProperties.map((property: string) => {
|
this.getContainer()?.querySelector("#airbase-properties")?.replaceChildren(...airbaseProperties.map((property: string) => {
|
||||||
var div = document.createElement("div");
|
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) => {
|
this.getContainer()?.querySelector("#airbase-parking")?.replaceChildren(...airbaseParkings.map((parking: string) => {
|
||||||
var div = document.createElement("div");
|
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)
|
enableLandButton(enableLandButton: boolean)
|
||||||
{
|
{
|
||||||
this.getContainer()?.querySelector("#land-here-button")?.classList.toggle("hide", !enableLandButton);
|
this.getContainer()?.querySelector("#land-here-button")?.classList.toggle("hide", !enableLandButton);
|
||||||
|
|||||||
Reference in New Issue
Block a user