Completed aircraft spawn contextmenu

This commit is contained in:
dpassoni
2023-03-10 13:07:19 +01:00
parent 60d7b364b6
commit 3dadff6d42
104 changed files with 1443 additions and 1071 deletions

View File

@@ -6,6 +6,16 @@ export class UnitDatabase {
}
getByLabel(label: string)
{
for (let unit in this.units)
{
if (this.units[unit].label === label)
return this.units[unit];
}
return null;
}
getRoles()
{
var roles: string[] = [];
@@ -15,7 +25,6 @@ export class UnitDatabase {
{
for (let role of loadout.roles)
{
role = role.toUpperCase();
if (role !== "" && !roles.includes(role))
roles.push(role);
}
@@ -46,7 +55,7 @@ export class UnitDatabase {
var loadouts = [];
for (let loadout of this.units[unit].loadouts)
{
if (loadout.roles.includes(role) || loadout.roles.includes(role.toLowerCase()) || loadout.roles.includes(""))
if (loadout.roles.includes(role) || loadout.roles.includes(""))
{
loadouts.push(loadout.name)
}