Display all settings on first load

This commit is contained in:
Bui 2019-05-03 03:59:31 +01:00 committed by GitHub
parent 5d7d38dced
commit 5a36e63f36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,14 +167,13 @@ class SettingsView{
var content = this.getElement("view-content")
this.items = []
this.selected = tutorial ? 1 : 0
this.selected = 0
for(let i in settings.items){
var current = settings.items[i]
if(
!touchEnabled && current.touch === true ||
touchEnabled && current.touch === false ||
!gamepadEnabled && current.gamepad === true ||
tutorial && current.type !== "language"
!gamepadEnabled && current.gamepad === true
){
continue
}
@ -202,10 +201,6 @@ class SettingsView{
valueDiv: valueDiv
})
}
if(tutorial){
this.defaultButton.style.display = "none"
this.endButton.classList.add("selected")
}else{
this.items.push({
id: "default",
settingBox: this.defaultButton
@ -494,11 +489,9 @@ class SettingsView{
this.gamepadTitle.setAttribute("alt", strings.settings.gamepadLayout.name)
this.gamepadEndButton.innerText = strings.settings.ok
this.gamepadEndButton.setAttribute("alt", strings.settings.ok)
if(!this.tutorial){
this.defaultButton.innerText = strings.settings.default
this.defaultButton.setAttribute("alt", strings.settings.default)
}
}
mod(length, index){
return ((index % length) + length) % length
}