Skip to content

Conversation

didiermichel
Copy link
Contributor

Playing with the badge, I though this could be nice as the number of menu items is growing.

Going down when the last item is selected, selection goes to the fist item
nd going up from first item brings us to the last item.

…em is selected, selection goes to the fist item and going up from first item brings us to the last item)
if released && buttons.Pins[shifter.BUTTON_UP].Get() && selected > 0 {
selected--
if released && buttons.Pins[shifter.BUTTON_UP].Get(){
prevSel := selected
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better if we pre-allocate/define the variable outside the loop (at the same time as selected instead to create it each time.
Also, maybe call it prevSelected to keep the parallelism with selected

what do you thing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants