Skip to content

Commit

Permalink
Completed scene input response migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetro48 committed Dec 6, 2023
1 parent 8e9afba commit d74033f
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions scene/highscores.lua
Original file line number Diff line number Diff line change
Expand Up @@ -203,13 +203,13 @@ function HighscoreScene:back()
end

function HighscoreScene:onInputRelease(e)
if e.input == "menu_up" or e.scancode == "up" then
if e.input == "menu_up" then
self.das_up = nil
elseif e.input == "menu_down" or e.scancode == "down" then
elseif e.input == "menu_down" then
self.das_down = nil
elseif e.input == "menu_right" or e.scancode == "right" then
elseif e.input == "menu_right" then
self.das_right = nil
elseif e.input == "menu_left" or e.scancode == "left" then
elseif e.input == "menu_left" then
self.das_left = nil
end
end
Expand Down
4 changes: 2 additions & 2 deletions scene/input_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ function ConfigScene:onInputPress(e)
if e.input == "menu_decide" or e.scancode == "return" then
playSE("main_decide")
scene = menu_screens[self.menu_state]()
elseif e.input == "menu_up" or e.scancode == "up" then
elseif e.input == "menu_up" then
self:changeOption(-1)
playSE("cursor")
elseif e.input == "menu_down" or e.scancode == "down" then
elseif e.input == "menu_down" then
self:changeOption(1)
playSE("cursor")
elseif config.input and (
Expand Down
2 changes: 1 addition & 1 deletion scene/mode_select.lua
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ end
function ModeSelectScene:onInputRelease(e)
if e.input == "menu_up" then
self.das_up = nil
elseif e.input == "menu_down" or e.scancode == "down" then
elseif e.input == "menu_down" then
self.das_down = nil
elseif e.input then
self.secret_inputs[e.input] = false
Expand Down
4 changes: 2 additions & 2 deletions scene/replay.lua
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,13 @@ function ReplayScene:onInputPress(e)
pitchBGM(1)
elseif e.input == "hold" then
self.show_invisible = not self.show_invisible
elseif e.input == "left" then
elseif e.input == "menu_left" then
self.replay_speed = self.replay_speed - 1
if self.replay_speed < 1 then
self.replay_speed = 1
end
pitchBGM(self.replay_speed)
elseif e.input == "right" then
elseif e.input == "menu_right" then
self.replay_speed = self.replay_speed + 1
if self.replay_speed > 99 then
self.replay_speed = 99
Expand Down
8 changes: 4 additions & 4 deletions scene/replay_select.lua
Original file line number Diff line number Diff line change
Expand Up @@ -555,13 +555,13 @@ function ReplaySelectScene:onInputPress(e)
end

function ReplaySelectScene:onInputRelease(e)
if e.input == "up" or e.scancode == "up" then
if e.input == "menu_up" then
self.das_up = nil
elseif e.input == "down" or e.scancode == "down" then
elseif e.input == "menu_down" then
self.das_down = nil
elseif e.input == "right" or e.scancode == "right" then
elseif e.input == "menu_right" then
self.das_right = nil
elseif e.input == "left" or e.scancode == "left" then
elseif e.input == "menu_left" then
self.das_left = nil
end
end
Expand Down
10 changes: 5 additions & 5 deletions scene/resource_pack_scene.lua
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,12 @@ function ResourcePackScene:onInputPress(e)
dividend = 1
end
local prev_right_selection_index = self.right_selection_index
if e.input == "up" or e.input == "down" then
if e.input == "menu_up" or e.input == "menu_down" then
if self.selection_type == 0 then
self.selection_type = 1
return
end
local inc_or_dec = (e.input == "down" and 1 or -1)
local inc_or_dec = (e.input == "menu_down" and 1 or -1)
if self.selection_type == 1 then
if self.left_selection_index + inc_or_dec > dividend then
self.selection_type = 3
Expand All @@ -334,11 +334,11 @@ function ResourcePackScene:onInputPress(e)
return
end
self.right_selection_index = math.max(self.right_selection_index + inc_or_dec, 1)
elseif self.selection_type > 2 and e.input == "up" then
elseif self.selection_type > 2 and e.input == "menu_up" then
self.selection_type = self.selection_type - 2
end
end
if e.input == "left" then
if e.input == "menu_left" then
if self.selection_type == 0 then
self.selection_type = 1
return
Expand All @@ -347,7 +347,7 @@ function ResourcePackScene:onInputPress(e)
self.selection_type = self.selection_type - 1
end
end
if e.input == "right" then
if e.input == "menu_right" then
if self.selection_type == 0 then
self.selection_type = 1
return
Expand Down
16 changes: 8 additions & 8 deletions scene/revamped_mode_select.lua
Original file line number Diff line number Diff line change
Expand Up @@ -451,16 +451,16 @@ function ModeSelectScene:onInputPress(e)
end
elseif e.input == "menu_decide" then
self:indirectStartMode()
elseif e.input == "up" or e.scancode == "up" then
elseif e.input == "menu_up" then
self.das_up = true
self.das_down = nil
elseif e.input == "down" or e.scancode == "down" then
elseif e.input == "menu_down" then
self.das_down = true
self.das_up = nil
elseif e.input == "left" or e.scancode == "left" then
elseif e.input == "menu_left" then
self.das_left = true
self.das_right = nil
elseif e.input == "right" or e.scancode == "right" then
elseif e.input == "menu_right" then
self.das_right = true
self.das_left = nil
elseif e.input then
Expand All @@ -469,13 +469,13 @@ function ModeSelectScene:onInputPress(e)
end

function ModeSelectScene:onInputRelease(e)
if e.input == "up" or e.scancode == "up" then
if e.input == "menu_up" then
self.das_up = nil
elseif e.input == "down" or e.scancode == "down" then
elseif e.input == "menu_down" then
self.das_down = nil
elseif e.input == "left" or e.scancode == "left" then
elseif e.input == "menu_left" then
self.das_left = nil
elseif e.input == "right" or e.scancode == "right" then
elseif e.input == "menu_right" then
self.das_right = nil
elseif e.input then
self.secret_inputs[e.input] = false
Expand Down

0 comments on commit d74033f

Please sign in to comment.