Changed pause menu logic to not allow pausing if any other button is down.
This commit is contained in:
@@ -157,6 +157,15 @@ menu_actions.MenuDown= menu_actions.Down
|
|||||||
|
|
||||||
local down_status= {}
|
local down_status= {}
|
||||||
|
|
||||||
|
local function other_button_down(button)
|
||||||
|
for other_button, down in pairs(down_status) do
|
||||||
|
if down and other_button ~= button then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
local function detect_lr_press()
|
local function detect_lr_press()
|
||||||
return down_status.MenuLeft and down_status.MenuRight
|
return down_status.MenuLeft and down_status.MenuRight
|
||||||
end
|
end
|
||||||
@@ -207,7 +216,7 @@ local function input(event)
|
|||||||
pause_and_show(pn)
|
pause_and_show(pn)
|
||||||
elseif pause_buttons[button] then
|
elseif pause_buttons[button] then
|
||||||
if GAMESTATE:GetCoinMode() == "CoinMode_Pay" then return end
|
if GAMESTATE:GetCoinMode() == "CoinMode_Pay" then return end
|
||||||
if pause_press_times[pn] then
|
if pause_press_times[pn] and not other_button_down(button) then
|
||||||
local time_since_press= GetTimeSinceStart() - pause_press_times[pn]
|
local time_since_press= GetTimeSinceStart() - pause_press_times[pn]
|
||||||
if time_since_press > tap_debounce_time then
|
if time_since_press > tap_debounce_time then
|
||||||
if time_since_press <= pause_double_tap_time then
|
if time_since_press <= pause_double_tap_time then
|
||||||
|
|||||||
Reference in New Issue
Block a user