Merge origin/main into dev; resolve Game.lua gamepad speed-hotkey conflict

This commit is contained in:
bryanthaboi
2026-08-03 17:17:26 -04:00
3 changed files with 124 additions and 7 deletions
+9 -6
View File
@@ -574,7 +574,7 @@ function Game:keypressed(key)
return
elseif key == "1" then
-- cycle GAME SPEED (0.25X → 200X, logic only; audio unaffected);
-- R2/L2 on gamepad do the same (see gamepadpressed)
-- shoulders/triggers on gamepad do the same (see gamepadpressed)
self:_cycleSpeed(1)
return
elseif key == "2" then
@@ -666,14 +666,17 @@ function Game:gamepadpressed(joystick, button)
end)
selectHeld = ok and down == true
end
-- shoulder buttons cycle GAME SPEED (R2/rightshoulder = faster,
-- L2/leftshoulder = slower; same as keyboard hotkey 1). Skip while
-- Select is held so Select+L can reach displayChordDigit ("7").
-- shoulder buttons and analog triggers cycle GAME SPEED (R1/RB or
-- R2/RT = faster, L1/LB or L2/LT = slower; same as keyboard hotkey
-- 1). LÖVE reports an analog trigger as gamepadpressed once it
-- crosses the press threshold, so a trigger pull lands here like any
-- other pad button. Skip while Select is held so Select+L can reach
-- displayChordDigit ("7").
if not selectHeld then
if button == "rightshoulder" then
if button == "rightshoulder" or button == "righttrigger" then
self:_cycleSpeed(1)
return
elseif button == "leftshoulder" then
elseif button == "leftshoulder" or button == "lefttrigger" then
self:_cycleSpeed(-1)
return
end