mirror of
https://github.com/jiojciojsioe3/a3cjroijsiojiorj.git
synced 2024-11-15 15:31:51 +08:00
Fix tutorial
This commit is contained in:
parent
0655b79293
commit
911841af95
@ -20,7 +20,6 @@ class Tutorial{
|
|||||||
this.setStrings()
|
this.setStrings()
|
||||||
|
|
||||||
pageEvents.add(this.endButton, ["mousedown", "touchstart"], this.onEnd.bind(this))
|
pageEvents.add(this.endButton, ["mousedown", "touchstart"], this.onEnd.bind(this))
|
||||||
pageEvents.add(this.formButton, ["mousedown", "touchstart"], this.linkButton.bind(this))
|
|
||||||
this.keyboard = new Keyboard({
|
this.keyboard = new Keyboard({
|
||||||
confirm: ["enter", "space", "don_l", "don_r"],
|
confirm: ["enter", "space", "don_l", "don_r"],
|
||||||
previous: ["left", "up", "ka_l"],
|
previous: ["left", "up", "ka_l"],
|
||||||
@ -52,10 +51,12 @@ class Tutorial{
|
|||||||
assets.sounds["se_don"].play()
|
assets.sounds["se_don"].play()
|
||||||
}
|
}
|
||||||
}else if(name === "previous" || name === "next"){
|
}else if(name === "previous" || name === "next"){
|
||||||
selected.classList.remove("selected")
|
if(this.items.length >= 2){
|
||||||
this.selected = this.mod(this.items.length, this.selected + (name === "next" ? 1 : -1))
|
selected.classList.remove("selected")
|
||||||
this.items[this.selected].classList.add("selected")
|
this.selected = this.mod(this.items.length, this.selected + (name === "next" ? 1 : -1))
|
||||||
assets.sounds["se_ka"].play()
|
this.items[this.selected].classList.add("selected")
|
||||||
|
assets.sounds["se_ka"].play()
|
||||||
|
}
|
||||||
}else if(name === "back"){
|
}else if(name === "back"){
|
||||||
this.onEnd()
|
this.onEnd()
|
||||||
}
|
}
|
||||||
@ -119,18 +120,6 @@ class Tutorial{
|
|||||||
parent.appendChild(kbd)
|
parent.appendChild(kbd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onEnd(pressed, name){
|
|
||||||
if(pressed){
|
|
||||||
this.clean()
|
|
||||||
assets.sounds["se_don"].play()
|
|
||||||
try{
|
|
||||||
localStorage.setItem("tutorial", "true")
|
|
||||||
}catch(e){}
|
|
||||||
setTimeout(() => {
|
|
||||||
new SongSelect(this.fromSongSel ? "tutorial" : false, false, this.touched, this.songId)
|
|
||||||
}, 500)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
setStrings(){
|
setStrings(){
|
||||||
this.tutorialTitle.innerText = strings.howToPlay
|
this.tutorialTitle.innerText = strings.howToPlay
|
||||||
this.tutorialTitle.setAttribute("alt", strings.howToPlay)
|
this.tutorialTitle.setAttribute("alt", strings.howToPlay)
|
||||||
|
Loading…
Reference in New Issue
Block a user