Fix tutorial not saving

This commit is contained in:
LoveEevee 2019-04-16 23:29:26 +03:00
parent f5d4c6bce5
commit 454028a7e6
2 changed files with 12 additions and 11 deletions

View File

@ -431,19 +431,15 @@ class SettingsView{
this.gamepadButtons.style.backgroundPosition = "0 " + (-318 - 132 * this.gamepadSelected) + "px"
this.gamepadSettings.style.display = "block"
}
gamepadBack(save){
gamepadBack(confirm){
if(this.mode !== "gamepad"){
return
}
if(save){
var selected = this.items[this.selected]
var current = settings.items[selected.id]
settings.setItem(selected.id, current.options[this.gamepadSelected])
this.getValue(selected.id, selected.valueDiv)
assets.sounds["se_don"].play()
}else{
assets.sounds["se_cancel"].play()
}
assets.sounds[confirm ? "se_don" : "se_cancel"].play()
this.gamepadSettings.style.display = ""
this.mode = "settings"
}
@ -466,6 +462,9 @@ class SettingsView{
if(this.tutorial && !this.touched){
new Tutorial(false, this.songId)
}else{
try{
localStorage.setItem("tutorial", "true")
}catch(e){}
new SongSelect(this.tutorial ? false : "settings", false, this.touched, this.songId)
}
}, 500)

View File

@ -44,7 +44,9 @@ class Tutorial{
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)