Skip to content

Commit

Permalink
fix indexing in input handlers too
Browse files Browse the repository at this point in the history
  • Loading branch information
cadin committed Sep 30, 2023
1 parent 4f157f3 commit 68ca0b1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions modules/Menus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,7 @@ local function createChapterMenu(data)
downButtonUp = function()
chapterOffset = 4
local selectedRow = chapterList:getSelectedRow()
local item = sections[selectedRow]
if not isLastUnlockedSequence(item.index) then
if not isLastUnlockedSequence(selectedRow) then
local next = getNextUnlockedSequence(selectedRow)
chapterList:setSelectedRow(next)
if Panels.Settings.playMenuSounds then
Expand All @@ -360,11 +359,8 @@ local function createChapterMenu(data)

upButtonUp = function()
chapterOffset = -4

local selectedRow = chapterList:getSelectedRow()
local item = sections[selectedRow]

if not isFirstUnlockedSequence(item.index) then
if not isFirstUnlockedSequence(selectedRow) then
local prev = getPreviousUnlockedSequence(selectedRow)
chapterList:setSelectedRow(prev)
if Panels.Settings.playMenuSounds then
Expand Down

0 comments on commit 68ca0b1

Please sign in to comment.