SessionMenu: implement wrapping select next/previous functions

This commit is contained in:
Damian D'Souza
2025-10-16 20:25:14 +02:00
parent 0da0d46003
commit 7715dbf17a
+12
View File
@@ -131,6 +131,18 @@ NPanel {
}
}
function selectNextWrapped() {
if (powerOptions.length > 0) {
selectedIndex = (selectedIndex + 1) % powerOptions.length
}
}
function selectPreviousWrapped() {
if (powerOptions.length > 0) {
selectedIndex = (((selectedIndex - 1) % powerOptions.length) + powerOptions.length) % powerOptions.length
}
}
function selectFirst() {
selectedIndex = 0
}