mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
More work on units spawn menu and started to add documentation
This commit is contained in:
@@ -1,7 +1,11 @@
|
||||
import { Panel } from "./panel";
|
||||
|
||||
export class ConnectionStatusPanel extends Panel {
|
||||
constructor(ID: string) {
|
||||
/**
|
||||
*
|
||||
* @param ID - the ID of the HTML element which will contain the context menu
|
||||
*/
|
||||
constructor(ID: string){
|
||||
super(ID);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,11 @@ import { Unit } from "../unit/unit";
|
||||
import { Panel } from "./panel";
|
||||
|
||||
export class HotgroupPanel extends Panel {
|
||||
constructor(ID: string) {
|
||||
/**
|
||||
*
|
||||
* @param ID - the ID of the HTML element which will contain the context menu
|
||||
*/
|
||||
constructor(ID: string){
|
||||
super(ID);
|
||||
document.addEventListener("unitDeath", () => this.refreshHotgroups());
|
||||
}
|
||||
|
||||
@@ -7,7 +7,11 @@ export class LogPanel extends Panel {
|
||||
#scrolledDown: boolean = true;
|
||||
#logs: {[key: string]: string} = {};
|
||||
|
||||
constructor(ID: string) {
|
||||
/**
|
||||
*
|
||||
* @param ID - the ID of the HTML element which will contain the context menu
|
||||
*/
|
||||
constructor(ID: string){
|
||||
super(ID);
|
||||
|
||||
document.addEventListener("toggleLogPanel", () => {
|
||||
|
||||
@@ -12,7 +12,11 @@ export class MouseInfoPanel extends Panel {
|
||||
#measureLine: Polyline = new Polyline([], { color: '#2d3e50', weight: 3, opacity: 0.5, smoothFactor: 1, interactive: false });
|
||||
#measureBox: HTMLElement;
|
||||
|
||||
constructor(ID: string) {
|
||||
/**
|
||||
*
|
||||
* @param ID - the ID of the HTML element which will contain the context menu
|
||||
*/
|
||||
constructor(ID: string){
|
||||
super(ID);
|
||||
|
||||
this.#measureIcon = new Icon({ iconUrl: 'resources/theme/images/icons/pin.svg', iconAnchor: [16, 32] });
|
||||
@@ -124,9 +128,9 @@ export class MouseInfoPanel extends Panel {
|
||||
this.#drawMeasureLine();
|
||||
}
|
||||
|
||||
#drawMeasure(imgId: string | null, textId: string, value: LatLng | null, mousePosition: LatLng) {
|
||||
var el = this.getElement().querySelector(`#${textId}`) as HTMLElement;
|
||||
var img = imgId != null ? this.getElement().querySelector(`#${imgId}`) as HTMLElement : null;
|
||||
#drawMeasure(imgID: string | null, textID: string, value: LatLng | null, mousePosition: LatLng) {
|
||||
var el = this.getElement().querySelector(`#${textID}`) as HTMLElement;
|
||||
var img = imgID != null ? this.getElement().querySelector(`#${imgID}`) as HTMLElement : null;
|
||||
if (value) {
|
||||
if (el != null) {
|
||||
el.classList.remove("hide");
|
||||
@@ -156,9 +160,9 @@ export class MouseInfoPanel extends Panel {
|
||||
}
|
||||
}
|
||||
|
||||
#drawCoordinates(imgId: string, textId: string, value: string) {
|
||||
const el = this.getElement().querySelector(`#${textId}`) as HTMLElement;
|
||||
const img = this.getElement().querySelector(`#${imgId}`) as HTMLElement;
|
||||
#drawCoordinates(imgID: string, textID: string, value: string) {
|
||||
const el = this.getElement().querySelector(`#${textID}`) as HTMLElement;
|
||||
const img = this.getElement().querySelector(`#${imgID}`) as HTMLElement;
|
||||
if (img && el) {
|
||||
el.dataset.value = value.substring(1);
|
||||
img.dataset.label = value[0];
|
||||
|
||||
@@ -2,7 +2,11 @@ export class Panel {
|
||||
#element: HTMLElement
|
||||
#visible: boolean = true;
|
||||
|
||||
constructor(ID: string) {
|
||||
/**
|
||||
*
|
||||
* @param ID - the ID of the HTML element which will contain the context menu
|
||||
*/
|
||||
constructor(ID: string){
|
||||
this.#element = <HTMLElement>document.getElementById(ID);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
import { Panel } from "./panel";
|
||||
|
||||
export class ServerStatusPanel extends Panel {
|
||||
constructor(ID: string) {
|
||||
/**
|
||||
*
|
||||
* @param ID - the ID of the HTML element which will contain the context menu
|
||||
*/
|
||||
constructor(ID: string){
|
||||
super(ID);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,11 @@ export class UnitControlPanel extends Panel {
|
||||
#units: Unit[] = [];
|
||||
#selectedUnitsTypes: string[] = [];
|
||||
|
||||
constructor(ID: string) {
|
||||
/**
|
||||
*
|
||||
* @param ID - the ID of the HTML element which will contain the context menu
|
||||
*/
|
||||
constructor(ID: string){
|
||||
super(ID);
|
||||
|
||||
/* Unit control sliders */
|
||||
|
||||
@@ -22,7 +22,11 @@ export class UnitInfoPanel extends Panel {
|
||||
#unitLabel: HTMLElement;
|
||||
#unitName: HTMLElement;
|
||||
|
||||
constructor(ID: string) {
|
||||
/**
|
||||
*
|
||||
* @param ID - the ID of the HTML element which will contain the context menu
|
||||
*/
|
||||
constructor(ID: string){
|
||||
super(ID);
|
||||
|
||||
this.#altitude = (this.getElement().querySelector("#altitude")) as HTMLElement;
|
||||
|
||||
Reference in New Issue
Block a user