From 75e9b9b7ad00c6ac4d1b8ae51029324a9253b39f Mon Sep 17 00:00:00 2001 From: CharlesCatYT Date: Sat, 24 Feb 2024 00:49:14 -0500 Subject: [PATCH] just gonna push this while im exporting smth --- Project.xml | 5 +- source/states/TitleState.hx | 156 +++++------------- source/states/editors/CharacterEditorState.hx | 6 +- source/states/editors/ChartingState.hx | 84 +++------- source/states/editors/EditorPlayState.hx | 4 +- source/states/editors/NoteSplashDebugState.hx | 12 +- 6 files changed, 78 insertions(+), 189 deletions(-) diff --git a/Project.xml b/Project.xml index 89dda42..846684f 100644 --- a/Project.xml +++ b/Project.xml @@ -9,7 +9,7 @@ - + @@ -159,15 +159,12 @@
- -
-
diff --git a/source/states/TitleState.hx b/source/states/TitleState.hx index 32caf92..fea5eb5 100644 --- a/source/states/TitleState.hx +++ b/source/states/TitleState.hx @@ -329,69 +329,38 @@ class TitleState extends MusicBeatState { override function update(elapsed:Float) { - //PlayState.instance.callOnLuas("updateTitle", [elapsed]); - - if (FlxG.sound.music != null) - Conductor.songPosition = FlxG.sound.music.time; + if (FlxG.sound.music != null) Conductor.songPosition = FlxG.sound.music.time; var pressedEnter:Bool = FlxG.keys.justPressed.ENTER || controls.ACCEPT; - if (FlxG.keys.justPressed.ESCAPE && !pressedEnter){ + if (FlxG.keys.justPressed.ESCAPE && !pressedEnter) { FlxG.sound.music.fadeOut(0.3); #if (cpp && windows) CppAPI._setWindowLayered(); - var numTween:NumTween = FlxTween.num(1, 0, 1, { - onComplete: function(twn:FlxTween) - { - Sys.exit(0); - } - }); - - numTween.onUpdate = function(twn:FlxTween) - { + var numTween:NumTween = FlxTween.num(1, 0, 1, {onComplete: function(twn:FlxTween) {Sys.exit(0);}}); + numTween.onUpdate = function(twn:FlxTween) { CppAPI.setWindowOpacity(numTween.value); } - #else - FlxG.camera.fade(FlxColor.BLACK, 0.5, false, () -> - { - Sys.exit(0); - }, false); - #end - } - - #if mobile - for (touch in FlxG.touches.list) - { - if (touch.justPressed) - { - pressedEnter = true; - } + #else FlxG.camera.fade(FlxColor.BLACK, 0.5, false, () -> {Sys.exit(0);}, false); #end } - #end - var gamepad:FlxGamepad = FlxG.gamepads.lastActive; + #if mobile for (touch in FlxG.touches.list) if (touch.justPressed) pressedEnter = true; #end - if (gamepad != null) - { - if (gamepad.justPressed.START) - pressedEnter = true; - } + var gamepad:FlxGamepad = FlxG.gamepads.lastActive; + if (gamepad != null) if (gamepad.justPressed.START) pressedEnter = true; if (newTitle) { titleTimer += FlxMath.bound(elapsed, 0, 1); if (titleTimer > 2) titleTimer -= 2; } - // EASTER EGG + // EASTER EGGS - if (initialized && !transitioning && skippedIntro) - { - if (newTitle && !pressedEnter) - { + if (initialized && !transitioning && skippedIntro) { + if (newTitle && !pressedEnter) { var timer:Float = titleTimer; - if (timer >= 1) - timer = (-timer) + 2; + if (timer >= 1) timer = (-timer) + 2; timer = FlxEase.quadInOut(timer); @@ -399,8 +368,7 @@ class TitleState extends MusicBeatState { titleText.alpha = FlxMath.lerp(titleTextAlphas[0], titleTextAlphas[1], timer); } - if(pressedEnter) - { + if(pressedEnter) { titleText.color = FlxColor.WHITE; titleText.alpha = 1; @@ -410,11 +378,8 @@ class TitleState extends MusicBeatState { FlxG.sound.play(Paths.sound('confirmMenu'), 0.7); transitioning = true; - new FlxTimer().start(1, function(tmr:FlxTimer) - { - if (mustUpdate) { - FlxG.switchState(() -> new OutdatedState()); - } else { + new FlxTimer().start(1, function(tmr:FlxTimer) { + if (mustUpdate) {FlxG.switchState(() -> new OutdatedState());} else { if (titleJSON.showThanks) FlxG.switchState(() -> new ThanksState()); else FlxG.switchState(() -> new MainMenuState()); } @@ -429,18 +394,12 @@ class TitleState extends MusicBeatState { if(allowedKeys.contains(keyName)) { easterEggKeysBuffer += keyName; if(easterEggKeysBuffer.length >= 32) easterEggKeysBuffer = easterEggKeysBuffer.substring(1); - //trace('Test! Allowed Key pressed!!! Buffer: ' + easterEggKeysBuffer); - for (wordRaw in easterEggKeys) - { + for (wordRaw in easterEggKeys) { var word:String = wordRaw.toUpperCase(); //just for being sure you're doing it right - if (easterEggKeysBuffer.contains(word)) - { - //trace('YOOO! ' + word); - if (FlxG.save.data.psychDevsEasterEgg == word) - FlxG.save.data.psychDevsEasterEgg = ''; - else - FlxG.save.data.psychDevsEasterEgg = word; + if (easterEggKeysBuffer.contains(word)) { + if (FlxG.save.data.psychDevsEasterEgg == word) FlxG.save.data.psychDevsEasterEgg = ''; + else FlxG.save.data.psychDevsEasterEgg = word; FlxG.save.flush(); FlxG.sound.play(Paths.sound('ToggleJingle')); @@ -458,9 +417,7 @@ class TitleState extends MusicBeatState { }); FlxG.sound.music.fadeOut(); if(FreeplayState.vocals != null) - { FreeplayState.vocals.fadeOut(); - } closedState = true; transitioning = true; playJingle = true; @@ -473,10 +430,7 @@ class TitleState extends MusicBeatState { #end } - if (initialized && pressedEnter && !skippedIntro) - { - skipIntro(); - } + if (initialized && pressedEnter && !skippedIntro) skipIntro(); if(swagShader != null) { @@ -489,8 +443,7 @@ class TitleState extends MusicBeatState { function createCoolText(textArray:Array, ?offset:Float = 0) { - for (i in 0...textArray.length) - { + for (i in 0...textArray.length) { var money:Alphabet = new Alphabet(0, 0, textArray[i], true); money.screenCenter(X); money.y += (i * 60) + 200 + offset; @@ -560,8 +513,7 @@ class TitleState extends MusicBeatState { #else addMoreText('present'); #end - case 5: - deleteCoolText(); + case 5: deleteCoolText(); case 6: #if ALLEYWAY_WATERMARKS if (titleJSON.noAssociate) createCoolText(['Not associated', 'with'], -40); @@ -575,31 +527,22 @@ class TitleState extends MusicBeatState { case 9: deleteCoolText(); ngSpr.visible = false; - case 10: - createCoolText([curWacky[0]]); - case 12: - addMoreText(curWacky[1]); - case 13: - deleteCoolText(); - case 14: - addMoreText(titleJSON.friday); - case 15: - addMoreText(titleJSON.night); - case 16: - addMoreText(titleJSON.funkin); - - case 17: - skipIntro(); + case 10: createCoolText([curWacky[0]]); + case 12: addMoreText(curWacky[1]); + case 13: deleteCoolText(); + case 14: addMoreText(titleJSON.friday); + case 15: addMoreText(titleJSON.night); + case 16: addMoreText(titleJSON.funkin); + + case 17: skipIntro(); } } } var skippedIntro:Bool = false; var increaseVolume:Bool = false; - function skipIntro():Void - { - if (!skippedIntro) - { + function skipIntro():Void { + if (!skippedIntro) { if (playJingle) //Ignore deez { var easteregg:String = FlxG.save.data.psychDevsEasterEgg; @@ -607,14 +550,10 @@ class TitleState extends MusicBeatState { easteregg = easteregg.toUpperCase(); var sound:FlxSound = null; - switch(easteregg) - { - case 'RIVER': - sound = FlxG.sound.play(Paths.sound('JingleRiver')); - case 'SHADOW': - FlxG.sound.play(Paths.sound('JingleShadow')); - case 'BBPANZU': - sound = FlxG.sound.play(Paths.sound('JingleBB')); + switch(easteregg) { + case 'RIVER':sound = FlxG.sound.play(Paths.sound('JingleRiver')); + case 'SHADOW': FlxG.sound.play(Paths.sound('JingleShadow')); + case 'BBPANZU': sound = FlxG.sound.play(Paths.sound('JingleBB')); default: //Go back to normal ugly ass boring GF remove(ngSpr); @@ -629,22 +568,18 @@ class TitleState extends MusicBeatState { } transitioning = true; - if(easteregg == 'SHADOW') - { - new FlxTimer().start(3.2, function(tmr:FlxTimer) - { + if(easteregg == 'SHADOW') { + new FlxTimer().start(3.2, function(tmr:FlxTimer) { remove(ngSpr); remove(credGroup); FlxG.camera.flash(FlxColor.WHITE, 0.6); transitioning = false; }); - } - else - { + } else { remove(ngSpr); remove(credGroup); FlxG.camera.flash(FlxColor.WHITE, 3); - sound.onComplete = function() { + sound.onComplete = () -> { FlxG.sound.playMusic(Paths.music('freakyMenu'), 0); FlxG.sound.music.fadeIn(4, 0, 0.7); transitioning = false; @@ -662,13 +597,9 @@ class TitleState extends MusicBeatState { if (easteregg == null) easteregg = ''; easteregg = easteregg.toUpperCase(); #if TITLE_SCREEN_EASTER_EGG - if(easteregg == 'SHADOW') - { + if(easteregg == 'SHADOW') { FlxG.sound.music.fadeOut(); - if(FreeplayState.vocals != null) - { - FreeplayState.vocals.fadeOut(); - } + if(FreeplayState.vocals != null) FreeplayState.vocals.fadeOut(); } #end } @@ -678,8 +609,7 @@ class TitleState extends MusicBeatState { FlxTween.tween(logoBl, {y: titleJSON.titley}, 1.4, {ease: FlxEase.quartInOut}); logoBl.angle = -4; - new FlxTimer().start(0.01, function(tmr:FlxTimer) - { + new FlxTimer().start(0.01, function(tmr:FlxTimer) { if(logoBl.angle == -4) FlxTween.angle(logoBl, logoBl.angle, 4, 4, {ease: FlxEase.quartInOut}); if(logoBl.angle == 4) FlxTween.angle(logoBl, logoBl.angle, -4, 4, {ease: FlxEase.quartInOut}); }, 0); diff --git a/source/states/editors/CharacterEditorState.hx b/source/states/editors/CharacterEditorState.hx index 0e7acf2..c48dfc6 100644 --- a/source/states/editors/CharacterEditorState.hx +++ b/source/states/editors/CharacterEditorState.hx @@ -382,7 +382,7 @@ class CharacterEditorState extends MusicBeatState var ghostAlphaSlider:FlxUISlider = new FlxUISlider(this, 'ghostAlpha', 10, makeGhostButton.y + 25, 0, 1, 210, null, 5, FlxColor.WHITE, FlxColor.BLACK); ghostAlphaSlider.nameLabel.text = 'Opacity:'; ghostAlphaSlider.decimals = 2; - ghostAlphaSlider.callback = function(relativePos:Float) { + ghostAlphaSlider.callback = (relativePos:Float) -> { ghost.alpha = ghostAlpha; if(animateGhost != null) animateGhost.alpha = ghostAlpha; }; @@ -457,7 +457,7 @@ class CharacterEditorState extends MusicBeatState templateCharacter.label.color = FlxColor.WHITE; - charDropDown = new FlxUIDropDownMenu(10, 30, FlxUIDropDownMenu.makeStrIdLabelArray([''], true), function(index:String) + charDropDown = new FlxUIDropDownMenu(10, 30, FlxUIDropDownMenu.makeStrIdLabelArray([''], true), (index:String) -> { var intended = characterList[Std.parseInt(index)]; if(intended == null || intended.length < 1) return; @@ -512,7 +512,7 @@ class CharacterEditorState extends MusicBeatState animationNameFramerate = new FlxUINumericStepper(animationInputText.x + 170, animationInputText.y, 1, 24, 0, 240, 0); animationLoopCheckBox = new FlxUICheckBox(animationNameInputText.x + 170, animationNameInputText.y - 1, null, null, "Should it Loop?", 100); - animationDropDown = new FlxUIDropDownMenu(15, animationInputText.y - 55, FlxUIDropDownMenu.makeStrIdLabelArray([''], true), function(pressed:String) { + animationDropDown = new FlxUIDropDownMenu(15, animationInputText.y - 55, FlxUIDropDownMenu.makeStrIdLabelArray([''], true), (pressed:String) -> { var selectedAnimation:Int = Std.parseInt(pressed); var anim:AnimArray = character.animationsArray[selectedAnimation]; animationInputText.text = anim.anim; diff --git a/source/states/editors/ChartingState.hx b/source/states/editors/ChartingState.hx index 7d1c222..5ac4ddb 100644 --- a/source/states/editors/ChartingState.hx +++ b/source/states/editors/ChartingState.hx @@ -411,6 +411,7 @@ class ChartingState extends MusicBeatState var check_mute_inst:FlxUICheckBox = null; var check_mute_vocals:FlxUICheckBox = null; + var check_mute_vocals_opponent:FlxUICheckBox = null; var check_vortex:FlxUICheckBox = null; var check_warnings:FlxUICheckBox = null; var playSoundBf:FlxUICheckBox = null; @@ -425,15 +426,9 @@ class ChartingState extends MusicBeatState var check_voices = new FlxUICheckBox(10, 25, null, null, "Has voice track", 100); check_voices.checked = _song.needsVoices; - check_voices.callback = () -> - { - _song.needsVoices = check_voices.checked; - }; + check_voices.callback = () -> _song.needsVoices = check_voices.checked; - var saveButton:FlxButton = new FlxButton(110, 8, "Save", () -> - { - saveLevel(); - }); + var saveButton:FlxButton = new FlxButton(110, 8, "Save", () -> saveLevel()); var reloadSong:FlxButton = new FlxButton(saveButton.x + 90, saveButton.y, "Reload Audio", () -> { @@ -459,7 +454,6 @@ class ChartingState extends MusicBeatState var loadEventJson:FlxButton = new FlxButton(loadAutosaveBtn.x, loadAutosaveBtn.y + 30, 'Load Events', () -> { - var songName:String = Paths.formatToSongPath(_song.song); var file:String = Paths.json(songName + '/events'); #if sys @@ -475,27 +469,17 @@ class ChartingState extends MusicBeatState } }); - var saveEvents:FlxButton = new FlxButton(110, reloadSongJson.y, 'Save Events', function () - { - saveEvents(); - }); + var saveEvents:FlxButton = new FlxButton(110, reloadSongJson.y, 'Save Events', () -> saveEvents()); - var clear_events:FlxButton = new FlxButton(320, 310, 'Clear events', () -> - { - openSubState(new Prompt('This action will clear current progress.\n\nProceed?', 0, clearEvents, null,ignoreWarnings)); - }); + var clear_events:FlxButton = new FlxButton(320, 310, 'Clear events', () -> openSubState(new Prompt('This action will clear current progress.\n\nProceed?', 0, clearEvents, null,ignoreWarnings))); clear_events.color = FlxColor.RED; clear_events.label.color = FlxColor.WHITE; var clear_notes:FlxButton = new FlxButton(320, clear_events.y + 30, 'Clear notes', () -> { - openSubState(new Prompt('This action will clear current progress.\n\nProceed?', 0, () ->{for (sec in 0..._song.notes.length) { - _song.notes[sec].sectionNotes = []; - } + openSubState(new Prompt('This action will clear current progress.\n\nProceed?', 0, () -> {for (sec in 0..._song.notes.length) {_song.notes[sec].sectionNotes = [];} updateGrid(); - }, null,ignoreWarnings)); - - }); + }, null,ignoreWarnings));}); clear_notes.color = FlxColor.RED; clear_notes.label.color = FlxColor.WHITE; @@ -518,11 +502,7 @@ class ChartingState extends MusicBeatState var tempArray:Array = []; var characters:Array = Mods.mergeAllTextsNamed('data/characterList.txt', Paths.getSharedPath()); - for (character in characters) - { - if(character.trim().length > 0) - tempArray.push(character); - } + for (character in characters) if(character.trim().length > 0) tempArray.push(character); #if MODS_ALLOWED for (i in 0...directories.length) { @@ -543,8 +523,7 @@ class ChartingState extends MusicBeatState #end tempArray = []; - var player1DropDown = new FlxUIDropDownMenu(10, stepperSpeed.y + 45, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String) - { + var player1DropDown = new FlxUIDropDownMenu(10, stepperSpeed.y + 45, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), (character:String) -> { _song.player1 = characters[Std.parseInt(character)]; updateJsonData(); updateHeads(); @@ -552,8 +531,7 @@ class ChartingState extends MusicBeatState player1DropDown.selectedLabel = _song.player1; blockPressWhileScrolling.push(player1DropDown); - var gfVersionDropDown = new FlxUIDropDownMenu(player1DropDown.x, player1DropDown.y + 40, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String) - { + var gfVersionDropDown = new FlxUIDropDownMenu(player1DropDown.x, player1DropDown.y + 40, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), (character:String) -> { _song.gfVersion = characters[Std.parseInt(character)]; updateJsonData(); updateHeads(); @@ -561,8 +539,7 @@ class ChartingState extends MusicBeatState gfVersionDropDown.selectedLabel = _song.gfVersion; blockPressWhileScrolling.push(gfVersionDropDown); - var player2DropDown = new FlxUIDropDownMenu(player1DropDown.x, gfVersionDropDown.y + 40, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), function(character:String) - { + var player2DropDown = new FlxUIDropDownMenu(player1DropDown.x, gfVersionDropDown.y + 40, FlxUIDropDownMenu.makeStrIdLabelArray(characters, true), (character:String) -> { _song.player2 = characters[Std.parseInt(character)]; updateJsonData(); updateHeads(); @@ -570,10 +547,6 @@ class ChartingState extends MusicBeatState player2DropDown.selectedLabel = _song.player2; blockPressWhileScrolling.push(player2DropDown); - /*var scriptEditor:FlxButton = new FlxButton(player1DropDown.x, player2DropDown.y + 100, "Edit Script", () -> { - openScriptEditor(); - });*/ - #if MODS_ALLOWED var directories:Array = [Paths.mods('stages/'), Paths.mods(Mods.currentModDirectory + '/stages/'), Paths.getSharedPath('stages/')]; for(mod in Mods.getGlobalMods()) @@ -585,9 +558,7 @@ class ChartingState extends MusicBeatState var stageFile:Array = Mods.mergeAllTextsNamed('data/stageList.txt', Paths.getSharedPath()); var stages:Array = []; for (stage in stageFile) { - if(stage.trim().length > 0) { - stages.push(stage); - } + if(stage.trim().length > 0) stages.push(stage); tempArray.push(stage); } #if MODS_ALLOWED @@ -610,8 +581,7 @@ class ChartingState extends MusicBeatState if(stages.length < 1) stages.push('stage'); - stageDropDown = new FlxUIDropDownMenu(player1DropDown.x + 140, player1DropDown.y, FlxUIDropDownMenu.makeStrIdLabelArray(stages, true), function(character:String) - { + stageDropDown = new FlxUIDropDownMenu(player1DropDown.x + 140, player1DropDown.y, FlxUIDropDownMenu.makeStrIdLabelArray(stages, true), (character:String) -> { _song.stage = stages[Std.parseInt(character)]; }); stageDropDown.selectedLabel = _song.stage; @@ -632,7 +602,6 @@ class ChartingState extends MusicBeatState tab_group_song.add(loadEventJson); tab_group_song.add(stepperBPM); tab_group_song.add(stepperSpeed); - tab_group_song.add(scriptEditor); tab_group_song.add(new FlxText(stepperBPM.x, stepperBPM.y - 15, 0, 'Song BPM:')); tab_group_song.add(new FlxText(stepperBPM.x + 100, stepperBPM.y - 15, 0, 'Song Offset:')); tab_group_song.add(new FlxText(stepperSpeed.x, stepperSpeed.y - 15, 0, 'Song Speed:')); @@ -968,7 +937,7 @@ class ChartingState extends MusicBeatState displayNameList[i] = i + '. ' + displayNameList[i]; } - noteTypeDropDown = new FlxUIDropDownMenu(10, 105, FlxUIDropDownMenu.makeStrIdLabelArray(displayNameList, true), function(character:String) + noteTypeDropDown = new FlxUIDropDownMenu(10, 105, FlxUIDropDownMenu.makeStrIdLabelArray(displayNameList, true), (character:String) -> { currentType = Std.parseInt(character); if(curSelectedNote != null && curSelectedNote[1] > -1) { @@ -1035,7 +1004,7 @@ class ChartingState extends MusicBeatState var text:FlxText = new FlxText(20, 30, 0, "Event:"); tab_group_event.add(text); - eventDropDown = new FlxUIDropDownMenu(20, 50, FlxUIDropDownMenu.makeStrIdLabelArray(leEvents, true), function(pressed:String) { + eventDropDown = new FlxUIDropDownMenu(20, 50, FlxUIDropDownMenu.makeStrIdLabelArray(leEvents, true), (pressed:String) -> { var selectedEvent:Int = Std.parseInt(pressed); descText.text = eventStuff[selectedEvent][1]; if (curSelectedNote != null && eventStuff != null) { @@ -1279,7 +1248,7 @@ class ChartingState extends MusicBeatState }; check_mute_vocals_opponent = new FlxUICheckBox(check_mute_vocals.x + 120, check_mute_vocals.y, null, null, "Mute Opp. Vocals (in editor)", 100); check_mute_vocals_opponent.checked = false; - check_mute_vocals_opponent.callback = function() + check_mute_vocals_opponent.callback = () -> { var vol:Float = voicesVolume.value; if (check_mute_vocals_opponent.checked) @@ -2674,24 +2643,20 @@ class ChartingState extends MusicBeatState function updateGrid():Void { - curRenderedNotes.forEachAlive(function(spr:Note) spr.destroy()); + curRenderedNotes.forEachAlive((spr:Note) -> spr.destroy()); curRenderedNotes.clear(); - curRenderedSustains.forEachAlive(function(spr:FlxSprite) spr.destroy()); + curRenderedSustains.forEachAlive((spr:FlxSprite) -> spr.destroy()); curRenderedSustains.clear(); - curRenderedNoteType.forEachAlive(function(spr:FlxText) spr.destroy()); + curRenderedNoteType.forEachAlive((spr:FlxText) -> spr.destroy()); curRenderedNoteType.clear(); - nextRenderedNotes.forEachAlive(function(spr:Note) spr.destroy()); + nextRenderedNotes.forEachAlive((spr:Note) -> spr.destroy()); nextRenderedNotes.clear(); - nextRenderedSustains.forEachAlive(function(spr:FlxSprite) spr.destroy()); + nextRenderedSustains.forEachAlive((spr:FlxSprite) -> spr.destroy()); nextRenderedSustains.clear(); if (_song.notes[curSec].changeBPM && _song.notes[curSec].bpm > 0) - { Conductor.bpm = _song.notes[curSec].bpm; - //trace('BPM of this section:'); - } - else - { + else { // get last bpm var daBPM:Float = _song.bpm; for (i in 0...curSec) @@ -2707,9 +2672,7 @@ class ChartingState extends MusicBeatState var note:Note = setupNoteData(i, false); curRenderedNotes.add(note); if (note.sustainLength > 0) - { curRenderedSustains.add(setupSusNote(note, beats)); - } if(i[3] != null && note.noteType != null && note.noteType.length > 0) { var typeInt:Int = curNoteTypes.indexOf(i[3]); @@ -2748,7 +2711,6 @@ class ChartingState extends MusicBeatState if(note.eventLength > 1) daText.yAdd += 8; curRenderedNoteType.add(daText); daText.sprTracker = note; - //trace('test: ' + i[0], 'startThing: ' + startThing, 'endThing: ' + endThing); } } @@ -2947,7 +2909,7 @@ class ChartingState extends MusicBeatState var delnote = false; if(strumLineNotes.members[d].overlaps(curRenderedNotes)) { - curRenderedNotes.forEachAlive(function(note:Note) + curRenderedNotes.forEachAlive((note:Note) -> { if (note.overlapsPoint(new FlxPoint(strumLineNotes.members[d].x + 1,strumLine.y+1)) && note.noteData == d%4) { diff --git a/source/states/editors/EditorPlayState.hx b/source/states/editors/EditorPlayState.hx index 16e1a0e..d9ec513 100644 --- a/source/states/editors/EditorPlayState.hx +++ b/source/states/editors/EditorPlayState.hx @@ -196,7 +196,7 @@ class EditorPlayState extends MusicBeatSubstate if(notes.length > 0) { var fakeCrochet:Float = (60 / PlayState.SONG.bpm) * 1000; - notes.forEachAlive(function(daNote:Note) + notes.forEachAlive((daNote:Note) -> { var strumGroup:FlxTypedGroup = playerStrums; if(!daNote.mustPress) strumGroup = opponentStrums; @@ -861,7 +861,7 @@ class EditorPlayState extends MusicBeatSubstate function noteMiss(daNote:Note):Void { //You didn't hit the key and let it go offscreen, also used by Hurt Notes //Dupe note remove - notes.forEachAlive(function(note:Note) { + notes.forEachAlive((note:Note) -> { if (daNote != note && daNote.mustPress && daNote.noteData == note.noteData && daNote.isSustainNote == note.isSustainNote && Math.abs(daNote.strumTime - note.strumTime) < 1) invalidateNote(daNote); }); diff --git a/source/states/editors/NoteSplashDebugState.hx b/source/states/editors/NoteSplashDebugState.hx index 9611b32..03a6e06 100644 --- a/source/states/editors/NoteSplashDebugState.hx +++ b/source/states/editors/NoteSplashDebugState.hx @@ -80,7 +80,7 @@ class NoteSplashDebugState extends MusicBeatState { add(imageName); imageInputText = new FlxInputText(txtx, txty - 100, 360, defaultTexture, 16); - imageInputText.callback = function(text:String, action:String) + imageInputText.callback = (text:String, action:String) -> { switch(action) { case 'enter': @@ -116,7 +116,7 @@ class NoteSplashDebugState extends MusicBeatState { add(animName); nameInputText = new FlxInputText(txtx, txty + 20, 360, '', 16); - nameInputText.callback = function(text:String, action:String) + nameInputText.callback = (text:String, action:String) -> { switch(action) { @@ -290,7 +290,7 @@ class NoteSplashDebugState extends MusicBeatState { else if(forceFrame >= maxFrame) forceFrame = maxFrame - 1; curFrameText.text = 'Force Frame: ${forceFrame+1} / $maxFrame\n(Press Q/E to change)'; - splashes.forEachAlive(function(spr:FlxSprite) { + splashes.forEachAlive((spr:FlxSprite) -> { spr.animation.curAnim.paused = true; spr.animation.curAnim.curFrame = forceFrame; }); @@ -308,7 +308,7 @@ class NoteSplashDebugState extends MusicBeatState { function loadFrames() { texturePath = 'noteSplashes/' + textureName; - splashes.forEachAlive(function(spr:FlxSprite) { + splashes.forEachAlive((spr:FlxSprite) -> { spr.frames = Paths.getSparrowAtlas(texturePath); }); @@ -370,7 +370,7 @@ class NoteSplashDebugState extends MusicBeatState { function reloadAnims() { var loopContinue:Bool = true; - splashes.forEachAlive(function(spr:FlxSprite) + splashes.forEachAlive((spr:FlxSprite) -> { spr.animation.destroyAnimations(); }); @@ -379,7 +379,7 @@ class NoteSplashDebugState extends MusicBeatState { while(loopContinue) { var animID:Int = maxAnims + 1; - splashes.forEachAlive(function(spr:FlxSprite) + splashes.forEachAlive((spr:FlxSprite) -> { for (i in 0...Note.colArray.length) { var animName = 'note$i-$animID';