[PATCH] Add Easier Big Notes setting

This commit is contained in:
LoveEevee 2020-02-29 18:56:59 +03:00 committed by purerosefallen
parent 2ab0de9644
commit 3097dd3736
No known key found for this signature in database
GPG Key ID: E6D78C90943A3185
5 changed files with 38 additions and 9 deletions

View File

@ -60,7 +60,11 @@ class Controller{
this.view = new View(this) this.view = new View(this)
this.mekadon = new Mekadon(this, this.game) this.mekadon = new Mekadon(this, this.game)
this.keyboard = new GameInput(this) this.keyboard = new GameInput(this)
this.TaikoForceLv5 = this.keyboard.keyboard.TaikoForceLv5 && !autoPlayEnabled && (this.multiplayer !== 2); if(!autoPlayEnabled && this.multiplayer !== 2){
this.easierBigNotes = settings.getItem("easierBigNotes") || this.keyboard.keyboard.TaikoForceLv5
}else{
this.easierBigNotes = false
}
this.drumSounds = settings.getItem("latency").drumSounds this.drumSounds = settings.getItem("latency").drumSounds
this.playedSounds = {} this.playedSounds = {}

View File

@ -31,6 +31,7 @@ class Game{
this.branchNames = ["normal", "advanced", "master"] this.branchNames = ["normal", "advanced", "master"]
this.resetSection() this.resetSection()
this.gameLagSync = !this.controller.touchEnabled && !(/Firefox/.test(navigator.userAgent)) this.gameLagSync = !this.controller.touchEnabled && !(/Firefox/.test(navigator.userAgent))
this.lastPressedKeys = [false, false, false, false]
assets.songs.forEach(song => { assets.songs.forEach(song => {
if(song.id == selectedSong.folder){ if(song.id == selectedSong.folder){
@ -264,6 +265,11 @@ class Game{
var don_r = keys["don_r"] && !this.controller.isWaiting("don_r", "score") var don_r = keys["don_r"] && !this.controller.isWaiting("don_r", "score")
var ka_l = keys["ka_l"] && !this.controller.isWaiting("ka_l", "score") var ka_l = keys["ka_l"] && !this.controller.isWaiting("ka_l", "score")
var ka_r = keys["ka_r"] && !this.controller.isWaiting("ka_r", "score") var ka_r = keys["ka_r"] && !this.controller.isWaiting("ka_r", "score")
if(don_l || don_r || ka_l || ka_r){
this.lastPressedKeys = [don_l, don_r, ka_l, ka_r]
}else{
[don_l, don_r, ka_l, ka_r] = this.lastPressedKeys
}
var checkDon = () => { var checkDon = () => {
if(don_l && don_r){ if(don_l && don_r){
@ -330,10 +336,11 @@ class Game{
} }
var score = 0 var score = 0
if(keysDon && typeDon || keysKa && typeKa){ if(keysDon && typeDon || keysKa && typeKa){
if (typeDai && !keyDai) { if(typeDai && !keyDai){
if (this.controller.TaikoForceLv5) { // Taiko Force Lv5 can't hit both Dons at the same time, so dai offered if(this.controller.easierBigNotes){
keyDai = true; // Taiko Force Lv5 can't hit both Dons at the same time, so dai offered
} else if(!circle.daiFailed){ keyDai = true
}else if(!circle.daiFailed){
circle.daiFailed = ms circle.daiFailed = ms
return false return false
}else if(ms < circle.daiFailed + this.rules.daiLeniency){ }else if(ms < circle.daiFailed + this.rules.daiLeniency){

View File

@ -19,14 +19,13 @@ class Keyboard{
pageEvents.keyAdd(this, "all", "both", this.keyEvent.bind(this)) pageEvents.keyAdd(this, "all", "both", this.keyEvent.bind(this))
pageEvents.blurAdd(this, this.blurEvent.bind(this)) pageEvents.blurAdd(this, this.blurEvent.bind(this))
} }
isTaikoForceLv5(kbdSettings) { // the key of Taiko Force Lv5's PC module looks like this isTaikoForceLv5(kbdSettings){
//console.log(kbdSettings); // the key of Taiko Force Lv5's PC module looks like this
return (kbdSettings.ka_l[0] === "f") && (kbdSettings.ka_r[0] === "e") && (kbdSettings.don_l[0] === "i") && (kbdSettings.don_r[0] === "j"); return (kbdSettings.ka_l[0] === "f") && (kbdSettings.ka_r[0] === "e") && (kbdSettings.don_l[0] === "i") && (kbdSettings.don_r[0] === "j");
} }
update(){ update(){
var kbdSettings = settings.getItem("keyboardSettings") var kbdSettings = settings.getItem("keyboardSettings")
this.TaikoForceLv5 = this.isTaikoForceLv5(kbdSettings); this.TaikoForceLv5 = this.isTaikoForceLv5(kbdSettings)
//console.log("Taiko Force Lv5", this.TaikoForceLv5);
var drumKeys = {} var drumKeys = {}
for(var name in kbdSettings){ for(var name in kbdSettings){
var keys = kbdSettings[name] var keys = kbdSettings[name]

View File

@ -46,6 +46,10 @@ class Settings{
"video": 0, "video": 0,
"drumSounds": true "drumSounds": true
} }
},
easierBigNotes: {
type: "toggle",
default: false
} }
} }

View File

@ -151,6 +151,9 @@
video: "Video", video: "Video",
drumSounds: "Drum Sounds" drumSounds: "Drum Sounds"
}, },
easierBigNotes: {
name: "大きな音符を簡単にする"
},
on: "オン", on: "オン",
off: "オフ", off: "オフ",
default: "既定値にリセット", default: "既定値にリセット",
@ -343,6 +346,9 @@ function StringsEn(){
video: "Video", video: "Video",
drumSounds: "Drum Sounds" drumSounds: "Drum Sounds"
}, },
easierBigNotes: {
name: "Easier Big Notes"
},
on: "On", on: "On",
off: "Off", off: "Off",
default: "Reset to Defaults", default: "Reset to Defaults",
@ -535,6 +541,9 @@ function StringsCn(){
video: "Video", video: "Video",
drumSounds: "Drum Sounds" drumSounds: "Drum Sounds"
}, },
easierBigNotes: {
name: "使大音符变得容易"
},
on: "开", on: "开",
off: "关", off: "关",
default: "重置为默认值", default: "重置为默认值",
@ -727,6 +736,9 @@ function StringsTw(){
video: "Video", video: "Video",
drumSounds: "Drum Sounds" drumSounds: "Drum Sounds"
}, },
easierBigNotes: {
name: "使大音符變得容易"
},
on: "開", on: "開",
off: "關", off: "關",
default: "重置為默認值", default: "重置為默認值",
@ -919,6 +931,9 @@ function StringsKo(){
video: "Video", video: "Video",
drumSounds: "Drum Sounds" drumSounds: "Drum Sounds"
}, },
easierBigNotes: {
name: "쉬운 큰 음표"
},
on: "온", on: "온",
off: "오프", off: "오프",
default: "기본값으로 재설정", default: "기본값으로 재설정",