Merge branch 'main' into 633-unable-to-hide-olympus-controlled-units

This commit is contained in:
PeekabooSteam
2023-12-02 15:58:37 +00:00
committed by GitHub
32 changed files with 19859 additions and 17253 deletions

View File

@@ -210,7 +210,7 @@ export abstract class UnitSpawnMenu {
let name = this.#unitLabelDropdown.getOptionsList()[idx];
let element = this.#unitLabelDropdown.getOptionElements()[idx] as HTMLElement;
let entry = this.#unitDatabase.getByName(name);
if (entry) {
if (entry && entry.tags?.trim() !== "") {
element.querySelectorAll("button")[0]?.append(...(entry.tags?.split(",").map((tag: string) => {
tag = tag.trim();
let el = document.createElement("div");

View File

@@ -53,7 +53,6 @@ export class OlympusApp {
#weaponsManager: WeaponsManager | null = null;
constructor() {
}
// TODO add checks on null

View File

@@ -12,7 +12,7 @@ export class ServerManager {
#connected: boolean = false;
#paused: boolean = false;
#REST_ADDRESS = "http://localhost:30000/olympus";
#DEMO_ADDRESS = window.location.href + "demo";
#DEMO_ADDRESS = window.location.href.split('?')[0] + "demo"; /* Remove query parameters */
#username = "";
#password = "";
#sessionHash: string | null = null;
@@ -105,7 +105,7 @@ export class ServerManager {
getConfig(callback: CallableFunction) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", window.location.href + "config", true);
xmlHttp.open("GET", window.location.href.split('?')[0] + "config", true);
xmlHttp.onload = function (e) {
var data = JSON.parse(xmlHttp.responseText);
callback(data);