mirror of
https://gitlab.com/Oreolek/salet-gamepad-module.git
synced 2024-04-27 06:39:45 +03:00
enter/exit options room
This commit is contained in:
parent
373f74b2db
commit
fd817756f3
|
@ -31,6 +31,15 @@ selectOption = (event, button) ->
|
|||
return
|
||||
$(".options li.active").click()
|
||||
|
||||
# enter the options room
|
||||
enterOptions = (event, button) ->
|
||||
if button != "back" and button != "start"
|
||||
return
|
||||
if button == "start"
|
||||
return salet.goTo(salet.optionsRoom)
|
||||
if button == "back" and salet.currentRoom == salet.optionsRoom
|
||||
return salet.goBack()
|
||||
|
||||
# Joystick check, fires events
|
||||
joystick = () ->
|
||||
if typeof navigator.getGamepads == "function"
|
||||
|
@ -59,3 +68,4 @@ window.selectedoption ?= 1
|
|||
$(document).on("press", selectUp)
|
||||
$(document).on("press", selectDown)
|
||||
$(document).on("press", selectOption)
|
||||
$(document).on("press", enterOptions)
|
||||
|
|
Loading…
Reference in a new issue