From 965b67b8ab691b11ae524db98a75c37e85af6131 Mon Sep 17 00:00:00 2001 From: WoodyXP <55553527+WoodyXP@users.noreply.github.com> Date: Tue, 6 Feb 2024 09:27:55 +0100 Subject: [PATCH] Sort SkillDropdown by Skill level --- client/src/controls/unitspawnmenu.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/src/controls/unitspawnmenu.ts b/client/src/controls/unitspawnmenu.ts index e237afd8..ae8f3630 100644 --- a/client/src/controls/unitspawnmenu.ts +++ b/client/src/controls/unitspawnmenu.ts @@ -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);