commit
5d19fb6701
@ -81,7 +81,7 @@
|
||||
}
|
||||
}
|
||||
if(!this.multiplayer){
|
||||
pageEvents.add(this.canvas, ["mousedown", "touchstart"], this.onmousedown.bind(this))
|
||||
pageEvents.add(this.canvas, "mousedown", this.onmousedown.bind(this))
|
||||
}
|
||||
}
|
||||
run(){
|
||||
@ -1356,6 +1356,13 @@
|
||||
ontouch(event){
|
||||
for(let touch of event.changedTouches){
|
||||
event.preventDefault()
|
||||
if(this.controller.game.paused){
|
||||
var mouse = this.mouseOffset(event.touches[0].pageX, event.touches[0].pageY)
|
||||
var moveTo = this.pauseMouse(mouse.x, mouse.y)
|
||||
if(moveTo !== null){
|
||||
this.pauseConfirm(moveTo)
|
||||
}
|
||||
}else{
|
||||
var pageX = touch.pageX * this.pixelRatio
|
||||
var pageY = touch.pageY * this.pixelRatio
|
||||
|
||||
@ -1381,6 +1388,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
touchNote(note){
|
||||
var keyboard = this.controller.keyboard
|
||||
var kbd = keyboard.getBindings()
|
||||
@ -1418,15 +1426,10 @@
|
||||
}
|
||||
onmousedown(event){
|
||||
if(this.controller.game.paused){
|
||||
if(event.type === "mousedown"){
|
||||
if(event.which !== 1){
|
||||
return
|
||||
}
|
||||
var mouse = this.mouseOffset(event.offsetX, event.offsetY)
|
||||
}else{
|
||||
event.preventDefault()
|
||||
var mouse = this.mouseOffset(event.touches[0].pageX, event.touches[0].pageY)
|
||||
}
|
||||
var moveTo = this.pauseMouse(mouse.x, mouse.y)
|
||||
if(moveTo !== null){
|
||||
this.pauseConfirm(moveTo)
|
||||
@ -1518,7 +1521,7 @@
|
||||
}
|
||||
}
|
||||
if(!this.multiplayer){
|
||||
pageEvents.remove(this.canvas, ["mousedown", "touchstart"])
|
||||
pageEvents.remove(this.canvas, "mousedown")
|
||||
}
|
||||
pageEvents.mouseRemove(this)
|
||||
delete this.pauseMenu
|
||||
|
Loading…
Reference in New Issue
Block a user