Sort SkillDropdown by Skill level

This commit is contained in:
WoodyXP 2024-02-06 09:27:55 +01:00
parent 0ef3abbffa
commit 965b67b8ab

View File

@ -272,9 +272,11 @@ export abstract class UnitSpawnMenu {
}
if (!this.#unitSkillDropdown.isHidden()) {
this.#unitSkillDropdown.setOptions(["Average", "Good", "High", "Excellent"])
const sortedOptions = ["Average", "Good", "High", "Excellent"];
this.#unitSkillDropdown.setOptions(sortedOptions, null);
this.#unitSkillDropdown.selectValue(4);
}
}
/* Get the unit data from the db */
var blueprint = this.#unitDatabase.getByName(this.spawnOptions.name);