mirror of
https://gitlab.com/Oreolek/salet-gamepad-module.git
synced 2024-04-25 21:59:37 +03:00
enter/exit options room
This commit is contained in:
parent
373f74b2db
commit
fd817756f3
|
@ -31,6 +31,15 @@ selectOption = (event, button) ->
|
||||||
return
|
return
|
||||||
$(".options li.active").click()
|
$(".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 check, fires events
|
||||||
joystick = () ->
|
joystick = () ->
|
||||||
if typeof navigator.getGamepads == "function"
|
if typeof navigator.getGamepads == "function"
|
||||||
|
@ -59,3 +68,4 @@ window.selectedoption ?= 1
|
||||||
$(document).on("press", selectUp)
|
$(document).on("press", selectUp)
|
||||||
$(document).on("press", selectDown)
|
$(document).on("press", selectDown)
|
||||||
$(document).on("press", selectOption)
|
$(document).on("press", selectOption)
|
||||||
|
$(document).on("press", enterOptions)
|
||||||
|
|
Loading…
Reference in a new issue