From d493cf0f78d8bc792f0c73e28515158a704a45df Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 22 Nov 2022 13:21:22 +0100 Subject: [PATCH] feat: skills are ordered by interest level, then by mastery level --- src/service/skills.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/service/skills.ts b/src/service/skills.ts index 53d51e7..d8624c4 100644 --- a/src/service/skills.ts +++ b/src/service/skills.ts @@ -18,11 +18,9 @@ export function available(): tID[] { availCache.push(id); } availCache.sort( (a: tID, b: tID) => { - const aname = skillLabel(a); - const bname = skillLabel(b); - if ( aname < bname ) { return -1; } - if ( aname > bname ) { return 1; } - return 0; + const alevel = Skills[a].interest * 1.1 + Skills[a].mastery; + const blevel = Skills[b].interest * 1.1 + Skills[b].mastery; + return blevel - alevel; }); return availCache; }