UI: Consistently calculate BitNode "level" (#2645)

This commit is contained in:
catloversg
2026-04-11 05:45:18 +07:00
committed by GitHub
parent 54287e5f7f
commit 5cb0d559df
5 changed files with 21 additions and 9 deletions
+9
View File
@@ -93,3 +93,12 @@ export function finishBitNode() {
}
wd.backdoorInstalled = true;
}
/**
* BitNode level is not something that is stored, but rather calculated from the current BN and SF level. The concept
* appeared because saying "Enter BN1.2" is shorter than saying "Enter BN1 with SF1.1". This is how we display it in the
* BitVerse UI and other places. This function is used to consistently calculate this "level".
*/
export function getBitNodeLevel(bn = Player.bitNodeN, sfLevel = Player.activeSourceFileLvl(bn)): number {
return Math.min(sfLevel + 1, bn === 12 ? Number.MAX_VALUE : 3);
}