Files
DCSOlympus/client/src/panels/panel.ts
Pax1601 2212162239 Added spawn from airbase code
The spawn from airbase code has been added. A couple of fixes to the UnitDataTable.
2023-03-21 21:22:29 +01:00

34 lines
667 B
TypeScript

export class Panel {
#element: HTMLElement
#visible: boolean = true;
constructor(ID: string) {
this.#element = <HTMLElement>document.getElementById(ID);
}
show() {
this.#element.classList.toggle("hide", false);
this.#visible = true;
}
hide() {
this.#element.classList.toggle("hide", true);
this.#visible = false;
}
toggle() {
// Simple way to track if currently visible
if (this.#visible)
this.hide();
else
this.show();
}
getElement() {
return this.#element;
}
getVisible(){
return this.#visible;
}
}