diff --git a/source/Conductor.hx b/source/Conductor.hx index 963e403..5857407 100644 --- a/source/Conductor.hx +++ b/source/Conductor.hx @@ -37,6 +37,9 @@ class Conductor { public static var bpmChangeMapSteps:Map = []; public function new(){} + public static function update(e:Float){ + songPosition = FlxG.sound.music.time; + } @:keep inline public static function recalculateTimings() { Conductor.safeFrames = SESave.data.frames; diff --git a/source/FakeNote.hx b/source/FakeNote.hx index 3f3917e..c77d2da 100644 --- a/source/FakeNote.hx +++ b/source/FakeNote.hx @@ -25,7 +25,7 @@ class FakeNote extends Note //Literally just copied flxsprite and flxobject's update override public function update(elapsed:Float):Void { - + updateAnimation(elapsed); } } \ No newline at end of file diff --git a/source/Note.hx b/source/Note.hx index 6945c80..967b0a9 100644 --- a/source/Note.hx +++ b/source/Note.hx @@ -293,7 +293,7 @@ class Note extends FlxSprite type = _type; x = y = 300; this.inCharter = _inCharter; - this.rawNote = (if(_rawNote == null) [strumTime,_noteData,0] else _rawNote); + this.rawNote = (_rawNote ?? [strumTime,_noteData,0]); diff --git a/source/Options.hx b/source/Options.hx index e07e6d3..41baea5 100644 --- a/source/Options.hx +++ b/source/Options.hx @@ -45,6 +45,8 @@ class OptionCategory this.options = options; this.modded = mod; } + public function update(e:Float){} + public function draw(){} } class Option @@ -69,6 +71,8 @@ class Option public function updateDisplay():String { return display; } public function left():Bool { return false; } public function right():Bool { return false; } + public function update(e:Float){} + public function draw(){} } @@ -537,7 +541,61 @@ class SelScriptOption extends Option } } +class ScrollSpeedOption extends HCFloatOption{ + public var note:Note; + public var strum:StrumArrow; + override public function new(){ + try{ + + note = new Note(0,SESave.data.downscroll ? 1 : 2); + strum = new StrumArrow(SESave.data.downscroll ? 1 : 2); + note.parentSprite = strum; + note.inCharter = note.visible = note.showNote = true; + strum.init(); + strum.playStatic(); + strum.x = 1000; + note.x = strum.x + (strum.width * 0.5); + }catch(e){ + trace('Failed to load note for Scroll Speed ${e}'); + } + super('Scroll Speed',"Change your scroll speed (1 = Chart dependent)","scrollSpeed",0.1,10,0.1); + } + override public function update(e:Float){ + // if(note == null || strum == null) return; + Conductor.update(e); + + strum.update(e); + note.update(e); + // trace(dist); + + } + override public function draw(){ + // if(note == null || strum == null) return; + var dist = (Conductor.songPosition - note.strumTime); + var _scrollSpeed = SESave.data.scrollSpeed; + Conductor.update(e); + if(Math.abs(dist) < 50){ + strum.confirm(); + } + + note.distanceToSprite = (0.45 * dist * _scrollSpeed); + if(SESave.data.downscroll){ + strum.y = 680; + note.y = strum.y + note.distanceToSprite; + }else{ + strum.y = 120; + note.y = strum.y - note.distanceToSprite; + } + if(dist > 500){ + strum.playStatic(); + note.strumTime = Conductor.songPosition + 500; + } + strum.draw(); + note.draw(); + } + +} class IntOption extends Option{ var min:Int = 0; var max:Int; diff --git a/source/OptionsMenu.hx b/source/OptionsMenu.hx index 61bd970..4b71a67 100644 --- a/source/OptionsMenu.hx +++ b/source/OptionsMenu.hx @@ -61,10 +61,7 @@ class OptionsMenu extends MusicBeatState var options:Array = [ new OptionCategory("Session/Temp Options", [ - for (name => setting in QuickOptionsSubState.normalSettings) - { - new QuickOption(name); - } + for (name => setting in QuickOptionsSubState.normalSettings){new QuickOption(name);} ],"Chart options.\nTHESE ARE TEMPORARY AND RESET WHEN GAME IS CLOSED!"), new OptionCategory("Modifications", [ new OpponentOption("Change the opponent character"), @@ -122,7 +119,7 @@ class OptionsMenu extends MusicBeatState new HCBoolOption("Debounce detection","Enables some simple debounce detection. Forces presses to be missed from one frame to another.","debounce"), new Judgement("Customize your Hit Timings (LEFT or RIGHT)"), - new HCFloatOption('Scroll Speed',"Change your scroll speed (1 = Chart dependent)","scrollSpeed",0.1,10,0.1), + new ScrollSpeedOption(), // new HCFloatOption('Scroll Speed(OSU Chart)',"Change your scroll speed OSU charts","scrollOSUSpeed",0.1,10,0.1), new HCBoolOption("Accurate Note Sustain","Whether note sustains/holds are more accurate. If off then they act like early kade","accurateNoteSustain"), @@ -231,7 +228,14 @@ class OptionsMenu extends MusicBeatState } ],Lang.get('se.options.lang.desc')), ]; - + override public function draw(){ + super.draw(); + if(isCat){ + currentSelectedCat.options[curSelected].draw(); + }else if (options[curSelected] !=null){ + options[curSelected].draw(); + } + } public var acceptInput:Bool = true; private var currentDescription:String = ""; @@ -242,6 +246,7 @@ class OptionsMenu extends MusicBeatState var currentSelectedCat:OptionCategory; var blackBorder:FlxSprite; var titleText:FlxText; + static public var bgMusic:FlxSound; static public var lastMusic:FlxSound; function addTitleText(str:String = "se.options.title"){ @@ -441,7 +446,11 @@ class OptionsMenu extends MusicBeatState // updateOffsetText(); } } - + if(isCat){ + currentSelectedCat.options[curSelected].update(elapsed); + }else if (options[curSelected] != null){ + options[curSelected].update(elapsed); + } } function updateAlphabet(obj:Alphabet,str:String = ""){ diff --git a/source/PlayState.hx b/source/PlayState.hx index edbc0c4..8bdf3e2 100644 --- a/source/PlayState.hx +++ b/source/PlayState.hx @@ -3007,10 +3007,9 @@ class PlayState extends ScriptMusicBeatState i++; if(daNote == null || !holdArray[daNote.noteData] || !daNote.mustPress || !daNote.isSustainNote || !daNote.updateCanHit()) continue; if(!acns || daNote.strumTime <= Conductor.songPosition - (50 * Conductor.timeScale) || daNote.isSustainNoteEnd) {// Only destroy the note when properly hit - goodNoteHit(daNote); - - continue; - } + goodNoteHit(daNote); + continue; + } // Tell note to be clipped to strumline daNote.isPressed = true; hitArray[daNote.noteData] = true; @@ -3018,10 +3017,8 @@ class PlayState extends ScriptMusicBeatState callInterp("susHit",[daNote]); } } - { - var i = possibleNotes.length; - while(i > 0){possibleNotes.pop();i--;} - } + while(possibleNotes.pop() != null){} + // var possibleNotes:Array = [null,null,null,null]; // notes that can be hit var onScreenNote:Bool = false; var members = notes.members; diff --git a/source/StrumArrow.hx b/source/StrumArrow.hx index f2f016e..fcb6997 100644 --- a/source/StrumArrow.hx +++ b/source/StrumArrow.hx @@ -1,3 +1,4 @@ + package; import flixel.FlxG; diff --git a/source/se/SESave.hx b/source/se/SESave.hx index c3190b2..d53e85b 100644 --- a/source/se/SESave.hx +++ b/source/se/SESave.hx @@ -81,7 +81,7 @@ typedef YourMother = Dynamic; var undlaSize:Int = 0; var undlaTrans:Float = 0.1; var instVol:Float = 0.8; - var masterVol:Float = 1; + var masterVol:Float = 0.6; var voicesVol:Float = 1; var missVol:Float = 0.1; var hitVol:Float = 0.6;