diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index c54bc1924b9..c739804609a 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -1339,11 +1339,27 @@ export default class StarterSelectUiHandler extends MessageUiHandler { case Button.UP: if (row) { success = this.setCursor(this.cursor - 9); + } else { + // when strictly opposite starter based on rows length + // does not exits, set cursor on the second to last row + if (this.cursor + (rows - 1) * 9 > genStarters - 1) { + success = this.setCursor(this.cursor + (rows - 2) * 9); + } else { + success = this.setCursor(this.cursor + (rows - 1) * 9); + } } break; case Button.DOWN: if (row < rows - 2 || (row < rows - 1 && this.cursor % 9 <= (genStarters - 1) % 9)) { success = this.setCursor(this.cursor + 9); + } else { + // if there is no starter below while being on the second to + // last row, adjust cursor position with one line less + if (row === rows - 2 && this.cursor + 9 > genStarters - 1) { + success = this.setCursor(this.cursor - (rows - 2) * 9); + } else { + success = this.setCursor(this.cursor - (rows - 1) * 9); + } } break; case Button.LEFT: