diff --git a/assets b/assets index 594af74e6..b10576a91 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 594af74e603a8941ffb2a6478c7126cc2b50c507 +Subproject commit b10576a917e01c8c1285a9cc68b895e4d5b479d4 diff --git a/source/Main.hx b/source/Main.hx index 8372e5059..baa184ed8 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -136,7 +136,8 @@ class Main extends Sprite #if hxvlc // Initialize hxvlc's Handle here so the videos are loading faster. - Handle.initAsync(function(success:Bool):Void { + Handle.initAsync(function(success:Bool):Void + { if (success) { trace(' HXVLC '.bold().bg_orange() + ' LibVLC instance initialized!'); diff --git a/source/Postbuild.hx b/source/Postbuild.hx index ccdcbcf92..c63d88557 100644 --- a/source/Postbuild.hx +++ b/source/Postbuild.hx @@ -36,12 +36,7 @@ class Postbuild static function format(time:Float, decimals:Int = 1):String { - var units = [ - {name: "day", secs: 86400}, - {name: "hour", secs: 3600}, - {name: "minute", secs: 60}, - {name: "second", secs: 1} - ]; + var units = [{name: "day", secs: 86400}, {name: "hour", secs: 3600}, {name: "minute", secs: 60}, {name: "second", secs: 1}]; var parts:Array = []; var remaining:Float = time; diff --git a/source/cpp/vm/tracy/TracyProfiler.hx b/source/cpp/vm/tracy/TracyProfiler.hx index e25e5ea5e..0886492c0 100644 --- a/source/cpp/vm/tracy/TracyProfiler.hx +++ b/source/cpp/vm/tracy/TracyProfiler.hx @@ -89,44 +89,35 @@ extern class Native_TracyProfiler class Cppia_TracyProfiler { @:inheritDoc(cpp.vm.tracy.Native_TracyProfiler.frameMark) - public static function frameMark() - Native_TracyProfiler.frameMark(); + public static function frameMark() Native_TracyProfiler.frameMark(); @:inheritDoc(cpp.vm.tracy.Native_TracyProfiler.frameMarkNamed) - public static function frameMarkNamed(_name:String) - Native_TracyProfiler.frameMarkNamed(_name); + public static function frameMarkNamed(_name:String) Native_TracyProfiler.frameMarkNamed(_name); @:inheritDoc(cpp.vm.tracy.Native_TracyProfiler.frameMarkStart) - public static function frameMarkStart(_name:String) - Native_TracyProfiler.frameMarkStart(_name); + public static function frameMarkStart(_name:String) Native_TracyProfiler.frameMarkStart(_name); @:inheritDoc(cpp.vm.tracy.Native_TracyProfiler.frameMarkEnd) - public static function frameMarkEnd(_name:String) - Native_TracyProfiler.frameMarkEnd(_name); + public static function frameMarkEnd(_name:String) Native_TracyProfiler.frameMarkEnd(_name); @:inheritDoc(cpp.vm.tracy.Native_TracyProfiler.message) - public static function message(_msg:String, ?_color:Int = 0x000000) - Native_TracyProfiler.message(_msg, _color); + public static function message(_msg:String, ?_color:Int = 0x000000) Native_TracyProfiler.message(_msg, _color); @:inheritDoc(cpp.vm.tracy.Native_TracyProfiler.messageAppInfo) - public static function messageAppInfo(_info:String) - Native_TracyProfiler.messageAppInfo(_info); + public static function messageAppInfo(_info:String) Native_TracyProfiler.messageAppInfo(_info); @:inheritDoc(cpp.vm.tracy.Native_TracyProfiler.plot) - public static function plot(_name:String, _val:Float) - Native_TracyProfiler.plot(_name, _val); + public static function plot(_name:String, _val:Float) Native_TracyProfiler.plot(_name, _val); @:inheritDoc(cpp.vm.tracy.Native_TracyProfiler.plotConfig) - public static function plotConfig(_name:String, _format:PlotFormatType, ?_step:Bool = false, ?_fill:Bool = false, ?_color:Int = 0x000000) - Native_TracyProfiler.plotConfig(_name, _format, _step, _fill, _color); + public static function plotConfig(_name:String, _format:PlotFormatType, ?_step:Bool = false, ?_fill:Bool = false, + ?_color:Int = 0x000000) Native_TracyProfiler.plotConfig(_name, _format, _step, _fill, _color); @:inheritDoc(cpp.vm.tracy.Native_TracyProfiler.setThreadName) - public static function setThreadName(_name:String, ?_groupHint:Int = 1) - Native_TracyProfiler.setThreadName(_name, _groupHint); + public static function setThreadName(_name:String, ?_groupHint:Int = 1) Native_TracyProfiler.setThreadName(_name, _groupHint); @:inheritDoc(cpp.vm.tracy.Native_TracyProfiler.zoneScoped) - public static function zoneScoped(_name:String) - Native_TracyProfiler.zoneScoped(_name); + public static function zoneScoped(_name:String) Native_TracyProfiler.zoneScoped(_name); } typedef TracyProfiler = Cppia_TracyProfiler; diff --git a/source/funkin/Conductor.hx b/source/funkin/Conductor.hx index 1d7e61f5e..9012cec12 100644 --- a/source/funkin/Conductor.hx +++ b/source/funkin/Conductor.hx @@ -381,7 +381,9 @@ class Conductor /** * The constructor. */ - public function new() {} + public function new() + { + } /** * Forcibly defines the current BPM of the song. diff --git a/source/funkin/Highscore.hx b/source/funkin/Highscore.hx index 646783359..2b29beaf3 100644 --- a/source/funkin/Highscore.hx +++ b/source/funkin/Highscore.hx @@ -49,20 +49,19 @@ abstract Tallies(RawTallies) { public function new() { - this = - { - combo: 0, - missed: 0, - shit: 0, - bad: 0, - good: 0, - sick: 0, - totalNotes: 0, - totalNotesHit: 0, - maxCombo: 0, - score: 0, - isNewHighscore: false - } + this = { + combo: 0, + missed: 0, + shit: 0, + bad: 0, + good: 0, + sick: 0, + totalNotes: 0, + totalNotesHit: 0, + maxCombo: 0, + score: 0, + isNewHighscore: false + } } } diff --git a/source/funkin/InitState.hx b/source/funkin/InitState.hx index 72a124dee..6a6df6292 100644 --- a/source/funkin/InitState.hx +++ b/source/funkin/InitState.hx @@ -188,7 +188,8 @@ class InitState extends FlxState FlxTransitionableState.defaultTransOut = new TransitionData(FADE, FlxColor.BLACK, 0.7, new FlxPoint(0, 1), tileData, new FlxRect(-200, -200, FlxG.width * 1.4, FlxG.height * 1.4)); - FlxG.signals.gameResized.add(function(width:Int, height:Int) { + FlxG.signals.gameResized.add(function(width:Int, height:Int) + { FlxTransitionableState.defaultTransIn = new TransitionData(FADE, FlxColor.BLACK, 1, new FlxPoint(0, -1), tileData, new FlxRect(-200, -200, FlxG.width * 1.4, FlxG.height * 1.4)); FlxTransitionableState.defaultTransOut = new TransitionData(FADE, FlxColor.BLACK, 0.7, new FlxPoint(0, 1), tileData, @@ -199,10 +200,12 @@ class InitState extends FlxState // Since we don't really need VSync on Android we're gonna forcefully disable it on these signals for now // This is fixed on SDL3 from what I've heared but that doodoo isn't working poperly for Android #if android - FlxG.signals.focusLost.add(function() { + FlxG.signals.focusLost.add(function() + { WindowUtil.setVSyncMode(lime.ui.WindowVSyncMode.OFF); }); - FlxG.signals.focusGained.add(function() { + FlxG.signals.focusGained.add(function() + { WindowUtil.setVSyncMode(lime.ui.WindowVSyncMode.OFF); }); #end @@ -220,7 +223,8 @@ class InitState extends FlxState #if FEATURE_DISCORD_RPC DiscordClient.instance.init(); - lime.app.Application.current.onExit.add(function(exitCode) { + lime.app.Application.current.onExit.add(function(exitCode) + { DiscordClient.instance.shutdown(); }); #end @@ -362,37 +366,34 @@ class InitState extends FlxState FlxG.switchState(() -> new funkin.ui.debug.stage.StageBuilderState()); #elseif RESULTS // -DRESULTS - FlxG.switchState(() -> new funkin.play.ResultState( - { - storyMode: true, - title: "Cum Song Erect by Kawai Sprite", - songId: "cum", - characterId: "pico", - difficultyId: "hard", - isNewHighscore: true, - scoreData: - { - score: 1_234_567, - tallies: - { - sick: 130, - good: 60, - bad: 69, - shit: 69, - missed: 69, - combo: 69, - maxCombo: 69, - totalNotesHit: 140, - totalNotes: 240 - } - // 2400 total notes = 7% = LOSS - // 275 total notes = 69% = NICE - // 240 total notes = 79% = GOOD - // 230 total notes = 82% = GREAT - // 210 total notes = 91% = EXCELLENT - // 190 total notes = PERFECT - }, - })); + FlxG.switchState(() -> new funkin.play.ResultState({ + storyMode: true, + title: "Cum Song Erect by Kawai Sprite", + songId: "cum", + characterId: "pico", + difficultyId: "hard", + isNewHighscore: true, + scoreData: { + score: 1_234_567, + tallies: { + sick: 130, + good: 60, + bad: 69, + shit: 69, + missed: 69, + combo: 69, + maxCombo: 69, + totalNotesHit: 140, + totalNotes: 240 + } + // 2400 total notes = 7% = LOSS + // 275 total notes = 69% = NICE + // 240 total notes = 79% = GOOD + // 230 total notes = 82% = GREAT + // 210 total notes = 91% = EXCELLENT + // 190 total notes = PERFECT + }, + })); #elseif ANIMDEBUG // -DANIMDEBUG FlxG.switchState(() -> new funkin.ui.debug.anim.DebugBoundingState()); @@ -415,10 +416,9 @@ class InitState extends FlxState if (params.chart.shouldLoadChart) { #if FEATURE_CHART_EDITOR - FlxG.switchState(() -> new ChartEditorState( - { - fnfcTargetPath: params.chart.chartPath, - })); + FlxG.switchState(() -> new ChartEditorState({ + fnfcTargetPath: params.chart.chartPath, + })); #else FlxG.switchState(() -> new TitleState()); #end @@ -426,10 +426,9 @@ class InitState extends FlxState else if (params.stage.shouldLoadStage) { #if FEATURE_STAGE_EDITOR - FlxG.switchState(() -> new StageEditorState( - { - fnfsTargetPath: params.stage.stagePath, - })); + FlxG.switchState(() -> new StageEditorState({ + fnfsTargetPath: params.stage.stagePath, + })); #else FlxG.switchState(() -> new TitleState()); #end @@ -446,7 +445,8 @@ class InitState extends FlxState { // FlxG.sound.cache(Paths.music('freakyMenu/freakyMenu')); #if mobile - funkin.mobile.util.FNFCUtil.onFNFCOpen.add(function(fnfcFile:String) { + funkin.mobile.util.FNFCUtil.onFNFCOpen.add(function(fnfcFile:String) + { flixel.tweens.FlxTween.globalManager.clear(); flixel.util.FlxTimer.globalManager.clear(); @:nullSafety(Off) @@ -520,11 +520,10 @@ class InitState extends FlxState } @:nullSafety(Off) // Cannot unify? - LoadingState.loadPlayState( - { - targetSong: songData, - targetDifficulty: difficultyId, - }); + LoadingState.loadPlayState({ + targetSong: songData, + targetDifficulty: difficultyId, + }); } /** @@ -563,11 +562,10 @@ class InitState extends FlxState } @:nullSafety(Off) - LoadingState.loadPlayState( - { - targetSong: targetSong, - targetDifficulty: difficultyId, - }); + LoadingState.loadPlayState({ + targetSong: targetSong, + targetDifficulty: difficultyId, + }); } @:nullSafety(Off) // Meh, remove when flixel.system.debug.log.LogStyle is null safe @@ -595,7 +593,8 @@ class InitState extends FlxState // Adds a red button to the debugger. // This pauses the game AND the music! This ensures the Conductor stops. - FlxG.debugger.addButton(CENTER, new BitmapData(20, 20, true, 0xFFCC2233), function() { + FlxG.debugger.addButton(CENTER, new BitmapData(20, 20, true, 0xFFCC2233), function() + { if (FlxG.vcr.paused) { FlxG.vcr.resume(); @@ -622,7 +621,8 @@ class InitState extends FlxState // Adds a blue button to the debugger. // This skips forward in the song. - FlxG.debugger.addButton(CENTER, new BitmapData(20, 20, true, 0xFF2222CC), function() { + FlxG.debugger.addButton(CENTER, new BitmapData(20, 20, true, 0xFF2222CC), function() + { FlxG.game.debugger.vcr.onStep(); for (snd in FlxG.sound.list) @@ -639,7 +639,8 @@ class InitState extends FlxState // This big obnoxious white button is for MOBILE, so that you can press it // easily with your finger when debug bullshit pops up during testing lol! #if mobile - FlxG.debugger.addButton(LEFT, new BitmapData(200, 200), function() { + FlxG.debugger.addButton(LEFT, new BitmapData(200, 200), function() + { FlxG.debugger.visible = false; // Make errors and warnings less annoying. diff --git a/source/funkin/Paths.hx b/source/funkin/Paths.hx index 8e8bf52e6..cddc1ea09 100644 --- a/source/funkin/Paths.hx +++ b/source/funkin/Paths.hx @@ -193,19 +193,18 @@ class Paths implements ConsoleClass graphicKey = Paths.animateAtlas(key); } - var validatedSettings:AtlasSpriteSettings = - { - swfMode: settings?.swfMode ?? false, - cacheOnLoad: settings?.cacheOnLoad ?? false, - filterQuality: settings?.filterQuality ?? MEDIUM, - spritemaps: settings?.spritemaps ?? null, - metadataJson: settings?.metadataJson ?? null, - cacheKey: settings?.cacheKey ?? null, - uniqueInCache: settings?.uniqueInCache ?? false, - onSymbolCreate: settings?.onSymbolCreate ?? null, - applyStageMatrix: settings?.applyStageMatrix ?? false, - useRenderTexture: settings?.useRenderTexture ?? false - }; + var validatedSettings:AtlasSpriteSettings = { + swfMode: settings?.swfMode ?? false, + cacheOnLoad: settings?.cacheOnLoad ?? false, + filterQuality: settings?.filterQuality ?? MEDIUM, + spritemaps: settings?.spritemaps ?? null, + metadataJson: settings?.metadataJson ?? null, + cacheKey: settings?.cacheKey ?? null, + uniqueInCache: settings?.uniqueInCache ?? false, + onSymbolCreate: settings?.onSymbolCreate ?? null, + applyStageMatrix: settings?.applyStageMatrix ?? false, + useRenderTexture: settings?.useRenderTexture ?? false + }; // Validate asset path. if (!Assets.exists('${graphicKey}/Animation.json')) diff --git a/source/funkin/Preferences.hx b/source/funkin/Preferences.hx index de3de67d6..ffe61c04a 100644 --- a/source/funkin/Preferences.hx +++ b/source/funkin/Preferences.hx @@ -384,7 +384,8 @@ class Preferences { var currTime = Date.now().getTime(); var timeToCall = 0; - var id = js.Browser.window.setTimeout(function() { + var id = js.Browser.window.setTimeout(function() + { callback(currTime + timeToCall); }, timeToCall); return id; diff --git a/source/funkin/api/newgrounds/Leaderboards.hx b/source/funkin/api/newgrounds/Leaderboards.hx index 2e760571e..71fed1ade 100644 --- a/source/funkin/api/newgrounds/Leaderboards.hx +++ b/source/funkin/api/newgrounds/Leaderboards.hx @@ -51,7 +51,8 @@ class Leaderboards var leaderboardData:Null = listLeaderboardData().get(leaderboard.getId()); if (leaderboardData != null) { - leaderboardData.postScore(score, function(outcome:Outcome):Void { + leaderboardData.postScore(score, function(outcome:Outcome):Void + { switch (outcome) { case SUCCESS: @@ -82,7 +83,8 @@ class Leaderboards if ((params?.useCurrentUser ?? false) && NewgroundsClient.instance.isLoggedIn()) user = NewgroundsClient.instance.user; leaderboardData.requestScores(params?.limit ?? 10, params?.skip ?? 0, params?.period ?? ALL, params?.social ?? false, params?.tag, user, - function(outcome:Outcome):Void { + function(outcome:Outcome):Void + { switch (outcome) { case SUCCESS: diff --git a/source/funkin/api/newgrounds/Medals.hx b/source/funkin/api/newgrounds/Medals.hx index 3a1594387..cbcb30c19 100644 --- a/source/funkin/api/newgrounds/Medals.hx +++ b/source/funkin/api/newgrounds/Medals.hx @@ -58,7 +58,8 @@ class Medals // Play the medal unlock animation, but only if the user has not already unlocked it. #if html5 // Web builds support parsing the bitmap data from the URL directly. - BitmapData.loadFromFile("https:" + medalData.icon).onComplete(function(bmp:BitmapData) { + BitmapData.loadFromFile("https:" + medalData.icon).onComplete(function(bmp:BitmapData) + { var medalGraphic = FlxGraphic.fromBitmapData(bmp); medalGraphic.persist = true; NewgroundsMedalPlugin.play(medalData.value, medalData.name, medalGraphic); @@ -68,7 +69,8 @@ class Medals // We have to use a medal image from the game files. We use a Base64 encoded image that NG spits out. // TODO: Wait, don't they give us the medal icon? - var localMedalData:Null = medalJSON.filter(function(jsonMedal) { + var localMedalData:Null = medalJSON.filter(function(jsonMedal) + { #if FEATURE_NEWGROUNDS_TESTING_MEDALS return medal == jsonMedal.idTest; #else @@ -436,27 +438,7 @@ enum abstract Medal(Int) from Int to Int */ public static function getAllMedals():Array { - return [ - StartGame, - StoryTutorial, - StoryWeek1, - StoryWeek2, - StoryWeek3, - StoryWeek4, - StoryWeek5, - StoryWeek6, - StoryWeek7, - StoryWeekend1, - CharSelect, - FreeplayPicoMix, - FreeplayStressPico, - LossRating, - PerfectRatingHard, - GoldPerfectRatingHard, - ErectDifficulty, - GoldPerfectRatingNightmare, - FridayNight, - Nice - ]; + return + [StartGame, StoryTutorial, StoryWeek1, StoryWeek2, StoryWeek3, StoryWeek4, StoryWeek5, StoryWeek6, StoryWeek7, StoryWeekend1, CharSelect, FreeplayPicoMix, FreeplayStressPico, LossRating, PerfectRatingHard, GoldPerfectRatingHard, ErectDifficulty, GoldPerfectRatingNightmare, FridayNight, Nice]; } } diff --git a/source/funkin/api/newgrounds/NGSaveSlot.hx b/source/funkin/api/newgrounds/NGSaveSlot.hx index e34c57a4a..e07da891c 100644 --- a/source/funkin/api/newgrounds/NGSaveSlot.hx +++ b/source/funkin/api/newgrounds/NGSaveSlot.hx @@ -58,7 +58,8 @@ class NGSaveSlot try { - ngSaveSlot?.save(encodedData, function(outcome:Outcome) { + ngSaveSlot?.save(encodedData, function(outcome:Outcome) + { switch (outcome) { case SUCCESS: @@ -80,7 +81,8 @@ class NGSaveSlot { try { - ngSaveSlot?.load(function(outcome:SaveSlotOutcome):Void { + ngSaveSlot?.load(function(outcome:SaveSlotOutcome):Void + { switch (outcome) { case SUCCESS(value): @@ -122,7 +124,8 @@ class NGSaveSlot { try { - ngSaveSlot?.clear(function(outcome:Outcome) { + ngSaveSlot?.clear(function(outcome:Outcome) + { switch (outcome) { case SUCCESS: diff --git a/source/funkin/api/newgrounds/NewgroundsClient.hx b/source/funkin/api/newgrounds/NewgroundsClient.hx index 439e0f046..5c3277068 100644 --- a/source/funkin/api/newgrounds/NewgroundsClient.hx +++ b/source/funkin/api/newgrounds/NewgroundsClient.hx @@ -113,14 +113,16 @@ class NewgroundsClient return; } - var passportHandler:String->Void = function(passportUrl:String) { + var passportHandler:String->Void = function(passportUrl:String) + { // This exists so we can create a popup on mobile but with a WebView instead. #if FEATURE_MOBILE_WEBVIEW if (passportUrl != null) { NG.core.logVerbose('Loading passport from WebView: ${passportUrl}'); - WebViewUtil.openURL(passportUrl, function():Void { + WebViewUtil.openURL(passportUrl, function():Void + { NG.core.cancelLoginRequest(); }); @@ -151,7 +153,8 @@ class NewgroundsClient return; } - var dummyPassport:String->Void = function(_) { + var dummyPassport:String->Void = function(_) + { // just a dummy passport, so we don't create a popup // otherwise `NG.core.requestLogin()` will automatically attempt to open a tab at the beginning of the game // users should go to the Options Menu to login to NG diff --git a/source/funkin/api/newgrounds/Referral.hx b/source/funkin/api/newgrounds/Referral.hx index 7fa38a518..c44b2fda5 100644 --- a/source/funkin/api/newgrounds/Referral.hx +++ b/source/funkin/api/newgrounds/Referral.hx @@ -23,7 +23,8 @@ class Referral { NG.core?.calls.loader.loadReferral(false) .addComponentParameter("referral_name", referralName) - .addResponseHandler(response -> { + .addResponseHandler(response -> + { trace(response); if (response.success) { diff --git a/source/funkin/audio/FunkinSound.hx b/source/funkin/audio/FunkinSound.hx index 66c6d29f8..f2d62ea1a 100644 --- a/source/funkin/audio/FunkinSound.hx +++ b/source/funkin/audio/FunkinSound.hx @@ -42,7 +42,8 @@ class FunkinSound extends FlxSound implements ICloneable if (_onVolumeChanged == null) { _onVolumeChanged = new FlxTypedSignalVoid>(); - FlxG.sound.onVolumeChange.add(function(volume:Float) { + FlxG.sound.onVolumeChange.add(function(volume:Float) + { _onVolumeChanged.dispatch(volume); }); } @@ -350,7 +351,8 @@ class FunkinSound extends FlxSound implements ICloneable partialQueue.push(music); @:nullSafety(Off) - music.future.onComplete(function(partialMusic:Null) { + music.future.onComplete(function(partialMusic:Null) + { FlxG.sound.music = partialMusic; FlxG.sound.list.remove(FlxG.sound.music); @@ -496,11 +498,13 @@ class FunkinSound extends FlxSound implements ICloneable } else { - promise.future.onError(function(e) { + promise.future.onError(function(e) + { soundRequest.error("Sound loading was errored or cancelled"); }); - soundRequest.future.onComplete(function(partialSound) { + soundRequest.future.onComplete(function(partialSound) + { var snd = FunkinSound.load(partialSound, volume, looped, autoDestroy, autoPlay, false, onComplete, onLoad); promise.complete(snd); }); diff --git a/source/funkin/audio/SoundGroup.hx b/source/funkin/audio/SoundGroup.hx index 2e9dea413..0c26a0dc8 100644 --- a/source/funkin/audio/SoundGroup.hx +++ b/source/funkin/audio/SoundGroup.hx @@ -58,7 +58,8 @@ class SoundGroup extends FlxTypedGroup { var error:Float = 0; - forEachAlive(function(snd) { + forEachAlive(function(snd) + { if (targetTime == null) targetTime = snd.time; else { @@ -85,7 +86,8 @@ class SoundGroup extends FlxTypedGroup // result.pause(); result.time = this.time; - result.onComplete = function() { + result.onComplete = function() + { this.onComplete(); } @@ -96,14 +98,17 @@ class SoundGroup extends FlxTypedGroup return result; } - public dynamic function onComplete():Void {} + public dynamic function onComplete():Void + { + } /** * Pause all the sounds in the group. */ public function pause() { - forEachAlive(function(sound:FunkinSound) { + forEachAlive(function(sound:FunkinSound) + { sound.pause(); }); } @@ -113,7 +118,8 @@ class SoundGroup extends FlxTypedGroup */ public function play(forceRestart:Bool = false, startTime:Float = 0.0, ?endTime:Float) { - forEachAlive(function(sound:FunkinSound) { + forEachAlive(function(sound:FunkinSound) + { if (sound.length < startTime) { // trace('Queuing sound (${sound.toString()} past its length! Skipping...)'); @@ -128,7 +134,8 @@ class SoundGroup extends FlxTypedGroup */ public function resume() { - forEachAlive(function(sound:FunkinSound) { + forEachAlive(function(sound:FunkinSound) + { sound.resume(); }); } @@ -139,7 +146,8 @@ class SoundGroup extends FlxTypedGroup @:nullSafety(Off) public function fadeIn(duration:Float, ?from:Float = 0.0, ?to:Float = 1.0, ?onComplete:FlxTween->Void):Void { - forEachAlive(function(sound:FunkinSound) { + forEachAlive(function(sound:FunkinSound) + { sound.fadeIn(duration, from, to, onComplete); }); } @@ -150,7 +158,8 @@ class SoundGroup extends FlxTypedGroup @:nullSafety(Off) public function fadeOut(duration:Float, ?to:Float = 0.0, ?onComplete:FlxTween->Void):Void { - forEachAlive(function(sound:FunkinSound) { + forEachAlive(function(sound:FunkinSound) + { sound.fadeOut(duration, to, onComplete); }); } @@ -162,7 +171,8 @@ class SoundGroup extends FlxTypedGroup { if (members != null) { - forEachAlive(function(sound:FunkinSound) { + forEachAlive(function(sound:FunkinSound) + { sound.stop(); }); } @@ -198,7 +208,8 @@ class SoundGroup extends FlxTypedGroup function set_time(time:Float):Float { - forEachAlive(function(snd:FunkinSound) { + forEachAlive(function(snd:FunkinSound) + { // account for different offsets per sound? snd.time = time; }); @@ -233,7 +244,8 @@ class SoundGroup extends FlxTypedGroup // in PlayState, adjust the code so that it only mutes the player1 vocal tracks? function set_volume(volume:Float):Float { - forEachAlive(function(snd:FunkinSound) { + forEachAlive(function(snd:FunkinSound) + { snd.volume = volume; }); @@ -249,7 +261,8 @@ class SoundGroup extends FlxTypedGroup function set_muted(muted:Bool):Bool { - forEachAlive(function(snd:FunkinSound) { + forEachAlive(function(snd:FunkinSound) + { snd.muted = muted; }); @@ -269,7 +282,8 @@ class SoundGroup extends FlxTypedGroup { #if FLX_PITCH trace('Setting audio pitch to ' + val); - forEachAlive(function(snd:FunkinSound) { + forEachAlive(function(snd:FunkinSound) + { snd.pitch = val; }); #end diff --git a/source/funkin/audio/VoicesGroup.hx b/source/funkin/audio/VoicesGroup.hx index 7342d9002..d81a562ea 100644 --- a/source/funkin/audio/VoicesGroup.hx +++ b/source/funkin/audio/VoicesGroup.hx @@ -47,7 +47,8 @@ class VoicesGroup extends SoundGroup function set_playerVolume(volume:Float):Float { - playerVoices?.forEachAlive(function(voice:FunkinSound) { + playerVoices?.forEachAlive(function(voice:FunkinSound) + { voice.volume = volume; }); return playerVolume = volume; @@ -55,15 +56,18 @@ class VoicesGroup extends SoundGroup override function set_time(time:Float):Float { - forEachAlive(function(snd) { + forEachAlive(function(snd) + { // account for different offsets per sound? snd.time = time; }); - playerVoices?.forEachAlive(function(voice:FunkinSound) { + playerVoices?.forEachAlive(function(voice:FunkinSound) + { voice.time -= playerVoicesOffset; }); - opponentVoices?.forEachAlive(function(voice:FunkinSound) { + opponentVoices?.forEachAlive(function(voice:FunkinSound) + { voice.time -= opponentVoicesOffset; }); @@ -72,7 +76,8 @@ class VoicesGroup extends SoundGroup function set_playerVoicesOffset(offset:Float):Float { - playerVoices?.forEachAlive(function(voice:FunkinSound) { + playerVoices?.forEachAlive(function(voice:FunkinSound) + { voice.time += playerVoicesOffset; voice.time -= offset; }); @@ -81,7 +86,8 @@ class VoicesGroup extends SoundGroup function set_opponentVoicesOffset(offset:Float):Float { - opponentVoices?.forEachAlive(function(voice:FunkinSound) { + opponentVoices?.forEachAlive(function(voice:FunkinSound) + { voice.time += opponentVoicesOffset; voice.time -= offset; }); @@ -99,7 +105,8 @@ class VoicesGroup extends SoundGroup function set_opponentVolume(volume:Float):Float { - opponentVoices?.forEachAlive(function(voice:FunkinSound) { + opponentVoices?.forEachAlive(function(voice:FunkinSound) + { voice.volume = volume; }); return opponentVolume = volume; diff --git a/source/funkin/audio/visualize/SpectogramSprite.hx b/source/funkin/audio/visualize/SpectogramSprite.hx index da2c57f32..d7a8da8ed 100644 --- a/source/funkin/audio/visualize/SpectogramSprite.hx +++ b/source/funkin/audio/visualize/SpectogramSprite.hx @@ -69,7 +69,8 @@ class SpectogramSprite extends FlxTypedSpriteGroup default: } - forEach(spr -> { + forEach(spr -> + { spr.visible = spr.ID % wavOptimiz == 0; }); diff --git a/source/funkin/audio/visualize/VisShit.hx b/source/funkin/audio/visualize/VisShit.hx index 83b9496ac..7d960efdd 100644 --- a/source/funkin/audio/visualize/VisShit.hx +++ b/source/funkin/audio/visualize/VisShit.hx @@ -40,7 +40,8 @@ class VisShit // helpers, note that spectrum indexes suppose non-negative frequencies final binSize = fs / fftN; - final indexToFreq = function(k:Int) { + final indexToFreq = function(k:Int) + { var powShit:Float = FlxMath.remapToRange(k, 0, halfN, 0, MathUtil.logBase(10, halfN)); // 4.3 is almost the log of 20Khz or so. Close enuf lol return 1.0 * (Math.pow(10, powShit)); // we need the `1.0` to avoid overflows @@ -49,7 +50,8 @@ class VisShit // "melodic" band-pass filter final minFreq = 20.70; final maxFreq = 4000.01; - final melodicBandPass = function(k:Int, s:Float) { + final melodicBandPass = function(k:Int, s:Float) + { final freq = indexToFreq(k); final filter = freq > minFreq - binSize && freq < maxFreq + binSize ? 1 : 0; return s; @@ -62,10 +64,7 @@ class VisShit while (c < samples.length) { // take a chunk (zero-padded if needed) and apply the window - final chunk = [ - for (n in 0...fftN) - (c + n < samples.length ? samples[c + n] : 0.0) * window(n) - ]; + final chunk = [for (n in 0...fftN) (c + n < samples.length ? samples[c + n] : 0.0) * window(n)]; // compute positive spectrum with sampling correction and BP filter final freqs = FFT.rfft(chunk).map(z -> z.scale(1 / fftN).magnitude).mapi(melodicBandPass); diff --git a/source/funkin/audio/visualize/dsp/Complex.hx b/source/funkin/audio/visualize/dsp/Complex.hx index 58a5fc100..2e89c8ea3 100644 --- a/source/funkin/audio/visualize/dsp/Complex.hx +++ b/source/funkin/audio/visualize/dsp/Complex.hx @@ -10,58 +10,48 @@ abstract Complex({ final imag:Float; }) { - public inline function new(real:Float, imag:Float) - this = {real: real, imag: imag}; + public inline function new(real:Float, imag:Float) this = {real: real, imag: imag}; /** Makes a Complex number with the given Float as its real part and a zero imag part. **/ @:from - public static inline function fromReal(r:Float) - return new Complex(r, 0); + public static inline function fromReal(r:Float) return new Complex(r, 0); /** Complex argument, in radians. **/ public var angle(get, never):Float; - inline function get_angle() - return Math.atan2(this.imag, this.real); + inline function get_angle() return Math.atan2(this.imag, this.real); /** Complex module. **/ public var magnitude(get, never):Float; - inline function get_magnitude() - return Math.sqrt(this.real * this.real + this.imag * this.imag); + inline function get_magnitude() return Math.sqrt(this.real * this.real + this.imag * this.imag); @:op(A + B) - public inline function add(rhs:Complex):Complex - return new Complex(this.real + rhs.real, this.imag + rhs.imag); + public inline function add(rhs:Complex):Complex return new Complex(this.real + rhs.real, this.imag + rhs.imag); @:op(A - B) - public inline function sub(rhs:Complex):Complex - return new Complex(this.real - rhs.real, this.imag - rhs.imag); + public inline function sub(rhs:Complex):Complex return new Complex(this.real - rhs.real, this.imag - rhs.imag); @:op(A * B) - public inline function mult(rhs:Complex):Complex - return new Complex(this.real * rhs.real - this.imag * rhs.imag, this.real * rhs.imag + this.imag * rhs.real); + public inline function mult(rhs:Complex):Complex return new Complex(this.real * rhs.real - this.imag * rhs.imag, this.real * rhs.imag + this.imag * rhs.real); /** Returns the complex conjugate, does not modify this object. **/ - public inline function conj():Complex - return new Complex(this.real, -this.imag); + public inline function conj():Complex return new Complex(this.real, -this.imag); /** Multiplication by a real factor, does not modify this object. **/ - public inline function scale(k:Float):Complex - return new Complex(this.real * k, this.imag * k); + public inline function scale(k:Float):Complex return new Complex(this.real * k, this.imag * k); - public inline function copy():Complex - return new Complex(this.real, this.imag); + public inline function copy():Complex return new Complex(this.real, this.imag); /** The imaginary unit. @@ -76,6 +66,5 @@ abstract Complex({ /** Computes the complex exponential `e^(iw)`. **/ - public static inline function exp(w:Float) - return new Complex(Math.cos(w), Math.sin(w)); + public static inline function exp(w:Float) return new Complex(Math.cos(w), Math.sin(w)); } diff --git a/source/funkin/audio/visualize/dsp/FFT.hx b/source/funkin/audio/visualize/dsp/FFT.hx index 5776307ce..412a76f47 100644 --- a/source/funkin/audio/visualize/dsp/FFT.hx +++ b/source/funkin/audio/visualize/dsp/FFT.hx @@ -19,8 +19,7 @@ class FFT samples from the Discrete-Time Fourier Transform (DTFT) - which is Fs-periodic - with a spacing of Fs/N Hz between them and a scaling factor of Fs. **/ - public static function fft(input:Array):Array - return do_fft(input, false); + public static function fft(input:Array):Array return do_fft(input, false); /** Like `fft`, but for a real (Float) sequence input. @@ -41,8 +40,7 @@ class FFT from each other, the result will consist of N data points as sampled from a time signal at intervals of 1/Fs with a scaling factor of 1/Fs. **/ - public static function ifft(input:Array):Array - return do_fft(input, true); + public static function ifft(input:Array):Array return do_fft(input, true); // Handles padding and scaling for forwards and inverse FFTs. static function do_fft(input:Array, inverse:Bool):Array diff --git a/source/funkin/audio/visualize/dsp/OffsetArray.hx b/source/funkin/audio/visualize/dsp/OffsetArray.hx index a3a72d66e..3a391b583 100644 --- a/source/funkin/audio/visualize/dsp/OffsetArray.hx +++ b/source/funkin/audio/visualize/dsp/OffsetArray.hx @@ -12,35 +12,28 @@ abstract OffsetArray({ final offset:Int; }) { - public inline function new(array:Array, offset:Int) - this = {array: array, offset: offset}; + public inline function new(array:Array, offset:Int) this = {array: array, offset: offset}; public var length(get, never):Int; - inline function get_length() - return this.array.length; + inline function get_length() return this.array.length; @:arrayAccess - public inline function get(index:Int):T - return this.array[index - this.offset]; + public inline function get(index:Int):T return this.array[index - this.offset]; @:arrayAccess - public inline function set(index:Int, value:T):Void - this.array[index - this.offset] = value; + public inline function set(index:Int, value:T):Void this.array[index - this.offset] = value; /** Iterates through items in their original order while providing the altered indexes as keys. **/ - public inline function keyValueIterator():KeyValueIterator - return new OffsetArrayIterator(this.array, this.offset); + public inline function keyValueIterator():KeyValueIterator return new OffsetArrayIterator(this.array, this.offset); @:from - static inline function fromArray(array:Array) - return new OffsetArray(array, 0); + static inline function fromArray(array:Array) return new OffsetArray(array, 0); @:to - inline function toArray() - return this.array; + inline function toArray() return this.array; /** Makes a shifted version of the given `array`, where elements are in the @@ -76,12 +69,12 @@ private class OffsetArrayIterator this.enumeration = 0; } - public inline function next():{key:Int, value:T} + public inline function next(): + {key:Int, value:T} { final i = this.enumeration++; return {key: i + this.offset, value: this.array[i]}; } - public inline function hasNext():Bool - return this.enumeration < this.array.length; + public inline function hasNext():Bool return this.enumeration < this.array.length; } diff --git a/source/funkin/audio/visualize/dsp/Signal.hx b/source/funkin/audio/visualize/dsp/Signal.hx index 36abfb027..8a5a73a42 100644 --- a/source/funkin/audio/visualize/dsp/Signal.hx +++ b/source/funkin/audio/visualize/dsp/Signal.hx @@ -86,30 +86,25 @@ class Signal /** Returns the average value of an array. **/ - public static function mean(y:Array):Float - return sum(y) / y.length; + public static function mean(y:Array):Float return sum(y) / y.length; /** Returns the global maximum. **/ - public static function max(y:Array):Float - return y.fold(Math.max, y[0]); + public static function max(y:Array):Float return y.fold(Math.max, y[0]); /** Returns the global maximum's index. **/ - public static function maxi(y:Array):Int - return y.foldi((yi, m, i) -> yi > y[m] ? i : m, 0); + public static function maxi(y:Array):Int return y.foldi((yi, m, i) -> yi > y[m] ? i : m, 0); /** Returns the global minimum. **/ - public static function min(y:Array):Float - return y.fold(Math.min, y[0]); + public static function min(y:Array):Float return y.fold(Math.min, y[0]); /** Returns the global minimum's index. **/ - public static function mini(y:Array):Int - return y.foldi((yi, m, i) -> yi < y[m] ? i : m, 0); + public static function mini(y:Array):Int return y.foldi((yi, m, i) -> yi < y[m] ? i : m, 0); } diff --git a/source/funkin/data/BaseRegistry.hx b/source/funkin/data/BaseRegistry.hx index 05de05980..34cc8b9cf 100644 --- a/source/funkin/data/BaseRegistry.hx +++ b/source/funkin/data/BaseRegistry.hx @@ -109,7 +109,8 @@ abstract class BaseRegistry & Constructible = DataAssets.listDataFilesInPath('${dataFilePath}/'); - var unscriptedEntryIds:Array = entryIdList.filter(function(entryId:String):Bool { + var unscriptedEntryIds:Array = entryIdList.filter(function(entryId:String):Bool + { return !entries.exists(entryId); }); log(' INFO '.info() + 'Parsing ${unscriptedEntryIds.length} unscripted entries...'); diff --git a/source/funkin/data/DataParse.hx b/source/funkin/data/DataParse.hx index 76da93e3b..98003fb7f 100644 --- a/source/funkin/data/DataParse.hx +++ b/source/funkin/data/DataParse.hx @@ -243,11 +243,10 @@ class DataParse switch (json.value) { case JObject(fields): - var result:LegacyNoteSection = - { - mustHitSection: false, - sectionNotes: [], - }; + var result:LegacyNoteSection = { + mustHitSection: false, + sectionNotes: [], + }; for (field in fields) { switch (field.name) diff --git a/source/funkin/data/DefaultRegistryImpl.hx b/source/funkin/data/DefaultRegistryImpl.hx index f7c137fbb..ead66c5bd 100644 --- a/source/funkin/data/DefaultRegistryImpl.hx +++ b/source/funkin/data/DefaultRegistryImpl.hx @@ -6,4 +6,6 @@ package funkin.data; * @see `funkin.data.BaseRegistry` */ @:autoBuild(funkin.util.macro.RegistryMacro.buildRegistry()) -interface DefaultRegistryImpl {} +interface DefaultRegistryImpl +{ +} diff --git a/source/funkin/data/character/CharacterData.hx b/source/funkin/data/character/CharacterData.hx index 7fe7547f8..339edc6de 100644 --- a/source/funkin/data/character/CharacterData.hx +++ b/source/funkin/data/character/CharacterData.hx @@ -57,7 +57,8 @@ class CharacterDataParser // UNSCRIPTED CHARACTERS // var charIdList:Array = DataAssets.listDataFilesInPath('characters/'); - var unscriptedCharIds:Array = charIdList.filter(function(charId:String):Bool { + var unscriptedCharIds:Array = charIdList.filter(function(charId:String):Bool + { return !characterCache.exists(charId); }); log('Fetching data for ${unscriptedCharIds.length} characters...'); @@ -188,7 +189,8 @@ class CharacterDataParser // NOTE: Only instantiate the ones not populated above. // ScriptedBaseCharacter.listScriptClasses() will pick up scripts extending the other classes. var scriptedCharClassNames:Array = ScriptedBaseCharacter.listScriptClasses(); - scriptedCharClassNames = scriptedCharClassNames.filter(function(charCls:String):Bool { + scriptedCharClassNames = scriptedCharClassNames.filter(function(charCls:String):Bool + { return !(scriptedCharClassNames1.contains(charCls) || scriptedCharClassNames2.contains(charCls) || scriptedCharClassNames3.contains(charCls) @@ -353,7 +355,8 @@ class CharacterDataParser { var frames = Paths.getSparrowAtlas(charPath); - var idleFrame:Null = frames.frames.find(function(frame:FlxFrame):Bool { + var idleFrame:Null = frames.frames.find(function(frame:FlxFrame):Bool + { return frame.name.startsWith('idle'); }); @@ -463,14 +466,13 @@ class CharacterDataParser public static final DEFAULT_STARTINGANIM:String = 'idle'; public static final DEFAULT_APPLYSTAGEMATRIX:Bool = false; public static final DEFAULT_ANIMTYPE:String = "framelabel"; - public static final DEFAULT_ATLASSETTINGS:funkin.data.stage.StageData.TextureAtlasData = - { - swfMode: true, - cacheOnLoad: false, - filterQuality: 1, - applyStageMatrix: false, - useRenderTexture: false - }; + public static final DEFAULT_ATLASSETTINGS:funkin.data.stage.StageData.TextureAtlasData = { + swfMode: true, + cacheOnLoad: false, + filterQuality: 1, + applyStageMatrix: false, + useRenderTexture: false + }; /** * Set unspecified parameters to their defaults. @@ -528,14 +530,13 @@ class CharacterDataParser if (input.healthIcon == null) { - input.healthIcon = - { - id: null, - scale: null, - flipX: null, - isPixel: null, - offsets: null - }; + input.healthIcon = { + id: null, + scale: null, + flipX: null, + isPixel: null, + offsets: null + }; } if (input.healthIcon.id == null) diff --git a/source/funkin/data/dialogue/SpeakerRegistry.hx b/source/funkin/data/dialogue/SpeakerRegistry.hx index 892432cc7..0e8aadf44 100644 --- a/source/funkin/data/dialogue/SpeakerRegistry.hx +++ b/source/funkin/data/dialogue/SpeakerRegistry.hx @@ -23,4 +23,6 @@ class SpeakerRegistry extends BaseRegistry, currentTime:Float):Array { - var result:Array = events.filter(function(event:SongEventData):Bool { + var result:Array = events.filter(function(event:SongEventData):Bool + { // If the event is already activated, don't activate it again. if (event.activated) return false; diff --git a/source/funkin/data/freeplay/album/AlbumRegistry.hx b/source/funkin/data/freeplay/album/AlbumRegistry.hx index 58218ca82..30c8c59c2 100644 --- a/source/funkin/data/freeplay/album/AlbumRegistry.hx +++ b/source/funkin/data/freeplay/album/AlbumRegistry.hx @@ -24,4 +24,6 @@ class AlbumRegistry extends BaseRegistry imp } } -typedef AlbumEntryParams = {} +typedef AlbumEntryParams = +{ +} diff --git a/source/funkin/data/freeplay/player/PlayerData.hx b/source/funkin/data/freeplay/player/PlayerData.hx index 9401a2822..d85eab9d2 100644 --- a/source/funkin/data/freeplay/player/PlayerData.hx +++ b/source/funkin/data/freeplay/player/PlayerData.hx @@ -169,11 +169,9 @@ class PlayerFreeplayDJData } } - public inline function getAssetPath():String - return assetPath; // return assetPath; + public inline function getAssetPath():String return assetPath; // return assetPath; - public inline function getAnimationsList():Array - return animations; + public inline function getAnimationsList():Array return animations; public function useApplyStageMatrix():Bool { diff --git a/source/funkin/data/freeplay/player/PlayerRegistry.hx b/source/funkin/data/freeplay/player/PlayerRegistry.hx index 0b1830f03..2a85fa7e7 100644 --- a/source/funkin/data/freeplay/player/PlayerRegistry.hx +++ b/source/funkin/data/freeplay/player/PlayerRegistry.hx @@ -148,4 +148,6 @@ class PlayerRegistry extends BaseRegistry public function valueAsStruct(?defaultKey:String = "key"):Dynamic { - if (this.value == null) return {}; + if (this.value == null) return + { + }; if (Std.isOfType(this.value, Array)) { var result:haxe.DynamicAccess = {}; diff --git a/source/funkin/data/song/SongDataUtils.hx b/source/funkin/data/song/SongDataUtils.hx index a2c348fbc..7380845f8 100644 --- a/source/funkin/data/song/SongDataUtils.hx +++ b/source/funkin/data/song/SongDataUtils.hx @@ -24,7 +24,8 @@ class SongDataUtils */ public static function offsetSongNoteData(notes:Array, offset:Float):Array { - var offsetNote = function(note:SongNoteData):SongNoteData { + var offsetNote = function(note:SongNoteData):SongNoteData + { var time:Float = note.time + offset; var data:Int = note.data; var length:Float = note.length; @@ -46,7 +47,8 @@ class SongDataUtils */ public static function offsetSongEventData(events:Array, offset:Float):Array { - return events.map(function(event:SongEventData):SongEventData { + return events.map(function(event:SongEventData):SongEventData + { return new SongEventData(event.time + offset, event.eventKind, event.value); }); } @@ -61,7 +63,8 @@ class SongDataUtils */ public static function clampSongNoteData(notes:Array, startTime:Float, endTime:Float):Array { - return notes.filter(function(note:SongNoteData):Bool { + return notes.filter(function(note:SongNoteData):Bool + { return note.time >= startTime && note.time <= endTime; }); } @@ -76,7 +79,8 @@ class SongDataUtils */ public static function clampSongEventData(events:Array, startTime:Float, endTime:Float):Array { - return events.filter(function(event:SongEventData):Bool { + return events.filter(function(event:SongEventData):Bool + { return event.time >= startTime && event.time <= endTime; }); } @@ -92,7 +96,8 @@ class SongDataUtils { if (notes.length == 0 || subtrahend.length == 0) return notes; - var result = notes.filter(function(note:SongNoteData):Bool { + var result = notes.filter(function(note:SongNoteData):Bool + { for (x in subtrahend) { // The currently iterated note is in the subtrahend array. @@ -117,7 +122,8 @@ class SongDataUtils { if (events.length == 0 || subtrahend.length == 0) return events; - return events.filter(function(event:SongEventData):Bool { + return events.filter(function(event:SongEventData):Bool + { for (x in subtrahend) { // The currently iterated event is in the subtrahend array. @@ -134,7 +140,8 @@ class SongDataUtils */ public static function flipNotes(notes:Array, strumlineSize:Int = 4):Array { - return notes.map(function(note:SongNoteData):SongNoteData { + return notes.map(function(note:SongNoteData):SongNoteData + { var newData = note.data; if (newData < strumlineSize) newData += strumlineSize; @@ -156,7 +163,6 @@ class SongDataUtils public static function mirrorNotes(notes:Array, strumlineSize:Int = 4, flip:Bool = false, mirrorX:Bool = true, mirrorY:Bool = true):Array { - var minTime = notes[0].time; var maxTime = notes[0].time; var minStrumline = notes[0].data; @@ -182,7 +188,8 @@ class SongDataUtils notes = flipNotes(notes); } - return notes.map(function(note:SongNoteData):SongNoteData { + return notes.map(function(note:SongNoteData):SongNoteData + { var newData = note.data; var newTime = note.time; @@ -232,7 +239,8 @@ class SongDataUtils public static function sortNotes(notes:Array, desc:Bool = false):Array { // TODO: Modifies the array in place. Is this okay? - notes.sort(function(a:SongNoteData, b:SongNoteData):Int { + notes.sort(function(a:SongNoteData, b:SongNoteData):Int + { return FlxSort.byValues(desc ? FlxSort.DESCENDING : FlxSort.ASCENDING, a.time, b.time); }); return notes; @@ -244,7 +252,8 @@ class SongDataUtils public static function sortEvents(events:Array, desc:Bool = false):Array { // TODO: Modifies the array in place. Is this okay? - events.sort(function(a:SongEventData, b:SongEventData):Int { + events.sort(function(a:SongEventData, b:SongEventData):Int + { return FlxSort.byValues(desc ? FlxSort.DESCENDING : FlxSort.ASCENDING, a.time, b.time); }); return events; @@ -256,7 +265,8 @@ class SongDataUtils public static function sortTimeChanges(timeChanges:Array, desc:Bool = false):Array { // TODO: Modifies the array in place. Is this okay? - timeChanges.sort(function(a:SongTimeChange, b:SongTimeChange):Int { + timeChanges.sort(function(a:SongTimeChange, b:SongTimeChange):Int + { return FlxSort.byValues(desc ? FlxSort.DESCENDING : FlxSort.ASCENDING, a.timeStamp, b.timeStamp); }); return timeChanges; @@ -313,7 +323,8 @@ class SongDataUtils */ public static function getNotesInTimeRange(notes:Array, start:Float, end:Float):Array { - return notes.filter(function(note:SongNoteData):Bool { + return notes.filter(function(note:SongNoteData):Bool + { return note.time >= start && note.time <= end; }); } @@ -323,7 +334,8 @@ class SongDataUtils */ public static function getEventsInTimeRange(events:Array, start:Float, end:Float):Array { - return events.filter(function(event:SongEventData):Bool { + return events.filter(function(event:SongEventData):Bool + { return event.time >= start && event.time <= end; }); } @@ -333,7 +345,8 @@ class SongDataUtils */ public static function getNotesInDataRange(notes:Array, start:Int, end:Int):Array { - return notes.filter(function(note:SongNoteData):Bool { + return notes.filter(function(note:SongNoteData):Bool + { return note.data >= start && note.data <= end; }); } @@ -343,7 +356,8 @@ class SongDataUtils */ public static function getNotesWithData(notes:Array, data:Array):Array { - return notes.filter(function(note:SongNoteData):Bool { + return notes.filter(function(note:SongNoteData):Bool + { return data.indexOf(note.data) != -1; }); } @@ -353,7 +367,8 @@ class SongDataUtils */ public static function getEventsWithKind(events:Array, kinds:Array):Array { - return events.filter(function(event:SongEventData):Bool { + return events.filter(function(event:SongEventData):Bool + { return kinds.indexOf(event.eventKind) != -1; }); } diff --git a/source/funkin/data/song/SongRegistry.hx b/source/funkin/data/song/SongRegistry.hx index 18570aa70..49d39711e 100644 --- a/source/funkin/data/song/SongRegistry.hx +++ b/source/funkin/data/song/SongRegistry.hx @@ -85,10 +85,12 @@ using funkin.data.song.migrator.SongDataMigrator; // // UNSCRIPTED ENTRIES // - var entryIdList:Array = DataAssets.listDataFilesInPath('songs/', '-metadata.json').map(function(songDataPath:String):String { + var entryIdList:Array = DataAssets.listDataFilesInPath('songs/', '-metadata.json').map(function(songDataPath:String):String + { return songDataPath.split('/')[0]; }); - var unscriptedEntryIds:Array = entryIdList.filter(function(entryId:String):Bool { + var unscriptedEntryIds:Array = entryIdList.filter(function(entryId:String):Bool + { return !entries.exists(entryId); }); log('Parsing ${unscriptedEntryIds.length} unscripted entries...'); diff --git a/source/funkin/data/song/importer/FNFLegacyData.hx b/source/funkin/data/song/importer/FNFLegacyData.hx index 3e05f8deb..a2426a656 100644 --- a/source/funkin/data/song/importer/FNFLegacyData.hx +++ b/source/funkin/data/song/importer/FNFLegacyData.hx @@ -27,7 +27,9 @@ class LegacySongData public var notes:Either, LegacyNoteData>; public var song:String; // Song name - public function new() {} + public function new() + { + } public function toString():String { diff --git a/source/funkin/data/song/importer/OsuManiaImporter.hx b/source/funkin/data/song/importer/OsuManiaImporter.hx index b25c53eb4..ad9391e7b 100644 --- a/source/funkin/data/song/importer/OsuManiaImporter.hx +++ b/source/funkin/data/song/importer/OsuManiaImporter.hx @@ -31,7 +31,8 @@ class OsuManiaImporter currentSection = sectionRegex.matched(1); if (nonCSVLikeSections.contains(currentSection)) { - Reflect.setField(result, currentSection, {}); + Reflect.setField(result, currentSection, { + }); } else { @@ -46,7 +47,8 @@ class OsuManiaImporter var parts:Array = line.split(":"); var key:String = StringTools.trim(parts.shift()); var value:String = StringTools.trim(parts.join(":")); - if (Reflect.field(result, currentSection) == null) Reflect.setField(result, currentSection, {}); + if (Reflect.field(result, currentSection) == null) Reflect.setField(result, currentSection, { + }); Reflect.setField(Reflect.field(result, currentSection), key, value); } // For CSV-like sections @@ -163,7 +165,8 @@ class OsuManiaImporter static function parseTimingPoints(timingLines:Array):Array { - return timingLines.map(function(line:String):TimingPoint { + return timingLines.map(function(line:String):TimingPoint + { var parts = line.split(","); var time = Std.parseFloat(parts[0]); var beatLength = Std.parseFloat(parts[1]); @@ -180,7 +183,8 @@ class OsuManiaImporter static function parseManiaHitObjects(hitObjectsLines:Array, ?columns:Int = 4):Array { - return hitObjectsLines.map(function(line:String):ManiaHitObject { + return hitObjectsLines.map(function(line:String):ManiaHitObject + { var parts = line.split(","); var x:Int = Std.parseInt(parts[0]); diff --git a/source/funkin/data/song/importer/StepManiaData.hx b/source/funkin/data/song/importer/StepManiaData.hx index 4ce0e115d..f04a52af2 100644 --- a/source/funkin/data/song/importer/StepManiaData.hx +++ b/source/funkin/data/song/importer/StepManiaData.hx @@ -10,7 +10,6 @@ typedef StepManiaData = var Credit:String; var Banner:String; var Background:String; - var Offset:Float; var SampleStart:Float; }; @@ -19,13 +18,15 @@ typedef StepManiaData = var Difficulties:Array; } -enum StepManiaChartType { +enum StepManiaChartType +{ DanceSingle; DanceDouble; Unknown; } -enum StepManiaNoteType { +enum StepManiaNoteType +{ Tap; Head; Tail; @@ -44,7 +45,8 @@ class StepNote { this.beat = beat; this.column = column; - switch (t) { + switch (t) + { case "2": this.type = StepManiaNoteType.Head; case "3": @@ -72,7 +74,8 @@ class StepDifficulty public function parseChartType(chartTypeStr:String):StepManiaChartType { - switch (chartTypeStr) { + switch (chartTypeStr) + { case "dance-single": return StepManiaChartType.DanceSingle; case "dance-double": diff --git a/source/funkin/data/song/importer/StepManiaImporter.hx b/source/funkin/data/song/importer/StepManiaImporter.hx index 45f60a766..65eb5f934 100644 --- a/source/funkin/data/song/importer/StepManiaImporter.hx +++ b/source/funkin/data/song/importer/StepManiaImporter.hx @@ -5,7 +5,6 @@ import funkin.data.song.SongData.SongChartData; import funkin.data.song.SongData.SongCharacterData; import funkin.data.song.SongData.SongNoteData; import funkin.data.song.SongData.SongTimeChange; - import funkin.data.song.importer.StepManiaData.StepTimingPoint; import funkin.data.song.importer.StepManiaData.StepDifficulty; import funkin.data.song.importer.StepManiaData.StepManiaChartType; @@ -223,7 +222,6 @@ class StepManiaImporter tp.endTimestamp = tp.startTimestamp; tpIndex++; } - } } else @@ -324,7 +322,7 @@ class StepManiaImporter SampleStart: 0 }, TimingPoints: [], - Stops: [], + Stops: [], Difficulties: [] }; @@ -430,7 +428,6 @@ class StepManiaImporter measure.push(line); } } - } if (workingDiff != null && workingDiff.notes.length > 0) @@ -484,8 +481,8 @@ class StepManiaImporter return (time * 1000) - (offset * 1000); // convert to ms } - static function convertStepNotes(offset:Float, type:StepManiaChartType, stepNotes:Array, - stepTimingPoints:Array, stepStops:Array):Array + static function convertStepNotes(offset:Float, type:StepManiaChartType, stepNotes:Array, stepTimingPoints:Array, + stepStops:Array):Array { var result:Array = []; var holdArray:Array = []; @@ -539,7 +536,6 @@ class StepManiaImporter result.push(snd); } return result; - } /** @@ -592,7 +588,8 @@ class StepManiaImporter * @param songData The StepManiaData to migrate. * @return SongChartData The migrated SongChartData. */ - public static function migrateChartData(songData:StepManiaData):SongChartData { + public static function migrateChartData(songData:StepManiaData):SongChartData + { var scrollsMap:Map = new Map(); var stepNoteMap:Map> = new Map>(); diff --git a/source/funkin/data/song/migrator/SongData_v2_0_0.hx b/source/funkin/data/song/migrator/SongData_v2_0_0.hx index 751ba4a52..29a08f03d 100644 --- a/source/funkin/data/song/migrator/SongData_v2_0_0.hx +++ b/source/funkin/data/song/migrator/SongData_v2_0_0.hx @@ -49,7 +49,9 @@ class SongMetadata_v2_0_0 public var timeChanges:Array; - public function new() {} + public function new() + { + } /** * Produces a string representation suitable for debugging. @@ -88,7 +90,9 @@ class SongPlayData_v2_0_0 public var stage:String; - public function new() {} + public function new() + { + } /** * Produces a string representation suitable for debugging. diff --git a/source/funkin/data/song/migrator/SongData_v2_1_0.hx b/source/funkin/data/song/migrator/SongData_v2_1_0.hx index 1a61184ed..68fd9be6d 100644 --- a/source/funkin/data/song/migrator/SongData_v2_1_0.hx +++ b/source/funkin/data/song/migrator/SongData_v2_1_0.hx @@ -100,7 +100,9 @@ class SongPlayData_v2_1_0 public var characters:SongData.SongCharacterData; public var stage:String; - public function new() {} + public function new() + { + } /** * Produces a string representation suitable for debugging. diff --git a/source/funkin/data/stage/StageData.hx b/source/funkin/data/stage/StageData.hx index 118fbc780..c41052f94 100644 --- a/source/funkin/data/stage/StageData.hx +++ b/source/funkin/data/stage/StageData.hx @@ -33,27 +33,24 @@ class StageData function makeDefaultCharacters():StageDataCharacters { return { - bf: - { - zIndex: 0, - scale: 1, - position: [0, 0], - cameraOffsets: [-100, -100] - }, - dad: - { - zIndex: 0, - scale: 1, - position: [0, 0], - cameraOffsets: [100, -100] - }, - gf: - { - zIndex: 0, - scale: 1, - position: [0, 0], - cameraOffsets: [0, 0] - } + bf: { + zIndex: 0, + scale: 1, + position: [0, 0], + cameraOffsets: [-100, -100] + }, + dad: { + zIndex: 0, + scale: 1, + position: [0, 0], + cameraOffsets: [100, -100] + }, + gf: { + zIndex: 0, + scale: 1, + position: [0, 0], + cameraOffsets: [0, 0] + } }; } diff --git a/source/funkin/data/stage/StageRegistry.hx b/source/funkin/data/stage/StageRegistry.hx index 23097a3a5..954e2dd57 100644 --- a/source/funkin/data/stage/StageRegistry.hx +++ b/source/funkin/data/stage/StageRegistry.hx @@ -23,4 +23,6 @@ class StageRegistry extends BaseRegistry imp } } -typedef StageEntryParams = {} +typedef StageEntryParams = +{ +} diff --git a/source/funkin/data/stickers/StickerRegistry.hx b/source/funkin/data/stickers/StickerRegistry.hx index d2dbd394f..4cf20116f 100644 --- a/source/funkin/data/stickers/StickerRegistry.hx +++ b/source/funkin/data/stickers/StickerRegistry.hx @@ -91,4 +91,6 @@ class StickerRegistry extends BaseRegistry imp { // This MUST be hard-coded (overriding the auto-generated method) // because the auto-generated method spits out values in alphabetical order. - return [ - 'tutorial', - 'week1', - 'week2', - 'week3', - 'week4', - 'week5', - 'week6', - 'week7', - 'weekend1', - 'sserafim' - ]; + return ['tutorial', 'week1', 'week2', 'week3', 'week4', 'week5', 'week6', 'week7', 'weekend1', 'sserafim']; } /** @@ -58,4 +47,6 @@ class LevelRegistry extends BaseRegistry imp } } -typedef LevelEntryParams = {} +typedef LevelEntryParams = +{ +} diff --git a/source/funkin/effects/IntervalShake.hx b/source/funkin/effects/IntervalShake.hx index 545739cc3..49c835ce9 100644 --- a/source/funkin/effects/IntervalShake.hx +++ b/source/funkin/effects/IntervalShake.hx @@ -236,5 +236,7 @@ class IntervalShake implements IFlxDestroyable * Internal constructor. Use static methods. */ @:keep - function new() {} + function new() + { + } } diff --git a/source/funkin/effects/RetroCameraFade.hx b/source/funkin/effects/RetroCameraFade.hx index ef65eef4c..7113f0a76 100644 --- a/source/funkin/effects/RetroCameraFade.hx +++ b/source/funkin/effects/RetroCameraFade.hx @@ -14,7 +14,8 @@ class RetroCameraFade var steps:Int = 0; var stepsTotal:Int = camSteps; - new FlxTimer().start(time / stepsTotal, _ -> { + new FlxTimer().start(time / stepsTotal, _ -> + { var V:Float = (1 / stepsTotal) * steps; if (steps == stepsTotal) V = 1; @@ -42,7 +43,8 @@ class RetroCameraFade ]; camera.filters = [new ColorMatrixFilter(matrixDerp)]; - new FlxTimer().start(time / stepsTotal, _ -> { + new FlxTimer().start(time / stepsTotal, _ -> + { var V:Float = (1 / stepsTotal) * steps; if (steps == stepsTotal) V = 1; @@ -62,7 +64,8 @@ class RetroCameraFade var steps:Int = 0; var stepsTotal:Int = camSteps; - new FlxTimer().start(time / stepsTotal, _ -> { + new FlxTimer().start(time / stepsTotal, _ -> + { var V:Float = (1 / stepsTotal) * steps; if (steps == stepsTotal) V = 1; @@ -90,7 +93,8 @@ class RetroCameraFade ]; camera.filters = [new ColorMatrixFilter(matrixDerp)]; - new FlxTimer().start(time / stepsTotal, _ -> { + new FlxTimer().start(time / stepsTotal, _ -> + { var V:Float = (1 / stepsTotal) * steps; if (steps == stepsTotal) V = 1; diff --git a/source/funkin/external/android/CallbackUtil.hx b/source/funkin/external/android/CallbackUtil.hx index 9b14243ee..c81972ed8 100644 --- a/source/funkin/external/android/CallbackUtil.hx +++ b/source/funkin/external/android/CallbackUtil.hx @@ -66,7 +66,9 @@ class CallbackUtil #if (lime >= "8.0.0") implements JNISafety #end } @:noCompletion - private function new() {} + private function new() + { + } @:noCompletion @:keep diff --git a/source/funkin/graphics/FunkinCamera.hx b/source/funkin/graphics/FunkinCamera.hx index ee4c11216..447bda99b 100644 --- a/source/funkin/graphics/FunkinCamera.hx +++ b/source/funkin/graphics/FunkinCamera.hx @@ -72,21 +72,7 @@ class FunkinCamera extends FlxCamera * - `LIGHTEN` is supported natively on desktop, but not other platforms. * - While `DARKEN` is supported natively on desktop, it causes issues with transparency. */ - static final KHR_BLEND_MODES:Array = [ - DARKEN, - HARDLIGHT, - #if !desktop LIGHTEN, #end - OVERLAY, - DIFFERENCE, - COLORDODGE, - COLORBURN, - SOFTLIGHT, - EXCLUSION, - HUE, - SATURATION, - COLOR, - LUMINOSITY - ]; + static final KHR_BLEND_MODES:Array = [DARKEN, HARDLIGHT, #if !desktop LIGHTEN, #end OVERLAY, DIFFERENCE, COLORDODGE, COLORBURN, SOFTLIGHT, EXCLUSION, HUE, SATURATION, COLOR, LUMINOSITY]; /** * A list of blend modes that require the shader no matter what. @@ -179,7 +165,8 @@ class FunkinCamera extends FlxCamera this.canvas.graphics.clear(); _blendRenderTexture.init(this.width, this.height); - _blendRenderTexture.drawToCamera((camera, frameMatrix) -> { + _blendRenderTexture.drawToCamera((camera, frameMatrix) -> + { var pivotX:Float = width / 2; var pivotY:Float = height / 2; @@ -200,7 +187,8 @@ class FunkinCamera extends FlxCamera _backgroundFrame.parent.bitmap = _blendRenderTexture.graphic.bitmap; _backgroundRenderTexture.init(Std.int(this.width * Lib.current.stage.window.scale), Std.int(this.height * Lib.current.stage.window.scale)); - _backgroundRenderTexture.drawToCamera((camera, matrix) -> { + _backgroundRenderTexture.drawToCamera((camera, matrix) -> + { camera.zoom = this.zoom; matrix.scale(Lib.current.stage.window.scale, Lib.current.stage.window.scale); camera.drawPixels(_backgroundFrame, null, matrix, canvas.transform.colorTransform, null, false, _blendShader); diff --git a/source/funkin/graphics/FunkinSprite.hx b/source/funkin/graphics/FunkinSprite.hx index 82d8806b2..4a7a1e210 100644 --- a/source/funkin/graphics/FunkinSprite.hx +++ b/source/funkin/graphics/FunkinSprite.hx @@ -256,7 +256,8 @@ class FunkinSprite extends FlxAnimate trace('[ASYNC] Start loading image (${key})'); graphic.persist = true; openfl.Assets.loadBitmapData(key) - .onComplete(function(bitmapData:openfl.display.BitmapData) { + .onComplete(function(bitmapData:openfl.display.BitmapData) + { trace('[ASYNC] Finished loading image'); var cache:Bool = false; loadBitmapData(bitmapData, cache); @@ -267,7 +268,8 @@ class FunkinSprite extends FlxAnimate FlxTween.tween(this, {alpha: 1.0}, 0.25); } }) - .onError(function(error:Dynamic) { + .onError(function(error:Dynamic) + { trace('[ASYNC] Failed to load image: ${error}'); if (fadeTween != null) { @@ -275,7 +277,8 @@ class FunkinSprite extends FlxAnimate this.alpha = 1.0; } }) - .onProgress(function(progress:Int, total:Int) { + .onProgress(function(progress:Int, total:Int) + { trace('[ASYNC] Loading image progress: ${progress}/${total}'); }); } @@ -462,8 +465,10 @@ class FunkinSprite extends FlxAnimate for (symbolItem in symbolItems) { - symbolItem.timeline.forEachLayer((layer) -> { - layer.forEachFrame((frame) -> { + symbolItem.timeline.forEachLayer((layer) -> + { + layer.forEachFrame((frame) -> + { frames.push(frame); }); }); diff --git a/source/funkin/graphics/ScriptedFunkinSprite.hx b/source/funkin/graphics/ScriptedFunkinSprite.hx index 274859384..3dc6fc9f9 100644 --- a/source/funkin/graphics/ScriptedFunkinSprite.hx +++ b/source/funkin/graphics/ScriptedFunkinSprite.hx @@ -5,4 +5,6 @@ package funkin.graphics; * Create a scripted class that extends FunkinSprite to use this. */ @:hscriptClass -class ScriptedFunkinSprite extends funkin.graphics.FunkinSprite implements polymod.hscript.HScriptedClass {} +class ScriptedFunkinSprite extends funkin.graphics.FunkinSprite implements polymod.hscript.HScriptedClass +{ +} diff --git a/source/funkin/graphics/shaders/DropShadowShader.hx b/source/funkin/graphics/shaders/DropShadowShader.hx index e3d0d9b7d..8e58d269c 100644 --- a/source/funkin/graphics/shaders/DropShadowShader.hx +++ b/source/funkin/graphics/shaders/DropShadowShader.hx @@ -217,7 +217,8 @@ class DropShadowShader extends FlxShader public function loadAltMask(path:String):Void { #if html5 - BitmapData.loadFromFile(path).onComplete(function(bmp:BitmapData) { + BitmapData.loadFromFile(path).onComplete(function(bmp:BitmapData) + { altMaskImage = bmp; }); #else diff --git a/source/funkin/graphics/shaders/RuntimeRainShader.hx b/source/funkin/graphics/shaders/RuntimeRainShader.hx index aab6807f6..4c212314a 100644 --- a/source/funkin/graphics/shaders/RuntimeRainShader.hx +++ b/source/funkin/graphics/shaders/RuntimeRainShader.hx @@ -133,14 +133,12 @@ class RuntimeRainShader extends RuntimePostEffectShader super.__processGLData(source, storageType); if (storageType == 'uniform') { - lights = [ - for (i in 0...MAX_LIGHTS) - { - position: addFloatUniform('lights[$i].position', 2), - color: addFloatUniform('lights[$i].color', 3), - radius: addFloatUniform('lights[$i].radius', 1), - } - ]; + lights = [for (i in 0...MAX_LIGHTS) + { + position: addFloatUniform('lights[$i].position', 2), + color: addFloatUniform('lights[$i].color', 3), + radius: addFloatUniform('lights[$i].radius', 1), + }]; } } diff --git a/source/funkin/graphics/shaders/TextureSwap.hx b/source/funkin/graphics/shaders/TextureSwap.hx index e5f5ea8d1..08b867bb9 100644 --- a/source/funkin/graphics/shaders/TextureSwap.hx +++ b/source/funkin/graphics/shaders/TextureSwap.hx @@ -11,7 +11,8 @@ class TextureSwap extends FlxShader public function loadSwapImage(path:String) { #if html5 - BitmapData.loadFromFile(path).onComplete(function(bmp:BitmapData) { + BitmapData.loadFromFile(path).onComplete(function(bmp:BitmapData) + { swappedImage = bmp; }); #else diff --git a/source/funkin/graphics/video/FunkinVideoSprite.hx b/source/funkin/graphics/video/FunkinVideoSprite.hx index 2e0f04ccf..c6eac4c95 100644 --- a/source/funkin/graphics/video/FunkinVideoSprite.hx +++ b/source/funkin/graphics/video/FunkinVideoSprite.hx @@ -16,7 +16,8 @@ class FunkinVideoSprite extends FlxVideoSprite if (bitmap != null) { - bitmap.onOpening.add(function():Void { + bitmap.onOpening.add(function():Void + { if (bitmap != null) { if (PlayState.instance != null) diff --git a/source/funkin/graphics/video/ScriptedFunkinVideoSprite.hx b/source/funkin/graphics/video/ScriptedFunkinVideoSprite.hx index b084d4b9a..eab195338 100644 --- a/source/funkin/graphics/video/ScriptedFunkinVideoSprite.hx +++ b/source/funkin/graphics/video/ScriptedFunkinVideoSprite.hx @@ -6,5 +6,7 @@ package funkin.graphics.video; */ #if hxvlc @:hscriptClass -class ScriptedFunkinVideoSprite extends funkin.graphics.video.FunkinVideoSprite implements polymod.hscript.HScriptedClass {} +class ScriptedFunkinVideoSprite extends funkin.graphics.video.FunkinVideoSprite implements polymod.hscript.HScriptedClass +{ +} #end diff --git a/source/funkin/input/Controls.hx b/source/funkin/input/Controls.hx index 3ea47e061..fb89f19e1 100644 --- a/source/funkin/input/Controls.hx +++ b/source/funkin/input/Controls.hx @@ -69,271 +69,219 @@ class Controls extends FlxActionSet public var UI_UP(get, never):Bool; - inline function get_UI_UP() - return _ui_up.checkPressed(); + inline function get_UI_UP() return _ui_up.checkPressed(); public var UI_LEFT(get, never):Bool; - inline function get_UI_LEFT() - return _ui_left.checkPressed(); + inline function get_UI_LEFT() return _ui_left.checkPressed(); public var UI_RIGHT(get, never):Bool; - inline function get_UI_RIGHT() - return _ui_right.checkPressed(); + inline function get_UI_RIGHT() return _ui_right.checkPressed(); public var UI_DOWN(get, never):Bool; - inline function get_UI_DOWN() - return _ui_down.checkPressed(); + inline function get_UI_DOWN() return _ui_down.checkPressed(); public var UI_UP_P(get, never):Bool; - inline function get_UI_UP_P() - return _ui_up.checkJustPressed(); + inline function get_UI_UP_P() return _ui_up.checkJustPressed(); public var UI_LEFT_P(get, never):Bool; - inline function get_UI_LEFT_P() - return _ui_left.checkJustPressed(); + inline function get_UI_LEFT_P() return _ui_left.checkJustPressed(); public var UI_RIGHT_P(get, never):Bool; - inline function get_UI_RIGHT_P() - return _ui_right.checkJustPressed(); + inline function get_UI_RIGHT_P() return _ui_right.checkJustPressed(); public var UI_DOWN_P(get, never):Bool; - inline function get_UI_DOWN_P() - return _ui_down.checkJustPressed(); + inline function get_UI_DOWN_P() return _ui_down.checkJustPressed(); public var UI_UP_R(get, never):Bool; - inline function get_UI_UP_R() - return _ui_up.checkJustReleased(); + inline function get_UI_UP_R() return _ui_up.checkJustReleased(); public var UI_LEFT_R(get, never):Bool; - inline function get_UI_LEFT_R() - return _ui_left.checkJustReleased(); + inline function get_UI_LEFT_R() return _ui_left.checkJustReleased(); public var UI_RIGHT_R(get, never):Bool; - inline function get_UI_RIGHT_R() - return _ui_right.checkJustReleased(); + inline function get_UI_RIGHT_R() return _ui_right.checkJustReleased(); public var UI_DOWN_R(get, never):Bool; - inline function get_UI_DOWN_R() - return _ui_down.checkJustReleased(); + inline function get_UI_DOWN_R() return _ui_down.checkJustReleased(); public var NOTE_UP(get, never):Bool; - inline function get_NOTE_UP() - return _note_up.checkPressed(); + inline function get_NOTE_UP() return _note_up.checkPressed(); public var NOTE_LEFT(get, never):Bool; - inline function get_NOTE_LEFT() - return _note_left.checkPressed(); + inline function get_NOTE_LEFT() return _note_left.checkPressed(); public var NOTE_RIGHT(get, never):Bool; - inline function get_NOTE_RIGHT() - return _note_right.checkPressed(); + inline function get_NOTE_RIGHT() return _note_right.checkPressed(); public var NOTE_DOWN(get, never):Bool; - inline function get_NOTE_DOWN() - return _note_down.checkPressed(); + inline function get_NOTE_DOWN() return _note_down.checkPressed(); public var NOTE_UP_P(get, never):Bool; - inline function get_NOTE_UP_P() - return _note_up.checkJustPressed(); + inline function get_NOTE_UP_P() return _note_up.checkJustPressed(); public var NOTE_LEFT_P(get, never):Bool; - inline function get_NOTE_LEFT_P() - return _note_left.checkJustPressed(); + inline function get_NOTE_LEFT_P() return _note_left.checkJustPressed(); public var NOTE_RIGHT_P(get, never):Bool; - inline function get_NOTE_RIGHT_P() - return _note_right.checkJustPressed(); + inline function get_NOTE_RIGHT_P() return _note_right.checkJustPressed(); public var NOTE_DOWN_P(get, never):Bool; - inline function get_NOTE_DOWN_P() - return _note_down.checkJustPressed(); + inline function get_NOTE_DOWN_P() return _note_down.checkJustPressed(); public var NOTE_UP_R(get, never):Bool; - inline function get_NOTE_UP_R() - return _note_up.checkJustReleased(); + inline function get_NOTE_UP_R() return _note_up.checkJustReleased(); public var NOTE_LEFT_R(get, never):Bool; - inline function get_NOTE_LEFT_R() - return _note_left.checkJustReleased(); + inline function get_NOTE_LEFT_R() return _note_left.checkJustReleased(); public var NOTE_RIGHT_R(get, never):Bool; - inline function get_NOTE_RIGHT_R() - return _note_right.checkJustReleased(); + inline function get_NOTE_RIGHT_R() return _note_right.checkJustReleased(); public var NOTE_DOWN_R(get, never):Bool; - inline function get_NOTE_DOWN_R() - return _note_down.checkJustReleased(); + inline function get_NOTE_DOWN_R() return _note_down.checkJustReleased(); public var ACCEPT(get, never):Bool; - inline function get_ACCEPT() - return _accept.checkPressed(); + inline function get_ACCEPT() return _accept.checkPressed(); public var ACCEPT_P(get, never):Bool; - inline function get_ACCEPT_P() - return _accept.checkJustPressed(); + inline function get_ACCEPT_P() return _accept.checkJustPressed(); public var ACCEPT_R(get, never):Bool; - inline function get_ACCEPT_R() - return _accept.checkJustReleased(); + inline function get_ACCEPT_R() return _accept.checkJustReleased(); public var BACK(get, never):Bool; - inline function get_BACK() - return _back.checkPressed(); + inline function get_BACK() return _back.checkPressed(); public var BACK_P(get, never):Bool; - inline function get_BACK_P() - return _back.checkJustPressed(); + inline function get_BACK_P() return _back.checkJustPressed(); public var BACK_R(get, never):Bool; - inline function get_BACK_R() - return _back.checkJustReleased(); + inline function get_BACK_R() return _back.checkJustReleased(); public var PAUSE(get, never):Bool; - inline function get_PAUSE() - return _pause.checkPressed(); + inline function get_PAUSE() return _pause.checkPressed(); public var PAUSE_P(get, never):Bool; - inline function get_PAUSE_P() - return _pause.checkJustPressed(); + inline function get_PAUSE_P() return _pause.checkJustPressed(); public var PAUSE_R(get, never):Bool; - inline function get_PAUSE_R() - return _pause.checkJustReleased(); + inline function get_PAUSE_R() return _pause.checkJustReleased(); public var RESET(get, never):Bool; - inline function get_RESET() - return _reset.checkPressed(); + inline function get_RESET() return _reset.checkPressed(); public var RESET_P(get, never):Bool; - inline function get_RESET_P() - return _reset.checkJustPressed(); + inline function get_RESET_P() return _reset.checkJustPressed(); public var RESET_R(get, never):Bool; - inline function get_RESET_R() - return _reset.checkJustReleased(); + inline function get_RESET_R() return _reset.checkJustReleased(); public var WINDOW_FULLSCREEN(get, never):Bool; - inline function get_WINDOW_FULLSCREEN() - return _window_fullscreen.check(); + inline function get_WINDOW_FULLSCREEN() return _window_fullscreen.check(); #if FEATURE_SCREENSHOTS public var WINDOW_SCREENSHOT(get, never):Bool; - inline function get_WINDOW_SCREENSHOT() - return _window_screenshot.check(); + inline function get_WINDOW_SCREENSHOT() return _window_screenshot.check(); #end public var FREEPLAY_FAVORITE(get, never):Bool; - inline function get_FREEPLAY_FAVORITE() - return _freeplay_favorite.check(); + inline function get_FREEPLAY_FAVORITE() return _freeplay_favorite.check(); public var FREEPLAY_LEFT(get, never):Bool; - inline function get_FREEPLAY_LEFT() - return _freeplay_left.check(); + inline function get_FREEPLAY_LEFT() return _freeplay_left.check(); public var FREEPLAY_RIGHT(get, never):Bool; - inline function get_FREEPLAY_RIGHT() - return _freeplay_right.check(); + inline function get_FREEPLAY_RIGHT() return _freeplay_right.check(); public var FREEPLAY_CHAR_SELECT(get, never):Bool; - inline function get_FREEPLAY_CHAR_SELECT() - return _freeplay_char_select.check(); + inline function get_FREEPLAY_CHAR_SELECT() return _freeplay_char_select.check(); public var FREEPLAY_JUMP_TO_TOP(get, never):Bool; - inline function get_FREEPLAY_JUMP_TO_TOP() - return _freeplay_jump_to_top.check(); + inline function get_FREEPLAY_JUMP_TO_TOP() return _freeplay_jump_to_top.check(); public var FREEPLAY_JUMP_TO_BOTTOM(get, never):Bool; - inline function get_FREEPLAY_JUMP_TO_BOTTOM() - return _freeplay_jump_to_bottom.check(); + inline function get_FREEPLAY_JUMP_TO_BOTTOM() return _freeplay_jump_to_bottom.check(); public var CUTSCENE_ADVANCE(get, never):Bool; - inline function get_CUTSCENE_ADVANCE() - return _cutscene_advance.check(); + inline function get_CUTSCENE_ADVANCE() return _cutscene_advance.check(); #if FEATURE_DEBUG_MENU public var DEBUG_MENU(get, never):Bool; - inline function get_DEBUG_MENU() - return _debug_menu.check(); + inline function get_DEBUG_MENU() return _debug_menu.check(); #end #if FEATURE_CHART_EDITOR public var DEBUG_CHART(get, never):Bool; - inline function get_DEBUG_CHART() - return _debug_chart.check(); + inline function get_DEBUG_CHART() return _debug_chart.check(); #end #if FEATURE_STAGE_EDITOR public var DEBUG_STAGE(get, never):Bool; - inline function get_DEBUG_STAGE() - return _debug_stage.check(); + inline function get_DEBUG_STAGE() return _debug_stage.check(); #end public var DEBUG_DISPLAY(get, never):Bool; - inline function get_DEBUG_DISPLAY() - return _debug_display.check(); + inline function get_DEBUG_DISPLAY() return _debug_display.check(); public var VOLUME_UP(get, never):Bool; - inline function get_VOLUME_UP() - return _volume_up.check(); + inline function get_VOLUME_UP() return _volume_up.check(); public var VOLUME_DOWN(get, never):Bool; - inline function get_VOLUME_DOWN() - return _volume_down.check(); + inline function get_VOLUME_DOWN() return _volume_down.check(); public var VOLUME_MUTE(get, never):Bool; - inline function get_VOLUME_MUTE() - return _volume_mute.check(); + inline function get_VOLUME_MUTE() return _volume_mute.check(); public function new(name, ?scheme:KeyboardScheme) { @@ -976,44 +924,8 @@ class Controls extends FlxActionSet public function addDefaultGamepad(id:Int):Void { - addGamepadLiteral(id, [ - Control.ACCEPT => getDefaultGamepadBinds(Control.ACCEPT), - Control.BACK => getDefaultGamepadBinds(Control.BACK), - Control.UI_UP => getDefaultGamepadBinds(Control.UI_UP), - Control.UI_DOWN => getDefaultGamepadBinds(Control.UI_DOWN), - Control.UI_LEFT => getDefaultGamepadBinds(Control.UI_LEFT), - Control.UI_RIGHT => getDefaultGamepadBinds(Control.UI_RIGHT), - Control.NOTE_UP => getDefaultGamepadBinds(Control.NOTE_UP), - Control.NOTE_DOWN => getDefaultGamepadBinds(Control.NOTE_DOWN), - Control.NOTE_LEFT => getDefaultGamepadBinds(Control.NOTE_LEFT), - Control.NOTE_RIGHT => getDefaultGamepadBinds(Control.NOTE_RIGHT), - Control.PAUSE => getDefaultGamepadBinds(Control.PAUSE), - Control.RESET => getDefaultGamepadBinds(Control.RESET), - Control.WINDOW_FULLSCREEN => getDefaultGamepadBinds(Control.WINDOW_FULLSCREEN), - #if FEATURE_SCREENSHOTS - Control.WINDOW_SCREENSHOT => getDefaultGamepadBinds(Control.WINDOW_SCREENSHOT), - #end - Control.CUTSCENE_ADVANCE => getDefaultGamepadBinds(Control.CUTSCENE_ADVANCE), - Control.FREEPLAY_FAVORITE => getDefaultGamepadBinds(Control.FREEPLAY_FAVORITE), - Control.FREEPLAY_LEFT => getDefaultGamepadBinds(Control.FREEPLAY_LEFT), - Control.FREEPLAY_RIGHT => getDefaultGamepadBinds(Control.FREEPLAY_RIGHT), - Control.FREEPLAY_CHAR_SELECT => getDefaultGamepadBinds(Control.FREEPLAY_CHAR_SELECT), - Control.FREEPLAY_JUMP_TO_TOP => getDefaultGamepadBinds(Control.FREEPLAY_JUMP_TO_TOP), - Control.FREEPLAY_JUMP_TO_BOTTOM => getDefaultGamepadBinds(Control.FREEPLAY_JUMP_TO_BOTTOM), - Control.VOLUME_UP => getDefaultGamepadBinds(Control.VOLUME_UP), - Control.VOLUME_DOWN => getDefaultGamepadBinds(Control.VOLUME_DOWN), - Control.VOLUME_MUTE => getDefaultGamepadBinds(Control.VOLUME_MUTE), - #if FEATURE_DEBUG_MENU - Control.DEBUG_MENU => getDefaultGamepadBinds(Control.DEBUG_MENU), - #end - #if FEATURE_CHART_EDITOR - Control.DEBUG_CHART => getDefaultGamepadBinds(Control.DEBUG_CHART), - #end - #if FEATURE_STAGE_EDITOR - Control.DEBUG_STAGE => getDefaultGamepadBinds(Control.DEBUG_STAGE), - #end - Control.DEBUG_DISPLAY => getDefaultGamepadBinds(Control.DEBUG_DISPLAY), - ]); + addGamepadLiteral(id, + [Control.ACCEPT => getDefaultGamepadBinds(Control.ACCEPT), Control.BACK => getDefaultGamepadBinds(Control.BACK), Control.UI_UP => getDefaultGamepadBinds(Control.UI_UP), Control.UI_DOWN => getDefaultGamepadBinds(Control.UI_DOWN), Control.UI_LEFT => getDefaultGamepadBinds(Control.UI_LEFT), Control.UI_RIGHT => getDefaultGamepadBinds(Control.UI_RIGHT), Control.NOTE_UP => getDefaultGamepadBinds(Control.NOTE_UP), Control.NOTE_DOWN => getDefaultGamepadBinds(Control.NOTE_DOWN), Control.NOTE_LEFT => getDefaultGamepadBinds(Control.NOTE_LEFT), Control.NOTE_RIGHT => getDefaultGamepadBinds(Control.NOTE_RIGHT), Control.PAUSE => getDefaultGamepadBinds(Control.PAUSE), Control.RESET => getDefaultGamepadBinds(Control.RESET), Control.WINDOW_FULLSCREEN => getDefaultGamepadBinds(Control.WINDOW_FULLSCREEN), #if FEATURE_SCREENSHOTS Control.WINDOW_SCREENSHOT => getDefaultGamepadBinds(Control.WINDOW_SCREENSHOT), #end Control.CUTSCENE_ADVANCE => getDefaultGamepadBinds(Control.CUTSCENE_ADVANCE), Control.FREEPLAY_FAVORITE => getDefaultGamepadBinds(Control.FREEPLAY_FAVORITE), Control.FREEPLAY_LEFT => getDefaultGamepadBinds(Control.FREEPLAY_LEFT), Control.FREEPLAY_RIGHT => getDefaultGamepadBinds(Control.FREEPLAY_RIGHT), Control.FREEPLAY_CHAR_SELECT => getDefaultGamepadBinds(Control.FREEPLAY_CHAR_SELECT), Control.FREEPLAY_JUMP_TO_TOP => getDefaultGamepadBinds(Control.FREEPLAY_JUMP_TO_TOP), Control.FREEPLAY_JUMP_TO_BOTTOM => getDefaultGamepadBinds(Control.FREEPLAY_JUMP_TO_BOTTOM), Control.VOLUME_UP => getDefaultGamepadBinds(Control.VOLUME_UP), Control.VOLUME_DOWN => getDefaultGamepadBinds(Control.VOLUME_DOWN), Control.VOLUME_MUTE => getDefaultGamepadBinds(Control.VOLUME_MUTE), #if FEATURE_DEBUG_MENU Control.DEBUG_MENU => getDefaultGamepadBinds(Control.DEBUG_MENU), #end#if FEATURE_CHART_EDITOR Control.DEBUG_CHART => getDefaultGamepadBinds(Control.DEBUG_CHART), #end#if FEATURE_STAGE_EDITOR Control.DEBUG_STAGE => getDefaultGamepadBinds(Control.DEBUG_STAGE), #end Control.DEBUG_DISPLAY => getDefaultGamepadBinds(Control.DEBUG_DISPLAY),]); } function getDefaultGamepadBinds(control:Control):Array @@ -1267,7 +1179,8 @@ class FunkinAction extends FlxActionDigital public var namePressed(default, null):Null; public var nameReleased(default, null):Null; - var cache:Map = []; + var cache:Map = []; public function new(?name:String = "", ?namePressed:String, ?nameReleased:String) { diff --git a/source/funkin/input/Cursor.hx b/source/funkin/input/Cursor.hx index 9a0648394..0d53700f9 100644 --- a/source/funkin/input/Cursor.hx +++ b/source/funkin/input/Cursor.hx @@ -47,121 +47,108 @@ class Cursor } } - public static final CURSOR_DEFAULT_PARAMS:CursorParams = - { - graphic: "assets/images/cursor/cursor-default.png", - scale: 1.0, - offsetX: 0, - offsetY: 0, - }; + public static final CURSOR_DEFAULT_PARAMS:CursorParams = { + graphic: "assets/images/cursor/cursor-default.png", + scale: 1.0, + offsetX: 0, + offsetY: 0, + }; static var assetCursorDefault:Null = null; - public static final CURSOR_CROSS_PARAMS:CursorParams = - { - graphic: "assets/images/cursor/cursor-cross.png", - scale: 1.0, - offsetX: 0, - offsetY: 0, - }; + public static final CURSOR_CROSS_PARAMS:CursorParams = { + graphic: "assets/images/cursor/cursor-cross.png", + scale: 1.0, + offsetX: 0, + offsetY: 0, + }; static var assetCursorCross:Null = null; - public static final CURSOR_ERASER_PARAMS:CursorParams = - { - graphic: "assets/images/cursor/cursor-eraser.png", - scale: 1.0, - offsetX: 0, - offsetY: 0, - }; + public static final CURSOR_ERASER_PARAMS:CursorParams = { + graphic: "assets/images/cursor/cursor-eraser.png", + scale: 1.0, + offsetX: 0, + offsetY: 0, + }; static var assetCursorEraser:Null = null; - public static final CURSOR_GRABBING_PARAMS:CursorParams = - { - graphic: "assets/images/cursor/cursor-grabbing.png", - scale: 1.0, - offsetX: -8, - offsetY: 0, - }; + public static final CURSOR_GRABBING_PARAMS:CursorParams = { + graphic: "assets/images/cursor/cursor-grabbing.png", + scale: 1.0, + offsetX: -8, + offsetY: 0, + }; static var assetCursorGrabbing:Null = null; - public static final CURSOR_HOURGLASS_PARAMS:CursorParams = - { - graphic: "assets/images/cursor/cursor-hourglass.png", - scale: 1.0, - offsetX: 0, - offsetY: 0, - }; + public static final CURSOR_HOURGLASS_PARAMS:CursorParams = { + graphic: "assets/images/cursor/cursor-hourglass.png", + scale: 1.0, + offsetX: 0, + offsetY: 0, + }; static var assetCursorHourglass:Null = null; - public static final CURSOR_POINTER_PARAMS:CursorParams = - { - graphic: "assets/images/cursor/cursor-pointer.png", - scale: 1.0, - offsetX: -8, - offsetY: 0, - }; + public static final CURSOR_POINTER_PARAMS:CursorParams = { + graphic: "assets/images/cursor/cursor-pointer.png", + scale: 1.0, + offsetX: -8, + offsetY: 0, + }; static var assetCursorPointer:Null = null; - public static final CURSOR_TEXT_PARAMS:CursorParams = - { - graphic: "assets/images/cursor/cursor-text.png", - scale: 0.2, - offsetX: 0, - offsetY: 0, - }; + public static final CURSOR_TEXT_PARAMS:CursorParams = { + graphic: "assets/images/cursor/cursor-text.png", + scale: 0.2, + offsetX: 0, + offsetY: 0, + }; static var assetCursorText:Null = null; - public static final CURSOR_TEXT_VERTICAL_PARAMS:CursorParams = - { - graphic: "assets/images/cursor/cursor-text-vertical.png", - scale: 0.2, - offsetX: 0, - offsetY: 0, - }; + public static final CURSOR_TEXT_VERTICAL_PARAMS:CursorParams = { + graphic: "assets/images/cursor/cursor-text-vertical.png", + scale: 0.2, + offsetX: 0, + offsetY: 0, + }; static var assetCursorTextVertical:Null = null; - public static final CURSOR_ZOOM_IN_PARAMS:CursorParams = - { - graphic: "assets/images/cursor/cursor-zoom-in.png", - scale: 1.0, - offsetX: 0, - offsetY: 0, - }; + public static final CURSOR_ZOOM_IN_PARAMS:CursorParams = { + graphic: "assets/images/cursor/cursor-zoom-in.png", + scale: 1.0, + offsetX: 0, + offsetY: 0, + }; static var assetCursorZoomIn:Null = null; - public static final CURSOR_ZOOM_OUT_PARAMS:CursorParams = - { - graphic: "assets/images/cursor/cursor-zoom-out.png", - scale: 1.0, - offsetX: 0, - offsetY: 0, - }; + public static final CURSOR_ZOOM_OUT_PARAMS:CursorParams = { + graphic: "assets/images/cursor/cursor-zoom-out.png", + scale: 1.0, + offsetX: 0, + offsetY: 0, + }; static var assetCursorZoomOut:Null = null; - public static final CURSOR_CROSSHAIR_PARAMS:CursorParams = - { - graphic: "assets/images/cursor/cursor-crosshair.png", - scale: 1.0, - offsetX: -16, - offsetY: -16, - }; + public static final CURSOR_CROSSHAIR_PARAMS:CursorParams = { + graphic: "assets/images/cursor/cursor-crosshair.png", + scale: 1.0, + offsetX: -16, + offsetY: -16, + }; static var assetCursorCrosshair:Null = null; - public static final CURSOR_CELL_PARAMS:CursorParams = - { - graphic: "assets/images/cursor/cursor-cell.png", - scale: 1.0, - offsetX: -16, - offsetY: -16, - }; + public static final CURSOR_CELL_PARAMS:CursorParams = { + graphic: "assets/images/cursor/cursor-cell.png", + scale: 1.0, + offsetX: -16, + offsetY: -16, + }; static var assetCursorCell:Null = null; - public static final CURSOR_SCROLL_PARAMS:CursorParams = - { - graphic: "assets/images/cursor/cursor-scroll.png", - scale: 0.2, - offsetX: -15, - offsetY: -15, - }; + public static final CURSOR_SCROLL_PARAMS:CursorParams = { + graphic: "assets/images/cursor/cursor-scroll.png", + scale: 0.2, + offsetX: -15, + offsetY: -15, + }; static var assetCursorScroll:Null = null; static function set_cursorMode(value:Null):Null @@ -353,7 +340,8 @@ class Cursor if (assetCursorDefault == null) { var future:Future = Assets.loadBitmapData(CURSOR_DEFAULT_PARAMS.graphic); - future.onComplete(function(bitmapData:BitmapData) { + future.onComplete(function(bitmapData:BitmapData) + { assetCursorDefault = bitmapData; applyCursorParams(assetCursorDefault, CURSOR_DEFAULT_PARAMS); }); @@ -368,7 +356,8 @@ class Cursor if (assetCursorCross == null) { var future:Future = Assets.loadBitmapData(CURSOR_CROSS_PARAMS.graphic); - future.onComplete(function(bitmapData:BitmapData) { + future.onComplete(function(bitmapData:BitmapData) + { assetCursorCross = bitmapData; applyCursorParams(assetCursorCross, CURSOR_CROSS_PARAMS); }); @@ -383,7 +372,8 @@ class Cursor if (assetCursorEraser == null) { var future:Future = Assets.loadBitmapData(CURSOR_ERASER_PARAMS.graphic); - future.onComplete(function(bitmapData:BitmapData) { + future.onComplete(function(bitmapData:BitmapData) + { assetCursorEraser = bitmapData; applyCursorParams(assetCursorEraser, CURSOR_ERASER_PARAMS); }); @@ -398,7 +388,8 @@ class Cursor if (assetCursorGrabbing == null) { var future:Future = Assets.loadBitmapData(CURSOR_GRABBING_PARAMS.graphic); - future.onComplete(function(bitmapData:BitmapData) { + future.onComplete(function(bitmapData:BitmapData) + { assetCursorGrabbing = bitmapData; applyCursorParams(assetCursorGrabbing, CURSOR_GRABBING_PARAMS); }); @@ -413,7 +404,8 @@ class Cursor if (assetCursorHourglass == null) { var future:Future = Assets.loadBitmapData(CURSOR_HOURGLASS_PARAMS.graphic); - future.onComplete(function(bitmapData:BitmapData) { + future.onComplete(function(bitmapData:BitmapData) + { assetCursorHourglass = bitmapData; applyCursorParams(assetCursorHourglass, CURSOR_HOURGLASS_PARAMS); }); @@ -428,7 +420,8 @@ class Cursor if (assetCursorPointer == null) { var future:Future = Assets.loadBitmapData(CURSOR_POINTER_PARAMS.graphic); - future.onComplete(function(bitmapData:BitmapData) { + future.onComplete(function(bitmapData:BitmapData) + { assetCursorPointer = bitmapData; applyCursorParams(assetCursorPointer, CURSOR_POINTER_PARAMS); }); @@ -443,7 +436,8 @@ class Cursor if (assetCursorText == null) { var future:Future = Assets.loadBitmapData(CURSOR_TEXT_PARAMS.graphic); - future.onComplete(function(bitmapData:BitmapData) { + future.onComplete(function(bitmapData:BitmapData) + { assetCursorText = bitmapData; applyCursorParams(assetCursorText, CURSOR_TEXT_PARAMS); }); @@ -458,7 +452,8 @@ class Cursor if (assetCursorZoomIn == null) { var future:Future = Assets.loadBitmapData(CURSOR_ZOOM_IN_PARAMS.graphic); - future.onComplete(function(bitmapData:BitmapData) { + future.onComplete(function(bitmapData:BitmapData) + { assetCursorZoomIn = bitmapData; applyCursorParams(assetCursorZoomIn, CURSOR_ZOOM_IN_PARAMS); }); @@ -473,7 +468,8 @@ class Cursor if (assetCursorZoomOut == null) { var future:Future = Assets.loadBitmapData(CURSOR_ZOOM_OUT_PARAMS.graphic); - future.onComplete(function(bitmapData:BitmapData) { + future.onComplete(function(bitmapData:BitmapData) + { assetCursorZoomOut = bitmapData; applyCursorParams(assetCursorZoomOut, CURSOR_ZOOM_OUT_PARAMS); }); @@ -488,7 +484,8 @@ class Cursor if (assetCursorCrosshair == null) { var future:Future = Assets.loadBitmapData(CURSOR_CROSSHAIR_PARAMS.graphic); - future.onComplete(function(bitmapData:BitmapData) { + future.onComplete(function(bitmapData:BitmapData) + { assetCursorCrosshair = bitmapData; applyCursorParams(assetCursorCrosshair, CURSOR_CROSSHAIR_PARAMS); }); @@ -503,7 +500,8 @@ class Cursor if (assetCursorCell == null) { var future:Future = Assets.loadBitmapData(CURSOR_CELL_PARAMS.graphic); - future.onComplete(function(bitmapData:BitmapData) { + future.onComplete(function(bitmapData:BitmapData) + { assetCursorCell = bitmapData; applyCursorParams(assetCursorCell, CURSOR_CELL_PARAMS); }); @@ -518,7 +516,8 @@ class Cursor if (assetCursorScroll == null) { var future:Future = Assets.loadBitmapData(CURSOR_SCROLL_PARAMS.graphic); - future.onComplete(function(bitmapData:BitmapData) { + future.onComplete(function(bitmapData:BitmapData) + { assetCursorScroll = bitmapData; applyCursorParams(assetCursorScroll, CURSOR_SCROLL_PARAMS); }); diff --git a/source/funkin/input/PreciseInputManager.hx b/source/funkin/input/PreciseInputManager.hx index 05d2c7c6c..33a490a1b 100644 --- a/source/funkin/input/PreciseInputManager.hx +++ b/source/funkin/input/PreciseInputManager.hx @@ -192,11 +192,10 @@ class PreciseInputManager extends FlxKeyManager clearButtons(); var limeGamepad = FlxGamepadUtil.getLimeGamepad(gamepad); - var callbacks = - { - onButtonDown: handleButtonDown.bind(gamepad), - onButtonUp: handleButtonUp.bind(gamepad) - }; + var callbacks = { + onButtonDown: handleButtonDown.bind(gamepad), + onButtonUp: handleButtonUp.bind(gamepad) + }; limeGamepad.onButtonDownPrecise.add(callbacks.onButtonDown); limeGamepad.onButtonUpPrecise.add(callbacks.onButtonUp); @@ -300,12 +299,11 @@ class PreciseInputManager extends FlxKeyManager if (getInputByKey(key)?.justPressed ?? false) { - onInputPressed.dispatch( - { - noteDirection: getDirectionForKey(key), - timestamp: timestamp, - keyCode: keyCode - }); + onInputPressed.dispatch({ + noteDirection: getDirectionForKey(key), + timestamp: timestamp, + keyCode: keyCode + }); _dirPressTimestamps.set(getDirectionForKey(key), timestamp); } } @@ -323,12 +321,11 @@ class PreciseInputManager extends FlxKeyManager if (getInputByKey(key)?.justReleased ?? false) { - onInputReleased.dispatch( - { - noteDirection: getDirectionForKey(key), - timestamp: timestamp, - keyCode: keyCode - }); + onInputReleased.dispatch({ + noteDirection: getDirectionForKey(key), + timestamp: timestamp, + keyCode: keyCode + }); _dirReleaseTimestamps.set(getDirectionForKey(key), timestamp); } } @@ -348,12 +345,11 @@ class PreciseInputManager extends FlxKeyManager if (getInputByButton(gamepad, buttonId)?.justPressed ?? false) { - onInputPressed.dispatch( - { - noteDirection: getDirectionForButton(gamepad, buttonId), - timestamp: timestamp, - keyCode: button // implicit cast to int - }); + onInputPressed.dispatch({ + noteDirection: getDirectionForButton(gamepad, buttonId), + timestamp: timestamp, + keyCode: button // implicit cast to int + }); _dirPressTimestamps.set(getDirectionForButton(gamepad, buttonId), timestamp); } } @@ -373,12 +369,11 @@ class PreciseInputManager extends FlxKeyManager if (getInputByButton(gamepad, buttonId)?.justReleased ?? false) { - onInputReleased.dispatch( - { - noteDirection: getDirectionForButton(gamepad, buttonId), - timestamp: timestamp, - keyCode: button // implicit cast to int - }); + onInputReleased.dispatch({ + noteDirection: getDirectionForButton(gamepad, buttonId), + timestamp: timestamp, + keyCode: button // implicit cast to int + }); _dirReleaseTimestamps.set(getDirectionForButton(gamepad, buttonId), timestamp); } } @@ -465,23 +460,19 @@ class PreciseInputList extends FlxKeyList public var NOTE_LEFT(get, never):Bool; - function get_NOTE_LEFT():Bool - return checkDir(NoteDirection.LEFT); + function get_NOTE_LEFT():Bool return checkDir(NoteDirection.LEFT); public var NOTE_DOWN(get, never):Bool; - function get_NOTE_DOWN():Bool - return checkDir(NoteDirection.DOWN); + function get_NOTE_DOWN():Bool return checkDir(NoteDirection.DOWN); public var NOTE_UP(get, never):Bool; - function get_NOTE_UP():Bool - return checkDir(NoteDirection.UP); + function get_NOTE_UP():Bool return checkDir(NoteDirection.UP); public var NOTE_RIGHT(get, never):Bool; - function get_NOTE_RIGHT():Bool - return checkDir(NoteDirection.RIGHT); + function get_NOTE_RIGHT():Bool return checkDir(NoteDirection.RIGHT); } typedef PreciseInputEvent = diff --git a/source/funkin/mobile/input/ControlsHandler.hx b/source/funkin/mobile/input/ControlsHandler.hx index 9628fa364..9d3dca827 100644 --- a/source/funkin/mobile/input/ControlsHandler.hx +++ b/source/funkin/mobile/input/ControlsHandler.hx @@ -78,19 +78,23 @@ class ControlsHandler switch (hint.noteDirection) { case NoteDirection.LEFT: - controls.forEachBound(Control.NOTE_LEFT, function(action:FlxActionDigital, state:FlxInputState):Void { + controls.forEachBound(Control.NOTE_LEFT, function(action:FlxActionDigital, state:FlxInputState):Void + { addButton(action, hint, state, cachedInput); }); case NoteDirection.DOWN: - controls.forEachBound(Control.NOTE_DOWN, function(action:FlxActionDigital, state:FlxInputState):Void { + controls.forEachBound(Control.NOTE_DOWN, function(action:FlxActionDigital, state:FlxInputState):Void + { addButton(action, hint, state, cachedInput); }); case NoteDirection.UP: - controls.forEachBound(Control.NOTE_UP, function(action:FlxActionDigital, state:FlxInputState):Void { + controls.forEachBound(Control.NOTE_UP, function(action:FlxActionDigital, state:FlxInputState):Void + { addButton(action, hint, state, cachedInput); }); case NoteDirection.RIGHT: - controls.forEachBound(Control.NOTE_RIGHT, function(action:FlxActionDigital, state:FlxInputState):Void { + controls.forEachBound(Control.NOTE_RIGHT, function(action:FlxActionDigital, state:FlxInputState):Void + { addButton(action, hint, state, cachedInput); }); } @@ -128,7 +132,9 @@ class ControlsHandler @:noCompletion private static function get_hasExternalInputDevice():Bool { - return FlxG.gamepads.numActiveGamepads > 0 #if android || KeyboardUtil.keyboardConnected || extension.androidtools.Tools.isChromebook() #end; + return FlxG.gamepads.numActiveGamepads > 0 #if android + || KeyboardUtil.keyboardConnected + || extension.androidtools.Tools.isChromebook() #end; } @:noCompletion diff --git a/source/funkin/mobile/ui/FunkinBackButton.hx b/source/funkin/mobile/ui/FunkinBackButton.hx index e41b91590..dbbf872a4 100644 --- a/source/funkin/mobile/ui/FunkinBackButton.hx +++ b/source/funkin/mobile/ui/FunkinBackButton.hx @@ -103,7 +103,8 @@ class FunkinBackButton extends FunkinButton onConfirmStart.dispatch(); - animation.onFinish.addOnce(function(name:String) { + animation.onFinish.addOnce(function(name:String) + { if (name != 'confirm') return; _confirming = false; held = false; @@ -119,13 +120,13 @@ class FunkinBackButton extends FunkinButton HapticUtil.vibrate(0, 0.01, 0.2); animation.play('idle'); - FlxTween.tween(this, {alpha: restingOpacity}, 0.5, + FlxTween.tween(this, {alpha: restingOpacity}, 0.5, { + ease: FlxEase.expoOut, + onComplete: function(tween:FlxTween):Void { - ease: FlxEase.expoOut, - onComplete: function(tween:FlxTween):Void { - held = false; - } - }); + held = false; + } + }); } public function resetCallbacks():Void diff --git a/source/funkin/mobile/ui/FunkinHitbox.hx b/source/funkin/mobile/ui/FunkinHitbox.hx index 21af1e597..b09e9762b 100644 --- a/source/funkin/mobile/ui/FunkinHitbox.hx +++ b/source/funkin/mobile/ui/FunkinHitbox.hx @@ -43,10 +43,8 @@ class FunkinHint extends FunkinButton * - The second value corresponds to the alpha when the hint is not pressed. * - The third value corresponds to the duratuon it'll take to tween between the two values. */ - static final HINT_ALPHA_STYLE:Map> = [ - INVISIBLE_TILL_PRESS => [0.3, 0.00001, 0.01], - VISIBLE_TILL_PRESS => [0.4, 0.2, 0.08] - ]; + static final HINT_ALPHA_STYLE:Map> = [INVISIBLE_TILL_PRESS => [0.3, 0.00001, 0.01], VISIBLE_TILL_PRESS => [0.4, 0.2, 0.08]]; /** * Indicates whether the hint is pixel. @@ -388,7 +386,8 @@ class FunkinHitbox extends FlxTypedSpriteGroup public function getFirstHintByDirection(direction:NoteDirection):Null { var result:Null = null; - forEachOfType(FunkinHint, function(hint:FunkinHint):Void { + forEachOfType(FunkinHint, function(hint:FunkinHint):Void + { @:privateAccess if (hint.noteDirection == direction) result = hint; }); @@ -497,19 +496,22 @@ class FunkinHitbox extends FlxTypedSpriteGroup hint.animation.play('static', true); - hint.onDown.add(() -> { + hint.onDown.add(() -> + { hint.animation.play('press', true); hint.centerOrigin(); hint.centerOffsets(); }); - hint.onUp.add(() -> { + hint.onUp.add(() -> + { hint.animation.play('static', true); hint.centerOrigin(); hint.centerOffsets(); }); - hint.onOut.add(() -> { + hint.onOut.add(() -> + { hint.animation.play('static', true); hint.centerOrigin(); hint.centerOffsets(); @@ -675,7 +677,8 @@ class FunkinHitbox extends FlxTypedSpriteGroup function set_isPixel(value:Bool):Bool { isPixel = value; - forEachOfType(FunkinHint, function(hint:FunkinHint):Void { + forEachOfType(FunkinHint, function(hint:FunkinHint):Void + { hint.isPixel = value; }); return value; diff --git a/source/funkin/mobile/ui/mainmenu/FunkinOptionsButton.hx b/source/funkin/mobile/ui/mainmenu/FunkinOptionsButton.hx index 7a88abd54..0afd570b1 100644 --- a/source/funkin/mobile/ui/mainmenu/FunkinOptionsButton.hx +++ b/source/funkin/mobile/ui/mainmenu/FunkinOptionsButton.hx @@ -87,13 +87,15 @@ class FunkinOptionsButton extends FunkinButton FunkinSound.playOnce(Paths.sound('confirmMenu')); - new FlxTimer().start(0.05, function(_) { + new FlxTimer().start(0.05, function(_) + { HapticUtil.vibrate(0, 0.01, 0.2); }, 4); onConfirmStart.dispatch(); - animation.onFinish.addOnce(function(name:String) { + animation.onFinish.addOnce(function(name:String) + { if (name != 'confirm') return; _confirming = false; held = false; diff --git a/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx b/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx index 6c8fd771d..b8a18332b 100644 --- a/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx +++ b/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx @@ -64,13 +64,7 @@ class ControlsSchemeMenu extends MusicBeatSubState /** * An array of every single scheme. */ - final availableSchemes:Array = [ - FunkinHitbox.FunkinHitboxControlSchemes.Arrows, - FunkinHitbox.FunkinHitboxControlSchemes.FourLanes, - FunkinHitbox.FunkinHitboxControlSchemes.DoubleThumbTriangle, - FunkinHitbox.FunkinHitboxControlSchemes.DoubleThumbSquare, - FunkinHitbox.FunkinHitboxControlSchemes.DoubleThumbDPad - ]; + final availableSchemes:Array = [FunkinHitbox.FunkinHitboxControlSchemes.Arrows, FunkinHitbox.FunkinHitboxControlSchemes.FourLanes, FunkinHitbox.FunkinHitboxControlSchemes.DoubleThumbTriangle, FunkinHitbox.FunkinHitboxControlSchemes.DoubleThumbSquare, FunkinHitbox.FunkinHitboxControlSchemes.DoubleThumbDPad]; /** * Current selected index @@ -227,7 +221,8 @@ class ControlsSchemeMenu extends MusicBeatSubState FlxTween.tween(hsv, {hue: 0, saturation: 0, value: 0.5}, 0.5); - hitboxShowcases.forEach(function(hitboxShowcase:HitboxShowcase) { + hitboxShowcases.forEach(function(hitboxShowcase:HitboxShowcase) + { hitboxShowcase.visible = false; }); @@ -237,7 +232,8 @@ class ControlsSchemeMenu extends MusicBeatSubState addHitbox(true, false, availableSchemes[currentIndex]); - hitbox.forEachAlive(function(hint:FunkinHint) { + hitbox.forEachAlive(function(hint:FunkinHint) + { if (availableSchemes[currentIndex] == FunkinHitboxControlSchemes.Arrows) hint.alpha = 1; if (!hint.deadZones.contains(cast(currentButton.body, FunkinSprite))) hint.deadZones.push(cast(currentButton.body, FunkinSprite)); @@ -253,7 +249,8 @@ class ControlsSchemeMenu extends MusicBeatSubState FlxTween.tween(hsv, {hue: -0.6, saturation: 0.9, value: 3.6}, 0.5); - hitboxShowcases.forEach(function(hitboxShowcase:HitboxShowcase) { + hitboxShowcases.forEach(function(hitboxShowcase:HitboxShowcase) + { hitboxShowcase.visible = true; }); @@ -285,7 +282,8 @@ class ControlsSchemeMenu extends MusicBeatSubState schemeNameText.text = availableSchemes[currentIndex]; - hitboxShowcases.forEach(function(hitboxShowcase:HitboxShowcase) { + hitboxShowcases.forEach(function(hitboxShowcase:HitboxShowcase) + { hitboxShowcase.selectionIndex = currentIndex; }); } diff --git a/source/funkin/mobile/ui/options/objects/HitboxShowcase.hx b/source/funkin/mobile/ui/options/objects/HitboxShowcase.hx index 270ebb729..035477e25 100644 --- a/source/funkin/mobile/ui/options/objects/HitboxShowcase.hx +++ b/source/funkin/mobile/ui/options/objects/HitboxShowcase.hx @@ -81,7 +81,8 @@ class HitboxShowcase extends FlxSpriteGroup add(bg); final hitbox:FunkinHitbox = new FunkinHitbox(controlsScheme, false); - hitbox.forEachAlive(function(hint:FunkinHint):Void { + hitbox.forEachAlive(function(hint:FunkinHint):Void + { if (controlsScheme != FunkinHitbox.FunkinHitboxControlSchemes.FourLanes) hint.alpha = 0.3; }); hitbox.active = false; @@ -99,7 +100,8 @@ class HitboxShowcase extends FlxSpriteGroup FunkinSound.playOnce(Paths.sound('confirmMenu')); - FlxFlicker.flicker(this, 1, 0.06, true, false, function(_) { + FlxFlicker.flicker(this, 1, 0.06, true, false, function(_) + { busy = false; onSelect.dispatch(); }); diff --git a/source/funkin/mobile/ui/options/objects/SchemeMenuButton.hx b/source/funkin/mobile/ui/options/objects/SchemeMenuButton.hx index 5011cf5d9..1e09c4fd6 100644 --- a/source/funkin/mobile/ui/options/objects/SchemeMenuButton.hx +++ b/source/funkin/mobile/ui/options/objects/SchemeMenuButton.hx @@ -69,7 +69,8 @@ class SchemeMenuButton extends FlxSpriteGroup FunkinSound.playOnce(Paths.sound('confirmMenu')); - FlxFlicker.flicker(this, 1, 0.06, true, false, function(_) { + FlxFlicker.flicker(this, 1, 0.06, true, false, function(_) + { busy = false; onSelect.dispatch(); }); diff --git a/source/funkin/mobile/util/AdMobUtil.hx b/source/funkin/mobile/util/AdMobUtil.hx index 279619f2b..f2f374ed7 100644 --- a/source/funkin/mobile/util/AdMobUtil.hx +++ b/source/funkin/mobile/util/AdMobUtil.hx @@ -72,7 +72,8 @@ class AdMobUtil */ public static function init():Void { - Admob.onEvent.add(function(event:AdmobEvent):Void { + Admob.onEvent.add(function(event:AdmobEvent):Void + { switch (event.name) { case AdmobEvent.INIT_OK: diff --git a/source/funkin/mobile/util/FNFCUtil.hx b/source/funkin/mobile/util/FNFCUtil.hx index dfbe7d5e2..5adefcd0a 100644 --- a/source/funkin/mobile/util/FNFCUtil.hx +++ b/source/funkin/mobile/util/FNFCUtil.hx @@ -22,7 +22,8 @@ class FNFCUtil onFNFCOpen = new FlxTypedSignalVoid>(); #if ios - FlxG.stage.window.onDropFile.add(function(_) { + FlxG.stage.window.onDropFile.add(function(_) + { final url = queryFNFC(); if (url != null) getFNFCFromURL(url); }); diff --git a/source/funkin/mobile/util/InAppPurchasesUtil.hx b/source/funkin/mobile/util/InAppPurchasesUtil.hx index a0bb46784..f30a4707c 100644 --- a/source/funkin/mobile/util/InAppPurchasesUtil.hx +++ b/source/funkin/mobile/util/InAppPurchasesUtil.hx @@ -46,11 +46,13 @@ class InAppPurchasesUtil public static function init():Void { #if android - IAPAndroid.onLog.add(function(message:String):Void { + IAPAndroid.onLog.add(function(message:String):Void + { trace(message); }); - IAPAndroid.onBillingSetupFinished.add(function(result:IAPResult):Void { + IAPAndroid.onBillingSetupFinished.add(function(result:IAPResult):Void + { if (result.getResponseCode() != IAPResponseCode.OK) { trace('Billing setup failed "$result"!'); @@ -62,11 +64,13 @@ class InAppPurchasesUtil IAPAndroid.queryProductDetails([UPGRADE_PRODUCT_ID]); }); - IAPAndroid.onBillingServiceDisconnected.add(function():Void { + IAPAndroid.onBillingServiceDisconnected.add(function():Void + { trace("Billing service disconnected!"); }); - IAPAndroid.onProductDetailsResponse.add(function(result:IAPResult, productDetails:Array):Void { + IAPAndroid.onProductDetailsResponse.add(function(result:IAPResult, productDetails:Array):Void + { if (result.getResponseCode() == IAPResponseCode.OK) { hasInitialized = true; @@ -79,7 +83,8 @@ class InAppPurchasesUtil } }); - IAPAndroid.onQueryPurchasesResponse.add(function(result:IAPResult, purchases:Array):Void { + IAPAndroid.onQueryPurchasesResponse.add(function(result:IAPResult, purchases:Array):Void + { if (result.getResponseCode() == IAPResponseCode.OK) handlePurchases(purchases); else { @@ -87,7 +92,8 @@ class InAppPurchasesUtil } }); - IAPAndroid.onPurchasesUpdated.add(function(result:IAPResult, purchases:Array):Void { + IAPAndroid.onPurchasesUpdated.add(function(result:IAPResult, purchases:Array):Void + { if (result.getResponseCode() == IAPResponseCode.OK) handlePurchases(purchases); else { @@ -95,7 +101,8 @@ class InAppPurchasesUtil } }); - IAPAndroid.onAcknowledgePurchaseResponse.add(function(result:IAPResult):Void { + IAPAndroid.onAcknowledgePurchaseResponse.add(function(result:IAPResult):Void + { if (result.getResponseCode() == IAPResponseCode.OK) trace('Purchase acknowledged successfully!'); else { @@ -107,18 +114,21 @@ class InAppPurchasesUtil IAPAndroid.startConnection(); #else - IAPIOS.onProductDetailsReceived.add(function(productDetails:Array):Void { + IAPIOS.onProductDetailsReceived.add(function(productDetails:Array):Void + { if (productDetails != null) { currentProductDetails = productDetails; } }); - IAPIOS.onProductDetailsFailed.add(function(error:IAPError):Void { + IAPIOS.onProductDetailsFailed.add(function(error:IAPError):Void + { hasInitialized = false; }); - IAPIOS.onPurchasesUpdated.add(function(purchases:Array):Void { + IAPIOS.onPurchasesUpdated.add(function(purchases:Array):Void + { handlePurchases(purchases); trace("iOS purchases updated: " + purchases.length); hasInitialized = true; diff --git a/source/funkin/mobile/util/InAppReviewUtil.hx b/source/funkin/mobile/util/InAppReviewUtil.hx index ac807c0d2..6aa868039 100644 --- a/source/funkin/mobile/util/InAppReviewUtil.hx +++ b/source/funkin/mobile/util/InAppReviewUtil.hx @@ -29,13 +29,16 @@ class InAppReviewUtil #if android trace('[IAR] Initializing callbacks...'); - IAR.onLog.add(function(message:String):Void { + IAR.onLog.add(function(message:String):Void + { trace('[IAR] Error occurred: "$message"'); }); - IAR.onReviewCompleted.add(function(success:Bool):Void { + IAR.onReviewCompleted.add(function(success:Bool):Void + { trace('[IAR] Review completed: "${success ? 'Success' : 'Failure'}"'); }); - IAR.onReviewError.add(function(message:String):Void { + IAR.onReviewError.add(function(message:String):Void + { trace('[IAR] Review failed: "$message"'); }); #end diff --git a/source/funkin/modding/ModStore.hx b/source/funkin/modding/ModStore.hx index 981a3498a..2d8df6ed0 100644 --- a/source/funkin/modding/ModStore.hx +++ b/source/funkin/modding/ModStore.hx @@ -24,7 +24,8 @@ class ModStore public static function register(id:String, ?data:Dynamic):Dynamic { if (stores.exists(id)) return stores.get(id); - stores.set(id, data ??= {}); + stores.set(id, data ??= { + }); return data; } diff --git a/source/funkin/modding/PolymodHandler.hx b/source/funkin/modding/PolymodHandler.hx index b6b557145..9803120f3 100644 --- a/source/funkin/modding/PolymodHandler.hx +++ b/source/funkin/modding/PolymodHandler.hx @@ -141,39 +141,38 @@ class PolymodHandler if (modFileSystem == null) modFileSystem = buildFileSystem(); - var loadedModList:Array = polymod.Polymod.init( - { - // Root directory for all mods. - modRoot: MOD_FOLDER, - // The directories for one or more mods to load. - dirs: ids, - // Framework being used to load assets. - framework: OPENFL, - // The current version of our API. - apiVersionRule: API_VERSION_RULE, - // Call this function any time an error occurs. - errorCallback: PolymodErrorHandler.onPolymodError, - // Enforce semantic version patterns for each mod. - // modVersions: null, - // A map telling Polymod what the asset type is for unfamiliar file extensions. - // extensionMap: [], + var loadedModList:Array = polymod.Polymod.init({ + // Root directory for all mods. + modRoot: MOD_FOLDER, + // The directories for one or more mods to load. + dirs: ids, + // Framework being used to load assets. + framework: OPENFL, + // The current version of our API. + apiVersionRule: API_VERSION_RULE, + // Call this function any time an error occurs. + errorCallback: PolymodErrorHandler.onPolymodError, + // Enforce semantic version patterns for each mod. + // modVersions: null, + // A map telling Polymod what the asset type is for unfamiliar file extensions. + // extensionMap: [], - customFilesystem: modFileSystem, + customFilesystem: modFileSystem, - frameworkParams: buildFrameworkParams(), + frameworkParams: buildFrameworkParams(), - // List of filenames to ignore in mods. Use the default list to ignore the metadata file, etc. - ignoredFiles: buildIgnoreList(), + // List of filenames to ignore in mods. Use the default list to ignore the metadata file, etc. + ignoredFiles: buildIgnoreList(), - // Parsing rules for various data formats. - parseRules: buildParseRules(), + // Parsing rules for various data formats. + parseRules: buildParseRules(), - skipDependencyErrors: true, + skipDependencyErrors: true, - // Parse hxc files and register the scripted classes in them. - useScriptedClasses: true, - loadScriptsAsync: #if html5 true #else false #end, - }); + // Parse hxc files and register the scripted classes in them. + useScriptedClasses: true, + loadScriptsAsync: #if html5 true #else false #end, + }); if (loadedModList == null) { @@ -239,11 +238,10 @@ class PolymodHandler static function buildFileSystem():polymod.fs.ZipFileSystem { polymod.Polymod.onError = PolymodErrorHandler.onPolymodError; - return new ZipFileSystem( - { - modRoot: MOD_FOLDER, - autoScan: true - }); + return new ZipFileSystem({ + modRoot: MOD_FOLDER, + autoScan: true + }); } static function buildImports():Void @@ -410,16 +408,10 @@ class PolymodHandler // `funkin.save.Save` // Direct access to save data is important for scripts (like checking unlocks), // but we don't want scripts to be able to perform operations like writing scores. - Polymod.blacklistInstanceFields(funkin.save.Save, [ - // No direct field access - 'data', - // LMFAO definitely not - 'clearData', - // No score manipulation please - 'setLevelScore', - 'setSongScore', - 'applySongRank' - ]); + Polymod.blacklistInstanceFields(funkin.save.Save, [ // No direct field access + 'data', // LMFAO definitely not + 'clearData', // No score manipulation please + 'setLevelScore', 'setSongScore', 'applySongRank']); // `funkin.api.*` // Contains functions which may allow for cheating and such. @@ -528,22 +520,7 @@ class PolymodHandler static inline function buildFrameworkParams():polymod.Polymod.FrameworkParams { return { - assetLibraryPaths: [ - 'default' => 'preload', - 'shared' => 'shared', - 'songs' => 'songs', - 'videos' => 'videos', - 'tutorial' => 'tutorial', - 'week1' => 'week1', - 'week2' => 'week2', - 'week3' => 'week3', - 'week4' => 'week4', - 'week5' => 'week5', - 'week6' => 'week6', - 'week7' => 'week7', - 'weekend1' => 'weekend1', - 'sserafim' => 'sserafim' - ], + assetLibraryPaths: ['default' => 'preload', 'shared' => 'shared', 'songs' => 'songs', 'videos' => 'videos', 'tutorial' => 'tutorial', 'week1' => 'week1', 'week2' => 'week2', 'week3' => 'week3', 'week4' => 'week4', 'week5' => 'week5', 'week6' => 'week6', 'week7' => 'week7', 'weekend1' => 'weekend1', 'sserafim' => 'sserafim'], coreAssetRedirect: CORE_FOLDER, } } @@ -558,13 +535,12 @@ class PolymodHandler if (modFileSystem == null) modFileSystem = buildFileSystem(); - var modMetadata:Array = Polymod.scan( - { - modRoot: MOD_FOLDER, - apiVersionRule: API_VERSION_RULE, - fileSystem: modFileSystem, - errorCallback: PolymodErrorHandler.onPolymodError - }); + var modMetadata:Array = Polymod.scan({ + modRoot: MOD_FOLDER, + apiVersionRule: API_VERSION_RULE, + fileSystem: modFileSystem, + errorCallback: PolymodErrorHandler.onPolymodError + }); trace('Found ${modMetadata.length} mods when scanning.'); return modMetadata; } diff --git a/source/funkin/modding/base/ScriptedFlxBasic.hx b/source/funkin/modding/base/ScriptedFlxBasic.hx index af0360554..7e4586008 100644 --- a/source/funkin/modding/base/ScriptedFlxBasic.hx +++ b/source/funkin/modding/base/ScriptedFlxBasic.hx @@ -5,4 +5,6 @@ package funkin.modding.base; * Create a scripted class that extends FlxBasic to use this. */ @:hscriptClass -class ScriptedFlxBasic extends flixel.FlxBasic implements HScriptedClass {} +class ScriptedFlxBasic extends flixel.FlxBasic implements HScriptedClass +{ +} diff --git a/source/funkin/modding/base/ScriptedFlxObject.hx b/source/funkin/modding/base/ScriptedFlxObject.hx index 9dd6b32ae..ca347922a 100644 --- a/source/funkin/modding/base/ScriptedFlxObject.hx +++ b/source/funkin/modding/base/ScriptedFlxObject.hx @@ -5,4 +5,6 @@ package funkin.modding.base; * Create a scripted class that extends FlxObject to use this. */ @:hscriptClass -class ScriptedFlxObject extends flixel.FlxObject implements HScriptedClass {} +class ScriptedFlxObject extends flixel.FlxObject implements HScriptedClass +{ +} diff --git a/source/funkin/modding/base/ScriptedFlxRuntimeShader.hx b/source/funkin/modding/base/ScriptedFlxRuntimeShader.hx index 0ef058d8a..2bc4fc2c4 100644 --- a/source/funkin/modding/base/ScriptedFlxRuntimeShader.hx +++ b/source/funkin/modding/base/ScriptedFlxRuntimeShader.hx @@ -5,4 +5,6 @@ package funkin.modding.base; * Create a scripted class that extends FlxRuntimeShader to use this. */ @:hscriptClass -class ScriptedFlxRuntimeShader extends flixel.addons.display.FlxRuntimeShader implements HScriptedClass {} +class ScriptedFlxRuntimeShader extends flixel.addons.display.FlxRuntimeShader implements HScriptedClass +{ +} diff --git a/source/funkin/modding/base/ScriptedFlxSprite.hx b/source/funkin/modding/base/ScriptedFlxSprite.hx index 0bd2e9dab..25ae4caa7 100644 --- a/source/funkin/modding/base/ScriptedFlxSprite.hx +++ b/source/funkin/modding/base/ScriptedFlxSprite.hx @@ -5,4 +5,6 @@ package funkin.modding.base; * Create a scripted class that extends FlxSprite to use this. */ @:hscriptClass -class ScriptedFlxSprite extends flixel.FlxSprite implements HScriptedClass {} +class ScriptedFlxSprite extends flixel.FlxSprite implements HScriptedClass +{ +} diff --git a/source/funkin/modding/base/ScriptedFlxSpriteGroup.hx b/source/funkin/modding/base/ScriptedFlxSpriteGroup.hx index 1391cb44a..f2629fa82 100644 --- a/source/funkin/modding/base/ScriptedFlxSpriteGroup.hx +++ b/source/funkin/modding/base/ScriptedFlxSpriteGroup.hx @@ -5,4 +5,6 @@ package funkin.modding.base; * Create a scripted class that extends FlxSpriteGroup to use this. */ @:hscriptClass -class ScriptedFlxSpriteGroup extends flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup implements HScriptedClass {} +class ScriptedFlxSpriteGroup extends flixel.group.FlxSpriteGroup.FlxTypedSpriteGroup implements HScriptedClass +{ +} diff --git a/source/funkin/modding/base/ScriptedFlxState.hx b/source/funkin/modding/base/ScriptedFlxState.hx index 8b659328a..5f65e6d69 100644 --- a/source/funkin/modding/base/ScriptedFlxState.hx +++ b/source/funkin/modding/base/ScriptedFlxState.hx @@ -5,4 +5,6 @@ package funkin.modding.base; * Create a scripted class that extends FlxState to use this. */ @:hscriptClass -class ScriptedFlxState extends flixel.FlxState implements HScriptedClass {} +class ScriptedFlxState extends flixel.FlxState implements HScriptedClass +{ +} diff --git a/source/funkin/modding/base/ScriptedFlxStrip.hx b/source/funkin/modding/base/ScriptedFlxStrip.hx index bcab2b1d2..e28b4af17 100644 --- a/source/funkin/modding/base/ScriptedFlxStrip.hx +++ b/source/funkin/modding/base/ScriptedFlxStrip.hx @@ -5,4 +5,6 @@ package funkin.modding.base; * Create a scripted class that extends FlxStrip to use this. */ @:hscriptClass -class ScriptedFlxStrip extends flixel.FlxStrip implements HScriptedClass {} +class ScriptedFlxStrip extends flixel.FlxStrip implements HScriptedClass +{ +} diff --git a/source/funkin/modding/base/ScriptedFlxSubState.hx b/source/funkin/modding/base/ScriptedFlxSubState.hx index a9812c10d..8766f2aed 100644 --- a/source/funkin/modding/base/ScriptedFlxSubState.hx +++ b/source/funkin/modding/base/ScriptedFlxSubState.hx @@ -5,4 +5,6 @@ package funkin.modding.base; * Create a scripted class that extends FlxSubState to use this. */ @:hscriptClass -class ScriptedFlxSubState extends flixel.FlxSubState implements HScriptedClass {} +class ScriptedFlxSubState extends flixel.FlxSubState implements HScriptedClass +{ +} diff --git a/source/funkin/modding/base/ScriptedFlxTransitionableState.hx b/source/funkin/modding/base/ScriptedFlxTransitionableState.hx index 2452b93a6..d64cdb737 100644 --- a/source/funkin/modding/base/ScriptedFlxTransitionableState.hx +++ b/source/funkin/modding/base/ScriptedFlxTransitionableState.hx @@ -5,4 +5,6 @@ package funkin.modding.base; * Create a scripted class that extends FlxTransitionableState to use this. */ @:hscriptClass -class ScriptedFlxTransitionableState extends flixel.addons.transition.FlxTransitionableState implements HScriptedClass {} +class ScriptedFlxTransitionableState extends flixel.addons.transition.FlxTransitionableState implements HScriptedClass +{ +} diff --git a/source/funkin/modding/base/ScriptedFlxTypedGroup.hx b/source/funkin/modding/base/ScriptedFlxTypedGroup.hx index e98349d2d..4b4b9c64b 100644 --- a/source/funkin/modding/base/ScriptedFlxTypedGroup.hx +++ b/source/funkin/modding/base/ScriptedFlxTypedGroup.hx @@ -5,4 +5,6 @@ package funkin.modding.base; * Create a scripted class that extends FlxTypedGroup to use this. */ @:hscriptClass -class ScriptedFlxTypedGroup extends flixel.group.FlxGroup.FlxTypedGroup implements HScriptedClass {} +class ScriptedFlxTypedGroup extends flixel.group.FlxGroup.FlxTypedGroup implements HScriptedClass +{ +} diff --git a/source/funkin/modding/events/ScriptEventDispatcher.hx b/source/funkin/modding/events/ScriptEventDispatcher.hx index 749a6ad82..15705c829 100644 --- a/source/funkin/modding/events/ScriptEventDispatcher.hx +++ b/source/funkin/modding/events/ScriptEventDispatcher.hx @@ -92,13 +92,8 @@ class ScriptEventDispatcher else { // If the target doesn't support the event, stop trying to dispatch. - if ([ - ScriptEventType.DIALOGUE_START, - ScriptEventType.DIALOGUE_LINE, - ScriptEventType.DIALOGUE_COMPLETE_LINE, - ScriptEventType.DIALOGUE_SKIP, - ScriptEventType.DIALOGUE_END - ].contains(event.type)) return; + if ([ScriptEventType.DIALOGUE_START, ScriptEventType.DIALOGUE_LINE, ScriptEventType.DIALOGUE_COMPLETE_LINE, ScriptEventType.DIALOGUE_SKIP, ScriptEventType.DIALOGUE_END].contains(event.type)) + return; } if (Std.isOfType(target, INoteScriptedClass)) @@ -124,12 +119,7 @@ class ScriptEventDispatcher else { // If the target doesn't support the event, stop trying to dispatch. - if ([ - ScriptEventType.NOTE_INCOMING, - ScriptEventType.NOTE_HIT, - ScriptEventType.NOTE_MISS, - ScriptEventType.NOTE_HOLD_DROP - ].contains(event.type)) return; + if ([ScriptEventType.NOTE_INCOMING, ScriptEventType.NOTE_HIT, ScriptEventType.NOTE_MISS, ScriptEventType.NOTE_HOLD_DROP].contains(event.type)) return; } if (Std.isOfType(target, IBPMSyncedScriptedClass)) @@ -199,20 +189,8 @@ class ScriptEventDispatcher else { // If the target doesn't support the event, stop trying to dispatch. - if ([ - ScriptEventType.NOTE_GHOST_MISS, - ScriptEventType.SONG_START, - ScriptEventType.SONG_END, - ScriptEventType.SONG_RETRY, - ScriptEventType.GAME_OVER, - ScriptEventType.PAUSE, - ScriptEventType.RESUME, - ScriptEventType.SONG_EVENT, - ScriptEventType.COUNTDOWN_START, - ScriptEventType.COUNTDOWN_STEP, - ScriptEventType.COUNTDOWN_END, - ScriptEventType.SONG_LOADED - ].contains(event.type)) return; + if ([ScriptEventType.NOTE_GHOST_MISS, ScriptEventType.SONG_START, ScriptEventType.SONG_END, ScriptEventType.SONG_RETRY, ScriptEventType.GAME_OVER, ScriptEventType.PAUSE, ScriptEventType.RESUME, ScriptEventType.SONG_EVENT, ScriptEventType.COUNTDOWN_START, ScriptEventType.COUNTDOWN_STEP, ScriptEventType.COUNTDOWN_END, ScriptEventType.SONG_LOADED].contains(event.type)) + return; } if (Std.isOfType(target, IStateChangingScriptedClass)) @@ -250,16 +228,8 @@ class ScriptEventDispatcher else { // If the target doesn't support the event, stop trying to dispatch. - if ([ - ScriptEventType.STATE_CHANGE_BEGIN, - ScriptEventType.STATE_CHANGE_END, - ScriptEventType.SUBSTATE_OPEN_BEGIN, - ScriptEventType.SUBSTATE_OPEN_END, - ScriptEventType.SUBSTATE_CLOSE_BEGIN, - ScriptEventType.SUBSTATE_CLOSE_END, - ScriptEventType.FOCUS_LOST, - ScriptEventType.FOCUS_GAINED - ].contains(event.type)) return; + if ([ScriptEventType.STATE_CHANGE_BEGIN, ScriptEventType.STATE_CHANGE_END, ScriptEventType.SUBSTATE_OPEN_BEGIN, ScriptEventType.SUBSTATE_OPEN_END, ScriptEventType.SUBSTATE_CLOSE_BEGIN, ScriptEventType.SUBSTATE_CLOSE_END, ScriptEventType.FOCUS_LOST, ScriptEventType.FOCUS_GAINED].contains(event.type)) + return; } if (Std.isOfType(target, IFreeplayScriptedClass)) @@ -291,14 +261,8 @@ class ScriptEventDispatcher else { // If the target doesn't support the event, stop trying to dispatch. - if ([ - ScriptEventType.CAPSULE_SELECTED, - ScriptEventType.DIFFICULTY_SWITCH, - ScriptEventType.SONG_SELECTED, - ScriptEventType.FREEPLAY_INTRO, - ScriptEventType.FREEPLAY_OUTRO, - ScriptEventType.FREEPLAY_CLOSE - ].contains(event.type)) return; + if ([ScriptEventType.CAPSULE_SELECTED, ScriptEventType.DIFFICULTY_SWITCH, ScriptEventType.SONG_SELECTED, ScriptEventType.FREEPLAY_INTRO, ScriptEventType.FREEPLAY_OUTRO, ScriptEventType.FREEPLAY_CLOSE].contains(event.type)) + return; } if (Std.isOfType(target, ICharacterSelectScriptedClass)) @@ -321,11 +285,7 @@ class ScriptEventDispatcher else { // If the target doesn't support the event, stop trying to dispatch. - if ([ - ScriptEventType.CHARACTER_SELECTED, - ScriptEventType.CHARACTER_DESELECTED, - ScriptEventType.CHARACTER_CONFIRMED - ].contains(event.type)) return; + if ([ScriptEventType.CHARACTER_SELECTED, ScriptEventType.CHARACTER_DESELECTED, ScriptEventType.CHARACTER_CONFIRMED].contains(event.type)) return; } // If we reach this line, it means a script event was dispatched while not being properly handled. diff --git a/source/funkin/modding/module/Module.hx b/source/funkin/modding/module/Module.hx index 27993e893..0d342d565 100644 --- a/source/funkin/modding/module/Module.hx +++ b/source/funkin/modding/module/Module.hx @@ -87,204 +87,284 @@ class Module implements IPlayStateScriptedClass implements IStateChangingScripte /** * Called when ANY script event is dispatched. */ - public function onScriptEvent(event:ScriptEvent) {} + public function onScriptEvent(event:ScriptEvent) + { + } /** * Called when the module is first created. * This happens before the title screen appears! */ - public function onCreate(event:ScriptEvent) {} + public function onCreate(event:ScriptEvent) + { + } /** * Called when a module is destroyed. * This currently only happens when reloading modules with F5. */ - public function onDestroy(event:ScriptEvent) {} + public function onDestroy(event:ScriptEvent) + { + } /** * Called every frame. */ - public function onUpdate(event:UpdateScriptEvent) {} + public function onUpdate(event:UpdateScriptEvent) + { + } /** * Called when the game is paused. */ - public function onPause(event:PauseScriptEvent) {} + public function onPause(event:PauseScriptEvent) + { + } /** * Called when the game is resumed. */ - public function onResume(event:ScriptEvent) {} + public function onResume(event:ScriptEvent) + { + } /** * Called when the song begins. */ - public function onSongStart(event:ScriptEvent) {} + public function onSongStart(event:ScriptEvent) + { + } /** * Called when the song ends. */ - public function onSongEnd(event:ScriptEvent) {} + public function onSongEnd(event:ScriptEvent) + { + } /** * Called when the player dies. */ - public function onGameOver(event:ScriptEvent) {} + public function onGameOver(event:ScriptEvent) + { + } /** * Called when a note on the strumline has been rendered and is now onscreen. * This gets dispatched for both the player and opponent strumlines. */ - public function onNoteIncoming(event:NoteScriptEvent) {} + public function onNoteIncoming(event:NoteScriptEvent) + { + } /** * Called when a note has been hit. * This gets dispatched for both the player and opponent strumlines. */ - public function onNoteHit(event:HitNoteScriptEvent) {} + public function onNoteHit(event:HitNoteScriptEvent) + { + } /** * Called when a note has been missed. * This gets dispatched for both the player and opponent strumlines. */ - public function onNoteMiss(event:NoteScriptEvent) {} + public function onNoteMiss(event:NoteScriptEvent) + { + } - public function onNoteHoldDrop(event:HoldNoteScriptEvent) {} + public function onNoteHoldDrop(event:HoldNoteScriptEvent) + { + } /** * Called when the player presses a key without any notes present. */ - public function onNoteGhostMiss(event:GhostMissNoteScriptEvent) {} + public function onNoteGhostMiss(event:GhostMissNoteScriptEvent) + { + } /** * Called when a step is hit in the song. */ - public function onStepHit(event:SongTimeScriptEvent) {} + public function onStepHit(event:SongTimeScriptEvent) + { + } /** * Called when a beat is hit in the song. */ - public function onBeatHit(event:SongTimeScriptEvent) {} + public function onBeatHit(event:SongTimeScriptEvent) + { + } /** * Called when a song event is triggered. */ - public function onSongEvent(event:SongEventScriptEvent) {} + public function onSongEvent(event:SongEventScriptEvent) + { + } /** * Called when the countdown begins. */ - public function onCountdownStart(event:CountdownScriptEvent) {} + public function onCountdownStart(event:CountdownScriptEvent) + { + } /** * Called for every step in the countdown. */ - public function onCountdownStep(event:CountdownScriptEvent) {} + public function onCountdownStep(event:CountdownScriptEvent) + { + } /** * Called when the countdown ends, but BEFORE the song starts. */ - public function onCountdownEnd(event:CountdownScriptEvent) {} + public function onCountdownEnd(event:CountdownScriptEvent) + { + } /** * Called when the song's chart has been parsed and loaded. */ - public function onSongLoaded(event:SongLoadScriptEvent) {} + public function onSongLoaded(event:SongLoadScriptEvent) + { + } /** * Called when the game is about to switch to a new state. */ - public function onStateChangeBegin(event:StateChangeScriptEvent) {} + public function onStateChangeBegin(event:StateChangeScriptEvent) + { + } /** * Called after the game has switched to a new state. */ - public function onStateChangeEnd(event:StateChangeScriptEvent) {} + public function onStateChangeEnd(event:StateChangeScriptEvent) + { + } /** * Called when the game regains focus. * This does not get called if "Pause on Unfocus" is disabled. */ - public function onFocusGained(event:FocusScriptEvent) {} + public function onFocusGained(event:FocusScriptEvent) + { + } /** * Called when the game loses focus. * This does not get called if "Pause on Unfocus" is disabled. */ - public function onFocusLost(event:FocusScriptEvent) {} + public function onFocusLost(event:FocusScriptEvent) + { + } /** * Called when the game is about to open a substate. */ - public function onSubStateOpenBegin(event:SubStateScriptEvent) {} + public function onSubStateOpenBegin(event:SubStateScriptEvent) + { + } /** * Called when a substate has been opened. */ - public function onSubStateOpenEnd(event:SubStateScriptEvent) {} + public function onSubStateOpenEnd(event:SubStateScriptEvent) + { + } /** * Called when the game is about to close a substate. */ - public function onSubStateCloseBegin(event:SubStateScriptEvent) {} + public function onSubStateCloseBegin(event:SubStateScriptEvent) + { + } /** * Called when a substate has been closed. */ - public function onSubStateCloseEnd(event:SubStateScriptEvent) {} + public function onSubStateCloseEnd(event:SubStateScriptEvent) + { + } /** * Called when the song has been restarted. */ - public function onSongRetry(event:SongRetryEvent) {} + public function onSongRetry(event:SongRetryEvent) + { + } /** * Called when any state is created. */ - public function onStateCreate(event:ScriptEvent) {} + public function onStateCreate(event:ScriptEvent) + { + } /** * Called when a capsule is selected. */ - public function onCapsuleSelected(event:CapsuleScriptEvent):Void {} + public function onCapsuleSelected(event:CapsuleScriptEvent):Void + { + } /** * Called when the current difficulty is changed. */ - public function onDifficultySwitch(event:CapsuleScriptEvent):Void {} + public function onDifficultySwitch(event:CapsuleScriptEvent):Void + { + } /** * Called when a song is selected. */ - public function onSongSelected(event:CapsuleScriptEvent):Void {} + public function onSongSelected(event:CapsuleScriptEvent):Void + { + } /** * Called when the intro for Freeplay finishes. */ - public function onFreeplayIntroDone(event:FreeplayScriptEvent):Void {} + public function onFreeplayIntroDone(event:FreeplayScriptEvent):Void + { + } /** * Called when the Freeplay outro begins. */ - public function onFreeplayOutro(event:FreeplayScriptEvent):Void {} + public function onFreeplayOutro(event:FreeplayScriptEvent):Void + { + } /** * Called when Freeplay is closed. */ - public function onFreeplayClose(event:FreeplayScriptEvent):Void {} + public function onFreeplayClose(event:FreeplayScriptEvent):Void + { + } /** * Called when a character is selected. */ - public function onCharacterSelect(event:CharacterSelectScriptEvent):Void {} + public function onCharacterSelect(event:CharacterSelectScriptEvent):Void + { + } /** * Called when the user presses BACK after confirming a character. */ - public function onCharacterDeselect(event:CharacterSelectScriptEvent):Void {} + public function onCharacterDeselect(event:CharacterSelectScriptEvent):Void + { + } /** * Called when a character has been confirmed. */ - public function onCharacterConfirm(event:CharacterSelectScriptEvent):Void {} + public function onCharacterConfirm(event:CharacterSelectScriptEvent):Void + { + } } diff --git a/source/funkin/modding/module/ScriptedModule.hx b/source/funkin/modding/module/ScriptedModule.hx index 3517bb9a1..c4a2740c2 100644 --- a/source/funkin/modding/module/ScriptedModule.hx +++ b/source/funkin/modding/module/ScriptedModule.hx @@ -7,4 +7,6 @@ import polymod.hscript.HScriptedClass; * Create a scripted class that extends Module to use this. */ @:hscriptClass -class ScriptedModule extends Module implements HScriptedClass {} +class ScriptedModule extends Module implements HScriptedClass +{ +} diff --git a/source/funkin/play/Countdown.hx b/source/funkin/play/Countdown.hx index c034ba763..818f5e796 100644 --- a/source/funkin/play/Countdown.hx +++ b/source/funkin/play/Countdown.hx @@ -67,7 +67,8 @@ class Countdown // The timer function gets called based on the beat of the song. countdownTimer = new FlxTimer(); - countdownTimer.start(Conductor.instance.beatLengthMs / 1000, function(tmr:FlxTimer) { + countdownTimer.start(Conductor.instance.beatLengthMs / 1000, function(tmr:FlxTimer) + { if (PlayState.instance == null) { tmr.cancel(); @@ -229,13 +230,13 @@ class Countdown if (noteStyle.isCountdownSpritePixel(index)) fadeEase = EaseUtil.stepped(8); // Fade sprite in, then out, then destroy it. - FlxTween.tween(countdownSprite, {alpha: 0}, Conductor.instance.beatLengthMs / 1000, + FlxTween.tween(countdownSprite, {alpha: 0}, Conductor.instance.beatLengthMs / 1000, { + ease: fadeEase, + onComplete: function(twn:FlxTween) { - ease: fadeEase, - onComplete: function(twn:FlxTween) { - countdownSprite.destroy(); - } - }); + countdownSprite.destroy(); + } + }); countdownSprite.cameras = [PlayState.instance.camHUD]; PlayState.instance.add(countdownSprite); diff --git a/source/funkin/play/GameOverSubState.hx b/source/funkin/play/GameOverSubState.hx index 16e27cfd8..f002281ff 100644 --- a/source/funkin/play/GameOverSubState.hx +++ b/source/funkin/play/GameOverSubState.hx @@ -159,7 +159,9 @@ class GameOverSubState extends MusicBeatSubState // Pluck Boyfriend from the PlayState and place him (in the same position) in the GameOverSubState. // We can then play the character's `firstDeath` animation. - if ((parentPlayState?.isMinimalMode ?? true)) {} + if ((parentPlayState?.isMinimalMode ?? true)) + { + } else { boyfriend = parentPlayState?.currentStage?.getBoyfriend(true); @@ -188,7 +190,8 @@ class GameOverSubState extends MusicBeatSubState HapticUtil.vibrate(0, Constants.DEFAULT_VIBRATION_DURATION); // Allow input a second later to prevent accidental gameover skips. - new FlxTimer().start(1, function(tmr:FlxTimer) { + new FlxTimer().start(1, function(tmr:FlxTimer) + { canInput = true; }); } @@ -339,7 +342,8 @@ class GameOverSubState extends MusicBeatSubState // Start music at lower volume startDeathMusic(0.2, false); boyfriend.playAnimation('deathLoop' + animationSuffix); - deathQuoteSound = FunkinSound.playOnce(deathQuote, function() { + deathQuoteSound = FunkinSound.playOnce(deathQuote, function() + { // Once the quote ends, fade in the game over music. if (!isEnding && gameOverMusic != null) { @@ -367,7 +371,9 @@ class GameOverSubState extends MusicBeatSubState startDeathMusic(1.0, true); // isEnding changes this function's behavior. - if ((parentPlayState?.isMinimalMode ?? true) || boyfriend == null) {} + if ((parentPlayState?.isMinimalMode ?? true) || boyfriend == null) + { + } else { boyfriend.playAnimation('deathConfirm' + animationSuffix, true); @@ -378,17 +384,21 @@ class GameOverSubState extends MusicBeatSubState final FADE_TIMER:Float = (gameOverMusic?.length ?? 0) / 7000; // After the animation finishes... - new FlxTimer().start(FADE_TIMER, function(tmr:FlxTimer) { + new FlxTimer().start(FADE_TIMER, function(tmr:FlxTimer) + { // ...fade out the graphics. Then after that happens... - var resetPlaying = function(pixel:Bool = false) { + var resetPlaying = function(pixel:Bool = false) + { // ...close the GameOverSubState. if (pixel) RetroCameraFade.fadeBlack(FlxG.camera, 10, 1); else FlxG.camera.fade(FlxColor.BLACK, 1, true, null, true); if (parentPlayState != null) parentPlayState.needsReset = true; - if ((parentPlayState?.isMinimalMode ?? true) || boyfriend == null) {} + if ((parentPlayState?.isMinimalMode ?? true) || boyfriend == null) + { + } else { // Readd Boyfriend to the stage. @@ -407,12 +417,14 @@ class GameOverSubState extends MusicBeatSubState if (musicSuffix.contains('-pixel')) { RetroCameraFade.fadeToBlack(FlxG.camera, 10, 2); - new FlxTimer().start(2, _ -> { + new FlxTimer().start(2, _ -> + { FlxG.camera.filters = []; #if FEATURE_MOBILE_ADVERTISEMENTS if (AdMobUtil.PLAYING_COUNTER >= AdMobUtil.MAX_BEFORE_AD) { - AdMobUtil.loadInterstitial(function():Void { + AdMobUtil.loadInterstitial(function():Void + { AdMobUtil.PLAYING_COUNTER = 0; resetPlaying(true); }); @@ -426,11 +438,13 @@ class GameOverSubState extends MusicBeatSubState } else { - FlxG.camera.fade(FlxColor.BLACK, 2, false, function() { + FlxG.camera.fade(FlxColor.BLACK, 2, false, function() + { #if FEATURE_MOBILE_ADVERTISEMENTS if (AdMobUtil.PLAYING_COUNTER >= AdMobUtil.MAX_BEFORE_AD) { - AdMobUtil.loadInterstitial(function():Void { + AdMobUtil.loadInterstitial(function():Void + { AdMobUtil.PLAYING_COUNTER = 0; resetPlaying(); }); @@ -494,7 +508,8 @@ class GameOverSubState extends MusicBeatSubState } else { - onComplete = function() { + onComplete = function() + { isStarting = false; // We need to force to ensure that the non-starting music plays. startDeathMusic(1.0, true); diff --git a/source/funkin/play/PauseSubState.hx b/source/funkin/play/PauseSubState.hx index 6035cc21f..31cd0c881 100644 --- a/source/funkin/play/PauseSubState.hx +++ b/source/funkin/play/PauseSubState.hx @@ -56,50 +56,35 @@ class PauseSubState extends MusicBeatSubState /** * Pause menu entries for when the game is paused during a song. */ - static final PAUSE_MENU_ENTRIES_STANDARD:Array = [ - {text: 'Resume', callback: resume}, - {text: 'Restart Song', callback: restartPlayState}, - {text: 'Change Difficulty', callback: switchMode.bind(_, Difficulty)}, - {text: 'Enable Practice Mode', callback: enablePracticeMode, filter: () -> !(PlayState.instance?.isPracticeMode ?? false)}, - {text: 'Exit to Menu', callback: quitToMenu}, - ]; + static final PAUSE_MENU_ENTRIES_STANDARD:Array = [{text: 'Resume', callback: resume}, {text: 'Restart Song', + callback: restartPlayState}, {text: 'Change Difficulty', callback: switchMode.bind(_, + Difficulty)}, {text: 'Enable Practice Mode', callback: enablePracticeMode, filter: () -> + !(PlayState.instance?.isPracticeMode ?? false)}, {text: 'Exit to Menu', callback: quitToMenu},]; /** * Pause menu entries for when the game is paused in the Chart Editor preview. */ - static final PAUSE_MENU_ENTRIES_CHARTING:Array = [ - {text: 'Resume', callback: resume}, - {text: 'Restart Song', callback: restartPlayState}, - {text: 'Return to Chart Editor', callback: quitToChartEditor}, - ]; + static final PAUSE_MENU_ENTRIES_CHARTING:Array = [{text: 'Resume', callback: resume}, {text: 'Restart Song', + callback: restartPlayState}, {text: 'Return to Chart Editor', callback: quitToChartEditor},]; /** * Pause menu entries for when the user selects "Change Difficulty". */ - static final PAUSE_MENU_ENTRIES_DIFFICULTY:Array = [ - {text: 'Back', callback: switchMode.bind(_, Standard)} - // Other entries are added dynamically. + static final PAUSE_MENU_ENTRIES_DIFFICULTY:Array = [{text: 'Back', callback: switchMode.bind(_, + Standard)} // Other entries are added dynamically. ]; /** * Pause menu entries for when the game is paused during a video cutscene. */ - static final PAUSE_MENU_ENTRIES_VIDEO_CUTSCENE:Array = [ - {text: 'Resume', callback: resume}, - {text: 'Skip Cutscene', callback: skipVideoCutscene}, - {text: 'Restart Cutscene', callback: restartVideoCutscene}, - {text: 'Exit to Menu', callback: quitToMenu}, - ]; + static final PAUSE_MENU_ENTRIES_VIDEO_CUTSCENE:Array = [{text: 'Resume', callback: resume}, {text: 'Skip Cutscene', + callback: skipVideoCutscene}, {text: 'Restart Cutscene', callback: restartVideoCutscene}, {text: 'Exit to Menu', callback: quitToMenu},]; /** * Pause menu entries for when the game is paused during a conversation. */ - static final PAUSE_MENU_ENTRIES_CONVERSATION:Array = [ - {text: 'Resume', callback: resume}, - {text: 'Skip Dialogue', callback: skipConversation}, - {text: 'Restart Dialogue', callback: restartConversation}, - {text: 'Exit to Menu', callback: quitToMenu}, - ]; + static final PAUSE_MENU_ENTRIES_CONVERSATION:Array = [{text: 'Resume', callback: resume}, {text: 'Skip Dialogue', + callback: skipConversation}, {text: 'Restart Dialogue', callback: restartConversation}, {text: 'Exit to Menu', callback: quitToMenu},]; /** * Duration for the music to fade in when the pause menu is opened. @@ -398,9 +383,8 @@ class PauseSubState extends MusicBeatSubState pauseButton = FunkinSprite.createSparrow(0, 0, "pauseButton"); pauseButton.animation.addByIndices('idle', 'pause', [0], "", 24, false); pauseButton.animation.addByIndices('hold', 'pause', [5], "", 24, false); - pauseButton.animation.addByIndices('confirm', 'pause', [ - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 - ], "", 24, false); + pauseButton.animation.addByIndices('confirm', 'pause', + [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], "", 24, false); pauseButton.scale.set(0.8, 0.8); pauseButton.updateHitbox(); pauseButton.animation.play("confirm"); @@ -504,56 +488,56 @@ class PauseSubState extends MusicBeatSubState function startCharterTimer():Void { - charterFadeTween = FlxTween.tween(metadataArtist, {alpha: 0.0}, CHARTER_FADE_DURATION, + charterFadeTween = FlxTween.tween(metadataArtist, {alpha: 0.0}, CHARTER_FADE_DURATION, { + startDelay: CHARTER_FADE_DELAY, + ease: FlxEase.quartOut, + onComplete: (_) -> { - startDelay: CHARTER_FADE_DELAY, - ease: FlxEase.quartOut, - onComplete: (_) -> { - if (PlayState.instance?.currentChart != null) - { - metadataArtist.text = 'Charter: ${PlayState.instance.currentChart.charter ?? 'Unknown'}'; - } - else - { - metadataArtist.text = 'Charter: ${Constants.DEFAULT_CHARTER}'; - } - - FlxTween.tween(metadataArtist, {alpha: 1.0}, CHARTER_FADE_DURATION, - { - ease: FlxEase.quartOut, - onComplete: (_) -> { - startArtistTimer(); - } - }); + if (PlayState.instance?.currentChart != null) + { + metadataArtist.text = 'Charter: ${PlayState.instance.currentChart.charter ?? 'Unknown'}'; } - }); + else + { + metadataArtist.text = 'Charter: ${Constants.DEFAULT_CHARTER}'; + } + + FlxTween.tween(metadataArtist, {alpha: 1.0}, CHARTER_FADE_DURATION, { + ease: FlxEase.quartOut, + onComplete: (_) -> + { + startArtistTimer(); + } + }); + } + }); } function startArtistTimer():Void { - charterFadeTween = FlxTween.tween(metadataArtist, {alpha: 0.0}, CHARTER_FADE_DURATION, + charterFadeTween = FlxTween.tween(metadataArtist, {alpha: 0.0}, CHARTER_FADE_DURATION, { + startDelay: CHARTER_FADE_DELAY, + ease: FlxEase.quartOut, + onComplete: (_) -> { - startDelay: CHARTER_FADE_DELAY, - ease: FlxEase.quartOut, - onComplete: (_) -> { - if (PlayState.instance?.currentChart != null) - { - metadataArtist.text = 'Artist: ${PlayState.instance.currentChart.songArtist}'; - } - else - { - metadataArtist.text = 'Artist: ${Constants.DEFAULT_ARTIST}'; - } - - FlxTween.tween(metadataArtist, {alpha: 1.0}, CHARTER_FADE_DURATION, - { - ease: FlxEase.quartOut, - onComplete: (_) -> { - startCharterTimer(); - } - }); + if (PlayState.instance?.currentChart != null) + { + metadataArtist.text = 'Artist: ${PlayState.instance.currentChart.songArtist}'; } - }); + else + { + metadataArtist.text = 'Artist: ${Constants.DEFAULT_ARTIST}'; + } + + FlxTween.tween(metadataArtist, {alpha: 1.0}, CHARTER_FADE_DURATION, { + ease: FlxEase.quartOut, + onComplete: (_) -> + { + startCharterTimer(); + } + }); + } + }); } var dataFadeTimer = new FlxTimer(); @@ -575,11 +559,13 @@ class PauseSubState extends MusicBeatSubState FlxTween.tween(pauseCircle.scale, {x: 0.84 * 0.8, y: 0.8 * 0.8}, 0.4, {ease: FlxEase.backInOut}); FlxTween.tween(pauseCircle, {alpha: 0}, 0.6, {ease: FlxEase.quartOut}); - hapticTimer.start(0.2, function(_) { + hapticTimer.start(0.2, function(_) + { HapticUtil.vibrate(0, 0.01, 0.5); }); - dataFadeTimer.start(0.3, function(_) { + dataFadeTimer.start(0.3, function(_) + { transitionMetadataIn(); FlxTween.tween(pauseButton, {alpha: 0}, 0.6, {ease: FlxEase.quartOut}); }); @@ -1016,7 +1002,8 @@ class PauseSubState extends MusicBeatSubState { state.allowInput = false; - AdMobUtil.loadInterstitial(function():Void { + AdMobUtil.loadInterstitial(function():Void + { AdMobUtil.PLAYING_COUNTER = 0; AdMobUtil.removeBanner(); @@ -1052,7 +1039,8 @@ class PauseSubState extends MusicBeatSubState { state.allowInput = false; - AdMobUtil.loadInterstitial(function():Void { + AdMobUtil.loadInterstitial(function():Void + { AdMobUtil.PLAYING_COUNTER = 0; AdMobUtil.removeBanner(); diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index c225018c6..89b6bb6ad 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -744,11 +744,10 @@ class PlayState extends MusicBeatSubState super(); // Validate parameters. - var params:PlayStateParams = params ?? - { - trace('WARNING: PlayState constructor called with no parameters. Reusing previous parameters.'); - lastParams ?? throw 'PlayState constructor called with no available parameters.'; - } + var params:PlayStateParams = params ?? { + trace('WARNING: PlayState constructor called with no parameters. Reusing previous parameters.'); + lastParams ?? throw 'PlayState constructor called with no available parameters.'; + } lastParams = params; // Apply parameters. @@ -1127,7 +1126,8 @@ class PlayState extends MusicBeatSubState Conductor.instance.update(-vwooshDelay * 1000 + startTimestamp + Conductor.instance.beatLengthMs * -5); // timer for vwoosh - vwooshTimer.start(vwooshDelay, function(_) { + vwooshTimer.start(vwooshDelay, function(_) + { if (playerStrumline.notes.length == 0) playerStrumline.updateNotes(); if (opponentStrumline.notes.length == 0) opponentStrumline.updateNotes(); playerStrumline.vwooshInNotes(); @@ -1303,7 +1303,8 @@ class PlayState extends MusicBeatSubState var deathPreTransitionDelay = currentStage?.getBoyfriend()?.getDeathPreTransitionDelay() ?? 0.0; if (deathPreTransitionDelay > 0) { - new FlxTimer().start(deathPreTransitionDelay, function(_) { + new FlxTimer().start(deathPreTransitionDelay, function(_) + { moveToGameOver(); }); } @@ -1314,14 +1315,13 @@ class PlayState extends MusicBeatSubState } #if FEATURE_DISCORD_RPC - DiscordClient.instance.setPresence( - { - details: 'Game Over - ${buildDiscordRPCDetails()}', - state: buildDiscordRPCState(), + DiscordClient.instance.setPresence({ + details: 'Game Over - ${buildDiscordRPCDetails()}', + state: buildDiscordRPCState(), - largeImageKey: discordRPCAlbum, - smallImageKey: discordRPCIcon - }); + largeImageKey: discordRPCAlbum, + smallImageKey: discordRPCIcon + }); #end } else if (isPlayerDying) @@ -1403,13 +1403,12 @@ class PlayState extends MusicBeatSubState } #if FEATURE_DISCORD_RPC - DiscordClient.instance.setPresence( - { - details: 'Paused - ${buildDiscordRPCDetails()}', - state: buildDiscordRPCState(), - largeImageKey: discordRPCAlbum, - smallImageKey: discordRPCIcon - }); + DiscordClient.instance.setPresence({ + details: 'Paused - ${buildDiscordRPCDetails()}', + state: buildDiscordRPCState(), + largeImageKey: discordRPCAlbum, + smallImageKey: discordRPCIcon + }); #end } } @@ -1462,11 +1461,10 @@ class PlayState extends MusicBeatSubState isGameOverState = true; shouldSubstatePause = true; // Transition to the game over substate. - var gameOverSubState = new GameOverSubState( - { - isChartingMode: isChartingMode, - transparent: persistentDraw - }); + var gameOverSubState = new GameOverSubState({ + isChartingMode: isChartingMode, + transparent: persistentDraw + }); FlxTransitionableState.skipNextTransIn = true; FlxTransitionableState.skipNextTransOut = true; openSubState(gameOverSubState); @@ -1556,7 +1554,8 @@ class PlayState extends MusicBeatSubState // Vocals are also paused here but are not included as they are handled separately. if (Std.isOfType(subState, PauseSubState)) { - FlxG.sound.list.forEachAlive(function(sound:FlxSound) { + FlxG.sound.list.forEachAlive(function(sound:FlxSound) + { if (!sound.active || sound == FlxG.sound.music) return; // In case it's a scheduled sound if (Std.isOfType(sound, FunkinSound)) @@ -1569,7 +1568,8 @@ class PlayState extends MusicBeatSubState soundsPausedBySubState.add(sound); }); - vocals?.forEach(function(voice:FunkinSound) { + vocals?.forEach(function(voice:FunkinSound) + { soundsPausedBySubState.remove(voice); }); } @@ -1633,7 +1633,8 @@ class PlayState extends MusicBeatSubState // Vocals are also paused here but are not included as they are handled separately. if (!isGameOverState) { - FlxG.sound.list.forEachAlive(function(sound:FlxSound) { + FlxG.sound.list.forEachAlive(function(sound:FlxSound) + { if (!sound.active || sound == FlxG.sound.music) return; // In case it's a scheduled sound if (Std.isOfType(sound, FunkinSound)) @@ -1646,7 +1647,8 @@ class PlayState extends MusicBeatSubState soundsPausedBySubState.add(sound); }); - vocals?.forEach(function(voice:FunkinSound) { + vocals?.forEach(function(voice:FunkinSound) + { soundsPausedBySubState.remove(voice); }); } @@ -1698,25 +1700,23 @@ class PlayState extends MusicBeatSubState { // DiscordClient.changePresence(detailsText, '${currentChart.songName} ($discordRPCDifficulty)', discordRPCIcon, true, // currentSongLengthMs - Conductor.instance.songPosition); - DiscordClient.instance.setPresence( - { - state: buildDiscordRPCState(), - details: buildDiscordRPCDetails(), + DiscordClient.instance.setPresence({ + state: buildDiscordRPCState(), + details: buildDiscordRPCDetails(), - largeImageKey: discordRPCAlbum, - smallImageKey: discordRPCIcon - }); + largeImageKey: discordRPCAlbum, + smallImageKey: discordRPCIcon + }); } else { - DiscordClient.instance.setPresence( - { - state: buildDiscordRPCState(), - details: buildDiscordRPCDetails(), + DiscordClient.instance.setPresence({ + state: buildDiscordRPCState(), + details: buildDiscordRPCDetails(), - largeImageKey: discordRPCAlbum, - smallImageKey: discordRPCIcon - }); + largeImageKey: discordRPCAlbum, + smallImageKey: discordRPCIcon + }); } #end @@ -1742,25 +1742,23 @@ class PlayState extends MusicBeatSubState { if (Conductor.instance.songPosition > 0.0) { - DiscordClient.instance.setPresence( - { - state: buildDiscordRPCState(), - details: buildDiscordRPCDetails(), + DiscordClient.instance.setPresence({ + state: buildDiscordRPCState(), + details: buildDiscordRPCDetails(), - largeImageKey: discordRPCAlbum, - smallImageKey: discordRPCIcon - }); + largeImageKey: discordRPCAlbum, + smallImageKey: discordRPCIcon + }); } else { - DiscordClient.instance.setPresence( - { - state: buildDiscordRPCState(), - details: buildDiscordRPCDetails(), + DiscordClient.instance.setPresence({ + state: buildDiscordRPCState(), + details: buildDiscordRPCDetails(), - largeImageKey: discordRPCAlbum, - smallImageKey: discordRPCIcon - }); + largeImageKey: discordRPCAlbum, + smallImageKey: discordRPCIcon + }); // DiscordClient.changePresence(detailsText, '${currentChart.songName} ($discordRPCDifficulty)', discordRPCIcon, true, // currentSongLengthMs - Conductor.instance.songPosition); } @@ -1782,14 +1780,13 @@ class PlayState extends MusicBeatSubState #if FEATURE_DISCORD_RPC if (health > Constants.HEALTH_MIN && !isGamePaused && Preferences.autoPause) { - DiscordClient.instance.setPresence( - { - state: buildDiscordRPCState(), - details: buildDiscordRPCDetails(), + DiscordClient.instance.setPresence({ + state: buildDiscordRPCState(), + details: buildDiscordRPCDetails(), - largeImageKey: discordRPCAlbum, - smallImageKey: discordRPCIcon - }); + largeImageKey: discordRPCAlbum, + smallImageKey: discordRPCIcon + }); } #end @@ -1889,12 +1886,14 @@ class PlayState extends MusicBeatSubState @:nullSafety(Off) @:privateAccess // todo: maybe make the groups public :thinking: { - vocals.playerVoices?.forEachAlive(function(voice:FunkinSound) { + vocals.playerVoices?.forEachAlive(function(voice:FunkinSound) + { var currentRawVoiceTime:Float = voice.time + vocals.playerVoicesOffset; if (Math.abs(currentRawVoiceTime - correctSync) > Math.abs(playerVoicesError)) playerVoicesError = currentRawVoiceTime - correctSync; }); - vocals.opponentVoices?.forEachAlive(function(voice:FunkinSound) { + vocals.opponentVoices?.forEachAlive(function(voice:FunkinSound) + { var currentRawVoiceTime:Float = voice.time + vocals.opponentVoicesOffset; if (Math.abs(currentRawVoiceTime - correctSync) > Math.abs(opponentVoicesError)) opponentVoicesError = currentRawVoiceTime - correctSync; }); @@ -1942,7 +1941,8 @@ class PlayState extends MusicBeatSubState public override function initConsoleHelpers():Void { - FlxG.console.registerFunction("debugUnbindCameraZoom", () -> { + FlxG.console.registerFunction("debugUnbindCameraZoom", () -> + { debugUnbindCameraZoom = !debugUnbindCameraZoom; }); }; @@ -2290,9 +2290,8 @@ class PlayState extends MusicBeatSubState { pauseButton.animation.addByIndices('idle', 'back', [0], "", 24, false); pauseButton.animation.addByIndices('hold', 'back', [5], "", 24, false); - pauseButton.animation.addByIndices('confirm', 'back', [ - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32 - ], "", 24, false); + pauseButton.animation.addByIndices('confirm', 'back', + [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32], "", 24, false); pauseButton.scale.set(0.8, 0.8); pauseButton.updateHitbox(); pauseButton.animation.play("idle"); @@ -2308,7 +2307,8 @@ class PlayState extends MusicBeatSubState add(pauseCircle); add(pauseButton); - hitbox?.forEachAlive(function(hint:FunkinHint) { + hitbox?.forEachAlive(function(hint:FunkinHint) + { hint.deadZones.push(pauseButton); }); @@ -2347,25 +2347,23 @@ class PlayState extends MusicBeatSubState // Determine the details strings once and reuse them. // Updating Discord Rich Presence. - DiscordClient.instance.setPresence( - { - state: buildDiscordRPCState(), - details: buildDiscordRPCDetails(), + DiscordClient.instance.setPresence({ + state: buildDiscordRPCState(), + details: buildDiscordRPCDetails(), - largeImageKey: discordRPCAlbum, - smallImageKey: discordRPCIcon - }); + largeImageKey: discordRPCAlbum, + smallImageKey: discordRPCIcon + }); #end #if FEATURE_DISCORD_RPC // Updating Discord Rich Presence. - DiscordClient.instance.setPresence( - { - state: buildDiscordRPCState(), - details: buildDiscordRPCDetails(), - largeImageKey: discordRPCAlbum, - smallImageKey: discordRPCIcon - }); + DiscordClient.instance.setPresence({ + state: buildDiscordRPCState(), + details: buildDiscordRPCDetails(), + largeImageKey: discordRPCAlbum, + smallImageKey: discordRPCIcon + }); #end } @@ -2594,7 +2592,8 @@ class PlayState extends MusicBeatSubState return; } - FlxG.sound.music.onComplete = function() { + FlxG.sound.music.onComplete = function() + { if (mayPauseGame) endSong(skipEndingTransition); }; @@ -2637,14 +2636,13 @@ class PlayState extends MusicBeatSubState #if FEATURE_DISCORD_RPC // Updating Discord Rich Presence (with Time Left) - DiscordClient.instance.setPresence( - { - state: buildDiscordRPCState(), - details: buildDiscordRPCDetails(), + DiscordClient.instance.setPresence({ + state: buildDiscordRPCState(), + details: buildDiscordRPCDetails(), - largeImageKey: discordRPCAlbum, - smallImageKey: discordRPCIcon - }); + largeImageKey: discordRPCAlbum, + smallImageKey: discordRPCIcon + }); // DiscordClient.changePresence(detailsText, '${currentChart.songName} ($discordRPCDifficulty)', discordRPCIcon, true, currentSongLengthMs); #end @@ -3114,12 +3112,7 @@ class PlayState extends MusicBeatSubState if (!isPracticeMode) { // messy copy paste rn lol - var pressArray:Array = [ - controls.NOTE_LEFT_P, - controls.NOTE_DOWN_P, - controls.NOTE_UP_P, - controls.NOTE_RIGHT_P - ]; + var pressArray:Array = [controls.NOTE_LEFT_P, controls.NOTE_DOWN_P, controls.NOTE_UP_P, controls.NOTE_RIGHT_P]; var indices:Array = []; for (i in 0...pressArray.length) @@ -3162,12 +3155,7 @@ class PlayState extends MusicBeatSubState if (!isPracticeMode) { - var pressArray:Array = [ - controls.NOTE_LEFT_P, - controls.NOTE_DOWN_P, - controls.NOTE_UP_P, - controls.NOTE_RIGHT_P - ]; + var pressArray:Array = [controls.NOTE_LEFT_P, controls.NOTE_DOWN_P, controls.NOTE_UP_P, controls.NOTE_RIGHT_P]; var indices:Array = []; for (i in 0...pressArray.length) @@ -3200,13 +3188,12 @@ class PlayState extends MusicBeatSubState var bf:String = currentStage?.getBoyfriend()?.characterId ?? ''; var gf:String = currentStage?.getGirlfriend()?.characterId ?? ''; var dad:String = currentStage?.getDad()?.characterId ?? ''; - FlxG.switchState(() -> new StageEditorState( - { - targetStageId: currentStageId, - targetBfChar: bf, - targetGfChar: gf, - targetDadChar: dad - })); + FlxG.switchState(() -> new StageEditorState({ + targetStageId: currentStageId, + targetBfChar: bf, + targetGfChar: gf, + targetDadChar: dad + })); } #end @@ -3225,13 +3212,12 @@ class PlayState extends MusicBeatSubState else { if (currentStage != null) this.remove(currentStage); - FlxG.switchState(() -> new ChartEditorState( - { - targetSongId: currentSong.id, - targetSongDifficulty: currentDifficulty, - targetSongVariation: currentVariation, - targetSongPosition: Conductor.instance.songPosition - })); + FlxG.switchState(() -> new ChartEditorState({ + targetSongId: currentSong.id, + targetSongDifficulty: currentDifficulty, + targetSongVariation: currentVariation, + targetSongPosition: Conductor.instance.songPosition + })); } } #end @@ -3326,12 +3312,7 @@ class PlayState extends MusicBeatSubState if (!isPracticeMode) { // TODO: Input splitter uses old input system, make it pull from the precise input queue directly. - var pressArray:Array = [ - controls.NOTE_LEFT_P, - controls.NOTE_DOWN_P, - controls.NOTE_UP_P, - controls.NOTE_RIGHT_P - ]; + var pressArray:Array = [controls.NOTE_LEFT_P, controls.NOTE_DOWN_P, controls.NOTE_UP_P, controls.NOTE_RIGHT_P]; var indices:Array = []; for (i in 0...pressArray.length) @@ -3437,22 +3418,20 @@ class PlayState extends MusicBeatSubState if (currentSong != null && currentSong.validScore) { // crackhead double thingie, sets whether was new highscore, AND saves the song! - var data = - { - score: songScore, - tallies: - { - sick: Highscore.tallies.sick, - good: Highscore.tallies.good, - bad: Highscore.tallies.bad, - shit: Highscore.tallies.shit, - missed: Highscore.tallies.missed, - combo: Highscore.tallies.combo, - maxCombo: Highscore.tallies.maxCombo, - totalNotesHit: Highscore.tallies.totalNotesHit, - totalNotes: Highscore.tallies.totalNotes, - }, - }; + var data = { + score: songScore, + tallies: { + sick: Highscore.tallies.sick, + good: Highscore.tallies.good, + bad: Highscore.tallies.bad, + shit: Highscore.tallies.shit, + missed: Highscore.tallies.missed, + combo: Highscore.tallies.combo, + maxCombo: Highscore.tallies.maxCombo, + totalNotesHit: Highscore.tallies.totalNotesHit, + totalNotes: Highscore.tallies.totalNotes, + }, + }; // adds current song data into the tallies for the level (story levels) Highscore.talliesLevel = Highscore.combineTallies(Highscore.tallies, Highscore.talliesLevel); @@ -3474,7 +3453,9 @@ class PlayState extends MusicBeatSubState // If neither are higher, nothing will change. Save.instance.applySongRank(currentSong.id, suffixedDifficulty, data); - if (isNewHighscore) {} + if (isNewHighscore) + { + } } } @@ -3486,22 +3467,20 @@ class PlayState extends MusicBeatSubState if (Date.now().getDay() == 5) Medals.award(FridayNight); // Determine the score rank for this song we just finished. - var scoreRank:Null = Scoring.calculateRank( - { - score: songScore, - tallies: - { - sick: Highscore.tallies.sick, - good: Highscore.tallies.good, - bad: Highscore.tallies.bad, - shit: Highscore.tallies.shit, - missed: Highscore.tallies.missed, - combo: Highscore.tallies.combo, - maxCombo: Highscore.tallies.maxCombo, - totalNotesHit: Highscore.tallies.totalNotesHit, - totalNotes: Highscore.tallies.totalNotes, - } - }); + var scoreRank:Null = Scoring.calculateRank({ + score: songScore, + tallies: { + sick: Highscore.tallies.sick, + good: Highscore.tallies.good, + bad: Highscore.tallies.bad, + shit: Highscore.tallies.shit, + missed: Highscore.tallies.missed, + combo: Highscore.tallies.combo, + maxCombo: Highscore.tallies.maxCombo, + totalNotesHit: Highscore.tallies.totalNotesHit, + totalNotes: Highscore.tallies.totalNotes, + } + }); // Award various medals based on variation, difficulty, song ID, and scoring rank. if (scoreRank == ScoringRank.SHIT) Medals.award(LossRating); @@ -3534,23 +3513,21 @@ class PlayState extends MusicBeatSubState { if (currentSong.validScore) { - var data = - { - score: PlayStatePlaylist.campaignScore, - tallies: - { - // TODO: Sum up the values for the whole week! - sick: 0, - good: 0, - bad: 0, - shit: 0, - missed: 0, - combo: 0, - maxCombo: 0, - totalNotesHit: 0, - totalNotes: 0, - }, - }; + var data = { + score: PlayStatePlaylist.campaignScore, + tallies: { + // TODO: Sum up the values for the whole week! + sick: 0, + good: 0, + bad: 0, + shit: 0, + missed: 0, + combo: 0, + maxCombo: 0, + totalNotesHit: 0, + totalNotes: 0, + }, + }; if (PlayStatePlaylist.campaignId != null) { @@ -3610,7 +3587,8 @@ class PlayState extends MusicBeatSubState camHUD.visible = false; isInCutscene = true; - FunkinSound.playOnce(Paths.sound('Lights_Shut_off'), function() { + FunkinSound.playOnce(Paths.sound('Lights_Shut_off'), function() + { // no camFollow so it centers on horror tree var targetSong:Song = SongRegistry.instance.fetchEntry(targetSongId) ?? throw 'Could not find a song with the ID $targetSongId'; var targetVariation:String = currentVariation; @@ -3619,13 +3597,12 @@ class PlayState extends MusicBeatSubState targetVariation = targetSong.getFirstValidVariation(PlayStatePlaylist.campaignDifficulty) ?? Constants.DEFAULT_VARIATION; } if (currentStage != null) this.remove(currentStage); - LoadingState.loadPlayState( - { - targetSong: targetSong, - targetDifficulty: PlayStatePlaylist.campaignDifficulty, - targetVariation: targetVariation, - cameraFollowPoint: cameraFollowPoint.getPosition(), - }); + LoadingState.loadPlayState({ + targetSong: targetSong, + targetDifficulty: PlayStatePlaylist.campaignDifficulty, + targetVariation: targetVariation, + cameraFollowPoint: cameraFollowPoint.getPosition(), + }); }); } else @@ -3637,13 +3614,12 @@ class PlayState extends MusicBeatSubState targetVariation = targetSong.getFirstValidVariation(PlayStatePlaylist.campaignDifficulty) ?? Constants.DEFAULT_VARIATION; } if (currentStage != null) this.remove(currentStage); - LoadingState.loadPlayState( - { - targetSong: targetSong, - targetDifficulty: PlayStatePlaylist.campaignDifficulty, - targetVariation: targetVariation, - cameraFollowPoint: cameraFollowPoint.getPosition(), - }); + LoadingState.loadPlayState({ + targetSong: targetSong, + targetDifficulty: PlayStatePlaylist.campaignDifficulty, + targetVariation: targetVariation, + cameraFollowPoint: cameraFollowPoint.getPosition(), + }); } } } @@ -3795,15 +3771,16 @@ class PlayState extends MusicBeatSubState // Replace zoom animation with a fade out for now. FlxG.camera.fade(FlxColor.BLACK, 0.6); - FlxTween.tween(camHUD, {alpha: 0}, 0.6, + FlxTween.tween(camHUD, {alpha: 0}, 0.6, { + onComplete: function(_) { - onComplete: function(_) { - moveToResultsScreen(isNewHighscore, prevScoreData); - } - }); + moveToResultsScreen(isNewHighscore, prevScoreData); + } + }); // Zoom in on Girlfriend (or BF if no GF) - new FlxTimer().start(0.8, function(_) { + new FlxTimer().start(0.8, function(_) + { if (targetBF) { boyfriend?.animation.play('hey'); @@ -3833,46 +3810,42 @@ class PlayState extends MusicBeatSubState */ function moveToResultsScreen(isNewHighscore:Bool, ?prevScoreData:SaveScoreData):Void { - var currentChart:SongDifficulty = currentChart ?? - { - trace('ERROR: Cannot move to results screen with a null chart.'); - return; - } + var currentChart:SongDifficulty = currentChart ?? { + trace('ERROR: Cannot move to results screen with a null chart.'); + return; + } persistentUpdate = false; vocals?.stop(); camHUD.alpha = 1; var talliesToUse:Tallies = PlayStatePlaylist.isStoryMode ? Highscore.talliesLevel : Highscore.tallies; - var res:ResultState = new ResultState( - { - storyMode: PlayStatePlaylist.isStoryMode, - songId: currentChart.song.id, - difficultyId: currentDifficulty, - variationId: currentVariation, - characterId: currentChart.characters.player, - title: PlayStatePlaylist.isStoryMode ? ('${PlayStatePlaylist.campaignTitle}') : ('${currentChart.songName} by ${currentChart.songArtist}'), - prevScoreData: prevScoreData, - scoreData: - { - score: PlayStatePlaylist.isStoryMode ? PlayStatePlaylist.campaignScore : songScore, - tallies: - { - sick: talliesToUse.sick, - good: talliesToUse.good, - bad: talliesToUse.bad, - shit: talliesToUse.shit, - missed: talliesToUse.missed, - combo: talliesToUse.combo, - maxCombo: talliesToUse.maxCombo, - totalNotesHit: talliesToUse.totalNotesHit, - totalNotes: talliesToUse.totalNotes, - }, - }, - isNewHighscore: isNewHighscore, - isPracticeMode: isPracticeMode, - isBotPlayMode: isBotPlayMode, - }); + var res:ResultState = new ResultState({ + storyMode: PlayStatePlaylist.isStoryMode, + songId: currentChart.song.id, + difficultyId: currentDifficulty, + variationId: currentVariation, + characterId: currentChart.characters.player, + title: PlayStatePlaylist.isStoryMode ? ('${PlayStatePlaylist.campaignTitle}') : ('${currentChart.songName} by ${currentChart.songArtist}'), + prevScoreData: prevScoreData, + scoreData: { + score: PlayStatePlaylist.isStoryMode ? PlayStatePlaylist.campaignScore : songScore, + tallies: { + sick: talliesToUse.sick, + good: talliesToUse.good, + bad: talliesToUse.bad, + shit: talliesToUse.shit, + missed: talliesToUse.missed, + combo: talliesToUse.combo, + maxCombo: talliesToUse.maxCombo, + totalNotesHit: talliesToUse.totalNotesHit, + totalNotes: talliesToUse.totalNotes, + }, + }, + isNewHighscore: isNewHighscore, + isPracticeMode: isPracticeMode, + isBotPlayMode: isBotPlayMode, + }); this.persistentDraw = false; openSubState(res); } @@ -3939,13 +3912,13 @@ class PlayState extends MusicBeatSubState // Follow tween! Caching it so we can cancel/pause it later if needed. var followPos:FlxPoint = cameraFollowPoint.getPosition() - FlxPoint.weak(FlxG.camera.width * 0.5, FlxG.camera.height * 0.5); - cameraFollowTween = FlxTween.tween(FlxG.camera.scroll, {x: followPos.x, y: followPos.y}, duration, + cameraFollowTween = FlxTween.tween(FlxG.camera.scroll, {x: followPos.x, y: followPos.y}, duration, { + ease: ease, + onComplete: function(_) { - ease: ease, - onComplete: function(_) { - resetCamera(false, false); // Re-enable camera following when the tween is complete. - } - }); + resetCamera(false, false); // Re-enable camera following when the tween is complete. + } + }); } } @@ -4030,10 +4003,9 @@ class PlayState extends MusicBeatSubState } else { - scrollSpeedTweens.push(FlxTween.tween(strum, - { - 'scrollSpeed': value - }, duration, {ease: ease})); + scrollSpeedTweens.push(FlxTween.tween(strum, { + 'scrollSpeed': value + }, duration, {ease: ease})); } // make sure charts dont break if the charter is dumb and stupid prevScrollTargets.push([value, i]); diff --git a/source/funkin/play/ResultScore.hx b/source/funkin/play/ResultScore.hx index 31cbb0bc6..9255c6c23 100644 --- a/source/funkin/play/ResultScore.hx +++ b/source/funkin/play/ResultScore.hx @@ -56,7 +56,8 @@ class ResultScore extends FlxTypedSpriteGroup { // if(i.finalDigit == 10) continue; - new FlxTimer().start((i - 1) / 24, _ -> { + new FlxTimer().start((i - 1) / 24, _ -> + { group.members[i].finalDelay = scoreStart - (i - 1); group.members[i].playAnim(); group.members[i].shuffle(); @@ -145,28 +146,28 @@ class ScoreNum extends FlxSprite public var baseY:Float = 0; public var baseX:Float = 0; - var numToString:Array = [ - "ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "DISABLED" - ]; + var numToString:Array = ["ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "DISABLED"]; function finishShuffleTween():Void { - var tweenFunction = function(x) { + var tweenFunction = function(x) + { var digitRounded = Math.floor(x); // if(digitRounded == finalDigit) glow = true; digit = digitRounded; }; - finalTween = FlxTween.num(0.0, finalDigit, 23 / 24, + finalTween = FlxTween.num(0.0, finalDigit, 23 / 24, { + ease: FlxEase.quadOut, + onComplete: function(input) { - ease: FlxEase.quadOut, - onComplete: function(input) { - new FlxTimer().start((finalDelay) / 24, _ -> { - animation.play(animation.curAnim.name, true, false, 0); - }); - // fuck - } - }, tweenFunction); + new FlxTimer().start((finalDelay) / 24, _ -> + { + animation.play(animation.curAnim.name, true, false, 0); + }); + // fuck + } + }, tweenFunction); } function shuffleProgress(shuffleTimer:FlxTimer):Void diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index c4485d308..6dbe8b25d 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -200,7 +200,8 @@ class ResultState extends MusicBeatSubState var soundSystem:FlxSprite = FunkinSprite.createSparrow(-15 + FullScreenScaleMode.gameNotchSize.x, -180, 'resultScreen/soundSystem'); soundSystem.animation.addByPrefix("idle", "sound system", 24, false); soundSystem.visible = false; - new FlxTimer().start(8 / 24, _ -> { + new FlxTimer().start(8 / 24, _ -> + { soundSystem.animation.play("idle"); soundSystem.visible = true; }); @@ -260,7 +261,8 @@ class ResultState extends MusicBeatSubState if (!(animData.looped ?? true)) { // Animation is not looped. - animation.anim.onFinish.add((_name:String) -> { + animation.anim.onFinish.add((_name:String) -> + { if (animation != null) { animation.anim.pause(); @@ -269,7 +271,8 @@ class ResultState extends MusicBeatSubState } else if (animData.loopFrameLabel != null) { - animation.anim.onFinish.add((_name:String) -> { + animation.anim.onFinish.add((_name:String) -> + { if (animation != null) { animation.anim.play(animData.loopFrameLabel ?? '', true); // unpauses this anim, since it's on PlayOnce! @@ -279,7 +282,8 @@ class ResultState extends MusicBeatSubState } else if (animData.loopFrame != null) { - animation.anim.onFinish.add((_name:String) -> { + animation.anim.onFinish.add((_name:String) -> + { if (animation != null) { animation.anim.play("", true, false, animData.loopFrame ?? 0); // unpauses this anim, since it's on PlayOnce! @@ -290,14 +294,13 @@ class ResultState extends MusicBeatSubState // Hide until ready to play. animation.visible = false; // Queue to play. - characterAtlasAnimations.push( - { - sprite: animation, - delay: animData.delay ?? 0.0, - forceLoop: (animData.loopFrame ?? -1) == 0, - startFrameLabel: (animData.startFrameLabel ?? ""), - sound: (animData.sound ?? "") - }); + characterAtlasAnimations.push({ + sprite: animation, + delay: animData.delay ?? 0.0, + forceLoop: (animData.loopFrame ?? -1) == 0, + startFrameLabel: (animData.startFrameLabel ?? ""), + sound: (animData.sound ?? "") + }); // Add to the scene. add(animation); case 'sparrow': @@ -315,7 +318,8 @@ class ResultState extends MusicBeatSubState if (animData.loopFrame != null) { - animation.animation.onFinish.add((_name:String) -> { + animation.animation.onFinish.add((_name:String) -> + { if (animation != null) { animation.animation.play('idle', true, false, animData.loopFrame ?? 0); @@ -326,11 +330,10 @@ class ResultState extends MusicBeatSubState // Hide until ready to play. animation.visible = false; // Queue to play. - characterSparrowAnimations.push( - { - sprite: animation, - delay: animData.delay ?? 0.0 - }); + characterSparrowAnimations.push({ + sprite: animation, + delay: animData.delay ?? 0.0 + }); // Add to the scene. add(animation); } @@ -367,7 +370,8 @@ class ResultState extends MusicBeatSubState resultsAnim.visible = false; resultsAnim.zIndex = 1200; add(resultsAnim); - new FlxTimer().start(6 / 24, _ -> { + new FlxTimer().start(6 / 24, _ -> + { resultsAnim.visible = true; resultsAnim.animation.play("result"); }); @@ -376,7 +380,8 @@ class ResultState extends MusicBeatSubState ratingsPopin.visible = false; ratingsPopin.zIndex = 1200; add(ratingsPopin); - new FlxTimer().start(21 / 24, _ -> { + new FlxTimer().start(21 / 24, _ -> + { ratingsPopin.visible = true; ratingsPopin.animation.play("idle"); }); @@ -385,23 +390,28 @@ class ResultState extends MusicBeatSubState scorePopin.visible = false; scorePopin.zIndex = 1200; add(scorePopin); - new FlxTimer().start(36 / 24, _ -> { + new FlxTimer().start(36 / 24, _ -> + { scorePopin.visible = true; scorePopin.animation.play("score"); - scorePopin.animation.onFinish.add(anim -> {}); + scorePopin.animation.onFinish.add(anim -> { + }); }); - new FlxTimer().start(37 / 24, _ -> { + new FlxTimer().start(37 / 24, _ -> + { score.visible = true; score.animateNumbers(); startRankTallySequence(); }); - new FlxTimer().start(rank.getBFDelay(), _ -> { + new FlxTimer().start(rank.getBFDelay(), _ -> + { afterRankTallySequence(); }); - new FlxTimer().start(rank.getFlashDelay(), _ -> { + new FlxTimer().start(rank.getFlashDelay(), _ -> + { displayRankText(); }); @@ -413,7 +423,8 @@ class ResultState extends MusicBeatSubState highscoreNew.zIndex = 1200; add(highscoreNew); - new FlxTimer().start(rank.getHighscoreDelay(), _ -> { + new FlxTimer().start(rank.getHighscoreDelay(), _ -> + { if (params.isNewHighscore ?? false) { highscoreNew.visible = true; @@ -480,7 +491,8 @@ class ResultState extends MusicBeatSubState for (ind => rating in ratingGrp.members) { rating.visible = false; - new FlxTimer().start((0.3 * ind) + 1.20, _ -> { + new FlxTimer().start((0.3 * ind) + 1.20, _ -> + { rating.visible = true; FlxTween.tween(rating, {curNumber: rating.neededNumber}, 0.5, {ease: FlxEase.quartOut}); }); @@ -497,7 +509,8 @@ class ResultState extends MusicBeatSubState // highscoreNew.visible = false; // } - new FlxTimer().start(rank.getMusicDelay(), _ -> { + new FlxTimer().start(rank.getMusicDelay(), _ -> + { var musicPath = getMusicPath(playerCharacter, rank); var introMusic:String = Paths.music('$musicPath/$musicPath-intro'); @@ -510,7 +523,8 @@ class ResultState extends MusicBeatSubState var musicLoop:FunkinSound = FunkinSound.load(mainMusic, 1.0, true, true, false, false, null, null, true); // Play the intro music. - introMusicAudio = FunkinSound.load(introMusic, 1.0, false, true, true, () -> { + introMusicAudio = FunkinSound.load(introMusic, 1.0, false, true, true, () -> + { introMusicAudio = null; musicLoop.play(); if (!isChartingMode) // Don't override the music and cause problems on the chart editor @@ -524,12 +538,11 @@ class ResultState extends MusicBeatSubState } else { - if (!isChartingMode) FunkinSound.playMusic(musicPath, - { - startingVolume: 1.0, - overrideExisting: true, - restartTrack: true - }); + if (!isChartingMode) FunkinSound.playMusic(musicPath, { + startingVolume: 1.0, + overrideExisting: true, + restartTrack: true + }); else { resultsMusic = FunkinSound.load(Paths.music(getMusicPath(playerCharacter, rank) + '/' + getMusicPath(playerCharacter, rank)), 1.0, true, false, true); @@ -572,61 +585,64 @@ class ResultState extends MusicBeatSubState var clearPercentCounter:ClearPercentCounter = new ClearPercentCounter((FlxG.width / 2 + 190) + (FullScreenScaleMode.gameCutoutSize.x / 2), FlxG.height / 2 - 70, clearPercentLerp); - FlxTween.tween(clearPercentCounter, {curNumber: clearPercentTarget}, 58 / 24, + FlxTween.tween(clearPercentCounter, {curNumber: clearPercentTarget}, 58 / 24, { + ease: FlxEase.quartOut, + onUpdate: _ -> { - ease: FlxEase.quartOut, - onUpdate: _ -> { - clearPercentLerp = Math.round(clearPercentLerp); - clearPercentCounter.curNumber = Math.round(clearPercentCounter.curNumber); - // Only play the tick sound if the number increased. - if (clearPercentLerp != clearPercentCounter.curNumber) - { - // trace('$clearPercentLerp and ${clearPercentCounter.curNumber}'); - clearPercentLerp = clearPercentCounter.curNumber; - FunkinSound.playOnce(Paths.sound('scrollMenu')); + clearPercentLerp = Math.round(clearPercentLerp); + clearPercentCounter.curNumber = Math.round(clearPercentCounter.curNumber); + // Only play the tick sound if the number increased. + if (clearPercentLerp != clearPercentCounter.curNumber) + { + // trace('$clearPercentLerp and ${clearPercentCounter.curNumber}'); + clearPercentLerp = clearPercentCounter.curNumber; + FunkinSound.playOnce(Paths.sound('scrollMenu')); - // Weak vibration each number increase. - HapticUtil.vibrate(0, 0.01); - } - }, - onComplete: _ -> { - // Strong vibration when rank number tween ends. - HapticUtil.vibrate(Constants.DEFAULT_VIBRATION_PERIOD, Constants.DEFAULT_VIBRATION_DURATION * 5, Constants.MAX_VIBRATION_AMPLITUDE); - - // Play confirm sound. - FunkinSound.playOnce(Paths.sound('confirmMenu')); - - // Just to be sure that the lerp didn't mess things up. - clearPercentCounter.curNumber = clearPercentTarget; - - #if FEATURE_NEWGROUNDS - var isScoreValid = !(params?.isPracticeMode ?? false) && !(params?.isBotPlayMode ?? false); - // This is the easiest spot to do the medal calculation lol. - if (isScoreValid && clearPercentTarget == 69) Medals.award(Nice); - #end - - clearPercentCounter.flash(true); - new FlxTimer().start(0.4, _ -> { - clearPercentCounter.flash(false); - }); - - // displayRankText(); - - // previously 2.0 seconds - new FlxTimer().start(0.25, _ -> { - FlxTween.tween(clearPercentCounter, {alpha: 0}, 0.5, - { - startDelay: 0.5, - ease: FlxEase.quartOut, - onComplete: _ -> { - remove(clearPercentCounter); - } - }); - - // afterRankTallySequence(); - }); + // Weak vibration each number increase. + HapticUtil.vibrate(0, 0.01); } - }); + }, + onComplete: _ -> + { + // Strong vibration when rank number tween ends. + HapticUtil.vibrate(Constants.DEFAULT_VIBRATION_PERIOD, Constants.DEFAULT_VIBRATION_DURATION * 5, Constants.MAX_VIBRATION_AMPLITUDE); + + // Play confirm sound. + FunkinSound.playOnce(Paths.sound('confirmMenu')); + + // Just to be sure that the lerp didn't mess things up. + clearPercentCounter.curNumber = clearPercentTarget; + + #if FEATURE_NEWGROUNDS + var isScoreValid = !(params?.isPracticeMode ?? false) && !(params?.isBotPlayMode ?? false); + // This is the easiest spot to do the medal calculation lol. + if (isScoreValid && clearPercentTarget == 69) Medals.award(Nice); + #end + + clearPercentCounter.flash(true); + new FlxTimer().start(0.4, _ -> + { + clearPercentCounter.flash(false); + }); + + // displayRankText(); + + // previously 2.0 seconds + new FlxTimer().start(0.25, _ -> + { + FlxTween.tween(clearPercentCounter, {alpha: 0}, 0.5, { + startDelay: 0.5, + ease: FlxEase.quartOut, + onComplete: _ -> + { + remove(clearPercentCounter); + } + }); + + // afterRankTallySequence(); + }); + } + }); clearPercentCounter.zIndex = 450; add(clearPercentCounter); @@ -639,12 +655,11 @@ class ResultState extends MusicBeatSubState // ratingsPopin.animation.play("idle"); // ratingsPopin.visible = true; - ratingsPopin.animation.onFinish.add(anim -> - { - // scorePopin.animation.play("score"); + ratingsPopin.animation.onFinish.add(anim -> { + // scorePopin.animation.play("score"); - // scorePopin.visible = true; - }); + // scorePopin.visible = true; + }); } refresh(); @@ -665,7 +680,8 @@ class ResultState extends MusicBeatSubState FlxFlicker.flicker(rankTextVert, 2 / 24 * 3, 2 / 24, true); // Scrolling. - new FlxTimer().start(30 / 24, _ -> { + new FlxTimer().start(30 / 24, _ -> + { rankTextVert.velocity.y = -80; }); @@ -692,7 +708,8 @@ class ResultState extends MusicBeatSubState for (atlas in characterAtlasAnimations) { - new FlxTimer().start(atlas.delay, _ -> { + new FlxTimer().start(atlas.delay, _ -> + { if (atlas.sprite == null) return; atlas.sprite.visible = true; atlas.sprite.anim.play(atlas.startFrameLabel); @@ -708,7 +725,8 @@ class ResultState extends MusicBeatSubState for (sprite in characterSparrowAnimations) { - new FlxTimer().start(sprite.delay, _ -> { + new FlxTimer().start(sprite.delay, _ -> + { if (sprite.sprite == null) return; sprite.sprite.visible = true; sprite.sprite.animation.play('idle', true); @@ -739,7 +757,8 @@ class ResultState extends MusicBeatSubState FlxTween.tween(songName, {y: (diffYTween - 25 - fuckedupnumber) + ((blackTopBar.height - 148) / 1)}, 0.5, {ease: FlxEase.expoOut, startDelay: 0.9}); songName.x = clearPercentSmall.x + 94; - new FlxTimer().start(timerLength, _ -> { + new FlxTimer().start(timerLength, _ -> + { var tempSpeed = FlxPoint.get(speedOfTween.x, speedOfTween.y); speedOfTween.set(0, 0); @@ -756,7 +775,8 @@ class ResultState extends MusicBeatSubState add(clearPercentSmall); clearPercentSmall.visible = true; clearPercentSmall.flash(true); - new FlxTimer().start(0.4, _ -> { + new FlxTimer().start(0.4, _ -> + { clearPercentSmall.flash(false); }); @@ -765,7 +785,8 @@ class ResultState extends MusicBeatSubState refresh(); } - new FlxTimer().start(2.5, _ -> { + new FlxTimer().start(2.5, _ -> + { movingSongStuff = true; }); } @@ -826,40 +847,40 @@ class ResultState extends MusicBeatSubState @:nullSafety(Off) introMusicAudio.onComplete = null; - FlxTween.tween(introMusicAudio, {volume: 0}, 0.8, + FlxTween.tween(introMusicAudio, {volume: 0}, 0.8, { + onComplete: _ -> { - onComplete: _ -> { - if (introMusicAudio != null) - { - introMusicAudio.stop(); - introMusicAudio.destroy(); - introMusicAudio = null; - } + if (introMusicAudio != null) + { + introMusicAudio.stop(); + introMusicAudio.destroy(); + introMusicAudio = null; } - }); - FlxTween.tween(introMusicAudio, {pitch: 3}, 0.1, + } + }); + FlxTween.tween(introMusicAudio, {pitch: 3}, 0.1, { + onComplete: _ -> { - onComplete: _ -> { - FlxTween.tween(introMusicAudio, {pitch: 0.5}, 0.4); - } - }); + FlxTween.tween(introMusicAudio, {pitch: 0.5}, 0.4); + } + }); } else if (FlxG.sound.music != null) { - FlxTween.tween(FlxG.sound.music, {volume: 0}, 0.8, + FlxTween.tween(FlxG.sound.music, {volume: 0}, 0.8, { + onComplete: _ -> { - onComplete: _ -> { - FlxG.sound.music.stop(); - FlxG.sound.music.destroy(); - } - }); - FlxTween.tween(FlxG.sound.music, {pitch: 3}, 0.1, + FlxG.sound.music.stop(); + FlxG.sound.music.destroy(); + } + }); + FlxTween.tween(FlxG.sound.music, {pitch: 3}, 0.1, { + onComplete: _ -> { - onComplete: _ -> { - FlxTween.tween(FlxG.sound.music, {pitch: 0.5}, 0.4); - } - }); + FlxTween.tween(FlxG.sound.music, {pitch: 0.5}, 0.4); + } + }); } // Determining the target state(s) to go to. @@ -871,10 +892,9 @@ class ResultState extends MusicBeatSubState var stickerPackId:Null = null; - var song:Null = params.songId == null ? null : SongRegistry.instance.fetchEntry(params.songId, - { - variation: params?.variationId - }); + var song:Null = params.songId == null ? null : SongRegistry.instance.fetchEntry(params.songId, { + variation: params?.variationId + }); if (song != null) { @@ -911,11 +931,10 @@ class ResultState extends MusicBeatSubState // targetState: (sticker) -> new StoryMenuState(sticker), // stickerPack: stickerPackId // }); - targetStateFactory = () -> new StickerSubState( - { - targetState: (sticker) -> new StoryMenuState(sticker), - stickerPack: stickerPackId - }); + targetStateFactory = () -> new StickerSubState({ + targetState: (sticker) -> new StoryMenuState(sticker), + stickerPack: stickerPackId + }); } } else @@ -938,20 +957,18 @@ class ResultState extends MusicBeatSubState this.close(); return; } - targetState = FreeplayState.build( + targetState = FreeplayState.build({ { - { - character: playerCharacterId ?? "bf", - fromResults: - { - oldRank: Scoring.calculateRank(params?.prevScoreData), - newRank: rank, - songId: params.songId, - difficultyId: params.difficultyId, - playRankAnim: true - } + character: playerCharacterId ?? "bf", + fromResults: { + oldRank: Scoring.calculateRank(params?.prevScoreData), + newRank: rank, + songId: params.songId, + difficultyId: params.difficultyId, + playRankAnim: true } - }); + } + }); } else { @@ -967,11 +984,10 @@ class ResultState extends MusicBeatSubState } shouldTween = false; shouldUseSubstate = true; - targetStateFactory = () -> new StickerSubState( - { - targetState: (sticker) -> FreeplayState.build(null, sticker), - stickerPack: stickerPackId - }); + targetStateFactory = () -> new StickerSubState({ + targetState: (sticker) -> FreeplayState.build(null, sticker), + stickerPack: stickerPackId + }); } } @@ -981,7 +997,8 @@ class ResultState extends MusicBeatSubState { busy = true; - AdMobUtil.loadInterstitial(function():Void { + AdMobUtil.loadInterstitial(function():Void + { AdMobUtil.PLAYING_COUNTER = 0; busy = false; @@ -1005,37 +1022,38 @@ class ResultState extends MusicBeatSubState { if (shouldTween) { - FlxTween.tween(rankBg, {alpha: 1}, 0.5, + FlxTween.tween(rankBg, {alpha: 1}, 0.5, { + ease: FlxEase.expoOut, + onComplete: function(_) { - ease: FlxEase.expoOut, - onComplete: function(_) { - requestReview(); + requestReview(); - if (targetStateFactory != null) - { - targetState = targetStateFactory(); - } - - if (shouldUseSubstate && targetState is FlxSubState) - { - openSubState(cast targetState); - } - else - { - FlxG.signals.preStateSwitch.addOnce(function() { - #if ios - trace(DeviceUtil.iPhoneNumber); - if (DeviceUtil.iPhoneNumber > 12) funkin.FunkinMemory.purgeCache(true); - else - funkin.FunkinMemory.purgeCache(); - #else - funkin.FunkinMemory.purgeCache(true); - #end - }); - FlxG.switchState(() -> targetState); - } + if (targetStateFactory != null) + { + targetState = targetStateFactory(); } - }); + + if (shouldUseSubstate && targetState is FlxSubState) + { + openSubState(cast targetState); + } + else + { + FlxG.signals.preStateSwitch.addOnce(function() + { + #if ios + trace(DeviceUtil.iPhoneNumber); + if (DeviceUtil.iPhoneNumber > 12) funkin.FunkinMemory.purgeCache(true); + else + funkin.FunkinMemory.purgeCache(); + #else + funkin.FunkinMemory.purgeCache(true); + #end + }); + FlxG.switchState(() -> targetState); + } + } + }); } else { @@ -1052,7 +1070,8 @@ class ResultState extends MusicBeatSubState } else { - FlxG.signals.preStateSwitch.addOnce(function() { + FlxG.signals.preStateSwitch.addOnce(function() + { #if ios trace(DeviceUtil.iPhoneNumber); if (DeviceUtil.iPhoneNumber > 12) funkin.FunkinMemory.purgeCache(true); diff --git a/source/funkin/play/character/ScriptedCharacter.hx b/source/funkin/play/character/ScriptedCharacter.hx index 1339a4ef3..abb4a9ca9 100644 --- a/source/funkin/play/character/ScriptedCharacter.hx +++ b/source/funkin/play/character/ScriptedCharacter.hx @@ -8,7 +8,9 @@ package funkin.play.character; * and can't use one of the built-in render modes. */ @:hscriptClass -class ScriptedBaseCharacter extends BaseCharacter implements polymod.hscript.HScriptedClass {} +class ScriptedBaseCharacter extends BaseCharacter implements polymod.hscript.HScriptedClass +{ +} /** * A script that can be tied to a SparrowCharacter, which persists across states. @@ -16,7 +18,9 @@ class ScriptedBaseCharacter extends BaseCharacter implements polymod.hscript.HSc * then call `super('charId')` in the constructor to use this. */ @:hscriptClass -class ScriptedSparrowCharacter extends SparrowCharacter implements polymod.hscript.HScriptedClass {} +class ScriptedSparrowCharacter extends SparrowCharacter implements polymod.hscript.HScriptedClass +{ +} /** * A script that can be tied to a MultiSparrowCharacter, which persists across states. @@ -24,7 +28,9 @@ class ScriptedSparrowCharacter extends SparrowCharacter implements polymod.hscri * then call `super('charId')` in the constructor to use this. */ @:hscriptClass -class ScriptedMultiSparrowCharacter extends MultiSparrowCharacter implements polymod.hscript.HScriptedClass {} +class ScriptedMultiSparrowCharacter extends MultiSparrowCharacter implements polymod.hscript.HScriptedClass +{ +} /** * A script that can be tied to a MultiAnimateAtlasCharacter, which persists across states. @@ -32,7 +38,9 @@ class ScriptedMultiSparrowCharacter extends MultiSparrowCharacter implements pol * then call `super('charId')` in the constructor to use this. */ @:hscriptClass -class ScriptedMultiAnimateAtlasCharacter extends MultiAnimateAtlasCharacter implements polymod.hscript.HScriptedClass {} +class ScriptedMultiAnimateAtlasCharacter extends MultiAnimateAtlasCharacter implements polymod.hscript.HScriptedClass +{ +} /** * A script that can be tied to a PackerCharacter, which persists across states. @@ -40,7 +48,9 @@ class ScriptedMultiAnimateAtlasCharacter extends MultiAnimateAtlasCharacter impl * then call `super('charId')` in the constructor to use this. */ @:hscriptClass -class ScriptedPackerCharacter extends PackerCharacter implements polymod.hscript.HScriptedClass {} +class ScriptedPackerCharacter extends PackerCharacter implements polymod.hscript.HScriptedClass +{ +} /** * A script that can be tied to an AnimateAtlasCharacter, which persists across states. @@ -48,4 +58,6 @@ class ScriptedPackerCharacter extends PackerCharacter implements polymod.hscript * then call `super('charId')` in the constructor to use this. */ @:hscriptClass -class ScriptedAnimateAtlasCharacter extends AnimateAtlasCharacter implements polymod.hscript.HScriptedClass {} +class ScriptedAnimateAtlasCharacter extends AnimateAtlasCharacter implements polymod.hscript.HScriptedClass +{ +} diff --git a/source/funkin/play/components/HealthIcon.hx b/source/funkin/play/components/HealthIcon.hx index 504ec6a36..77b216de7 100644 --- a/source/funkin/play/components/HealthIcon.hx +++ b/source/funkin/play/components/HealthIcon.hx @@ -299,12 +299,15 @@ class HealthIcon extends FunkinSprite bopTween?.cancel(); setGraphicSize(Std.int(this.width + (HEALTH_ICON_SIZE * this.size.x * BOP_SCALE)), 0); bopTween = FlxTween.num(this.width + (HEALTH_ICON_SIZE * this.size.x * BOP_SCALE), HEALTH_ICON_SIZE * this.size.x, - Math.min(Conductor.instance.stepLengthMs * 0.002, .175), {onComplete: _ -> bopTween = null}, value -> { - setGraphicSize(Std.int(value), 0); - // Ensure the icon is positioned correctly after updating the hitbox, while its changing size. - this.updateHitbox(); - this.updatePosition(); - }); + Math.min(Conductor.instance.stepLengthMs * 0.002, .175), { + onComplete: _ -> bopTween = null + }, value -> + { + setGraphicSize(Std.int(value), 0); + // Ensure the icon is positioned correctly after updating the hitbox, while its changing size. + this.updateHitbox(); + this.updatePosition(); + }); // Ensure the icon is positioned correctly after updating the hitbox. this.updateHitbox(); this.updatePosition(); diff --git a/source/funkin/play/components/PopUpStuff.hx b/source/funkin/play/components/PopUpStuff.hx index 07318f684..26e1eecb1 100644 --- a/source/funkin/play/components/PopUpStuff.hx +++ b/source/funkin/play/components/PopUpStuff.hx @@ -56,15 +56,15 @@ class PopUpStuff extends FlxTypedGroup var fadeEase = noteStyle.isJudgementSpritePixel(daRating) ? EaseUtil.stepped(2) : null; - FlxTween.tween(rating, {alpha: 0}, 0.2, + FlxTween.tween(rating, {alpha: 0}, 0.2, { + onComplete: function(tween:FlxTween) { - onComplete: function(tween:FlxTween) { - remove(rating, true); - rating.destroy(); - }, - startDelay: Conductor.instance.beatLengthMs * 0.001, - ease: fadeEase - }); + remove(rating, true); + rating.destroy(); + }, + startDelay: Conductor.instance.beatLengthMs * 0.001, + ease: fadeEase + }); } public function displayCombo(combo:Int = 0):Void @@ -105,15 +105,15 @@ class PopUpStuff extends FlxTypedGroup var fadeEase = noteStyle.isComboNumSpritePixel(digit) ? EaseUtil.stepped(2) : null; - FlxTween.tween(numScore, {alpha: 0}, 0.2, + FlxTween.tween(numScore, {alpha: 0}, 0.2, { + onComplete: function(tween:FlxTween) { - onComplete: function(tween:FlxTween) { - remove(numScore, true); - numScore.destroy(); - }, - startDelay: Conductor.instance.beatLengthMs * 0.002, - ease: fadeEase - }); + remove(numScore, true); + numScore.destroy(); + }, + startDelay: Conductor.instance.beatLengthMs * 0.002, + ease: fadeEase + }); daLoop++; } diff --git a/source/funkin/play/cutscene/VanillaCutscenes.hx b/source/funkin/play/cutscene/VanillaCutscenes.hx index 38ef03669..cc652a4a0 100644 --- a/source/funkin/play/cutscene/VanillaCutscenes.hx +++ b/source/funkin/play/cutscene/VanillaCutscenes.hx @@ -32,7 +32,8 @@ class VanillaCutscenes blackScreen.zIndex = 1000000; PlayState.instance.add(blackScreen); - new FlxTimer().start(0.1, function(_) { + new FlxTimer().start(0.1, function(_) + { trace('Playing horrorland cutscene...'); PlayState.instance.remove(blackScreen); @@ -43,7 +44,8 @@ class VanillaCutscenes // Play the Sound effect. HapticUtil.vibrate(0.1, 0.5, 1, 1); - FunkinSound.playOnce(Paths.sound('Lights_Turn_On'), function() { + FunkinSound.playOnce(Paths.sound('Lights_Turn_On'), function() + { // Fade in the HUD. trace('SFX done...'); PlayState.instance.camHUD.visible = true; diff --git a/source/funkin/play/cutscene/VideoCutscene.hx b/source/funkin/play/cutscene/VideoCutscene.hx index c76da0b4f..1fedc2241 100644 --- a/source/funkin/play/cutscene/VideoCutscene.hx +++ b/source/funkin/play/cutscene/VideoCutscene.hx @@ -157,7 +157,8 @@ class VideoCutscene vid.active = false; - vid.bitmap.onFormatSetup.add(function():Void { + vid.bitmap.onFormatSetup.add(function():Void + { if (vid.bitmap != null && vid.bitmap.bitmapData != null) { final scale:Float = Math.min(FlxG.width / vid.bitmap.bitmapData.width, FlxG.height / vid.bitmap.bitmapData.height); @@ -168,7 +169,8 @@ class VideoCutscene } }); - vid.bitmap.onEncounteredError.add(function(msg:String):Void { + vid.bitmap.onEncounteredError.add(function(msg:String):Void + { finishVideo(0.5); }); @@ -337,22 +339,22 @@ class VideoCutscene PlayState.instance.camHUD.visible = true; - FlxTween.tween(blackScreen, {alpha: 0}, transitionTime, + FlxTween.tween(blackScreen, {alpha: 0}, transitionTime, { + ease: FlxEase.quadInOut, + onComplete: function(twn:FlxTween) { - ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { - PlayState.instance.remove(blackScreen); - blackScreen = null; - } - }); - FlxTween.tween(FlxG.camera, {zoom: PlayState.instance.stageZoom}, transitionTime, + PlayState.instance.remove(blackScreen); + blackScreen = null; + } + }); + FlxTween.tween(FlxG.camera, {zoom: PlayState.instance.stageZoom}, transitionTime, { + ease: FlxEase.quadInOut, + onComplete: function(twn:FlxTween) { - ease: FlxEase.quadInOut, - onComplete: function(twn:FlxTween) { - onVideoEnded.dispatch(); - onCutsceneFinish(cutsceneType); - } - }); + onVideoEnded.dispatch(); + onCutsceneFinish(cutsceneType); + } + }); } /** diff --git a/source/funkin/play/cutscene/dialogue/Conversation.hx b/source/funkin/play/cutscene/dialogue/Conversation.hx index 0a8e68ad1..f892745ff 100644 --- a/source/funkin/play/cutscene/dialogue/Conversation.hx +++ b/source/funkin/play/cutscene/dialogue/Conversation.hx @@ -407,13 +407,12 @@ class Conversation extends FlxSpriteGroup implements IDialogueScriptedClass impl switch (_data?.outro) { case FADE(outroData): - outroTween = FlxTween.tween(this, {alpha: 0.0}, outroData.fadeTime, - { - type: ONESHOT, // holy shit like the game no way - startDelay: 0, - onComplete: (_) -> endOutro(), - ease: EaseUtil.stepped(8) - }); + outroTween = FlxTween.tween(this, {alpha: 0.0}, outroData.fadeTime, { + type: ONESHOT, // holy shit like the game no way + startDelay: 0, + onComplete: (_) -> endOutro(), + ease: EaseUtil.stepped(8) + }); if (this.music != null) FlxTween.tween(this.music, {volume: 0.0}, outroData.fadeTime); case NONE(_): diff --git a/source/funkin/play/cutscene/dialogue/DialogueBox.hx b/source/funkin/play/cutscene/dialogue/DialogueBox.hx index 46318f523..c2f093168 100644 --- a/source/funkin/play/cutscene/dialogue/DialogueBox.hx +++ b/source/funkin/play/cutscene/dialogue/DialogueBox.hx @@ -259,7 +259,9 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple * Called when an animation finishes. * @param name The name of the animation that just finished. */ - function onAnimationFinished(name:String):Void {} + function onAnimationFinished(name:String):Void + { + } /** * Called when the current animation's frame changes. @@ -393,17 +395,29 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple return this.boxSprite?.animation?.finished ?? false; } - public function onDialogueStart(event:DialogueScriptEvent):Void {} + public function onDialogueStart(event:DialogueScriptEvent):Void + { + } - public function onDialogueCompleteLine(event:DialogueScriptEvent):Void {} + public function onDialogueCompleteLine(event:DialogueScriptEvent):Void + { + } - public function onDialogueLine(event:DialogueScriptEvent):Void {} + public function onDialogueLine(event:DialogueScriptEvent):Void + { + } - public function onDialogueSkip(event:DialogueScriptEvent):Void {} + public function onDialogueSkip(event:DialogueScriptEvent):Void + { + } - public function onDialogueEnd(event:DialogueScriptEvent):Void {} + public function onDialogueEnd(event:DialogueScriptEvent):Void + { + } - public function onUpdate(event:UpdateScriptEvent):Void {} + public function onUpdate(event:UpdateScriptEvent):Void + { + } public function onDestroy(event:ScriptEvent):Void { @@ -422,5 +436,7 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple this.kill(); } - public function onScriptEvent(event:ScriptEvent):Void {} + public function onScriptEvent(event:ScriptEvent):Void + { + } } diff --git a/source/funkin/play/cutscene/dialogue/ScriptedConversation.hx b/source/funkin/play/cutscene/dialogue/ScriptedConversation.hx index cb7344273..459ff3895 100644 --- a/source/funkin/play/cutscene/dialogue/ScriptedConversation.hx +++ b/source/funkin/play/cutscene/dialogue/ScriptedConversation.hx @@ -7,4 +7,6 @@ package funkin.play.cutscene.dialogue; * Someone clever could use this to add branching dialogue I think. */ @:hscriptClass -class ScriptedConversation extends Conversation implements polymod.hscript.HScriptedClass {} +class ScriptedConversation extends Conversation implements polymod.hscript.HScriptedClass +{ +} diff --git a/source/funkin/play/cutscene/dialogue/ScriptedDialogueBox.hx b/source/funkin/play/cutscene/dialogue/ScriptedDialogueBox.hx index 7689fc0d9..e3ace0898 100644 --- a/source/funkin/play/cutscene/dialogue/ScriptedDialogueBox.hx +++ b/source/funkin/play/cutscene/dialogue/ScriptedDialogueBox.hx @@ -6,4 +6,6 @@ package funkin.play.cutscene.dialogue; * This allows you to customize how a specific dialogue box appears. */ @:hscriptClass -class ScriptedDialogueBox extends DialogueBox implements polymod.hscript.HScriptedClass {} +class ScriptedDialogueBox extends DialogueBox implements polymod.hscript.HScriptedClass +{ +} diff --git a/source/funkin/play/cutscene/dialogue/ScriptedSpeaker.hx b/source/funkin/play/cutscene/dialogue/ScriptedSpeaker.hx index a244ff6f1..0274436a3 100644 --- a/source/funkin/play/cutscene/dialogue/ScriptedSpeaker.hx +++ b/source/funkin/play/cutscene/dialogue/ScriptedSpeaker.hx @@ -6,4 +6,6 @@ package funkin.play.cutscene.dialogue; * This allows you to customize how a specific conversation speaker appears. */ @:hscriptClass -class ScriptedSpeaker extends funkin.play.cutscene.dialogue.Speaker implements polymod.hscript.HScriptedClass {} +class ScriptedSpeaker extends funkin.play.cutscene.dialogue.Speaker implements polymod.hscript.HScriptedClass +{ +} diff --git a/source/funkin/play/cutscene/dialogue/Speaker.hx b/source/funkin/play/cutscene/dialogue/Speaker.hx index e24dce83b..e8e969af9 100644 --- a/source/funkin/play/cutscene/dialogue/Speaker.hx +++ b/source/funkin/play/cutscene/dialogue/Speaker.hx @@ -266,17 +266,29 @@ class Speaker extends FlxSprite implements IDialogueScriptedClass implements IRe } } - public function onDialogueStart(event:DialogueScriptEvent):Void {} + public function onDialogueStart(event:DialogueScriptEvent):Void + { + } - public function onDialogueCompleteLine(event:DialogueScriptEvent):Void {} + public function onDialogueCompleteLine(event:DialogueScriptEvent):Void + { + } - public function onDialogueLine(event:DialogueScriptEvent):Void {} + public function onDialogueLine(event:DialogueScriptEvent):Void + { + } - public function onDialogueSkip(event:DialogueScriptEvent):Void {} + public function onDialogueSkip(event:DialogueScriptEvent):Void + { + } - public function onDialogueEnd(event:DialogueScriptEvent):Void {} + public function onDialogueEnd(event:DialogueScriptEvent):Void + { + } - public function onUpdate(event:UpdateScriptEvent):Void {} + public function onUpdate(event:UpdateScriptEvent):Void + { + } public function onDestroy(event:ScriptEvent):Void { @@ -290,5 +302,7 @@ class Speaker extends FlxSprite implements IDialogueScriptedClass implements IRe this.kill(); } - public function onScriptEvent(event:ScriptEvent):Void {} + public function onScriptEvent(event:ScriptEvent):Void + { + } } diff --git a/source/funkin/play/event/FocusCameraSongEvent.hx b/source/funkin/play/event/FocusCameraSongEvent.hx index 11559040a..dbec512bf 100644 --- a/source/funkin/play/event/FocusCameraSongEvent.hx +++ b/source/funkin/play/event/FocusCameraSongEvent.hx @@ -50,10 +50,9 @@ class FocusCameraSongEvent extends SongEvent { public function new() { - super('FocusCamera', - { - processOldEvents: true - }); + super('FocusCamera', { + processOldEvents: true + }); } static final DEFAULT_X_POSITION:Float = 0.0; @@ -174,69 +173,46 @@ class FocusCameraSongEvent extends SongEvent */ public override function getEventSchema():SongEventSchema { - return new SongEventSchema([ - { - name: "char", - title: "Target", - defaultValue: DEFAULT_TARGET, - type: SongEventFieldType.ENUM, - keys: ["Position" => -1, "Player" => 0, "Opponent" => 1, "Girlfriend" => 2] - }, - { - name: "x", - title: "X Position", - defaultValue: DEFAULT_X_POSITION, - step: 10.0, - type: SongEventFieldType.FLOAT, - units: "px" - }, - { - name: "y", - title: "Y Position", - defaultValue: DEFAULT_Y_POSITION, - step: 10.0, - type: SongEventFieldType.FLOAT, - units: "px" - }, - { - name: 'duration', - title: 'Duration', - defaultValue: DEFAULT_DURATION, - min: 0, - step: 0.5, - type: SongEventFieldType.FLOAT, - units: 'steps' - }, - { - name: 'ease', - title: 'Easing Type', - defaultValue: DEFAULT_CAMERA_EASE, - type: SongEventFieldType.ENUM, - keys: [ - 'Linear' => 'linear', - 'Instant (Ignores duration)' => 'INSTANT', - 'Classic (Ignores duration)' => 'CLASSIC', - 'Sine' => 'sine', - 'Quad' => 'quad', - 'Cube' => 'cube', - 'Quart' => 'quart', - 'Quint' => 'quint', - 'Expo' => 'expo', - 'Smooth Step' => 'smoothStep', - 'Smoother Step' => 'smootherStep', - 'Elastic' => 'elastic', - 'Back' => 'back', - 'Bounce' => 'bounce', - 'Circ ' => 'circ', - ] - }, - { - name: 'easeDir', - title: 'Easing Direction', - defaultValue: SongEvent.DEFAULT_EASE_DIR, - type: SongEventFieldType.ENUM, - keys: ['In' => 'In', 'Out' => 'Out', 'In/Out' => 'InOut'] - } - ]); + return new SongEventSchema([{ + name: "char", + title: "Target", + defaultValue: DEFAULT_TARGET, + type: SongEventFieldType.ENUM, + keys: ["Position" => -1, "Player" => 0, "Opponent" => 1, "Girlfriend" => 2] + }, { + name: "x", + title: "X Position", + defaultValue: DEFAULT_X_POSITION, + step: 10.0, + type: SongEventFieldType.FLOAT, + units: "px" + }, { + name: "y", + title: "Y Position", + defaultValue: DEFAULT_Y_POSITION, + step: 10.0, + type: SongEventFieldType.FLOAT, + units: "px" + }, { + name: 'duration', + title: 'Duration', + defaultValue: DEFAULT_DURATION, + min: 0, + step: 0.5, + type: SongEventFieldType.FLOAT, + units: 'steps' + }, { + name: 'ease', + title: 'Easing Type', + defaultValue: DEFAULT_CAMERA_EASE, + type: SongEventFieldType.ENUM, + keys: ['Linear' => 'linear', 'Instant (Ignores duration)' => 'INSTANT', 'Classic (Ignores duration)' => 'CLASSIC', 'Sine' => 'sine', 'Quad' => 'quad', 'Cube' => 'cube', 'Quart' => 'quart', 'Quint' => 'quint', 'Expo' => 'expo', 'Smooth Step' => 'smoothStep', 'Smoother Step' => 'smootherStep', 'Elastic' => 'elastic', 'Back' => 'back', 'Bounce' => 'bounce', 'Circ ' => 'circ',] + }, { + name: 'easeDir', + title: 'Easing Direction', + defaultValue: SongEvent.DEFAULT_EASE_DIR, + type: SongEventFieldType.ENUM, + keys: ['In' => 'In', 'Out' => 'Out', 'In/Out' => 'InOut'] + }]); } } diff --git a/source/funkin/play/event/PlayAnimationSongEvent.hx b/source/funkin/play/event/PlayAnimationSongEvent.hx index 141a758a4..449ec162e 100644 --- a/source/funkin/play/event/PlayAnimationSongEvent.hx +++ b/source/funkin/play/event/PlayAnimationSongEvent.hx @@ -90,25 +90,21 @@ class PlayAnimationSongEvent extends SongEvent */ public override function getEventSchema():SongEventSchema { - return new SongEventSchema([ - { - name: 'target', - title: 'Target', - type: SongEventFieldType.STRING, - defaultValue: DEFAULT_TARGET, - }, - { - name: 'anim', - title: 'Animation', - type: SongEventFieldType.STRING, - defaultValue: DEFAULT_ANIM, - }, - { - name: 'force', - title: 'Force', - type: SongEventFieldType.BOOL, - defaultValue: DEFAULT_FORCE - } - ]); + return new SongEventSchema([{ + name: 'target', + title: 'Target', + type: SongEventFieldType.STRING, + defaultValue: DEFAULT_TARGET, + }, { + name: 'anim', + title: 'Animation', + type: SongEventFieldType.STRING, + defaultValue: DEFAULT_ANIM, + }, { + name: 'force', + title: 'Force', + type: SongEventFieldType.BOOL, + defaultValue: DEFAULT_FORCE + }]); } } diff --git a/source/funkin/play/event/ScriptedSongEvent.hx b/source/funkin/play/event/ScriptedSongEvent.hx index f9e0a4d7f..51119357e 100644 --- a/source/funkin/play/event/ScriptedSongEvent.hx +++ b/source/funkin/play/event/ScriptedSongEvent.hx @@ -11,4 +11,6 @@ import polymod.hscript.HScriptedClass; * - Override `getEventSchema()` to return a schema for the event data, used to build a form in the chart editor. */ @:hscriptClass -class ScriptedSongEvent extends SongEvent implements HScriptedClass {} +class ScriptedSongEvent extends SongEvent implements HScriptedClass +{ +} diff --git a/source/funkin/play/event/ScrollSpeedEvent.hx b/source/funkin/play/event/ScrollSpeedEvent.hx index 52d16ef53..570e49ed7 100644 --- a/source/funkin/play/event/ScrollSpeedEvent.hx +++ b/source/funkin/play/event/ScrollSpeedEvent.hx @@ -29,10 +29,9 @@ class ScrollSpeedEvent extends SongEvent { public function new() { - super('ScrollSpeed', - { - processOldEvents: true - }); + super('ScrollSpeed', { + processOldEvents: true + }); } static final DEFAULT_SCROLL:Float = 1; @@ -111,67 +110,45 @@ class ScrollSpeedEvent extends SongEvent */ public override function getEventSchema():SongEventSchema { - return new SongEventSchema([ - { - name: 'scroll', - title: 'Target Value', - defaultValue: DEFAULT_SCROLL, - min: 0.1, - step: 0.1, - type: SongEventFieldType.FLOAT, - units: 'x' - }, - { - name: 'duration', - title: 'Duration', - defaultValue: DEFAULT_DURATION, - min: 0, - step: 0.5, - type: SongEventFieldType.FLOAT, - units: 'steps' - }, - { - name: 'ease', - title: 'Easing Type', - defaultValue: SongEvent.DEFAULT_EASE, - type: SongEventFieldType.ENUM, - keys: [ - 'Linear' => 'linear', - 'Instant (Ignores duration)' => 'INSTANT', - 'Sine' => 'sine', - 'Quad' => 'quad', - 'Cube' => 'cube', - 'Quart' => 'quart', - 'Quint' => 'quint', - 'Expo' => 'expo', - 'Smooth Step' => 'smoothStep', - 'Smoother Step' => 'smootherStep', - 'Elastic' => 'elastic', - 'Back' => 'back', - 'Bounce' => 'bounce', - 'Circ ' => 'circ', - ] - }, - { - name: 'easeDir', - title: 'Easing Direction', - defaultValue: SongEvent.DEFAULT_EASE_DIR, - type: SongEventFieldType.ENUM, - keys: ['In' => 'In', 'Out' => 'Out', 'In/Out' => 'InOut'] - }, - { - name: 'strumline', - title: 'Target Strumline', - defaultValue: DEFAULT_STRUMLINE, - type: SongEventFieldType.ENUM, - keys: ['Both' => 'both', 'Player' => 'player', 'Opponent' => 'opponent'] - }, - { - name: 'absolute', - title: 'Absolute', - defaultValue: DEFAULT_ABSOLUTE, - type: SongEventFieldType.BOOL, - } - ]); + return new SongEventSchema([{ + name: 'scroll', + title: 'Target Value', + defaultValue: DEFAULT_SCROLL, + min: 0.1, + step: 0.1, + type: SongEventFieldType.FLOAT, + units: 'x' + }, { + name: 'duration', + title: 'Duration', + defaultValue: DEFAULT_DURATION, + min: 0, + step: 0.5, + type: SongEventFieldType.FLOAT, + units: 'steps' + }, { + name: 'ease', + title: 'Easing Type', + defaultValue: SongEvent.DEFAULT_EASE, + type: SongEventFieldType.ENUM, + keys: ['Linear' => 'linear', 'Instant (Ignores duration)' => 'INSTANT', 'Sine' => 'sine', 'Quad' => 'quad', 'Cube' => 'cube', 'Quart' => 'quart', 'Quint' => 'quint', 'Expo' => 'expo', 'Smooth Step' => 'smoothStep', 'Smoother Step' => 'smootherStep', 'Elastic' => 'elastic', 'Back' => 'back', 'Bounce' => 'bounce', 'Circ ' => 'circ',] + }, { + name: 'easeDir', + title: 'Easing Direction', + defaultValue: SongEvent.DEFAULT_EASE_DIR, + type: SongEventFieldType.ENUM, + keys: ['In' => 'In', 'Out' => 'Out', 'In/Out' => 'InOut'] + }, { + name: 'strumline', + title: 'Target Strumline', + defaultValue: DEFAULT_STRUMLINE, + type: SongEventFieldType.ENUM, + keys: ['Both' => 'both', 'Player' => 'player', 'Opponent' => 'opponent'] + }, { + name: 'absolute', + title: 'Absolute', + defaultValue: DEFAULT_ABSOLUTE, + type: SongEventFieldType.BOOL, + }]); } } diff --git a/source/funkin/play/event/SetCameraBopSongEvent.hx b/source/funkin/play/event/SetCameraBopSongEvent.hx index fbdc9f556..aedad7b2b 100644 --- a/source/funkin/play/event/SetCameraBopSongEvent.hx +++ b/source/funkin/play/event/SetCameraBopSongEvent.hx @@ -32,10 +32,9 @@ class SetCameraBopSongEvent extends SongEvent { public function new() { - super('SetCameraBop', - { - processOldEvents: true - }); + super('SetCameraBop', { + processOldEvents: true + }); } public override function handleEvent(data:SongEventData):Void @@ -70,33 +69,29 @@ class SetCameraBopSongEvent extends SongEvent */ public override function getEventSchema():SongEventSchema { - return new SongEventSchema([ - { - name: 'intensity', - title: 'Intensity', - defaultValue: Constants.DEFAULT_BOP_INTENSITY, - min: 0, - step: 0.1, - type: SongEventFieldType.FLOAT, - units: 'x' - }, - { - name: 'offset', - title: 'Offset', - defaultValue: Constants.DEFAULT_ZOOM_OFFSET, - step: 0.25, - type: SongEventFieldType.FLOAT, - units: 'beats' - }, - { - name: 'rate', - title: 'Rate', - defaultValue: Constants.DEFAULT_ZOOM_RATE, - min: 0, - step: 0.25, - type: SongEventFieldType.FLOAT, - units: 'beats/zoom' - } - ]); + return new SongEventSchema([{ + name: 'intensity', + title: 'Intensity', + defaultValue: Constants.DEFAULT_BOP_INTENSITY, + min: 0, + step: 0.1, + type: SongEventFieldType.FLOAT, + units: 'x' + }, { + name: 'offset', + title: 'Offset', + defaultValue: Constants.DEFAULT_ZOOM_OFFSET, + step: 0.25, + type: SongEventFieldType.FLOAT, + units: 'beats' + }, { + name: 'rate', + title: 'Rate', + defaultValue: Constants.DEFAULT_ZOOM_RATE, + min: 0, + step: 0.25, + type: SongEventFieldType.FLOAT, + units: 'beats/zoom' + }]); } } diff --git a/source/funkin/play/event/SetHealthIconSongEvent.hx b/source/funkin/play/event/SetHealthIconSongEvent.hx index 4a05dd991..e79ad0e2c 100644 --- a/source/funkin/play/event/SetHealthIconSongEvent.hx +++ b/source/funkin/play/event/SetHealthIconSongEvent.hx @@ -29,10 +29,9 @@ class SetHealthIconSongEvent extends SongEvent { public function new() { - super('SetHealthIcon', - { - processOldEvents: true - }); + super('SetHealthIcon', { + processOldEvents: true + }); } static final DEFAULT_CHAR:Int = 0; @@ -53,14 +52,13 @@ class SetHealthIconSongEvent extends SongEvent var offsets:Array = [data.value.offsetX ?? DEFAULT_X_OFFSET, data.value.offsetY ?? DEFAULT_Y_OFFSET]; - var healthIconData:HealthIconData = - { - id: data.value.id ?? Constants.DEFAULT_HEALTH_ICON, - scale: data.value.scale ?? DEFAULT_SCALE, - flipX: data.value.flipX ?? DEFAULT_FLIPX, - isPixel: data.value.isPixel ?? DEFAULT_ISPIXEL, - offsets: offsets, - }; + var healthIconData:HealthIconData = { + id: data.value.id ?? Constants.DEFAULT_HEALTH_ICON, + scale: data.value.scale ?? DEFAULT_SCALE, + flipX: data.value.flipX ?? DEFAULT_FLIPX, + isPixel: data.value.isPixel ?? DEFAULT_ISPIXEL, + offsets: offsets, + }; switch (data?.value?.char ?? DEFAULT_CHAR) { @@ -88,51 +86,43 @@ class SetHealthIconSongEvent extends SongEvent public override function getEventSchema():SongEventSchema { - return new SongEventSchema([ - { - name: 'char', - title: 'Character', - defaultValue: DEFAULT_CHAR, - type: SongEventFieldType.ENUM, - keys: ['Player' => 0, 'Opponent' => 1], - }, - { - name: 'id', - title: 'Health Icon ID', - defaultValue: Constants.DEFAULT_HEALTH_ICON, - type: SongEventFieldType.STRING, - }, - { - name: 'scale', - title: 'Scale', - defaultValue: DEFAULT_SCALE, - min: 0, - type: SongEventFieldType.FLOAT, - }, - { - name: 'flipX', - title: 'Flip X?', - defaultValue: DEFAULT_FLIPX, - type: SongEventFieldType.BOOL, - }, - { - name: 'isPixel', - title: 'Is Pixel?', - defaultValue: DEFAULT_ISPIXEL, - type: SongEventFieldType.BOOL, - }, - { - name: 'offsetX', - title: 'X Offset', - defaultValue: DEFAULT_X_OFFSET, - type: SongEventFieldType.FLOAT, - }, - { - name: 'offsetY', - title: 'Y Offset', - defaultValue: DEFAULT_Y_OFFSET, - type: SongEventFieldType.FLOAT, - } - ]); + return new SongEventSchema([{ + name: 'char', + title: 'Character', + defaultValue: DEFAULT_CHAR, + type: SongEventFieldType.ENUM, + keys: ['Player' => 0, 'Opponent' => 1], + }, { + name: 'id', + title: 'Health Icon ID', + defaultValue: Constants.DEFAULT_HEALTH_ICON, + type: SongEventFieldType.STRING, + }, { + name: 'scale', + title: 'Scale', + defaultValue: DEFAULT_SCALE, + min: 0, + type: SongEventFieldType.FLOAT, + }, { + name: 'flipX', + title: 'Flip X?', + defaultValue: DEFAULT_FLIPX, + type: SongEventFieldType.BOOL, + }, { + name: 'isPixel', + title: 'Is Pixel?', + defaultValue: DEFAULT_ISPIXEL, + type: SongEventFieldType.BOOL, + }, { + name: 'offsetX', + title: 'X Offset', + defaultValue: DEFAULT_X_OFFSET, + type: SongEventFieldType.FLOAT, + }, { + name: 'offsetY', + title: 'Y Offset', + defaultValue: DEFAULT_Y_OFFSET, + type: SongEventFieldType.FLOAT, + }]); } } diff --git a/source/funkin/play/event/SongEventHelper.hx b/source/funkin/play/event/SongEventHelper.hx index eb48e1994..147f13fd1 100644 --- a/source/funkin/play/event/SongEventHelper.hx +++ b/source/funkin/play/event/SongEventHelper.hx @@ -8,20 +8,7 @@ class SongEventHelper { public static var EASE_CANVAS_SIZE:Int = 200; public static var easeBitmapMap:Map = new Map(); - public static var easeDirList:Array = [ - "sine", - "quad", - "cube", - "quart", - "quint", - "expo", - "smoothStep", - "smootherStep", - "elastic", - "back", - "bounce", - "circ" - ]; + public static var easeDirList:Array = ["sine", "quad", "cube", "quart", "quint", "expo", "smoothStep", "smootherStep", "elastic", "back", "bounce", "circ"]; public static var easeDirs:Array = ["In", "Out", "InOut"]; public static var easeDotCache:Map> = new Map>(); diff --git a/source/funkin/play/event/ZoomCameraSongEvent.hx b/source/funkin/play/event/ZoomCameraSongEvent.hx index d1c4f4865..091a7e3fa 100644 --- a/source/funkin/play/event/ZoomCameraSongEvent.hx +++ b/source/funkin/play/event/ZoomCameraSongEvent.hx @@ -22,10 +22,9 @@ class ZoomCameraSongEvent extends SongEvent { public function new() { - super('ZoomCamera', - { - processOldEvents: true - }); + super('ZoomCamera', { + processOldEvents: true + }); } static final DEFAULT_ZOOM:Float = 1.0; @@ -89,61 +88,40 @@ class ZoomCameraSongEvent extends SongEvent */ public override function getEventSchema():SongEventSchema { - return new SongEventSchema([ - { - name: 'zoom', - title: 'Zoom Level', - defaultValue: DEFAULT_ZOOM, - min: 0, - step: 0.05, - type: SongEventFieldType.FLOAT, - units: 'x' - }, - { - name: 'duration', - title: 'Duration', - defaultValue: DEFAULT_DURATION, - min: 0, - step: 0.5, - type: SongEventFieldType.FLOAT, - units: 'steps' - }, - { - name: 'mode', - title: 'Mode', - defaultValue: DEFAULT_MODE, - type: SongEventFieldType.ENUM, - keys: ['Stage zoom' => 'stage', 'Absolute zoom' => 'direct'] - }, - { - name: 'ease', - title: 'Easing Type', - defaultValue: SongEvent.DEFAULT_EASE, - type: SongEventFieldType.ENUM, - keys: [ - 'Linear' => 'linear', - 'Instant (Ignores duration)' => 'INSTANT', - 'Sine' => 'sine', - 'Quad' => 'quad', - 'Cube' => 'cube', - 'Quart' => 'quart', - 'Quint' => 'quint', - 'Expo' => 'expo', - 'Smooth Step' => 'smoothStep', - 'Smoother Step' => 'smootherStep', - 'Elastic' => 'elastic', - 'Back' => 'back', - 'Bounce' => 'bounce', - 'Circ ' => 'circ', - ] - }, - { - name: 'easeDir', - title: 'Easing Direction', - defaultValue: SongEvent.DEFAULT_EASE_DIR, - type: SongEventFieldType.ENUM, - keys: ['In' => 'In', 'Out' => 'Out', 'In/Out' => 'InOut'] - } - ]); + return new SongEventSchema([{ + name: 'zoom', + title: 'Zoom Level', + defaultValue: DEFAULT_ZOOM, + min: 0, + step: 0.05, + type: SongEventFieldType.FLOAT, + units: 'x' + }, { + name: 'duration', + title: 'Duration', + defaultValue: DEFAULT_DURATION, + min: 0, + step: 0.5, + type: SongEventFieldType.FLOAT, + units: 'steps' + }, { + name: 'mode', + title: 'Mode', + defaultValue: DEFAULT_MODE, + type: SongEventFieldType.ENUM, + keys: ['Stage zoom' => 'stage', 'Absolute zoom' => 'direct'] + }, { + name: 'ease', + title: 'Easing Type', + defaultValue: SongEvent.DEFAULT_EASE, + type: SongEventFieldType.ENUM, + keys: ['Linear' => 'linear', 'Instant (Ignores duration)' => 'INSTANT', 'Sine' => 'sine', 'Quad' => 'quad', 'Cube' => 'cube', 'Quart' => 'quart', 'Quint' => 'quint', 'Expo' => 'expo', 'Smooth Step' => 'smoothStep', 'Smoother Step' => 'smootherStep', 'Elastic' => 'elastic', 'Back' => 'back', 'Bounce' => 'bounce', 'Circ ' => 'circ',] + }, { + name: 'easeDir', + title: 'Easing Direction', + defaultValue: SongEvent.DEFAULT_EASE_DIR, + type: SongEventFieldType.ENUM, + keys: ['In' => 'In', 'Out' => 'Out', 'In/Out' => 'InOut'] + }]); } } diff --git a/source/funkin/play/notes/ScriptedStrumline.hx b/source/funkin/play/notes/ScriptedStrumline.hx index c6fead4a2..7c5871a0b 100644 --- a/source/funkin/play/notes/ScriptedStrumline.hx +++ b/source/funkin/play/notes/ScriptedStrumline.hx @@ -5,4 +5,6 @@ package funkin.play.notes; * Create a scripted class that extends Strumline to use this. */ @:hscriptClass -class ScriptedStrumline extends funkin.play.notes.Strumline implements polymod.hscript.HScriptedClass {} +class ScriptedStrumline extends funkin.play.notes.Strumline implements polymod.hscript.HScriptedClass +{ +} diff --git a/source/funkin/play/notes/Strumline.hx b/source/funkin/play/notes/Strumline.hx index 6ca560919..78cb7e1d1 100644 --- a/source/funkin/play/notes/Strumline.hx +++ b/source/funkin/play/notes/Strumline.hx @@ -362,7 +362,8 @@ class Strumline extends FlxSpriteGroup */ public function getNotesMayHit():Array { - return notes.members.filter(function(note:NoteSprite) { + return notes.members.filter(function(note:NoteSprite) + { return note != null && note.alive && !note.hasBeenHit && note.mayHit; }); } @@ -373,7 +374,8 @@ class Strumline extends FlxSpriteGroup */ public function getHoldNotesHitOrMissed():Array { - return holdNotes.members.filter(function(holdNote:SustainTrail) { + return holdNotes.members.filter(function(holdNote:SustainTrail) + { return holdNote != null && holdNote.alive && (holdNote.hitNote || holdNote.missedNote); }); } @@ -435,15 +437,15 @@ class Strumline extends FlxSpriteGroup var targetY:Float = FlxG.height + note.y; if (isDownscroll) targetY = note.y - FlxG.height; - FlxTween.tween(note, {y: targetY}, vwooshTime, + FlxTween.tween(note, {y: targetY}, vwooshTime, { + ease: FlxEase.expoIn, + onComplete: function(twn) { - ease: FlxEase.expoIn, - onComplete: function(twn) { - note.kill(); - notesVwoosh.remove(note, true); - note.destroy(); - } - }); + note.kill(); + notesVwoosh.remove(note, true); + note.destroy(); + } + }); } for (holdNote in holdNotes.members) @@ -456,15 +458,15 @@ class Strumline extends FlxSpriteGroup var targetY:Float = FlxG.height + holdNote.y; if (isDownscroll) targetY = holdNote.y - FlxG.height; - FlxTween.tween(holdNote, {y: targetY}, vwooshTime, + FlxTween.tween(holdNote, {y: targetY}, vwooshTime, { + ease: FlxEase.expoIn, + onComplete: function(twn) { - ease: FlxEase.expoIn, - onComplete: function(twn) { - holdNote.kill(); - holdNotesVwoosh.remove(holdNote, true); - holdNote.destroy(); - } - }); + holdNote.kill(); + holdNotesVwoosh.remove(holdNote, true); + holdNote.destroy(); + } + }); } } @@ -474,7 +476,8 @@ class Strumline extends FlxSpriteGroup */ public function enterMiniMode(scale:Float = 1):Void { - forEach(function(obj:flixel.FlxObject):Void { + forEach(function(obj:flixel.FlxObject):Void + { if (obj != strumlineNotes) obj.visible = false; }); @@ -487,7 +490,8 @@ class Strumline extends FlxSpriteGroup */ function strumlineScaleCallback(scale:FlxPoint):Void { - strumlineNotes.forEach(function(note:StrumlineNote):Void { + strumlineNotes.forEach(function(note:StrumlineNote):Void + { var styleScale = noteStyle.getStrumlineScale(); note.scale.set(styleScale * scale.x, styleScale * scale.y); }); @@ -534,13 +538,13 @@ class Strumline extends FlxSpriteGroup { note.yOffset = -200; } - FlxTween.tween(note, {yOffset: 0}, vwooshTime, + FlxTween.tween(note, {yOffset: 0}, vwooshTime, { + ease: FlxEase.expoOut, + onComplete: function(twn) { - ease: FlxEase.expoOut, - onComplete: function(twn) { - note.yOffset = 0; - } - }); + note.yOffset = 0; + } + }); } for (holdNote in holdNotes.members) @@ -553,13 +557,13 @@ class Strumline extends FlxSpriteGroup { holdNote.yOffset = -200; } - FlxTween.tween(holdNote, {yOffset: 0}, vwooshTime, + FlxTween.tween(holdNote, {yOffset: 0}, vwooshTime, { + ease: FlxEase.expoOut, + onComplete: function(twn) { - ease: FlxEase.expoOut, - onComplete: function(twn) { - holdNote.yOffset = 0; - } - }); + holdNote.yOffset = 0; + } + }); } } @@ -788,7 +792,8 @@ class Strumline extends FlxSpriteGroup */ public function getNotesOnScreen():Array { - return notes.members.filter(function(note:NoteSprite) { + return notes.members.filter(function(note:NoteSprite) + { return note != null && note.alive && !note.hasBeenHit; }); } diff --git a/source/funkin/play/notes/notekind/NoteKind.hx b/source/funkin/play/notes/notekind/NoteKind.hx index a8c63476f..c0e49976c 100644 --- a/source/funkin/play/notes/notekind/NoteKind.hx +++ b/source/funkin/play/notes/notekind/NoteKind.hx @@ -68,7 +68,8 @@ class NoteKind implements INoteScriptedClass function getNotes(visibleCheck:Bool = false):Array { var allNotes:Array = PlayState.instance.playerStrumline.notes.members.concat(PlayState.instance.opponentStrumline.notes.members); - return allNotes.filter(function(note:NoteSprite) { + return allNotes.filter(function(note:NoteSprite) + { return note != null && note.noteData.kind == this.noteKind && (!visibleCheck || note.visible); }); } @@ -81,26 +82,43 @@ class NoteKind implements INoteScriptedClass function getOtherNotes(visibleCheck:Bool = false):Array { var allNotes:Array = PlayState.instance.playerStrumline.notes.members.concat(PlayState.instance.opponentStrumline.notes.members); - return allNotes.filter(function(note:NoteSprite) { + return allNotes.filter(function(note:NoteSprite) + { return note != null && note.noteData.kind != this.noteKind && (!visibleCheck || note.visible); }); } - public function onScriptEvent(event:ScriptEvent):Void {} + public function onScriptEvent(event:ScriptEvent):Void + { + } - public function onCreate(event:ScriptEvent):Void {} + public function onCreate(event:ScriptEvent):Void + { + } - public function onDestroy(event:ScriptEvent):Void {} + public function onDestroy(event:ScriptEvent):Void + { + } - public function onUpdate(event:UpdateScriptEvent):Void {} + public function onUpdate(event:UpdateScriptEvent):Void + { + } - public function onNoteIncoming(event:NoteScriptEvent):Void {} + public function onNoteIncoming(event:NoteScriptEvent):Void + { + } - public function onNoteHit(event:HitNoteScriptEvent):Void {} + public function onNoteHit(event:HitNoteScriptEvent):Void + { + } - public function onNoteMiss(event:NoteScriptEvent):Void {} + public function onNoteMiss(event:NoteScriptEvent):Void + { + } - public function onNoteHoldDrop(event:HoldNoteScriptEvent) {} + public function onNoteHoldDrop(event:HoldNoteScriptEvent) + { + } } /** diff --git a/source/funkin/play/notes/notekind/ScriptedNoteKind.hx b/source/funkin/play/notes/notekind/ScriptedNoteKind.hx index cd1781394..7d581653c 100644 --- a/source/funkin/play/notes/notekind/ScriptedNoteKind.hx +++ b/source/funkin/play/notes/notekind/ScriptedNoteKind.hx @@ -6,4 +6,6 @@ package funkin.play.notes.notekind; * then call `super('noteKind')` in the constructor to use this. */ @:hscriptClass -class ScriptedNoteKind extends NoteKind implements polymod.hscript.HScriptedClass {} +class ScriptedNoteKind extends NoteKind implements polymod.hscript.HScriptedClass +{ +} diff --git a/source/funkin/play/notes/notestyle/NoteStyle.hx b/source/funkin/play/notes/notestyle/NoteStyle.hx index 3d6749d1b..2118f43ce 100644 --- a/source/funkin/play/notes/notestyle/NoteStyle.hx +++ b/source/funkin/play/notes/notestyle/NoteStyle.hx @@ -279,30 +279,10 @@ class NoteStyle implements IRegistryEntry var result:Array> = switch (dir) { case NoteDirection.LEFT: - [ - _data.assets.noteStrumline?.data?.leftStatic?.toNamed('static'), - _data.assets.noteStrumline?.data?.leftPress?.toNamed('press'), - _data.assets.noteStrumline?.data?.leftConfirm?.toNamed('confirm'), - _data.assets.noteStrumline?.data?.leftConfirmHold?.toNamed('confirm-hold'), - ]; - case NoteDirection.DOWN: [ - _data.assets.noteStrumline?.data?.downStatic?.toNamed('static'), - _data.assets.noteStrumline?.data?.downPress?.toNamed('press'), - _data.assets.noteStrumline?.data?.downConfirm?.toNamed('confirm'), - _data.assets.noteStrumline?.data?.downConfirmHold?.toNamed('confirm-hold'), - ]; - case NoteDirection.UP: [ - _data.assets.noteStrumline?.data?.upStatic?.toNamed('static'), - _data.assets.noteStrumline?.data?.upPress?.toNamed('press'), - _data.assets.noteStrumline?.data?.upConfirm?.toNamed('confirm'), - _data.assets.noteStrumline?.data?.upConfirmHold?.toNamed('confirm-hold'), - ]; - case NoteDirection.RIGHT: [ - _data.assets.noteStrumline?.data?.rightStatic?.toNamed('static'), - _data.assets.noteStrumline?.data?.rightPress?.toNamed('press'), - _data.assets.noteStrumline?.data?.rightConfirm?.toNamed('confirm'), - _data.assets.noteStrumline?.data?.rightConfirmHold?.toNamed('confirm-hold'), - ]; + [_data.assets.noteStrumline?.data?.leftStatic?.toNamed('static'), _data.assets.noteStrumline?.data?.leftPress?.toNamed('press'), _data.assets.noteStrumline?.data?.leftConfirm?.toNamed('confirm'), _data.assets.noteStrumline?.data?.leftConfirmHold?.toNamed('confirm-hold'),]; + case NoteDirection.DOWN: [_data.assets.noteStrumline?.data?.downStatic?.toNamed('static'), _data.assets.noteStrumline?.data?.downPress?.toNamed('press'), _data.assets.noteStrumline?.data?.downConfirm?.toNamed('confirm'), _data.assets.noteStrumline?.data?.downConfirmHold?.toNamed('confirm-hold'),]; + case NoteDirection.UP: [_data.assets.noteStrumline?.data?.upStatic?.toNamed('static'), _data.assets.noteStrumline?.data?.upPress?.toNamed('press'), _data.assets.noteStrumline?.data?.upConfirm?.toNamed('confirm'), _data.assets.noteStrumline?.data?.upConfirmHold?.toNamed('confirm-hold'),]; + case NoteDirection.RIGHT: [_data.assets.noteStrumline?.data?.rightStatic?.toNamed('static'), _data.assets.noteStrumline?.data?.rightPress?.toNamed('press'), _data.assets.noteStrumline?.data?.rightConfirm?.toNamed('confirm'), _data.assets.noteStrumline?.data?.rightConfirmHold?.toNamed('confirm-hold'),]; default: []; }; @@ -942,7 +922,8 @@ class NoteStyle implements IRegistryEntry function buildSplashAnimations(target:NoteSplash):Void { - final addSplashAnim:NoteDirection->Void = function(dir:NoteDirection) { + final addSplashAnim:NoteDirection->Void = function(dir:NoteDirection) + { var animData:Null> = fetchSplashAnimationData(dir); if (animData != null) { @@ -1086,26 +1067,10 @@ class NoteStyle implements IRegistryEntry var noteColor:String = dir.colorName.toTitleCase(); var result:Array> = switch (dir) { - case LEFT: [ - _data.assets?.holdNoteCover?.data?.left?.start?.toNamed('holdCoverStart$noteColor'), - _data.assets?.holdNoteCover?.data?.left?.hold?.toNamed('holdCover$noteColor'), - _data.assets?.holdNoteCover?.data?.left?.end?.toNamed('holdCoverEnd$noteColor'), - ]; - case DOWN: [ - _data.assets?.holdNoteCover?.data?.down?.start?.toNamed('holdCoverStart$noteColor'), - _data.assets?.holdNoteCover?.data?.down?.hold?.toNamed('holdCover$noteColor'), - _data.assets?.holdNoteCover?.data?.down?.end?.toNamed('holdCoverEnd$noteColor'), - ]; - case UP: [ - _data.assets?.holdNoteCover?.data?.up?.start?.toNamed('holdCoverStart$noteColor'), - _data.assets?.holdNoteCover?.data?.up?.hold?.toNamed('holdCover$noteColor'), - _data.assets?.holdNoteCover?.data?.up?.end?.toNamed('holdCoverEnd$noteColor'), - ]; - case RIGHT: [ - _data.assets?.holdNoteCover?.data?.right?.start?.toNamed('holdCoverStart$noteColor'), - _data.assets?.holdNoteCover?.data?.right?.hold?.toNamed('holdCover$noteColor'), - _data.assets?.holdNoteCover?.data?.right?.end?.toNamed('holdCoverEnd$noteColor'), - ]; + case LEFT: [_data.assets?.holdNoteCover?.data?.left?.start?.toNamed('holdCoverStart$noteColor'), _data.assets?.holdNoteCover?.data?.left?.hold?.toNamed('holdCover$noteColor'), _data.assets?.holdNoteCover?.data?.left?.end?.toNamed('holdCoverEnd$noteColor'),]; + case DOWN: [_data.assets?.holdNoteCover?.data?.down?.start?.toNamed('holdCoverStart$noteColor'), _data.assets?.holdNoteCover?.data?.down?.hold?.toNamed('holdCover$noteColor'), _data.assets?.holdNoteCover?.data?.down?.end?.toNamed('holdCoverEnd$noteColor'),]; + case UP: [_data.assets?.holdNoteCover?.data?.up?.start?.toNamed('holdCoverStart$noteColor'), _data.assets?.holdNoteCover?.data?.up?.hold?.toNamed('holdCover$noteColor'), _data.assets?.holdNoteCover?.data?.up?.end?.toNamed('holdCoverEnd$noteColor'),]; + case RIGHT: [_data.assets?.holdNoteCover?.data?.right?.start?.toNamed('holdCoverStart$noteColor'), _data.assets?.holdNoteCover?.data?.right?.hold?.toNamed('holdCover$noteColor'), _data.assets?.holdNoteCover?.data?.right?.end?.toNamed('holdCoverEnd$noteColor'),]; default: []; }; @@ -1165,7 +1130,9 @@ class NoteStyle implements IRegistryEntry return _data?.assets?.holdNoteCover?.offsets ?? fallback?.getHoldCoverOffsets() ?? [0.0, 0.0]; } - public function destroy():Void {} + public function destroy():Void + { + } /** * Returns a string of the library name for the given asset id diff --git a/source/funkin/play/notes/notestyle/ScriptedNoteStyle.hx b/source/funkin/play/notes/notestyle/ScriptedNoteStyle.hx index cae0e60ec..2caddd8b0 100644 --- a/source/funkin/play/notes/notestyle/ScriptedNoteStyle.hx +++ b/source/funkin/play/notes/notestyle/ScriptedNoteStyle.hx @@ -6,4 +6,6 @@ package funkin.play.notes.notestyle; * This allows you to customize how a specific note style appears. */ @:hscriptClass -class ScriptedNoteStyle extends funkin.play.notes.notestyle.NoteStyle implements polymod.hscript.HScriptedClass {} +class ScriptedNoteStyle extends funkin.play.notes.notestyle.NoteStyle implements polymod.hscript.HScriptedClass +{ +} diff --git a/source/funkin/play/scoring/Scoring.hx b/source/funkin/play/scoring/Scoring.hx index 921959529..965bcfb66 100644 --- a/source/funkin/play/scoring/Scoring.hx +++ b/source/funkin/play/scoring/Scoring.hx @@ -420,7 +420,8 @@ class Scoring public static function tallyCompletion(?tallies:SaveScoreTallyData):Float { if (tallies == null) return 0.0; - return ((tallies.sick + tallies.good - tallies.missed) / tallies.totalNotes).clamp(0, 1); // Needs to be clamped to make sure Perfect ranks are saved properly + return ((tallies.sick + tallies.good - tallies.missed) / tallies.totalNotes).clamp(0, + 1); // Needs to be clamped to make sure Perfect ranks are saved properly } } diff --git a/source/funkin/play/song/ScriptedSong.hx b/source/funkin/play/song/ScriptedSong.hx index 35cd80014..30f253c47 100644 --- a/source/funkin/play/song/ScriptedSong.hx +++ b/source/funkin/play/song/ScriptedSong.hx @@ -5,4 +5,6 @@ package funkin.play.song; * Create a scripted class that extends Song to use this. */ @:hscriptClass -class ScriptedSong extends funkin.play.song.Song implements polymod.hscript.HScriptedClass {} +class ScriptedSong extends funkin.play.song.Song implements polymod.hscript.HScriptedClass +{ +} diff --git a/source/funkin/play/song/Song.hx b/source/funkin/play/song/Song.hx index e02218cb9..12bbd88c2 100644 --- a/source/funkin/play/song/Song.hx +++ b/source/funkin/play/song/Song.hx @@ -519,7 +519,8 @@ class Song implements IPlayStateScriptedClass implements IRegistryEntry = variationIds.map(function(variationId:String):Array { + var diffFiltered:Array = variationIds.map(function(variationId:String):Array + { var metadata = _metadata.get(variationId); return metadata?.playData?.difficulties ?? []; }) @@ -527,7 +528,8 @@ class Song implements IPlayStateScriptedClass implements IRegistryEntry { @@ -973,7 +1019,8 @@ class SongDifficulty } // Sometimes the sounds don't set their important value to true, so we have to do this manually. - result.forEach(function(snd:FunkinSound) { + result.forEach(function(snd:FunkinSound) + { snd.important = true; }); diff --git a/source/funkin/play/stage/Bopper.hx b/source/funkin/play/stage/Bopper.hx index 4db8806da..a797a0e59 100644 --- a/source/funkin/play/stage/Bopper.hx +++ b/source/funkin/play/stage/Bopper.hx @@ -169,7 +169,9 @@ class Bopper extends StageProp implements IPlayStateScriptedClass } } - public function onBeatHit(event:SongTimeScriptEvent):Void {} + public function onBeatHit(event:SongTimeScriptEvent):Void + { + } /** * Called every `danceEvery` beats of the song. @@ -260,7 +262,9 @@ class Bopper extends StageProp implements IPlayStateScriptedClass if ((!canPlayOtherAnims)) { var id = name; - if (getCurrentAnimation() == id && restart) {} + if (getCurrentAnimation() == id && restart) + { + } else if (ignoreExclusionPref != null && ignoreExclusionPref.length > 0) { var detected:Bool = false; @@ -310,7 +314,8 @@ class Bopper extends StageProp implements IPlayStateScriptedClass applyAnimationOffsets(correctName); canPlayOtherAnims = false; - forceAnimationTimer.start(duration, (timer) -> { + forceAnimationTimer.start(duration, (timer) -> + { canPlayOtherAnims = true; }, 1); } @@ -335,35 +340,67 @@ class Bopper extends StageProp implements IPlayStateScriptedClass return output; } - public function onPause(event:PauseScriptEvent) {} + public function onPause(event:PauseScriptEvent) + { + } - public function onResume(event:ScriptEvent) {} + public function onResume(event:ScriptEvent) + { + } - public function onSongStart(event:ScriptEvent) {} + public function onSongStart(event:ScriptEvent) + { + } - public function onSongEnd(event:ScriptEvent) {} + public function onSongEnd(event:ScriptEvent) + { + } - public function onGameOver(event:ScriptEvent) {} + public function onGameOver(event:ScriptEvent) + { + } - public function onNoteIncoming(event:NoteScriptEvent) {} + public function onNoteIncoming(event:NoteScriptEvent) + { + } - public function onNoteHit(event:HitNoteScriptEvent) {} + public function onNoteHit(event:HitNoteScriptEvent) + { + } - public function onNoteHoldDrop(event:HoldNoteScriptEvent) {} + public function onNoteHoldDrop(event:HoldNoteScriptEvent) + { + } - public function onNoteMiss(event:NoteScriptEvent) {} + public function onNoteMiss(event:NoteScriptEvent) + { + } - public function onSongEvent(event:SongEventScriptEvent) {} + public function onSongEvent(event:SongEventScriptEvent) + { + } - public function onNoteGhostMiss(event:GhostMissNoteScriptEvent) {} + public function onNoteGhostMiss(event:GhostMissNoteScriptEvent) + { + } - public function onCountdownStart(event:CountdownScriptEvent) {} + public function onCountdownStart(event:CountdownScriptEvent) + { + } - public function onCountdownStep(event:CountdownScriptEvent) {} + public function onCountdownStep(event:CountdownScriptEvent) + { + } - public function onCountdownEnd(event:CountdownScriptEvent) {} + public function onCountdownEnd(event:CountdownScriptEvent) + { + } - public function onSongLoaded(event:SongLoadScriptEvent) {} + public function onSongLoaded(event:SongLoadScriptEvent) + { + } - public function onSongRetry(event:SongRetryEvent) {} + public function onSongRetry(event:SongRetryEvent) + { + } } diff --git a/source/funkin/play/stage/ScriptedBopper.hx b/source/funkin/play/stage/ScriptedBopper.hx index d35d53503..5f75ef879 100644 --- a/source/funkin/play/stage/ScriptedBopper.hx +++ b/source/funkin/play/stage/ScriptedBopper.hx @@ -5,4 +5,6 @@ package funkin.play.stage; * Create a scripted class that extends Bopper to use this. */ @:hscriptClass -class ScriptedBopper extends funkin.play.stage.Bopper implements polymod.hscript.HScriptedClass {} +class ScriptedBopper extends funkin.play.stage.Bopper implements polymod.hscript.HScriptedClass +{ +} diff --git a/source/funkin/play/stage/ScriptedStage.hx b/source/funkin/play/stage/ScriptedStage.hx index 95bdec50b..b8c76e025 100644 --- a/source/funkin/play/stage/ScriptedStage.hx +++ b/source/funkin/play/stage/ScriptedStage.hx @@ -6,4 +6,6 @@ package funkin.play.stage; * and call `super('stageID')` in the constructor. */ @:hscriptClass -class ScriptedStage extends funkin.play.stage.Stage implements polymod.hscript.HScriptedClass {} +class ScriptedStage extends funkin.play.stage.Stage implements polymod.hscript.HScriptedClass +{ +} diff --git a/source/funkin/play/stage/ScriptedStageProp.hx b/source/funkin/play/stage/ScriptedStageProp.hx index 37196cc8d..706cbb863 100644 --- a/source/funkin/play/stage/ScriptedStageProp.hx +++ b/source/funkin/play/stage/ScriptedStageProp.hx @@ -5,4 +5,6 @@ package funkin.play.stage; * Create a scripted class that extends StageProp to use this. */ @:hscriptClass -class ScriptedStageProp extends funkin.play.stage.StageProp implements polymod.hscript.HScriptedClass {} +class ScriptedStageProp extends funkin.play.stage.StageProp implements polymod.hscript.HScriptedClass +{ +} diff --git a/source/funkin/play/stage/Stage.hx b/source/funkin/play/stage/Stage.hx index ad8bc47e8..d1834f1b7 100644 --- a/source/funkin/play/stage/Stage.hx +++ b/source/funkin/play/stage/Stage.hx @@ -360,7 +360,8 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements */ public function setShader(shader:FlxShader):Void { - forEachAlive(function(prop:FlxSprite) { + forEachAlive(function(prop:FlxSprite) + { prop.shader = shader; }); } @@ -629,7 +630,8 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements */ public function pause():Void { - forEachAlive(function(prop:FlxSprite) { + forEachAlive(function(prop:FlxSprite) + { if (prop.animation != null) prop.animation.pause(); }); } @@ -639,7 +641,8 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements */ public function resume():Void { - forEachAlive(function(prop:FlxSprite) { + forEachAlive(function(prop:FlxSprite) + { if (prop.animation != null) prop.animation.resume(); }); } @@ -785,15 +788,21 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements * A function that gets called once per step in the song. * @param curStep The current step number. */ - public function onStepHit(event:SongTimeScriptEvent):Void {} + public function onStepHit(event:SongTimeScriptEvent):Void + { + } /** * A function that gets called once per beat in the song (once every four steps). * @param curStep The current beat number. */ - public function onBeatHit(event:SongTimeScriptEvent):Void {} + public function onBeatHit(event:SongTimeScriptEvent):Void + { + } - public function onUpdate(event:UpdateScriptEvent) {} + public function onUpdate(event:UpdateScriptEvent) + { + } public override function kill() { @@ -835,7 +844,9 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements * Called when the frame buffer manager is ready. * Create frame buffers inside this method. */ - function setupFrameBuffers():Void {} + function setupFrameBuffers():Void + { + } /** * Called when all the frame buffers are updated. If you need any @@ -843,7 +854,9 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements * grab the screen inside this method since it immediately uses the * frame buffers. */ - function frameBuffersUpdated():Void {} + function frameBuffersUpdated():Void + { + } public function onScriptEvent(event:ScriptEvent) { @@ -855,37 +868,69 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements } } - public function onPause(event:PauseScriptEvent) {} + public function onPause(event:PauseScriptEvent) + { + } - public function onResume(event:ScriptEvent) {} + public function onResume(event:ScriptEvent) + { + } - public function onSongStart(event:ScriptEvent) {} + public function onSongStart(event:ScriptEvent) + { + } - public function onSongEnd(event:ScriptEvent) {} + public function onSongEnd(event:ScriptEvent) + { + } - public function onGameOver(event:ScriptEvent) {} + public function onGameOver(event:ScriptEvent) + { + } - public function onCountdownStart(event:CountdownScriptEvent) {} + public function onCountdownStart(event:CountdownScriptEvent) + { + } - public function onCountdownStep(event:CountdownScriptEvent) {} + public function onCountdownStep(event:CountdownScriptEvent) + { + } - public function onCountdownEnd(event:CountdownScriptEvent) {} + public function onCountdownEnd(event:CountdownScriptEvent) + { + } - public function onNoteIncoming(event:NoteScriptEvent) {} + public function onNoteIncoming(event:NoteScriptEvent) + { + } - public function onNoteHit(event:HitNoteScriptEvent) {} + public function onNoteHit(event:HitNoteScriptEvent) + { + } - public function onNoteMiss(event:NoteScriptEvent) {} + public function onNoteMiss(event:NoteScriptEvent) + { + } - public function onNoteHoldDrop(event:HoldNoteScriptEvent) {} + public function onNoteHoldDrop(event:HoldNoteScriptEvent) + { + } - public function onSongEvent(event:SongEventScriptEvent) {} + public function onSongEvent(event:SongEventScriptEvent) + { + } - public function onNoteGhostMiss(event:GhostMissNoteScriptEvent) {} + public function onNoteGhostMiss(event:GhostMissNoteScriptEvent) + { + } - public function onSongLoaded(event:SongLoadScriptEvent) {} + public function onSongLoaded(event:SongLoadScriptEvent) + { + } - public function onSongRetry(event:SongRetryEvent) {} + public function onSongRetry(event:SongRetryEvent) + { + } static function log(message:String):Void { diff --git a/source/funkin/play/stage/StageProp.hx b/source/funkin/play/stage/StageProp.hx index 4d846162b..5b31a6a29 100644 --- a/source/funkin/play/stage/StageProp.hx +++ b/source/funkin/play/stage/StageProp.hx @@ -20,13 +20,23 @@ class StageProp extends FunkinSprite implements IStateStageProp * Called when this prop is added to the stage. * @param event */ - public function onAdd(event:ScriptEvent):Void {} + public function onAdd(event:ScriptEvent):Void + { + } - public function onScriptEvent(event:ScriptEvent) {} + public function onScriptEvent(event:ScriptEvent) + { + } - public function onCreate(event:ScriptEvent) {} + public function onCreate(event:ScriptEvent) + { + } - public function onDestroy(event:ScriptEvent) {} + public function onDestroy(event:ScriptEvent) + { + } - public function onUpdate(event:UpdateScriptEvent) {} + public function onUpdate(event:UpdateScriptEvent) + { + } } diff --git a/source/funkin/save/Save.hx b/source/funkin/save/Save.hx index dd51b32fb..41d2c3cd8 100644 --- a/source/funkin/save/Save.hx +++ b/source/funkin/save/Save.hx @@ -86,113 +86,104 @@ class Save implements ConsoleClass version: thx.Dynamics.clone(Save.SAVE_DATA_VERSION), volume: 1.0, mute: false, - api: - { - newgrounds: - { - sessionId: null, - } - }, - scores: - { - // No saved scores. - levels: [], - songs: [], - }, - favoriteSongs: [], - options: - { - // Reasonable defaults. - framerate: #if mobile refreshRate #else 60 #end, - naughtyness: true, - downscroll: false, - flashingLights: true, - zoomCamera: true, - debugDisplay: 'Off', - debugDisplayBGOpacity: 50, - subtitles: true, - hapticsMode: 'All', - hapticsIntensityMultiplier: 1, - autoPause: true, - vsyncMode: 'Off', - strumlineBackgroundOpacity: 0, - autoFullscreen: false, - globalOffset: 0, - audioVisualOffset: 0, - unlockedFramerate: false, - screenshot: - { - shouldHideMouse: true, - fancyPreview: true, - previewOnSave: true, - }, - controls: - { - // Leave controls blank so defaults are loaded. - p1: - { - keyboard: {}, - gamepad: {}, - }, - p2: - { - keyboard: {}, - gamepad: {}, - }, - }, - }, - #if mobile - mobileOptions: - { - // Reasonable defaults. - screenTimeout: false, - controlsScheme: FunkinHitboxControlSchemes.Arrows, - noAds: false - }, - #end - mods: - { - // No mods enabled. - enabledMods: [], - modOptions: [], - }, - unlocks: - { - // Default to having seen the default character. - charactersSeen: ["bf"], - oldChar: false - }, - optionsChartEditor: - { - // Reasonable defaults. - previousFiles: [], - noteQuant: 3, - chartEditorLiveInputStyle: ChartEditorLiveInputStyle.None, - theme: ChartEditorTheme.Light, - playtestStartTime: false, - playtestAudioSettings: false, - playtestResultsSettings: false, - downscroll: false, - showNoteKinds: true, - metronomeVolume: 1.0, - hitsoundVolumePlayer: 1.0, - hitsoundVolumeOpponent: 1.0, - instVolume: 1.0, - playerVoiceVolume: 1.0, - opponentVoiceVolume: 1.0, - playbackSpeed: 0.5, - themeMusic: true - }, - optionsStageEditor: - { - previousFiles: [], - moveStep: "1px", - angleStep: 5, - theme: StageEditorTheme.Light, - bfChar: "bf", - gfChar: "gf", - dadChar: "dad" + api: { + newgrounds: { + sessionId: null, } + }, + scores: { + // No saved scores. + levels: [], + songs: [], + }, + favoriteSongs: [], + options: { + // Reasonable defaults. + framerate: #if mobile refreshRate #else 60 #end, + naughtyness: true, + downscroll: false, + flashingLights: true, + zoomCamera: true, + debugDisplay: 'Off', + debugDisplayBGOpacity: 50, + subtitles: true, + hapticsMode: 'All', + hapticsIntensityMultiplier: 1, + autoPause: true, + vsyncMode: 'Off', + strumlineBackgroundOpacity: 0, + autoFullscreen: false, + globalOffset: 0, + audioVisualOffset: 0, + unlockedFramerate: false, + screenshot: { + shouldHideMouse: true, + fancyPreview: true, + previewOnSave: true, + }, + controls: { + // Leave controls blank so defaults are loaded. + p1: { + keyboard: { + }, + gamepad: { + }, + }, + p2: { + keyboard: { + }, + gamepad: { + }, + }, + }, + }, + #if mobile + mobileOptions: { + // Reasonable defaults. + screenTimeout: false, + controlsScheme: FunkinHitboxControlSchemes.Arrows, + noAds: false + }, + #end + mods: { + // No mods enabled. + enabledMods: [], + modOptions: [], + }, + unlocks: { + // Default to having seen the default character. + charactersSeen: ["bf"], + oldChar: false + }, + optionsChartEditor: { + // Reasonable defaults. + previousFiles: [], + noteQuant: 3, + chartEditorLiveInputStyle: ChartEditorLiveInputStyle.None, + theme: ChartEditorTheme.Light, + playtestStartTime: false, + playtestAudioSettings: false, + playtestResultsSettings: false, + downscroll: false, + showNoteKinds: true, + metronomeVolume: 1.0, + hitsoundVolumePlayer: 1.0, + hitsoundVolumeOpponent: 1.0, + instVolume: 1.0, + playerVoiceVolume: 1.0, + opponentVoiceVolume: 1.0, + playbackSpeed: 0.5, + themeMusic: true + }, + optionsStageEditor: { + previousFiles: [], + moveStep: "1px", + angleStep: 5, + theme: StageEditorTheme.Light, + bfChar: "bf", + gfChar: "gf", + dadChar: "dad" + } }; } @@ -431,11 +422,10 @@ class Save implements ConsoleClass { if (data.scores == null) { - data.scores = - { - songs: [], - levels: [] - }; + data.scores = { + songs: [], + levels: [] + }; } else { @@ -580,12 +570,11 @@ class Save implements ConsoleClass return; } // Set the high score and the high rank separately. - var newScore:SaveScoreData = - { - score: (previousScoreData.score > newScoreData.score) ? previousScoreData.score : newScoreData.score, - tallies: (previousRank > newRank - || Scoring.tallyCompletion(previousScoreData.tallies) > Scoring.tallyCompletion(newScoreData.tallies)) ? previousScoreData.tallies : newScoreData.tallies - }; + var newScore:SaveScoreData = { + score: (previousScoreData.score > newScoreData.score) ? previousScoreData.score : newScoreData.score, + tallies: (previousRank > newRank + || Scoring.tallyCompletion(previousScoreData.tallies) > Scoring.tallyCompletion(newScoreData.tallies)) ? previousScoreData.tallies : newScoreData.tallies + }; song.set(difficultyId, newScore); Save.system.flush(); } @@ -774,7 +763,8 @@ class Save implements ConsoleClass { if (!data.mods.modOptions.exists(modId)) { - data.mods.modOptions.set(modId, {}); + data.mods.modOptions.set(modId, { + }); } return data.mods.modOptions.get(modId); @@ -949,7 +939,8 @@ class Save implements ConsoleClass { trace('[SAVE] Loading Save Data from Newgrounds...'); - funkin.api.newgrounds.NGSaveSlot.instance.load((data:Dynamic) -> { + funkin.api.newgrounds.NGSaveSlot.instance.load((data:Dynamic) -> + { FlxG.save.bind(Constants.SAVE_NAME + Constants.BASE_SAVE_SLOT, Constants.SAVE_PATH); if (FlxG.save.status != EMPTY) @@ -966,14 +957,15 @@ class Save implements ConsoleClass FlxG.save.mergeData(gameSave.data, true); _instance = gameSave; onFinish(); - }, (error:io.newgrounds.Call.CallError) -> { - var errorMsg:String = io.newgrounds.Call.CallErrorTools.toString(error); + }, (error:io.newgrounds.Call.CallError) -> + { + var errorMsg:String = io.newgrounds.Call.CallErrorTools.toString(error); - var msg = 'There was an error loading your save data from Newgrounds.'; - msg += '\n${errorMsg}'; - msg += '\nAre you sure you are connected to the internet?'; - funkin.util.WindowUtil.showError("Newgrounds Save Slot Failure", msg); - }); + var msg = 'There was an error loading your save data from Newgrounds.'; + msg += '\n${errorMsg}'; + msg += '\nAre you sure you are connected to the internet?'; + funkin.util.WindowUtil.showError("Newgrounds Save Slot Failure", msg); + }); } #end } diff --git a/source/funkin/save/SaveSystem.hx b/source/funkin/save/SaveSystem.hx index d269bffef..12a54e920 100644 --- a/source/funkin/save/SaveSystem.hx +++ b/source/funkin/save/SaveSystem.hx @@ -9,7 +9,9 @@ import flixel.util.FlxSave; */ class SaveSystem { - public function new():Void {} + public function new():Void + { + } /** * Call this to make sure the save data is written to disk. diff --git a/source/funkin/save/migrator/SaveDataMigrator.hx b/source/funkin/save/migrator/SaveDataMigrator.hx index 9c623ee9e..48f4a9a6c 100644 --- a/source/funkin/save/migrator/SaveDataMigrator.hx +++ b/source/funkin/save/migrator/SaveDataMigrator.hx @@ -139,82 +139,74 @@ class SaveDataMigrator static function migrateLegacyLevelScore(result:Save, inputSaveData:RawSaveData_v1_0_0, levelId:String):Void { - var scoreDataEasy:SaveScoreData = - { - score: inputSaveData.songScores.get('${levelId}-easy') ?? 0, - // accuracy: inputSaveData.songCompletion.get('${levelId}-easy') ?? 0.0, - tallies: - { - sick: 0, - good: 0, - bad: 0, - shit: 0, - missed: 0, - combo: 0, - maxCombo: 0, - totalNotesHit: 0, - totalNotes: 0, - } - }; + var scoreDataEasy:SaveScoreData = { + score: inputSaveData.songScores.get('${levelId}-easy') ?? 0, + // accuracy: inputSaveData.songCompletion.get('${levelId}-easy') ?? 0.0, + tallies: { + sick: 0, + good: 0, + bad: 0, + shit: 0, + missed: 0, + combo: 0, + maxCombo: 0, + totalNotesHit: 0, + totalNotes: 0, + } + }; result.setLevelScore(levelId, 'easy', scoreDataEasy); - var scoreDataNormal:SaveScoreData = - { - score: inputSaveData.songScores.get('${levelId}') ?? 0, - // accuracy: inputSaveData.songCompletion.get('${levelId}') ?? 0.0, - tallies: - { - sick: 0, - good: 0, - bad: 0, - shit: 0, - missed: 0, - combo: 0, - maxCombo: 0, - totalNotesHit: 0, - totalNotes: 0, - } - }; + var scoreDataNormal:SaveScoreData = { + score: inputSaveData.songScores.get('${levelId}') ?? 0, + // accuracy: inputSaveData.songCompletion.get('${levelId}') ?? 0.0, + tallies: { + sick: 0, + good: 0, + bad: 0, + shit: 0, + missed: 0, + combo: 0, + maxCombo: 0, + totalNotesHit: 0, + totalNotes: 0, + } + }; result.setLevelScore(levelId, 'normal', scoreDataNormal); - var scoreDataHard:SaveScoreData = - { - score: inputSaveData.songScores.get('${levelId}-hard') ?? 0, - // accuracy: inputSaveData.songCompletion.get('${levelId}-hard') ?? 0.0, - tallies: - { - sick: 0, - good: 0, - bad: 0, - shit: 0, - missed: 0, - combo: 0, - maxCombo: 0, - totalNotesHit: 0, - totalNotes: 0, - } - }; + var scoreDataHard:SaveScoreData = { + score: inputSaveData.songScores.get('${levelId}-hard') ?? 0, + // accuracy: inputSaveData.songCompletion.get('${levelId}-hard') ?? 0.0, + tallies: { + sick: 0, + good: 0, + bad: 0, + shit: 0, + missed: 0, + combo: 0, + maxCombo: 0, + totalNotesHit: 0, + totalNotes: 0, + } + }; result.setLevelScore(levelId, 'hard', scoreDataHard); } static function migrateLegacySongScore(result:Save, inputSaveData:RawSaveData_v1_0_0, songIds:Array):Void { - var scoreDataEasy:SaveScoreData = - { - score: 0, - tallies: - { - sick: 0, - good: 0, - bad: 0, - shit: 0, - missed: 0, - combo: 0, - maxCombo: 0, - totalNotesHit: 0, - totalNotes: 0, - } - }; + var scoreDataEasy:SaveScoreData = { + score: 0, + tallies: { + sick: 0, + good: 0, + bad: 0, + shit: 0, + missed: 0, + combo: 0, + maxCombo: 0, + totalNotesHit: 0, + totalNotes: 0, + } + }; for (songId in songIds) { @@ -223,22 +215,20 @@ class SaveDataMigrator } result.setSongScore(songIds[0], 'easy', scoreDataEasy); - var scoreDataNormal:SaveScoreData = - { - score: 0, - tallies: - { - sick: 0, - good: 0, - bad: 0, - shit: 0, - missed: 0, - combo: 0, - maxCombo: 0, - totalNotesHit: 0, - totalNotes: 0, - } - }; + var scoreDataNormal:SaveScoreData = { + score: 0, + tallies: { + sick: 0, + good: 0, + bad: 0, + shit: 0, + missed: 0, + combo: 0, + maxCombo: 0, + totalNotesHit: 0, + totalNotes: 0, + } + }; for (songId in songIds) { @@ -247,22 +237,20 @@ class SaveDataMigrator } result.setSongScore(songIds[0], 'normal', scoreDataNormal); - var scoreDataHard:SaveScoreData = - { - score: 0, - tallies: - { - sick: 0, - good: 0, - bad: 0, - shit: 0, - missed: 0, - combo: 0, - maxCombo: 0, - totalNotesHit: 0, - totalNotes: 0, - } - }; + var scoreDataHard:SaveScoreData = { + score: 0, + tallies: { + sick: 0, + good: 0, + bad: 0, + shit: 0, + missed: 0, + combo: 0, + maxCombo: 0, + totalNotesHit: 0, + totalNotes: 0, + } + }; for (songId in songIds) { @@ -289,45 +277,43 @@ class SaveDataMigrator static function migrateLegacyPlayerControls(result:Save, playerId:Int, controlsData:SavePlayerControlsData_v1_0_0):Void { - var outputKeyControls:SaveControlsData = - { - ACCEPT: controlsData?.keys?.ACCEPT ?? null, - BACK: controlsData?.keys?.BACK ?? null, - CUTSCENE_ADVANCE: controlsData?.keys?.CUTSCENE_ADVANCE ?? null, - NOTE_DOWN: controlsData?.keys?.NOTE_DOWN ?? null, - NOTE_LEFT: controlsData?.keys?.NOTE_LEFT ?? null, - NOTE_RIGHT: controlsData?.keys?.NOTE_RIGHT ?? null, - NOTE_UP: controlsData?.keys?.NOTE_UP ?? null, - PAUSE: controlsData?.keys?.PAUSE ?? null, - RESET: controlsData?.keys?.RESET ?? null, - UI_DOWN: controlsData?.keys?.UI_DOWN ?? null, - UI_LEFT: controlsData?.keys?.UI_LEFT ?? null, - UI_RIGHT: controlsData?.keys?.UI_RIGHT ?? null, - UI_UP: controlsData?.keys?.UI_UP ?? null, - VOLUME_DOWN: controlsData?.keys?.VOLUME_DOWN ?? null, - VOLUME_MUTE: controlsData?.keys?.VOLUME_MUTE ?? null, - VOLUME_UP: controlsData?.keys?.VOLUME_UP ?? null, - }; + var outputKeyControls:SaveControlsData = { + ACCEPT: controlsData?.keys?.ACCEPT ?? null, + BACK: controlsData?.keys?.BACK ?? null, + CUTSCENE_ADVANCE: controlsData?.keys?.CUTSCENE_ADVANCE ?? null, + NOTE_DOWN: controlsData?.keys?.NOTE_DOWN ?? null, + NOTE_LEFT: controlsData?.keys?.NOTE_LEFT ?? null, + NOTE_RIGHT: controlsData?.keys?.NOTE_RIGHT ?? null, + NOTE_UP: controlsData?.keys?.NOTE_UP ?? null, + PAUSE: controlsData?.keys?.PAUSE ?? null, + RESET: controlsData?.keys?.RESET ?? null, + UI_DOWN: controlsData?.keys?.UI_DOWN ?? null, + UI_LEFT: controlsData?.keys?.UI_LEFT ?? null, + UI_RIGHT: controlsData?.keys?.UI_RIGHT ?? null, + UI_UP: controlsData?.keys?.UI_UP ?? null, + VOLUME_DOWN: controlsData?.keys?.VOLUME_DOWN ?? null, + VOLUME_MUTE: controlsData?.keys?.VOLUME_MUTE ?? null, + VOLUME_UP: controlsData?.keys?.VOLUME_UP ?? null, + }; - var outputPadControls:SaveControlsData = - { - ACCEPT: controlsData?.pad?.ACCEPT ?? null, - BACK: controlsData?.pad?.BACK ?? null, - CUTSCENE_ADVANCE: controlsData?.pad?.CUTSCENE_ADVANCE ?? null, - NOTE_DOWN: controlsData?.pad?.NOTE_DOWN ?? null, - NOTE_LEFT: controlsData?.pad?.NOTE_LEFT ?? null, - NOTE_RIGHT: controlsData?.pad?.NOTE_RIGHT ?? null, - NOTE_UP: controlsData?.pad?.NOTE_UP ?? null, - PAUSE: controlsData?.pad?.PAUSE ?? null, - RESET: controlsData?.pad?.RESET ?? null, - UI_DOWN: controlsData?.pad?.UI_DOWN ?? null, - UI_LEFT: controlsData?.pad?.UI_LEFT ?? null, - UI_RIGHT: controlsData?.pad?.UI_RIGHT ?? null, - UI_UP: controlsData?.pad?.UI_UP ?? null, - VOLUME_DOWN: controlsData?.pad?.VOLUME_DOWN ?? null, - VOLUME_MUTE: controlsData?.pad?.VOLUME_MUTE ?? null, - VOLUME_UP: controlsData?.pad?.VOLUME_UP ?? null, - }; + var outputPadControls:SaveControlsData = { + ACCEPT: controlsData?.pad?.ACCEPT ?? null, + BACK: controlsData?.pad?.BACK ?? null, + CUTSCENE_ADVANCE: controlsData?.pad?.CUTSCENE_ADVANCE ?? null, + NOTE_DOWN: controlsData?.pad?.NOTE_DOWN ?? null, + NOTE_LEFT: controlsData?.pad?.NOTE_LEFT ?? null, + NOTE_RIGHT: controlsData?.pad?.NOTE_RIGHT ?? null, + NOTE_UP: controlsData?.pad?.NOTE_UP ?? null, + PAUSE: controlsData?.pad?.PAUSE ?? null, + RESET: controlsData?.pad?.RESET ?? null, + UI_DOWN: controlsData?.pad?.UI_DOWN ?? null, + UI_LEFT: controlsData?.pad?.UI_LEFT ?? null, + UI_RIGHT: controlsData?.pad?.UI_RIGHT ?? null, + UI_UP: controlsData?.pad?.UI_UP ?? null, + VOLUME_DOWN: controlsData?.pad?.VOLUME_DOWN ?? null, + VOLUME_MUTE: controlsData?.pad?.VOLUME_MUTE ?? null, + VOLUME_UP: controlsData?.pad?.VOLUME_UP ?? null, + }; result.setControls(playerId, Keys, outputKeyControls); result.setControls(playerId, Gamepad(0), outputPadControls); diff --git a/source/funkin/ui/AtlasText.hx b/source/funkin/ui/AtlasText.hx index 20192cfd0..f6cc326af 100644 --- a/source/funkin/ui/AtlasText.hx +++ b/source/funkin/ui/AtlasText.hx @@ -21,18 +21,15 @@ class AtlasText extends FlxTypedSpriteGroup public var atlas(get, never):FlxAtlasFrames; - inline function get_atlas():FlxAtlasFrames - return font.atlas; + inline function get_atlas():FlxAtlasFrames return font.atlas; public var caseAllowed(get, never):Case; - inline function get_caseAllowed():Case - return font.caseAllowed; + inline function get_caseAllowed():Case return font.caseAllowed; public var maxHeight(get, never):Float; - inline function get_maxHeight():Float - return font.maxHeight; + inline function get_maxHeight():Float return font.maxHeight; public function new(x = 0.0, y = 0.0, text:String = "", fontName:AtlasFont = AtlasFont.DEFAULT) { @@ -169,11 +166,7 @@ class AtlasText extends FlxTypedSpriteGroup override function toString():String { - return "InputItem, " + FlxStringUtil.getDebugString([ - LabelValuePair.weak("x", x), - LabelValuePair.weak("y", y), - LabelValuePair.weak("text", text) - ]); + return "InputItem, " + FlxStringUtil.getDebugString([LabelValuePair.weak("x", x), LabelValuePair.weak("y", y), LabelValuePair.weak("text", text)]); } } diff --git a/source/funkin/ui/Codex.hx b/source/funkin/ui/Codex.hx index 77ac669a4..1dba0bf14 100644 --- a/source/funkin/ui/Codex.hx +++ b/source/funkin/ui/Codex.hx @@ -15,8 +15,7 @@ class Codex extends FlxGroup public var currentName:T; public var currentPage(get, never):Page; - inline function get_currentPage():Page - return pages[currentName]; + inline function get_currentPage():Page return pages[currentName]; public function new(initPage:T) { diff --git a/source/funkin/ui/MenuList.hx b/source/funkin/ui/MenuList.hx index 5aaa8bfe0..28c7e9e2c 100644 --- a/source/funkin/ui/MenuList.hx +++ b/source/funkin/ui/MenuList.hx @@ -287,7 +287,8 @@ class MenuTypedList extends FlxTypedGroup { busy = true; FunkinSound.playOnce(Paths.sound('confirmMenu')); - FlxFlicker.flicker(menuItem, 1, 0.06, true, false, function(_) { + FlxFlicker.flicker(menuItem, 1, 0.06, true, false, function(_) + { busy = false; menuItem.callback(); }); @@ -369,8 +370,7 @@ class MenuListItem extends FlxSprite public var selected(get, never):Bool; - function get_selected() - return alpha == 1.0; + function get_selected() return alpha == 1.0; public function new(x = 0.0, y = 0.0, name:String, callback, available:Bool = true) { diff --git a/source/funkin/ui/MusicBeatState.hx b/source/funkin/ui/MusicBeatState.hx index fe8fefb55..cd92be652 100644 --- a/source/funkin/ui/MusicBeatState.hx +++ b/source/funkin/ui/MusicBeatState.hx @@ -33,8 +33,7 @@ class MusicBeatState extends FlxTransitionableState implements IEventHandler { var controls(get, never):Controls; - inline function get_controls():Controls - return PlayerSettings.player1.controls; + inline function get_controls():Controls return PlayerSettings.player1.controls; public var leftWatermarkText:Null = null; public var rightWatermarkText:Null = null; diff --git a/source/funkin/ui/MusicBeatSubState.hx b/source/funkin/ui/MusicBeatSubState.hx index 0298c1097..5956e49c3 100644 --- a/source/funkin/ui/MusicBeatSubState.hx +++ b/source/funkin/ui/MusicBeatSubState.hx @@ -47,8 +47,7 @@ class MusicBeatSubState extends FlxSubState implements IEventHandler var controls(get, never):Controls; - inline function get_controls():Controls - return PlayerSettings.player1.controls; + inline function get_controls():Controls return PlayerSettings.player1.controls; #if mobile public var hitbox:Null; @@ -168,7 +167,9 @@ class MusicBeatSubState extends FlxSubState implements IEventHandler dispatchEvent(new FocusScriptEvent(FOCUS_LOST)); } - public function initConsoleHelpers():Void {} + public function initConsoleHelpers():Void + { + } function reloadAssets() { diff --git a/source/funkin/ui/Page.hx b/source/funkin/ui/Page.hx index e8dee37f2..9e20b60d0 100644 --- a/source/funkin/ui/Page.hx +++ b/source/funkin/ui/Page.hx @@ -24,8 +24,7 @@ class Page extends FlxGroup var controls(get, never):Controls; - inline function get_controls() - return PlayerSettings.player1.controls; + inline function get_controls() return PlayerSettings.player1.controls; var subState:FlxSubState; @@ -63,7 +62,8 @@ class Page extends FlxGroup function openPrompt(prompt:Prompt, onClose:Void->Void) { enabled = false; - prompt.closeCallback = function() { + prompt.closeCallback = function() + { enabled = true; if (onClose != null) onClose(); } @@ -81,4 +81,6 @@ class Page extends FlxGroup /** * For you to fill in your own page name stuff, see OptionsState.hx and it's OptionsMenuPageName */ -enum abstract PageName(String) from String to String {} +enum abstract PageName(String) from String to String +{ +} diff --git a/source/funkin/ui/PixelatedIcon.hx b/source/funkin/ui/PixelatedIcon.hx index fa05b6042..13642c173 100644 --- a/source/funkin/ui/PixelatedIcon.hx +++ b/source/funkin/ui/PixelatedIcon.hx @@ -88,7 +88,8 @@ class PixelatedIcon extends FlxFilteredSprite this.animation.addByPrefix('confirm', 'confirm0', 10, false); this.animation.addByPrefix('confirm-hold', 'confirm-hold0', 10, true); - this.animation.onFinish.add(function(name:String):Void { + this.animation.onFinish.add(function(name:String):Void + { if (name == 'confirm') this.animation.play('confirm-hold'); }); diff --git a/source/funkin/ui/Prompt.hx b/source/funkin/ui/Prompt.hx index b1983308c..6acca19a4 100644 --- a/source/funkin/ui/Prompt.hx +++ b/source/funkin/ui/Prompt.hx @@ -92,7 +92,8 @@ class Prompt extends flixel.FlxSubState { buttons.exists = true; // pass anonymous functions rather than the current callbacks, in case they change later - var yesButton = buttons.createItem(yes, function() { + var yesButton = buttons.createItem(yes, function() + { if (onYes != null) onYes(); else FlxG.log.warn("onYes function was called without being set"); diff --git a/source/funkin/ui/ScriptedMusicBeatState.hx b/source/funkin/ui/ScriptedMusicBeatState.hx index aa9165cee..f000d4dc5 100644 --- a/source/funkin/ui/ScriptedMusicBeatState.hx +++ b/source/funkin/ui/ScriptedMusicBeatState.hx @@ -5,4 +5,6 @@ package funkin.ui; * Create a scripted class that extends MusicBeatState to use this. */ @:hscriptClass -class ScriptedMusicBeatState extends funkin.ui.MusicBeatState implements polymod.hscript.HScriptedClass {} +class ScriptedMusicBeatState extends funkin.ui.MusicBeatState implements polymod.hscript.HScriptedClass +{ +} diff --git a/source/funkin/ui/ScriptedMusicBeatSubState.hx b/source/funkin/ui/ScriptedMusicBeatSubState.hx index c28373779..18d6d7705 100644 --- a/source/funkin/ui/ScriptedMusicBeatSubState.hx +++ b/source/funkin/ui/ScriptedMusicBeatSubState.hx @@ -5,4 +5,6 @@ package funkin.ui; * Create a scripted class that extends MusicBeatSubState to use this. */ @:hscriptClass -class ScriptedMusicBeatSubState extends funkin.ui.MusicBeatSubState implements polymod.hscript.HScriptedClass {} +class ScriptedMusicBeatSubState extends funkin.ui.MusicBeatSubState implements polymod.hscript.HScriptedClass +{ +} diff --git a/source/funkin/ui/TextMenuList.hx b/source/funkin/ui/TextMenuList.hx index eb7711815..0ef5127e4 100644 --- a/source/funkin/ui/TextMenuList.hx +++ b/source/funkin/ui/TextMenuList.hx @@ -25,6 +25,7 @@ class TextMenuList extends MenuTypedList class TextMenuItem extends TextTypedMenuItem { public var atlasText:AtlasText; + public function new(x = 0.0, y = 0.0, name:String, font:AtlasFont = BOLD, ?callback:Void->Void, available:Bool = true) { atlasText = new AtlasText(0, 0, name, font); diff --git a/source/funkin/ui/UIStateMachine.hx b/source/funkin/ui/UIStateMachine.hx index a21ede398..48d59cf35 100644 --- a/source/funkin/ui/UIStateMachine.hx +++ b/source/funkin/ui/UIStateMachine.hx @@ -33,14 +33,7 @@ class UIStateMachine public function new(?transitions:Map>) { // Default valid transitions if none provided - validTransitions = transitions != null ? transitions : [ - Idle => [Interacting, EnteringMainMenu, EnteringFreeplay, Exiting, Disabled], - EnteringMainMenu => [Idle, Exiting, Disabled, Interacting], - Interacting => [Idle, EnteringMainMenu, EnteringFreeplay, Exiting, Disabled], - Exiting => [Idle], - Disabled => [Idle], - EnteringFreeplay => [Idle] - ]; + validTransitions = transitions != null ? transitions : [Idle => [Interacting, EnteringMainMenu, EnteringFreeplay, Exiting, Disabled], EnteringMainMenu => [Idle, Exiting, Disabled, Interacting], Interacting => [Idle, EnteringMainMenu, EnteringFreeplay, Exiting, Disabled], Exiting => [Idle], Disabled => [Idle], EnteringFreeplay => [Idle]]; } public function canTransition(from:UIState, to:UIState):Bool diff --git a/source/funkin/ui/charSelect/CharSelectAtlasHandler.hx b/source/funkin/ui/charSelect/CharSelectAtlasHandler.hx index ebf0258d6..ce0ecc3cb 100644 --- a/source/funkin/ui/charSelect/CharSelectAtlasHandler.hx +++ b/source/funkin/ui/charSelect/CharSelectAtlasHandler.hx @@ -15,12 +15,11 @@ class CharSelectAtlasHandler { if (framesCache.exists(path)) return framesCache.get(path); - var result:FlxAnimateFrames = FlxAnimateFrames.fromAnimate(Paths.animateAtlas(path), - { - swfMode: settings?.swfMode ?? true, - filterQuality: settings?.filterQuality ?? MEDIUM, - cacheOnLoad: settings?.cacheOnLoad ?? false - }); + var result:FlxAnimateFrames = FlxAnimateFrames.fromAnimate(Paths.animateAtlas(path), { + swfMode: settings?.swfMode ?? true, + filterQuality: settings?.filterQuality ?? MEDIUM, + cacheOnLoad: settings?.cacheOnLoad ?? false + }); if (result == null) { diff --git a/source/funkin/ui/charSelect/CharSelectCursors.hx b/source/funkin/ui/charSelect/CharSelectCursors.hx index 4dd9b31d6..8ac51107f 100644 --- a/source/funkin/ui/charSelect/CharSelectCursors.hx +++ b/source/funkin/ui/charSelect/CharSelectCursors.hx @@ -79,7 +79,8 @@ class CharSelectCursors extends FlxTypedSpriteContainer { cursorDenied.visible = true; cursorDenied.animation.play('idle', true); - cursorDenied.animation.onFinish.add((_) -> { + cursorDenied.animation.onFinish.add((_) -> + { cursorDenied.visible = false; }); } diff --git a/source/funkin/ui/charSelect/CharSelectGF.hx b/source/funkin/ui/charSelect/CharSelectGF.hx index 3ddf2cb4e..13eb95d84 100644 --- a/source/funkin/ui/charSelect/CharSelectGF.hx +++ b/source/funkin/ui/charSelect/CharSelectGF.hx @@ -27,7 +27,9 @@ class CharSelectGF extends FunkinSprite implements IBPMSyncedScriptedClass switchGF(Constants.DEFAULT_CHARACTER); } - public function onStepHit(event:SongTimeScriptEvent):Void {} + public function onStepHit(event:SongTimeScriptEvent):Void + { + } public function onBeatHit(event:SongTimeScriptEvent):Void { @@ -127,11 +129,19 @@ class CharSelectGF extends FunkinSprite implements IBPMSyncedScriptedClass updateHitbox(); } - public function onScriptEvent(event:ScriptEvent):Void {}; + public function onScriptEvent(event:ScriptEvent):Void + { + }; - public function onCreate(event:ScriptEvent):Void {}; + public function onCreate(event:ScriptEvent):Void + { + }; - public function onDestroy(event:ScriptEvent):Void {}; + public function onDestroy(event:ScriptEvent):Void + { + }; - public function onUpdate(event:UpdateScriptEvent):Void {}; + public function onUpdate(event:UpdateScriptEvent):Void + { + }; } diff --git a/source/funkin/ui/charSelect/CharSelectPlayer.hx b/source/funkin/ui/charSelect/CharSelectPlayer.hx index 2164a2c44..638381388 100644 --- a/source/funkin/ui/charSelect/CharSelectPlayer.hx +++ b/source/funkin/ui/charSelect/CharSelectPlayer.hx @@ -21,13 +21,13 @@ class CharSelectPlayer extends FunkinSprite implements IBPMSyncedScriptedClass super(x, y); - loadTextureAtlas(DEFAULT_PATH, - { - applyStageMatrix: true, - swfMode: true - }); + loadTextureAtlas(DEFAULT_PATH, { + applyStageMatrix: true, + swfMode: true + }); - anim.onFinish.add(function(animLabel:String) { + anim.onFinish.add(function(animLabel:String) + { switch (animLabel) { case "slidein": @@ -59,7 +59,9 @@ class CharSelectPlayer extends FunkinSprite implements IBPMSyncedScriptedClass }); } - public function onStepHit(event:SongTimeScriptEvent):Void {} + public function onStepHit(event:SongTimeScriptEvent):Void + { + } public function onBeatHit(event:SongTimeScriptEvent):Void { @@ -95,11 +97,19 @@ class CharSelectPlayer extends FunkinSprite implements IBPMSyncedScriptedClass updateHitbox(); } - public function onScriptEvent(event:ScriptEvent):Void {}; + public function onScriptEvent(event:ScriptEvent):Void + { + }; - public function onCreate(event:ScriptEvent):Void {}; + public function onCreate(event:ScriptEvent):Void + { + }; - public function onDestroy(event:ScriptEvent):Void {}; + public function onDestroy(event:ScriptEvent):Void + { + }; - public function onUpdate(event:UpdateScriptEvent):Void {}; + public function onUpdate(event:UpdateScriptEvent):Void + { + }; } diff --git a/source/funkin/ui/charSelect/CharSelectSubState.hx b/source/funkin/ui/charSelect/CharSelectSubState.hx index 679f2ab08..bb0ff7ea8 100644 --- a/source/funkin/ui/charSelect/CharSelectSubState.hx +++ b/source/funkin/ui/charSelect/CharSelectSubState.hx @@ -81,10 +81,8 @@ class CharSelectSubState extends MusicBeatSubState var introSound:FunkinSound = new FunkinSound(); var staticSound:FunkinSound = new FunkinSound(); - var selectedBizz:Array = [ - new DropShadowFilter(0, 0, 0xFFFFFF, 1, 2, 2, 19, 1, false, false, false), - new DropShadowFilter(5, 45, 0x000000, 1, 2, 2, 1, 1, false, false, false) - ]; + var selectedBizz:Array = [new DropShadowFilter(0, 0, 0xFFFFFF, 1, 2, 2, 19, 1, false, false, + false), new DropShadowFilter(5, 45, 0x000000, 1, 2, 2, 1, 1, false, false, false)]; var bopInfo:Null>; @@ -174,19 +172,17 @@ class CharSelectSubState extends MusicBeatSubState bg.scrollFactor.set(0.1, 0.1); add(bg); - var crowd:FunkinSprite = FunkinSprite.createTextureAtlas(cutoutSize, 0, "charSelect/crowd", - { - applyStageMatrix: true - }); + var crowd:FunkinSprite = FunkinSprite.createTextureAtlas(cutoutSize, 0, "charSelect/crowd", { + applyStageMatrix: true + }); crowd.anim.play(''); crowd.anim.curAnim.looped = true; crowd.scrollFactor.set(0.3, 0.3); add(crowd); - var stageSpr:FunkinSprite = FunkinSprite.createTextureAtlas(cutoutSize - 2, 1, "charSelect/charSelectStage", - { - applyStageMatrix: true - }); + var stageSpr:FunkinSprite = FunkinSprite.createTextureAtlas(cutoutSize - 2, 1, "charSelect/charSelectStage", { + applyStageMatrix: true + }); stageSpr.anim.play(''); stageSpr.anim.curAnim.looped = true; add(stageSpr); @@ -196,10 +192,9 @@ class CharSelectSubState extends MusicBeatSubState curtains.scrollFactor.set(1.4, 1.4); add(curtains); - barthing.loadTextureAtlas("charSelect/barThing", - { - applyStageMatrix: true - }); + barthing.loadTextureAtlas("charSelect/barThing", { + applyStageMatrix: true + }); barthing.anim.play(''); barthing.anim.curAnim.looped = true; barthing.blend = BlendMode.MULTIPLY; @@ -252,10 +247,9 @@ class CharSelectSubState extends MusicBeatSubState setCursorPosition(DEFAULT_CURSOR_INDEX, true); } - var speakers:FunkinSprite = FunkinSprite.createTextureAtlas(cutoutSize - 10, 0, "charSelect/charSelectSpeakers", - { - applyStageMatrix: true - }); + var speakers:FunkinSprite = FunkinSprite.createTextureAtlas(cutoutSize - 10, 0, "charSelect/charSelectSpeakers", { + applyStageMatrix: true + }); speakers.anim.play(''); speakers.anim.curAnim.looped = true; speakers.scrollFactor.set(1.8, 1.8); @@ -342,12 +336,11 @@ class CharSelectSubState extends MusicBeatSubState // playing it here to preload it. not doing this makes a super awkward pause at the end of the intro // TODO: probably make an intro thing for funkinSound itself that preloads the next audio? - FunkinSound.playMusic('stayFunky', - { - startingVolume: 0, - overrideExisting: true, - restartTrack: true, - }); + FunkinSound.playMusic('stayFunky', { + startingVolume: 0, + overrideExisting: true, + restartTrack: true, + }); initLocks(); @@ -380,13 +373,13 @@ class CharSelectSubState extends MusicBeatSubState backButton.cameras = [FlxG.camera]; } - FlxTween.tween(backButton, {x: FlxG.width - 230}, 0.5, + FlxTween.tween(backButton, {x: FlxG.width - 230}, 0.5, { + ease: FlxEase.expoOut, + onComplete: (_) -> { - ease: FlxEase.expoOut, - onComplete: (_) -> { - if (backButton != null) backButton.enabled = true; - } - }); + if (backButton != null) backButton.enabled = true; + } + }); #end transitionGradient.loadGraphic(Paths.image('freeplay/transitionGradient')); @@ -399,21 +392,21 @@ class CharSelectSubState extends MusicBeatSubState camFollow.screenCenter(); camFollow.y -= 150; FlxG.camera.filtersEnabled = true; - fadeShader.fade(0.0, 1.0, 0.8, + fadeShader.fade(0.0, 1.0, 0.8, { + ease: FlxEase.quadOut, + onComplete: (twn) -> { - ease: FlxEase.quadOut, - onComplete: (twn) -> { - FlxG.camera.filtersEnabled = false; - } - }); - FlxTween.tween(camFollow, {y: camFollow.y + 150}, 1.5, + FlxG.camera.filtersEnabled = false; + } + }); + FlxTween.tween(camFollow, {y: camFollow.y + 150}, 1.5, { + ease: FlxEase.expoOut, + onComplete: function(_) { - ease: FlxEase.expoOut, - onComplete: function(_) { - autoFollow = true; - FlxG.camera.follow(camFollow, LOCKON, 0.01); - } - }); + autoFollow = true; + FlxG.camera.follow(camFollow, LOCKON, 0.01); + } + }); var blackScreen = new FunkinSprite().makeSolidColor(FlxG.width * 2, FlxG.height * 2, 0xFF000000); blackScreen.x = -(FlxG.width * 0.5); @@ -429,7 +422,8 @@ class CharSelectSubState extends MusicBeatSubState openSubState(new IntroSubState()); - subStateClosed.addOnce((_) -> { + subStateClosed.addOnce((_) -> + { remove(blackScreen); if (!Save.instance.oldChar.value) { @@ -452,7 +446,8 @@ class CharSelectSubState extends MusicBeatSubState function checkNewChar():Void { - if (nonLocks.length > 0) selectTimer.start(2, (_) -> { + if (nonLocks.length > 0) selectTimer.start(2, (_) -> + { unLock(); }); else @@ -462,24 +457,24 @@ class CharSelectSubState extends MusicBeatSubState if (availableChars.size() > 1) Medals.award(CharSelect); #end - FunkinSound.playMusic('stayFunky', + FunkinSound.playMusic('stayFunky', { + startingVolume: 1, + overrideExisting: true, + restartTrack: true, + onLoad: function() { - startingVolume: 1, - overrideExisting: true, - restartTrack: true, - onLoad: function() { - allowInput = true; + allowInput = true; - @:privateAccess - gfChill.analyzer = new SpectralAnalyzer(FlxG.sound.music._channel.__audioSource, 7, 0.1); - #if sys - // On native it uses FFT stuff that isn't as optimized as the direct browser stuff we use on HTML5 - // So we want to manually change it! - @:privateAccess - gfChill.analyzer.fftN = 512; - #end - } - }); + @:privateAccess + gfChill.analyzer = new SpectralAnalyzer(FlxG.sound.music._channel.__audioSource, 7, 0.1); + #if sys + // On native it uses FFT stuff that isn't as optimized as the direct browser stuff we use on HTML5 + // So we want to manually change it! + @:privateAccess + gfChill.analyzer.fftN = 512; + #end + } + }); } } @@ -514,11 +509,10 @@ class CharSelectSubState extends MusicBeatSubState var isPlayerUnlocked:Bool = player?.isUnlocked() ?? false; if (availableChars.exists(i) && isPlayerUnlocked) nonLocks.push(i); - var temp:Lock = new Lock(0, 0, i, - { - swfMode: true, - uniqueInCache: true - }); + var temp:Lock = new Lock(0, 0, i, { + swfMode: true, + uniqueInCache: true + }); temp.ID = 1; @@ -560,11 +554,13 @@ class CharSelectSubState extends MusicBeatSubState nonLocks.shift(); - selectTimer.start(0.5, function(_) { + selectTimer.start(0.5, function(_) + { var lock:Lock = cast grpIcons.group.members[index]; lock.anim.play("unlock"); - lock.anim.onFrameChange.add(function(animName:String, frame:Int, index:Int) { + lock.anim.onFrameChange.add(function(animName:String, frame:Int, index:Int) + { if (frame == 40) { playerChillOut.anim.play("death"); @@ -574,7 +570,8 @@ class CharSelectSubState extends MusicBeatSubState unlockSound.volume = 0.7; unlockSound.play(true); - lock.anim.onFinish.addOnce(function(_) { + lock.anim.onFinish.addOnce(function(_) + { var char:String = availableChars.get(index) ?? Constants.DEFAULT_CHARACTER; camera.flash(0xFFFFFFFF, 0.1); playerChill.anim.play("unlock"); @@ -617,24 +614,24 @@ class CharSelectSubState extends MusicBeatSubState staticSound.stop(); - FunkinSound.playMusic('stayFunky', + FunkinSound.playMusic('stayFunky', { + startingVolume: 1, + overrideExisting: true, + restartTrack: true, + onLoad: function() { - startingVolume: 1, - overrideExisting: true, - restartTrack: true, - onLoad: function() { - allowInput = true; + allowInput = true; - @:privateAccess - gfChill.analyzer = new SpectralAnalyzer(FlxG.sound.music._channel.__audioSource, 7, 0.1); - #if sys - // On native it uses FFT stuff that isn't as optimized as the direct browser stuff we use on HTML5 - // So we want to manually change it! - @:privateAccess - gfChill.analyzer.fftN = 512; - #end - } - }); + @:privateAccess + gfChill.analyzer = new SpectralAnalyzer(FlxG.sound.music._channel.__audioSource, 7, 0.1); + #if sys + // On native it uses FFT stuff that isn't as optimized as the direct browser stuff we use on HTML5 + // So we want to manually change it! + @:privateAccess + gfChill.analyzer.fftN = 512; + #end + } + }); } else playerChill.anim.onFinish.addOnce((_) -> unLock()); @@ -709,19 +706,18 @@ class CharSelectSubState extends MusicBeatSubState FlxTween.tween(transitionGradient, {y: -150}, 0.8, {ease: FlxEase.backIn}); FlxG.camera.filtersEnabled = true; fadeShader.fade(1.0, 0, 0.8, {ease: FlxEase.quadIn}); - FlxTween.tween(camFollow, {y: camFollow.y - 150}, 0.8, + FlxTween.tween(camFollow, {y: camFollow.y - 150}, 0.8, { + ease: FlxEase.backIn, + onComplete: function(_) { - ease: FlxEase.backIn, - onComplete: function(_) { - FlxG.switchState(() -> FreeplayState.build( - { - { - character: wentBackToFreeplay ? rememberedChar : curChar, - fromCharSelect: true - } - })); - } - }); + FlxG.switchState(() -> FreeplayState.build({ + { + character: wentBackToFreeplay ? rememberedChar : curChar, + fromCharSelect: true + } + })); + } + }); } var holdTmrUp:Float = 0; @@ -875,19 +871,19 @@ class CharSelectSubState extends MusicBeatSubState playerChill.anim.play("deselect"); gfChill.anim.play("deselect"); pressedSelect = false; - FlxTween.tween(FlxG.sound.music, {pitch: 1.0}, 1, + FlxTween.tween(FlxG.sound.music, {pitch: 1.0}, 1, { + ease: FlxEase.quartInOut, + onComplete: (_) -> { - ease: FlxEase.quartInOut, - onComplete: (_) -> { - if (playerChill.getCurrentAnimation() == "deselect loop start" || playerChill.getCurrentAnimation() == "deselect") - { - playerChill.anim.play("idle", true); - playerChill.anim.curAnim.looped = true; - gfChill.anim.play("idle", true); - gfChill.anim.curAnim.looped = true; - } + if (playerChill.getCurrentAnimation() == "deselect loop start" || playerChill.getCurrentAnimation() == "deselect") + { + playerChill.anim.play("idle", true); + playerChill.anim.curAnim.looped = true; + gfChill.anim.play("idle", true); + gfChill.anim.curAnim.looped = true; } - }); + } + }); selectTimer.cancel(); } @@ -917,7 +913,8 @@ class CharSelectSubState extends MusicBeatSubState gfChill.anim.curAnim.looped = true; pressedSelect = true; - selectTimer.start(1.5, (_) -> { + selectTimer.start(1.5, (_) -> + { goToFreeplay(); }); } @@ -1103,7 +1100,8 @@ class CharSelectSubState extends MusicBeatSubState if (autoFollow && !pressedSelect && memb.animation.curAnim?.name != 'idle') { memb.animation.play("confirm", false, true); - var onFinish:String->Void = (_) -> { + var onFinish:String->Void = (_) -> + { member.animation.play('idle'); member.animation.onFinish.removeAll(); }; @@ -1175,7 +1173,8 @@ class CharSelectSubState extends MusicBeatSubState playerChillOut.anim.play("slideout"); playerChillOut.anim.onFrameChange.removeAll(); - playerChillOut.anim.onFrameChange.add(function(animName:String, frameNumber:Int, index:Int) { + playerChillOut.anim.onFrameChange.add(function(animName:String, frameNumber:Int, index:Int) + { if (!playerChill.visible) { playerChill.visible = true; @@ -1185,7 +1184,8 @@ class CharSelectSubState extends MusicBeatSubState } }); - playerChillOut.anim.onFinish.addOnce(function(animName:String) { + playerChillOut.anim.onFinish.addOnce(function(animName:String) + { playerChillOut.switchChar(value); playerChillOut.visible = false; playerChillOut.anim.onFrameChange.removeAll(); diff --git a/source/funkin/ui/charSelect/CharacterUnlockState.hx b/source/funkin/ui/charSelect/CharacterUnlockState.hx index 81ce0fb05..456a92578 100644 --- a/source/funkin/ui/charSelect/CharacterUnlockState.hx +++ b/source/funkin/ui/charSelect/CharacterUnlockState.hx @@ -94,13 +94,13 @@ class CharacterUnlockState extends MusicBeatState dialogContainer.add(healthIcon); dialogContainer.scale.set(0, 0); - FlxTween.num(0.0, 1.0, 0.75, - { - ease: FlxEase.elasticOut, - }, function(curScale) { - dialogContainer.scale.set(curScale, curScale); - healthIcon.size.set(0.5 * curScale, 0.5 * curScale); - }); + FlxTween.num(0.0, 1.0, 0.75, { + ease: FlxEase.elasticOut, + }, function(curScale) + { + dialogContainer.scale.set(curScale, curScale); + healthIcon.size.set(0.5 * curScale, 0.5 * curScale); + }); // performUnlock(); } @@ -125,7 +125,8 @@ class CharacterUnlockState extends MusicBeatState function startClose():Void { // Fade to black, then switch state. - FlxG.camera.fade(FlxColor.BLACK, 0.75, false, () -> { + FlxG.camera.fade(FlxColor.BLACK, 0.75, false, () -> + { funkin.FunkinMemory.clearFreeplay(); #if ios trace(DeviceUtil.iPhoneNumber); diff --git a/source/funkin/ui/charSelect/IntroSubState.hx b/source/funkin/ui/charSelect/IntroSubState.hx index f4afba7b8..17f10b98f 100644 --- a/source/funkin/ui/charSelect/IntroSubState.hx +++ b/source/funkin/ui/charSelect/IntroSubState.hx @@ -92,13 +92,15 @@ class IntroSubState extends MusicBeatSubState { vid.zIndex = 0; vid.active = false; - vid.bitmap?.onEncounteredError.add(function(msg:String):Void { + vid.bitmap?.onEncounteredError.add(function(msg:String):Void + { trace('[VLC] Encountered an error: $msg'); onLightsEnd(); }); vid.bitmap?.onEndReached.add(onLightsEnd); - vid.bitmap?.onFormatSetup.add(() -> { + vid.bitmap?.onFormatSetup.add(() -> + { vid?.setGraphicSize(FlxG.initialWidth, FlxG.initialHeight); vid?.updateHitbox(); vid.screenCenter(); diff --git a/source/funkin/ui/charSelect/Lock.hx b/source/funkin/ui/charSelect/Lock.hx index 599998280..86e6bd951 100644 --- a/source/funkin/ui/charSelect/Lock.hx +++ b/source/funkin/ui/charSelect/Lock.hx @@ -20,23 +20,22 @@ class Lock extends FunkinSprite super(x, y); - loadTextureAtlas("charSelect/lock", + loadTextureAtlas("charSelect/lock", { + swfMode: settings.swfMode, + uniqueInCache: settings.uniqueInCache, + onSymbolCreate: (symbol) -> { - swfMode: settings.swfMode, - uniqueInCache: settings.uniqueInCache, - onSymbolCreate: (symbol) -> { - if (symbol.timeline.getLayer("color") != null) - { - var colorSymbol:Null = symbol.timeline.getLayer("color")?.getFrameAtIndex(0)?.convertToSymbol(0, - 1) ?? null; + if (symbol.timeline.getLayer("color") != null) + { + var colorSymbol:Null = symbol.timeline.getLayer("color")?.getFrameAtIndex(0)?.convertToSymbol(0, 1) ?? null; - if (colorSymbol != null) - { - colorSymbol.setColorTransform(0, 0, 0, 1, tint.red, tint.green, tint.blue, 0); - } + if (colorSymbol != null) + { + colorSymbol.setColorTransform(0, 0, 0, 1, tint.red, tint.green, tint.blue, 0); } } - }); + } + }); anim.play("idle"); offset.set(230, 110); diff --git a/source/funkin/ui/charSelect/Nametag.hx b/source/funkin/ui/charSelect/Nametag.hx index efe0a2e26..8a0db731b 100644 --- a/source/funkin/ui/charSelect/Nametag.hx +++ b/source/funkin/ui/charSelect/Nametag.hx @@ -43,7 +43,8 @@ class Nametag extends FlxSprite { if (playMosaicSequence) shaderEffect(); - new FlxTimer().start(4 / 30, _ -> { + new FlxTimer().start(4 / 30, _ -> + { var path:String = str; switch str { @@ -74,20 +75,16 @@ class Nametag extends FlxSprite if (fadeOut) { - currentMosaicSequence = new Sequence([ - {time: 0 / 30, callback: () -> mosaicShader.setBlockSize(1, 1)}, - {time: 1 / 30, callback: () -> mosaicShader.setBlockSize(width / 27, height / 26)}, - {time: 2 / 30, callback: () -> mosaicShader.setBlockSize(width / 10, height / 10)}, - {time: 3 / 30, callback: () -> mosaicShader.setBlockSize(1, 1)}, - ]); + currentMosaicSequence = new Sequence([{time: 0 / 30, callback: () -> mosaicShader.setBlockSize(1, + 1)}, {time: 1 / 30, callback: () -> mosaicShader.setBlockSize(width / 27, + height / 26)}, {time: 2 / 30, callback: () -> mosaicShader.setBlockSize(width / 10, + height / 10)}, {time: 3 / 30, callback: () -> mosaicShader.setBlockSize(1, 1)},]); } else { - currentMosaicSequence = new Sequence([ - {time: 0 / 30, callback: () -> mosaicShader.setBlockSize(width / 10, height / 10)}, - {time: 1 / 30, callback: () -> mosaicShader.setBlockSize(width / 73, height / 6)}, - {time: 2 / 30, callback: () -> mosaicShader.setBlockSize(width / 10, height / 10)}, - ]); + currentMosaicSequence = new Sequence([{time: 0 / 30, callback: () -> mosaicShader.setBlockSize(width / 10, + height / 10)}, {time: 1 / 30, callback: () -> mosaicShader.setBlockSize(width / 73, + height / 6)}, {time: 2 / 30, callback: () -> mosaicShader.setBlockSize(width / 10, height / 10)},]); } } @@ -96,7 +93,8 @@ class Nametag extends FlxSprite var daX:Float = forceX ?? 10 * FlxG.random.int(1, 4); var daY:Float = forceY ?? 10 * FlxG.random.int(1, 4); - FlxTimer.wait(frame / 30, () -> { + FlxTimer.wait(frame / 30, () -> + { mosaicShader.setBlockSize(daX, daY); }); } diff --git a/source/funkin/ui/credits/CreditsDataHandler.hx b/source/funkin/ui/credits/CreditsDataHandler.hx index 299b1f4d6..39f2c3cd2 100644 --- a/source/funkin/ui/credits/CreditsDataHandler.hx +++ b/source/funkin/ui/credits/CreditsDataHandler.hx @@ -51,17 +51,10 @@ class CreditsDataHandler public static inline function getFallback():CreditsData { return { - entries: [ - { - header: 'Founders', - body: [ - {line: 'ninjamuffin99'}, - {line: 'PhantomArcade'}, - {line: 'Kawai Sprite'}, - {line: 'evilsk8r'}, - ] - } - ] + entries: [{ + header: 'Founders', + body: [{line: 'ninjamuffin99'}, {line: 'PhantomArcade'}, {line: 'Kawai Sprite'}, {line: 'evilsk8r'},] + }] }; } diff --git a/source/funkin/ui/credits/CreditsState.hx b/source/funkin/ui/credits/CreditsState.hx index 377df8981..bbfb394f9 100644 --- a/source/funkin/ui/credits/CreditsState.hx +++ b/source/funkin/ui/credits/CreditsState.hx @@ -107,15 +107,14 @@ class CreditsState extends MusicBeatState entriesToBuild = []; for (entry in CreditsDataHandler.CREDITS_DATA.entries) { - entriesToBuild.push( - { - data: entry, - lineIndexToBuild: 0, - backerIndexToBuild: 0, - hasBuiltHeader: (entry.header == null), - hasBuiltBody: (entry.body.length == 0), - hasBuiltBackers: (!entry.appendBackers || backersToBuild.length == 0) - }); + entriesToBuild.push({ + data: entry, + lineIndexToBuild: 0, + backerIndexToBuild: 0, + hasBuiltHeader: (entry.header == null), + hasBuiltBody: (entry.body.length == 0), + hasBuiltBackers: (!entry.appendBackers || backersToBuild.length == 0) + }); } // Background @@ -142,13 +141,12 @@ class CreditsState extends MusicBeatState add(creditsGroup); // Music - FunkinSound.playMusic('freeplayRandom', - { - startingVolume: 0.0, - overrideExisting: true, - restartTrack: true, - loop: true - }); + FunkinSound.playMusic('freeplayRandom', { + startingVolume: 0.0, + overrideExisting: true, + restartTrack: true, + loop: true + }); FlxG.sound.music.fadeIn(6, 0, 0.8); #if mobile @@ -221,7 +219,8 @@ class CreditsState extends MusicBeatState function killOffScreenLines():Void { - creditsGroup.forEachExists(function(creditsLine:FlxSprite) { + creditsGroup.forEachExists(function(creditsLine:FlxSprite) + { if (creditsLine.y + creditsLine.height <= 0) { creditsLine.kill(); diff --git a/source/funkin/ui/debug/DebugMenuSubState.hx b/source/funkin/ui/debug/DebugMenuSubState.hx index 73c991484..1ddb11353 100644 --- a/source/funkin/ui/debug/DebugMenuSubState.hx +++ b/source/funkin/ui/debug/DebugMenuSubState.hx @@ -126,7 +126,8 @@ class DebugMenuSubState extends MusicBeatSubState function testStickers():Void { - openSubState(new funkin.ui.transition.stickers.StickerSubState({})); + openSubState(new funkin.ui.transition.stickers.StickerSubState({ + })); trace('opened stickers'); } diff --git a/source/funkin/ui/debug/GraphicCursorCross.hx b/source/funkin/ui/debug/GraphicCursorCross.hx index e22218931..a3632b6cd 100644 --- a/source/funkin/ui/debug/GraphicCursorCross.hx +++ b/source/funkin/ui/debug/GraphicCursorCross.hx @@ -1,4 +1,6 @@ package funkin.ui.debug; @:bitmap("assets/images/debugger/cursorCross.png") -class GraphicCursorCross extends openfl.display.BitmapData {} +class GraphicCursorCross extends openfl.display.BitmapData +{ +} diff --git a/source/funkin/ui/debug/anim/DebugBoundingState.hx b/source/funkin/ui/debug/anim/DebugBoundingState.hx index 65025397d..7170f12de 100644 --- a/source/funkin/ui/debug/anim/DebugBoundingState.hx +++ b/source/funkin/ui/debug/anim/DebugBoundingState.hx @@ -91,7 +91,8 @@ class DebugBoundingState extends FlxState // offsetEditorDialog.findComponent("btnViewSpriteSheet").onClick = _ -> curView = SPRITESHEET; var viewDropdown:DropDown = offsetEditorDialog.findComponent("swapper", DropDown); - viewDropdown.onChange = function(e:UIEvent) { + viewDropdown.onChange = function(e:UIEvent) + { trace(e.type); curView = cast e?.data?.curView; trace(e.data); @@ -217,7 +218,8 @@ class DebugBoundingState extends FlxState charDropdown.dataSource.add({text: char}); } - charDropdown.onChange = function(e:UIEvent) { + charDropdown.onChange = function(e:UIEvent) + { loadAnimShit(e.data.text); }; } @@ -289,7 +291,8 @@ class DebugBoundingState extends FlxState if (!LimeAssets.libraryPaths.exists(library)) throw "Missing library: " + library; // var callback = callbacks.add("library:" + library); - Assets.loadLibrary(library).onComplete(function(_) { + Assets.loadLibrary(library).onComplete(function(_) + { trace('LOADED... awesomeness...'); // callback(); }); @@ -581,7 +584,8 @@ class DebugBoundingState extends FlxState trace('Added ${offsetAnimationDropdown.dataSource.size} to HaxeUI dropdown'); - offsetAnimationDropdown.onChange = function(event:UIEvent) { + offsetAnimationDropdown.onChange = function(event:UIEvent) + { if (event.data != null) { trace('Selected animation ${event.data.id}'); diff --git a/source/funkin/ui/debug/anim/FlxAnimateTest.hx b/source/funkin/ui/debug/anim/FlxAnimateTest.hx index f713c8a6b..ad49f42f2 100644 --- a/source/funkin/ui/debug/anim/FlxAnimateTest.hx +++ b/source/funkin/ui/debug/anim/FlxAnimateTest.hx @@ -24,12 +24,11 @@ class FlxAnimateTest extends MusicBeatState implements ConsoleClass { super.create(); - sprite = FunkinSprite.createTextureAtlas(0, 0, "charSelect/bfChill", - { - swfMode: false, // If to render like in a SWF file, rather than the Animate editor. - cacheOnLoad: true, // If to precache all animation filters and masks at once, rather than at runtime. - filterQuality: MEDIUM // Level of quality used to render filters. (HIGH, MEDIUM, LOW, RUDY) - }); + sprite = FunkinSprite.createTextureAtlas(0, 0, "charSelect/bfChill", { + swfMode: false, // If to render like in a SWF file, rather than the Animate editor. + cacheOnLoad: true, // If to precache all animation filters and masks at once, rather than at runtime. + filterQuality: MEDIUM // Level of quality used to render filters. (HIGH, MEDIUM, LOW, RUDY) + }); add(sprite); } diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index b14232fec..9f391a3cc 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -263,17 +263,13 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState /** * A map of the keys for every live input style. */ - public static final LIVE_INPUT_KEYS:Map> = [ - NumberKeys => [ - FIVE, SIX, SEVEN, EIGHT, - ONE, TWO, THREE, FOUR - ], - WASDKeys => [ - LEFT, DOWN, UP, RIGHT, - A, S, W, D - ], - None => [] - ]; + public static final LIVE_INPUT_KEYS:Map> = [NumberKeys => [ + FIVE, SIX, SEVEN, EIGHT, + ONE, TWO, THREE, FOUR + ], WASDKeys => [ + LEFT, DOWN, UP, RIGHT, + A, S, W, D + ], None => []]; /** * INSTANCE DATA @@ -1089,7 +1085,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState if (previousWorkingFilePaths.contains(null)) { // Filter all instances of `null` from the array. - previousWorkingFilePaths = previousWorkingFilePaths.filter(function(x:Null):Bool { + previousWorkingFilePaths = previousWorkingFilePaths.filter(function(x:Null):Bool + { return x != null; }); } @@ -1382,13 +1379,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState function get_allDifficulties():Array { - var result:Array> = [ - for (x in availableVariations) - { - var m:Null = songMetadata.get(x); - [for (diff in (m?.playData?.difficulties ?? [])) '$diff-$x']; - } - ]; + var result:Array> = [for (x in availableVariations) + { + var m:Null = songMetadata.get(x); + [for (diff in (m?.playData?.difficulties ?? [])) '$diff-$x']; + }]; return result.flatten(); } @@ -2514,13 +2509,12 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState #if FEATURE_DISCORD_RPC function updateDiscordRPC():Void { - funkin.api.discord.DiscordClient.instance.setPresence( - { - // TODO: Make this display the song name and update when it changes. - // state: '${currentSongName} [${selectedDifficulty}]', - state: null, - details: 'Chart Editor [Charting]' - }); + funkin.api.discord.DiscordClient.instance.setPresence({ + // TODO: Make this display the song name and update when it changes. + // state: '${currentSongName} [${selectedDifficulty}]', + state: null, + details: 'Chart Editor [Charting]' + }); } #end @@ -2609,7 +2603,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState var menuItemRecentChart:MenuItem = new MenuItem(); menuItemRecentChart.text = chartPath; - menuItemRecentChart.onClick = function(_event) { + menuItemRecentChart.onClick = function(_event) + { // Load chart from file var result:Null> = this.loadFromFNFCPath(chartPath); if (result != null) @@ -2663,7 +2658,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState if (!welcomeMusic.exists) setupWelcomeMusic(); if (bgMusicTimer != null) bgMusicTimer.cancel(); - bgMusicTimer = new FlxTimer().start(extraWait, (_) -> { + bgMusicTimer = new FlxTimer().start(extraWait, (_) -> + { if (shouldPlayWelcomeMusic) { trace(' CHART EDITOR '.bold().bg_bright_yellow() + ' Starting welcome music!'); @@ -2748,7 +2744,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState gridGhostEvent = new ChartEditorEventSprite(this, true); gridGhostEvent.alpha = 0.6; - gridGhostEvent.eventData = new SongEventData(-1, '', {}); + gridGhostEvent.eventData = new SongEventData(-1, '', { + }); gridGhostEvent.visible = false; add(gridGhostEvent); gridGhostEvent.zIndex = 22; @@ -2975,7 +2972,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState playbarHeadLayout.playbarHead.styleString = 'padding-left: 0px; padding-right: 0px; border-left: 0px; border-right: 0px;'; playbarHeadLayout.playbarHead.min = 0; - playbarHeadLayout.playbarHead.onDragStart = function(_:DragEvent) { + playbarHeadLayout.playbarHead.onDragStart = function(_:DragEvent) + { playbarHeadDragging = true; if ((audioInstTrack != null && audioInstTrack.isPlaying) || audioVocalTrackGroup.playing) @@ -2989,7 +2987,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState } } - playbarHeadLayout.playbarHead.onDrag = function(d:DragEvent) { + playbarHeadLayout.playbarHead.onDrag = function(d:DragEvent) + { if (playbarHeadDragging) { // Update the conductor and audio tracks to match. @@ -2998,7 +2997,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState } } - playbarHeadLayout.playbarHead.onDragEnd = function(_:DragEvent) { + playbarHeadLayout.playbarHead.onDragEnd = function(_:DragEvent) + { playbarHeadDragging = false; // If we were dragging the playhead while the song was playing, resume playing. @@ -3025,14 +3025,16 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState this.setupNotifications(); // Setup character dropdowns. - FlxMouseEvent.add(healthIconDad, function(_) { + FlxMouseEvent.add(healthIconDad, function(_) + { if (!isCursorOverHaxeUI && !isPlaytesting) { this.openCharacterDropdown(CharacterType.DAD, true); } }); - FlxMouseEvent.add(healthIconBF, function(_) { + FlxMouseEvent.add(healthIconBF, function(_) + { if (!isCursorOverHaxeUI && !isPlaytesting) { this.openCharacterDropdown(CharacterType.BF, true); @@ -3050,7 +3052,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState buttonSelectOpponent.zIndex = 110; add(buttonSelectOpponent); - buttonSelectOpponent.onClick = (_) -> { + buttonSelectOpponent.onClick = (_) -> + { var notesToSelect:Array = currentSongChartNoteData; notesToSelect = SongDataUtils.getNotesInDataRange(notesToSelect, STRUMLINE_SIZE, STRUMLINE_SIZE * 2 - 1); if (FlxG.keys.pressed.SHIFT) @@ -3074,7 +3077,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState buttonSelectPlayer.zIndex = 110; add(buttonSelectPlayer); - buttonSelectPlayer.onClick = (_) -> { + buttonSelectPlayer.onClick = (_) -> + { var notesToSelect:Array = currentSongChartNoteData; notesToSelect = SongDataUtils.getNotesInDataRange(notesToSelect, 0, STRUMLINE_SIZE - 1); if (FlxG.keys.pressed.SHIFT) @@ -3099,7 +3103,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState buttonSelectEvent.zIndex = 110; add(buttonSelectEvent); - buttonSelectEvent.onClick = (_) -> { + buttonSelectEvent.onClick = (_) -> + { if (FlxG.keys.pressed.SHIFT) { performCommand(new SelectItemsCommand([], currentSongChartEventData)); @@ -3134,11 +3139,13 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState playbarEnd.onClick = _ -> playbarButtonPressed = 'playbarEnd'; // Cycle note snap quant. - playbarNoteSnap.onRightClick = _ -> { + playbarNoteSnap.onRightClick = _ -> + { noteSnapQuantIndex--; if (noteSnapQuantIndex < 0) noteSnapQuantIndex = SNAP_QUANTS.length - 1; }; - playbarNoteSnap.onClick = _ -> { + playbarNoteSnap.onClick = _ -> + { if (FlxG.keys.pressed.SHIFT) { noteSnapQuantIndex = BASE_QUANT_INDEX; @@ -3150,7 +3157,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState } }; - playbarBPM.onClick = _ -> { + playbarBPM.onClick = _ -> + { if (pressingControl()) { this.setToolboxState(CHART_EDITOR_TOOLBOX_METADATA_LAYOUT, true); @@ -3162,12 +3170,14 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState } } - playbarBPM.onRightClick = _ -> { + playbarBPM.onRightClick = _ -> + { Conductor.instance.currentTimeChange.bpm -= 1; this.refreshToolbox(CHART_EDITOR_TOOLBOX_METADATA_LAYOUT); } - playbarDifficulty.onClick = _ -> { + playbarDifficulty.onClick = _ -> + { if (pressingControl()) { this.setToolboxState(CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT, true); @@ -3179,7 +3189,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState } } - playbarDifficulty.onRightClick = _ -> { + playbarDifficulty.onRightClick = _ -> + { incrementDifficulty(1); this.refreshToolbox(CHART_EDITOR_TOOLBOX_DIFFICULTY_LAYOUT); } @@ -3189,7 +3200,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState // File menubarItemNewChart.onClick = _ -> this.openWelcomeDialog(true); menubarItemOpenChart.onClick = _ -> this.openBrowseFNFC(true); - menubarItemSaveChart.onClick = _ -> { + menubarItemSaveChart.onClick = _ -> + { if (currentWorkingFilePath != null) { this.exportAllSongData(true, currentWorkingFilePath); @@ -3205,12 +3217,14 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState // Edit menubarItemUndo.onClick = _ -> undoLastCommand(); menubarItemRedo.onClick = _ -> redoLastCommand(); - menubarItemCopy.onClick = function(_) { + menubarItemCopy.onClick = function(_) + { copySelection(); }; menubarItemCut.onClick = _ -> performCommand(new CutItemsCommand(currentNoteSelection, currentEventSelection)); - menubarItemPaste.onClick = _ -> { + menubarItemPaste.onClick = _ -> + { var targetMs:Float = scrollPositionInMs + playheadPositionInMs; var targetStep:Float = Conductor.instance.getTimeInSteps(targetMs); var targetSnappedStep:Float = Math.floor(targetStep / noteSnapRatio) * noteSnapRatio; @@ -3218,12 +3232,14 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState performCommand(new PasteItemsCommand(targetSnappedMs)); }; - menubarItemPasteUnsnapped.onClick = _ -> { + menubarItemPasteUnsnapped.onClick = _ -> + { var targetMs:Float = scrollPositionInMs + playheadPositionInMs; performCommand(new PasteItemsCommand(targetMs)); }; - menubarItemDelete.onClick = _ -> { + menubarItemDelete.onClick = _ -> + { if (currentNoteSelection.length > 0 && currentEventSelection.length > 0) { performCommand(new RemoveItemsCommand(currentNoteSelection, currentEventSelection)); @@ -3242,7 +3258,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState } }; - menubarItemDeleteStacked.onClick = _ -> { + menubarItemDeleteStacked.onClick = _ -> + { if (currentEventSelection.length > 0 && currentNoteSelection.length == 0) { performCommand(new RemoveEventsCommand(currentEventSelection)); @@ -3275,11 +3292,13 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState menubarItemPlaytestFull.onClick = _ -> testSongInPlayState(false); menubarItemPlaytestMinimal.onClick = _ -> testSongInPlayState(true); - menuBarItemNoteSnapDecrease.onClick = _ -> { + menuBarItemNoteSnapDecrease.onClick = _ -> + { noteSnapQuantIndex--; if (noteSnapQuantIndex < 0) noteSnapQuantIndex = SNAP_QUANTS.length - 1; }; - menuBarItemNoteSnapIncrease.onClick = _ -> { + menuBarItemNoteSnapIncrease.onClick = _ -> + { noteSnapQuantIndex++; if (noteSnapQuantIndex >= SNAP_QUANTS.length) noteSnapQuantIndex = 0; }; @@ -3290,7 +3309,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState menuBarStackedNoteThreshold.dataSource.add({text: '1/$snap'}); } - menuBarStackedNoteThreshold.onChange = event -> { + menuBarStackedNoteThreshold.onChange = event -> + { // NOTE: It needs to be offset by 1 because of the 'Exact' option // -1 value means that it is the one selected var selectedIdx:Int = menuBarStackedNoteThreshold.selectedIndex - 1; @@ -3299,15 +3319,18 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState notePreviewDirty = true; } - menuBarItemInputStyleNone.onClick = function(event:UIEvent) { + menuBarItemInputStyleNone.onClick = function(event:UIEvent) + { currentLiveInputStyle = None; }; menuBarItemInputStyleNone.selected = currentLiveInputStyle == None; - menuBarItemInputStyleNumberKeys.onClick = function(event:UIEvent) { + menuBarItemInputStyleNumberKeys.onClick = function(event:UIEvent) + { currentLiveInputStyle = NumberKeys; }; menuBarItemInputStyleNumberKeys.selected = currentLiveInputStyle == NumberKeys; - menuBarItemInputStyleWASD.onClick = function(event:UIEvent) { + menuBarItemInputStyleWASD.onClick = function(event:UIEvent) + { currentLiveInputStyle = WASDKeys; }; menuBarItemInputStyleWASD.selected = currentLiveInputStyle == WASDKeys; @@ -3339,39 +3362,46 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState menubarItemDifficultyUp.onClick = _ -> incrementDifficulty(1); menubarItemDifficultyDown.onClick = _ -> incrementDifficulty(-1); - menuBarItemThemeLight.onChange = function(event:UIEvent) { + menuBarItemThemeLight.onChange = function(event:UIEvent) + { if (event.target.value) currentTheme = ChartEditorTheme.Light; }; menuBarItemThemeLight.selected = currentTheme == ChartEditorTheme.Light; - menuBarItemThemeDark.onChange = function(event:UIEvent) { + menuBarItemThemeDark.onChange = function(event:UIEvent) + { if (event.target.value) currentTheme = ChartEditorTheme.Dark; }; menuBarItemThemeDark.selected = currentTheme == ChartEditorTheme.Dark; menubarItemPlayPause.onClick = _ -> toggleAudioPlayback(); - menubarItemLoadInstrumental.onClick = _ -> { + menubarItemLoadInstrumental.onClick = _ -> + { var dialog = this.openUploadInstDialog(true); // Ensure instrumental and vocals are reloaded properly. - dialog.onDialogClosed = function(_) { + dialog.onDialogClosed = function(_) + { this.isHaxeUIDialogOpen = false; this.switchToCurrentInstrumental(); this.postLoadInstrumental(); } }; - menubarItemLoadVocals.onClick = _ -> { + menubarItemLoadVocals.onClick = _ -> + { var dialog = this.openUploadVocalsDialog(true); // Ensure instrumental and vocals are reloaded properly. - dialog.onDialogClosed = function(_) { + dialog.onDialogClosed = function(_) + { this.isHaxeUIDialogOpen = false; this.switchToCurrentInstrumental(); this.postLoadInstrumental(); } }; - menubarItemVolumeMetronome.onChange = event -> { + menubarItemVolumeMetronome.onChange = event -> + { var volume:Float = event.value.toFloat() / 100.0; metronomeVolume = volume; menubarLabelVolumeMetronome.text = 'Metronome - ${Std.int(event.value)}%'; @@ -3379,7 +3409,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState menubarItemVolumeMetronome.value = Std.int(metronomeVolume * 100); previousAudioVolumes[0] = Std.int(metronomeVolume * 100); - menubarItemThemeMusic.onChange = event -> { + menubarItemThemeMusic.onChange = event -> + { shouldPlayWelcomeMusic = event.value; // Don't restart the music when the menu is opened for the first time if (!welcomeMusic.active || !shouldPlayWelcomeMusic) @@ -3389,7 +3420,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState }; menubarItemThemeMusic.selected = shouldPlayWelcomeMusic; - menubarItemVolumeHitsoundPlayer.onChange = event -> { + menubarItemVolumeHitsoundPlayer.onChange = event -> + { var volume:Float = event.value.toFloat() / 100.0; hitsoundVolumePlayer = volume; menubarLabelVolumeHitsoundPlayer.text = 'Player - ${Std.int(event.value)}%'; @@ -3397,7 +3429,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState menubarItemVolumeHitsoundPlayer.value = Std.int(hitsoundVolumePlayer * 100); previousAudioVolumes[1] = Std.int(hitsoundVolumePlayer * 100); - menubarItemVolumeHitsoundOpponent.onChange = event -> { + menubarItemVolumeHitsoundOpponent.onChange = event -> + { var volume:Float = event.value.toFloat() / 100.0; hitsoundVolumeOpponent = volume; menubarLabelVolumeHitsoundOpponent.text = 'Enemy - ${Std.int(event.value)}%'; @@ -3405,28 +3438,32 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState menubarItemVolumeHitsoundOpponent.value = Std.int(hitsoundVolumeOpponent * 100); previousAudioVolumes[2] = Std.int(hitsoundVolumeOpponent * 100); - menubarItemVolumeInstrumental.onChange = event -> { + menubarItemVolumeInstrumental.onChange = event -> + { var volume:Float = event.value.toFloat() / 100.0; if (audioInstTrack != null) audioInstTrack.volume = volume; menubarLabelVolumeInstrumental.text = 'Instrumental - ${Std.int(event.value)}%'; }; previousAudioVolumes[3] = menubarLabelVolumeInstrumental.value; - menubarItemVolumeVocalsPlayer.onChange = event -> { + menubarItemVolumeVocalsPlayer.onChange = event -> + { var volume:Float = event.value.toFloat() / 100.0; audioVocalTrackGroup.playerVolume = volume; menubarLabelVolumeVocalsPlayer.text = 'Player - ${Std.int(event.value)}%'; }; previousAudioVolumes[4] = menubarLabelVolumeVocalsPlayer.value; - menubarItemVolumeVocalsOpponent.onChange = event -> { + menubarItemVolumeVocalsOpponent.onChange = event -> + { var volume:Float = event.value.toFloat() / 100.0; audioVocalTrackGroup.opponentVolume = volume; menubarLabelVolumeVocalsOpponent.text = 'Enemy - ${Std.int(event.value)}%'; }; previousAudioVolumes[5] = menubarLabelVolumeVocalsOpponent.value; - menubarItemPlaybackSpeed.onChange = event -> { + menubarItemPlaybackSpeed.onChange = event -> + { var pitch:Float = (event.value.toFloat() * 2.0) / 100.0; pitch = Math.round(pitch / 0.05) * 0.05; // Round to nearest 5% pitch = pitch.clamp(0.05, 2.0); // Clamp to 5% to 200% @@ -3445,11 +3482,13 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState menubarItemToggleToolboxEventData.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_EVENT_DATA_LAYOUT, event.value); menubarItemToggleToolboxFreeplay.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_FREEPLAY_LAYOUT, event.value); menubarItemToggleToolboxPlaytestProperties.onChange = event -> this.setToolboxState(CHART_EDITOR_TOOLBOX_PLAYTEST_PROPERTIES_LAYOUT, event.value); - menubarItemToggleToolboxPlayerPreview.onChange = event -> { + menubarItemToggleToolboxPlayerPreview.onChange = event -> + { this.setToolboxState(CHART_EDITOR_TOOLBOX_PLAYER_PREVIEW_LAYOUT, event.value); playerPreviewDirty = event.value; } - menubarItemToggleToolboxOpponentPreview.onChange = event -> { + menubarItemToggleToolboxOpponentPreview.onChange = event -> + { this.setToolboxState(CHART_EDITOR_TOOLBOX_OPPONENT_PREVIEW_LAYOUT, event.value); opponentPreviewDirty = event.value; } @@ -3472,11 +3511,10 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState } } - SongDataUtils.writeItemsToClipboard( - { - notes: SongDataUtils.buildNoteClipboard(currentNoteSelection, timeOffset), - events: SongDataUtils.buildEventClipboard(currentEventSelection, timeOffset), - }); + SongDataUtils.writeItemsToClipboard({ + notes: SongDataUtils.buildNoteClipboard(currentNoteSelection, timeOffset), + events: SongDataUtils.buildEventClipboard(currentEventSelection, timeOffset), + }); } /** @@ -3556,12 +3594,10 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState { displayAutosavePopup = false; var absoluteBackupsPath:String = Path.join([Sys.getCwd(), ChartEditorImportExportHandler.BACKUPS_PATH]); - this.infoWithActions('Auto-Save', 'Chart auto-saved to ${absoluteBackupsPath}.', [ - { - text: "Take Me There", - callback: openBackupsFolder, - } - ]); + this.infoWithActions('Auto-Save', 'Chart auto-saved to ${absoluteBackupsPath}.', [{ + text: "Take Me There", + callback: openBackupsFolder, + }]); } } #end @@ -4057,7 +4093,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState if (!ChartEditorHoldNoteSprite.wouldHoldNoteBeVisible(viewAreaBottomPixels, viewAreaTopPixels, noteData, renderedHoldNotes)) continue; // Hold note should be rendered. - var holdNoteFactory = function() { + var holdNoteFactory = function() + { // TODO: Print some kind of warning if `renderedHoldNotes.members` is too high? return new ChartEditorHoldNoteSprite(this); } @@ -4362,7 +4399,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState shouldPause = true; } - var funcJumpUp = (playheadOnly:Bool) -> { + var funcJumpUp = (playheadOnly:Bool) -> + { var playheadPosition:Float = scrollPositionInMs + playheadPositionInMs; var currentPositionMeasure:Float = Conductor.instance.currentMeasureTime; var currentPositionMeasureFlooredInMs:Float = Conductor.instance.getMeasureTimeInMs(Math.floor(currentPositionMeasure)); @@ -4409,7 +4447,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState shouldPause = true; } - var funcJumpDown = (playheadOnly:Bool) -> { + var funcJumpDown = (playheadOnly:Bool) -> + { var playheadPosition:Float = scrollPositionInMs + playheadPositionInMs; var currentPositionMeasure:Float = Conductor.instance.currentMeasureTime; var targetScrollPosition:Float = Conductor.instance.getMeasureTimeInMs(Math.floor(currentPositionMeasure + 1.0001)); @@ -4581,7 +4620,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState // Find the first note that is at the cursor position. if (overlapsGrid && FlxG.mouse.overlaps(renderedNotes)) { - highlightedNote = renderedNotes.members.find(function(note:ChartEditorNoteSprite):Bool { + highlightedNote = renderedNotes.members.find(function(note:ChartEditorNoteSprite):Bool + { // If note.alive is false, the note is dead and awaiting recycling. return note.alive && FlxG.mouse.overlaps(note); }); @@ -4597,7 +4637,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState // Skip this if we're already highlighting a note. if (overlapsGrid && !overlapsRenderedNotes && FlxG.mouse.overlaps(renderedEvents)) { - highlightedEvent = renderedEvents.members.find(function(event:ChartEditorEventSprite):Bool { + highlightedEvent = renderedEvents.members.find(function(event:ChartEditorEventSprite):Bool + { // If event.alive is false, the event is dead and awaiting recycling. return event.alive && FlxG.mouse.overlaps(event); }); @@ -4613,7 +4654,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState // Skip this if we're already highlighting a note or event. if (overlapsGrid && !(overlapsRenderedNotes || overlapsRenderedEvents) && FlxG.mouse.overlaps(renderedHoldNotes)) { - if (overlapsGrid) highlightedHoldNote = renderedHoldNotes.members.find(function(holdNote:ChartEditorHoldNoteSprite):Bool { + if (overlapsGrid) highlightedHoldNote = renderedHoldNotes.members.find(function(holdNote:ChartEditorHoldNoteSprite):Bool + { // If holdNote.alive is false, the holdNote is dead and awaiting recycling. return holdNote.alive && FlxG.mouse.overlaps(holdNote); }); @@ -4638,7 +4680,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState var highlightedSelectionSquare:Null = null; - if (overlapsGrid) highlightedSelectionSquare = renderedSelectionSquares.members.find(function(selectionSquare:ChartEditorSelectionSquareSprite):Bool { + if (overlapsGrid) highlightedSelectionSquare = renderedSelectionSquares.members.find(function(selectionSquare:ChartEditorSelectionSquareSprite):Bool + { return selectionSquare.alive && FlxG.mouse.overlaps(selectionSquare); }); @@ -4782,7 +4825,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState // We build a list of columns to select. var columnStart:Int = Std.int(Math.min(cursorColumnBase, cursorColumnBaseStart)); var columnEnd:Int = Std.int(Math.max(cursorColumnBase, cursorColumnBaseStart)); - var columns:Array = [for (i in columnStart...(columnEnd + 1)) i].map(function(i:Int):Int { + var columns:Array = [for (i in columnStart...(columnEnd + 1)) i].map(function(i:Int):Int + { if (i >= eventColumn) { // Don't invert the event column. @@ -5729,10 +5773,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState if (eventsAtPos.length == 0 && !removeEventInstead) { trace('Placing event ${isOpponent}'); - var newEventData:SongEventData = new SongEventData(playheadSnappedMs, 'FocusCamera', - { - char: isOpponent ? 1 : 0, - }); + var newEventData:SongEventData = new SongEventData(playheadSnappedMs, 'FocusCamera', { + char: isOpponent ? 1 : 0, + }); performCommand(new AddEventsCommand([newEventData], pressingControl())); } else if (removeEventInstead) @@ -5964,10 +6007,12 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState if (currentWorkingFilePath == null || FlxG.keys.pressed.SHIFT) { // CTRL + SHIFT + S = Save As - this.exportAllSongData(false, null, function(path:String) { + this.exportAllSongData(false, null, function(path:String) + { // CTRL + SHIFT + S Successful this.success('Saved Chart', 'Chart saved successfully to ${path}.'); - }, function() { + }, function() + { // CTRL + SHIFT + S Cancelled }); } @@ -6409,19 +6454,18 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState FlxTransitionableState.skipNextTransIn = false; FlxTransitionableState.skipNextTransOut = false; - var targetStateParams = - { - targetSong: targetSong, - targetDifficulty: selectedDifficulty, - targetVariation: selectedVariation, - practiceMode: playtestPracticeMode, - botPlayMode: playtestBotPlayMode, - playtestResults: playtestShowResults, - minimalMode: minimal, - startTimestamp: startTimestamp, - playbackRate: playbackRate, - overrideMusic: true, - }; + var targetStateParams = { + targetSong: targetSong, + targetDifficulty: selectedDifficulty, + targetVariation: selectedVariation, + practiceMode: playtestPracticeMode, + botPlayMode: playtestBotPlayMode, + playtestResults: playtestShowResults, + minimalMode: minimal, + startTimestamp: startTimestamp, + playbackRate: playbackRate, + overrideMusic: true, + }; // Override music. if (audioInstTrack != null) @@ -6439,7 +6483,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState Cursor.hide(); - LoadingState.loadPlayState(targetStateParams, false, true, function(targetState) { + LoadingState.loadPlayState(targetStateParams, false, true, function(targetState) + { // Apply volume settings. if (playtestAudioSettings) { @@ -6613,12 +6658,14 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState function sortChartData():Void { // TODO: .insertionSort() - currentSongChartNoteData.sort(function(a:SongNoteData, b:SongNoteData):Int { + currentSongChartNoteData.sort(function(a:SongNoteData, b:SongNoteData):Int + { return FlxSort.byValues(FlxSort.ASCENDING, a.time, b.time); }); // TODO: .insertionSort() - currentSongChartEventData.sort(function(a:SongEventData, b:SongEventData):Int { + currentSongChartEventData.sort(function(a:SongEventData, b:SongEventData):Int + { return FlxSort.byValues(FlxSort.ASCENDING, a.time, b.time); }); } @@ -6879,14 +6926,13 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState { displayAutosavePopup = false; #if sys - haxe.ui.Toolkit.callLater(() -> { + haxe.ui.Toolkit.callLater(() -> + { var absoluteBackupsPath:String = Path.join([Sys.getCwd(), ChartEditorImportExportHandler.BACKUPS_PATH]); - this.infoWithActions('Auto-Save', 'Chart auto-saved to ${absoluteBackupsPath}.', [ - { - text: "Take Me There", - callback: openBackupsFolder, - } - ]); + this.infoWithActions('Auto-Save', 'Chart auto-saved to ${absoluteBackupsPath}.', [{ + text: "Take Me There", + callback: openBackupsFolder, + }]); }); #else // TODO: No auto-save on HTML5? @@ -6944,7 +6990,9 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState /** * Updates the measure tick bitmap forcibly to make sure it's correct. */ - function updateTimeSignature():Void {} + function updateTimeSignature():Void + { + } /** * Handle positioning the measure ticks sprite. @@ -7167,7 +7215,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState if (audioInstTrack != null) { // Prevent the time from skipping back to 0 when the song ends. - audioInstTrack.onComplete = function() { + audioInstTrack.onComplete = function() + { if (audioInstTrack != null) { audioInstTrack.pause(); diff --git a/source/funkin/ui/debug/charting/commands/CopyItemsCommand.hx b/source/funkin/ui/debug/charting/commands/CopyItemsCommand.hx index b51835248..fcf0794da 100644 --- a/source/funkin/ui/debug/charting/commands/CopyItemsCommand.hx +++ b/source/funkin/ui/debug/charting/commands/CopyItemsCommand.hx @@ -36,11 +36,10 @@ class CopyItemsCommand implements ChartEditorCommand } } - SongDataUtils.writeItemsToClipboard( - { - notes: SongDataUtils.buildNoteClipboard(state.currentNoteSelection, timeOffset), - events: SongDataUtils.buildEventClipboard(state.currentEventSelection, timeOffset), - }); + SongDataUtils.writeItemsToClipboard({ + notes: SongDataUtils.buildNoteClipboard(state.currentNoteSelection, timeOffset), + events: SongDataUtils.buildEventClipboard(state.currentEventSelection, timeOffset), + }); performVisuals(state); } @@ -71,13 +70,13 @@ class CopyItemsCommand implements ChartEditorCommand note.angle = FlxG.random.bool() ? -10 : 10; FlxTween.tween(note, {"angle": 0}, 0.8, {ease: FlxEase.elasticOut}); - FlxTween.tween(note.scale, {"y": prevX, "x": prevY}, 0.7, + FlxTween.tween(note.scale, {"y": prevX, "x": prevY}, 0.7, { + ease: FlxEase.elasticOut, + onComplete: function(_) { - ease: FlxEase.elasticOut, - onComplete: function(_) { - note.playNoteAnimation(); - } - }); + note.playNoteAnimation(); + } + }); } } } @@ -103,13 +102,13 @@ class CopyItemsCommand implements ChartEditorCommand event.angle = FlxG.random.bool() ? -10 : 10; FlxTween.tween(event, {"angle": 0}, 0.8, {ease: FlxEase.elasticOut}); - FlxTween.tween(event.scale, {"y": prevX, "x": prevY}, 0.7, + FlxTween.tween(event.scale, {"y": prevX, "x": prevY}, 0.7, { + ease: FlxEase.elasticOut, + onComplete: function(_) { - ease: FlxEase.elasticOut, - onComplete: function(_) { - event.playAnimation(); - } - }); + event.playAnimation(); + } + }); } } } @@ -139,14 +138,14 @@ class CopyItemsCommand implements ChartEditorCommand state.txtCopyNotif.text = 'Copied ${copiedString} to clipboard'; state.txtCopyNotif.x = FlxG.mouse.x - (state.txtCopyNotif.width / 2); state.txtCopyNotif.y = FlxG.mouse.y - 16; - FlxTween.tween(state.txtCopyNotif, {y: state.txtCopyNotif.y - 32}, 0.5, + FlxTween.tween(state.txtCopyNotif, {y: state.txtCopyNotif.y - 32}, 0.5, { + type: FlxTweenType.ONESHOT, + ease: FlxEase.quadOut, + onComplete: function(_) { - type: FlxTweenType.ONESHOT, - ease: FlxEase.quadOut, - onComplete: function(_) { - state.txtCopyNotif.visible = false; - } - }); + state.txtCopyNotif.visible = false; + } + }); } } diff --git a/source/funkin/ui/debug/charting/commands/CutItemsCommand.hx b/source/funkin/ui/debug/charting/commands/CutItemsCommand.hx index 94401afac..e21932619 100644 --- a/source/funkin/ui/debug/charting/commands/CutItemsCommand.hx +++ b/source/funkin/ui/debug/charting/commands/CutItemsCommand.hx @@ -25,11 +25,10 @@ class CutItemsCommand implements ChartEditorCommand public function execute(state:ChartEditorState):Void { // Copy the notes. - SongDataUtils.writeItemsToClipboard( - { - notes: SongDataUtils.buildNoteClipboard(notes), - events: SongDataUtils.buildEventClipboard(events) - }); + SongDataUtils.writeItemsToClipboard({ + notes: SongDataUtils.buildNoteClipboard(notes), + events: SongDataUtils.buildEventClipboard(events) + }); // Delete the notes. state.currentSongChartNoteData = SongDataUtils.subtractNotes(state.currentSongChartNoteData, notes); diff --git a/source/funkin/ui/debug/charting/commands/DeselectAllItemsCommand.hx b/source/funkin/ui/debug/charting/commands/DeselectAllItemsCommand.hx index 4356bc34d..af09ed8de 100644 --- a/source/funkin/ui/debug/charting/commands/DeselectAllItemsCommand.hx +++ b/source/funkin/ui/debug/charting/commands/DeselectAllItemsCommand.hx @@ -14,7 +14,9 @@ class DeselectAllItemsCommand implements ChartEditorCommand var previousNoteSelection:Array = []; var previousEventSelection:Array = []; - public function new() {} + public function new() + { + } public function execute(state:ChartEditorState):Void { diff --git a/source/funkin/ui/debug/charting/commands/InvertSelectedItemsCommand.hx b/source/funkin/ui/debug/charting/commands/InvertSelectedItemsCommand.hx index cf3461241..7f464a901 100644 --- a/source/funkin/ui/debug/charting/commands/InvertSelectedItemsCommand.hx +++ b/source/funkin/ui/debug/charting/commands/InvertSelectedItemsCommand.hx @@ -16,7 +16,9 @@ class InvertSelectedItemsCommand implements ChartEditorCommand var previousNoteSelection:Array = []; var previousEventSelection:Array = []; - public function new() {} + public function new() + { + } public function execute(state:ChartEditorState):Void { diff --git a/source/funkin/ui/debug/charting/components/ChartEditorMeasureTicks.hx b/source/funkin/ui/debug/charting/components/ChartEditorMeasureTicks.hx index bc4a5bb72..b4014ad2b 100644 --- a/source/funkin/ui/debug/charting/components/ChartEditorMeasureTicks.hx +++ b/source/funkin/ui/debug/charting/components/ChartEditorMeasureTicks.hx @@ -140,12 +140,14 @@ class ChartEditorMeasureTicks extends FlxTypedSpriteGroup measureTicksSprite.loadGraphic(measureTickBitmap); // Destroy these so they get rebuilt with the right theme later. - measureNumbers.forEach(function(measureNumber:FlxText) { + measureNumbers.forEach(function(measureNumber:FlxText) + { measureNumber.destroy(); }); measureNumbers.clear(); // Destroy these so they get rebuilt with the right theme later. - measureDividers.forEach(function(measureDivider:FlxSprite) { + measureDividers.forEach(function(measureDivider:FlxSprite) + { measureDivider.destroy(); }); measureDividers.clear(); @@ -167,10 +169,12 @@ class ChartEditorMeasureTicks extends FlxTypedSpriteGroup previousMeasure = currentMeasure; // Remove existing measure numbers. - measureNumbers.forEachAlive(function(measureNumber:FlxText) { + measureNumbers.forEachAlive(function(measureNumber:FlxText) + { measureNumber.kill(); }); - measureDividers.forEachAlive(function(measureDivider:FlxSprite) { + measureDividers.forEachAlive(function(measureDivider:FlxSprite) + { measureDivider.kill(); }); diff --git a/source/funkin/ui/debug/charting/contextmenus/ChartEditorEventContextMenu.hx b/source/funkin/ui/debug/charting/contextmenus/ChartEditorEventContextMenu.hx index 456c9ec74..7c2322f05 100644 --- a/source/funkin/ui/debug/charting/contextmenus/ChartEditorEventContextMenu.hx +++ b/source/funkin/ui/debug/charting/contextmenus/ChartEditorEventContextMenu.hx @@ -24,11 +24,13 @@ class ChartEditorEventContextMenu extends ChartEditorBaseContextMenu public function initialize() { - contextmenuEdit.onClick = function(_) { + contextmenuEdit.onClick = function(_) + { chartEditorState.showToolbox(ChartEditorState.CHART_EDITOR_TOOLBOX_EVENT_DATA_LAYOUT); } - contextmenuDelete.onClick = function(_) { + contextmenuDelete.onClick = function(_) + { chartEditorState.performCommand(new RemoveEventsCommand([data])); } } diff --git a/source/funkin/ui/debug/charting/contextmenus/ChartEditorHoldNoteContextMenu.hx b/source/funkin/ui/debug/charting/contextmenus/ChartEditorHoldNoteContextMenu.hx index 5a08943b0..17a468d52 100644 --- a/source/funkin/ui/debug/charting/contextmenus/ChartEditorHoldNoteContextMenu.hx +++ b/source/funkin/ui/debug/charting/contextmenus/ChartEditorHoldNoteContextMenu.hx @@ -27,15 +27,18 @@ class ChartEditorHoldNoteContextMenu extends ChartEditorBaseContextMenu public function initialize():Void { // NOTE: Remember to use commands here to ensure undo/redo works properly - contextmenuFlip.onClick = function(_) { + contextmenuFlip.onClick = function(_) + { chartEditorState.performCommand(new FlipNotesCommand([data])); } - contextmenuRemoveHold.onClick = function(_) { + contextmenuRemoveHold.onClick = function(_) + { chartEditorState.performCommand(new ExtendNoteLengthCommand(data, 0)); } - contextmenuDelete.onClick = function(_) { + contextmenuDelete.onClick = function(_) + { chartEditorState.performCommand(new RemoveNotesCommand([data])); } } diff --git a/source/funkin/ui/debug/charting/contextmenus/ChartEditorNoteContextMenu.hx b/source/funkin/ui/debug/charting/contextmenus/ChartEditorNoteContextMenu.hx index fa5e70405..aac0c2845 100644 --- a/source/funkin/ui/debug/charting/contextmenus/ChartEditorNoteContextMenu.hx +++ b/source/funkin/ui/debug/charting/contextmenus/ChartEditorNoteContextMenu.hx @@ -29,19 +29,23 @@ class ChartEditorNoteContextMenu extends ChartEditorBaseContextMenu public function initialize():Void { // NOTE: Remember to use commands here to ensure undo/redo works properly - contextmenuFlip.onClick = function(_) { + contextmenuFlip.onClick = function(_) + { chartEditorState.performCommand(new FlipNotesCommand([data])); } - contextmenuMirrorX.onClick = function(_) { + contextmenuMirrorX.onClick = function(_) + { chartEditorState.performCommand(new MirrorNotesCommand([data], true, false, true, true)); } - contextmenuAddHold.onClick = function(_) { + contextmenuAddHold.onClick = function(_) + { chartEditorState.performCommand(new ExtendNoteLengthCommand(data, 4, STEPS)); } - contextmenuDelete.onClick = function(_) { + contextmenuDelete.onClick = function(_) + { chartEditorState.performCommand(new RemoveNotesCommand([data])); } } diff --git a/source/funkin/ui/debug/charting/contextmenus/ChartEditorSelectionContextMenu.hx b/source/funkin/ui/debug/charting/contextmenus/ChartEditorSelectionContextMenu.hx index 0bd896fad..a564bec78 100644 --- a/source/funkin/ui/debug/charting/contextmenus/ChartEditorSelectionContextMenu.hx +++ b/source/funkin/ui/debug/charting/contextmenus/ChartEditorSelectionContextMenu.hx @@ -39,13 +39,16 @@ class ChartEditorSelectionContextMenu extends ChartEditorBaseContextMenu public function initialize():Void { - contextmenuCut.onClick = (_) -> { + contextmenuCut.onClick = (_) -> + { chartEditorState.performCommand(new CutItemsCommand(chartEditorState.currentNoteSelection, chartEditorState.currentEventSelection)); }; - contextmenuCopy.onClick = (_) -> { + contextmenuCopy.onClick = (_) -> + { chartEditorState.copySelection(); }; - contextmenuDelete.onClick = (_) -> { + contextmenuDelete.onClick = (_) -> + { if (chartEditorState.currentNoteSelection.length > 0 && chartEditorState.currentEventSelection.length > 0) { chartEditorState.performCommand(new RemoveItemsCommand(chartEditorState.currentNoteSelection, chartEditorState.currentEventSelection)); @@ -64,32 +67,39 @@ class ChartEditorSelectionContextMenu extends ChartEditorBaseContextMenu } }; - contextmenuFlip.onClick = function(_) { + contextmenuFlip.onClick = function(_) + { chartEditorState.performCommand(new FlipNotesCommand(chartEditorState.currentNoteSelection)); } - contextmenuMirrorX.onClick = function(_) { + contextmenuMirrorX.onClick = function(_) + { chartEditorState.performCommand(new MirrorNotesCommand(chartEditorState.currentNoteSelection, contextmenuMirrorFlipWithinStrumline.selected, !contextmenuMirrorFlipWithinStrumline.selected, true, false)); } - contextmenuMirrorY.onClick = function(_) { + contextmenuMirrorY.onClick = function(_) + { chartEditorState.performCommand(new MirrorNotesCommand(chartEditorState.currentNoteSelection, contextmenuMirrorFlipWithinStrumline.selected, !contextmenuMirrorFlipWithinStrumline.selected, false, true)); } - contextmenuMirrorXY.onClick = function(_) { + contextmenuMirrorXY.onClick = function(_) + { chartEditorState.performCommand(new MirrorNotesCommand(chartEditorState.currentNoteSelection, contextmenuMirrorFlipWithinStrumline.selected, !contextmenuMirrorFlipWithinStrumline.selected, true, true)); } - contextmenuSelectAll.onClick = function(_) { + contextmenuSelectAll.onClick = function(_) + { chartEditorState.performCommand(new SelectAllItemsCommand(true, false)); } - contextmenuSelectInverse.onClick = function(_) { + contextmenuSelectInverse.onClick = function(_) + { chartEditorState.performCommand(new InvertSelectedItemsCommand()); } - contextmenuSelectNone.onClick = function(_) { + contextmenuSelectNone.onClick = function(_) + { chartEditorState.performCommand(new DeselectAllItemsCommand()); } } diff --git a/source/funkin/ui/debug/charting/dialogs/ChartEditorAboutDialog.hx b/source/funkin/ui/debug/charting/dialogs/ChartEditorAboutDialog.hx index 3a0db490b..8e2b99c40 100644 --- a/source/funkin/ui/debug/charting/dialogs/ChartEditorAboutDialog.hx +++ b/source/funkin/ui/debug/charting/dialogs/ChartEditorAboutDialog.hx @@ -13,11 +13,10 @@ class ChartEditorAboutDialog extends ChartEditorBaseDialog public static function build(chartEditorState:ChartEditorState, ?closable:Bool, ?modal:Bool):ChartEditorAboutDialog { - var dialog = new ChartEditorAboutDialog(chartEditorState, - { - closable: closable ?? true, - modal: modal ?? true - }); + var dialog = new ChartEditorAboutDialog(chartEditorState, { + closable: closable ?? true, + modal: modal ?? true + }); dialog.showDialog(modal ?? true); diff --git a/source/funkin/ui/debug/charting/dialogs/ChartEditorCharacterIconSelectorMenu.hx b/source/funkin/ui/debug/charting/dialogs/ChartEditorCharacterIconSelectorMenu.hx index ba5d41bd7..56e86792b 100644 --- a/source/funkin/ui/debug/charting/dialogs/ChartEditorCharacterIconSelectorMenu.hx +++ b/source/funkin/ui/debug/charting/dialogs/ChartEditorCharacterIconSelectorMenu.hx @@ -33,16 +33,16 @@ class ChartEditorCharacterIconSelectorMenu extends ChartEditorBaseMenu initialize(charType, lockPosition); this.alpha = 0; this.y -= 10; - FlxTween.tween(this, {alpha: 1, y: this.y + 10}, 0.2, + FlxTween.tween(this, {alpha: 1, y: this.y + 10}, 0.2, { + ease: FlxEase.quartOut, + onComplete: function(_) { - ease: FlxEase.quartOut, - onComplete: function(_) { - // Just focus the button FFS. Idk why, but the scrollbar doesn't update until after the tween finishes with this???? - if (currentCharButton != null) currentCharButton.focus = true; - else - chartEditorState.error('Failure', 'Could not find character of ${currentCharId} in registry (Is the character in the registry?)'); - } - }); + // Just focus the button FFS. Idk why, but the scrollbar doesn't update until after the tween finishes with this???? + if (currentCharButton != null) currentCharButton.focus = true; + else + chartEditorState.error('Failure', 'Could not find character of ${currentCharId} in registry (Is the character in the registry?)'); + } + }); } function initialize(charType:CharacterType, lockPosition:Bool) @@ -113,7 +113,8 @@ class ChartEditorCharacterIconSelectorMenu extends ChartEditorBaseMenu charButton.icon = haxe.ui.util.Variant.fromImageData(CharacterDataParser.getCharPixelIconAsset(charId)); charButton.text = (charId != "") ? (charData.name.length > LIMIT ? '${charData.name.substr(0, LIMIT)}.' : '${charData.name}') : 'None'; - charButton.onClick = _ -> { + charButton.onClick = _ -> + { switch (charType) { case BF: @@ -132,10 +133,12 @@ class ChartEditorCharacterIconSelectorMenu extends ChartEditorBaseMenu chartEditorState.refreshToolbox(ChartEditorState.CHART_EDITOR_TOOLBOX_METADATA_LAYOUT); }; - charButton.onMouseOver = _ -> { + charButton.onMouseOver = _ -> + { charIconName.text = (charId != "") ? '${charData.name} [${charId}]' : 'None'; }; - charButton.onMouseOut = _ -> { + charButton.onMouseOut = _ -> + { charIconName.text = defaultText; }; charGrid.addComponent(charButton); diff --git a/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadChartDialog.hx b/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadChartDialog.hx index b30c482a1..0c02b3d25 100644 --- a/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadChartDialog.hx +++ b/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadChartDialog.hx @@ -25,13 +25,15 @@ class ChartEditorUploadChartDialog extends ChartEditorBaseDialog this.chartBox.onClick = (_) -> this.onClickChartBox(); - this.chartBox.onMouseOver = function(_event) { + this.chartBox.onMouseOver = function(_event) + { if (this.locked) return; this.chartBox.swapClass('upload-bg', 'upload-bg-hover'); Cursor.cursorMode = Pointer; } - this.chartBox.onMouseOut = function(_event) { + this.chartBox.onMouseOut = function(_event) + { this.chartBox.swapClass('upload-bg-hover', 'upload-bg'); Cursor.cursorMode = Default; } @@ -41,11 +43,10 @@ class ChartEditorUploadChartDialog extends ChartEditorBaseDialog public static function build(state:ChartEditorState, ?closable:Bool, ?modal:Bool):ChartEditorUploadChartDialog { - var dialog = new ChartEditorUploadChartDialog(state, - { - closable: closable ?? false, - modal: modal ?? true - }); + var dialog = new ChartEditorUploadChartDialog(state, { + closable: closable ?? false, + modal: modal ?? true + }); for (dropTarget in dialog.dropHandlers) { diff --git a/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadVocalsDialog.hx b/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadVocalsDialog.hx index 9acfd6779..c6e135912 100644 --- a/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadVocalsDialog.hx +++ b/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadVocalsDialog.hx @@ -39,17 +39,20 @@ class ChartEditorUploadVocalsDialog extends ChartEditorBaseDialog this.charIds = charIds; this.instId = chartEditorState.currentInstrumentalId; - dialogCancel.onClick = function(_) { + dialogCancel.onClick = function(_) + { hideDialog(DialogButton.CANCEL); } - dialogNoVocals.onClick = function(_) { + dialogNoVocals.onClick = function(_) + { // Dismiss chartEditorState.wipeVocalData(); hideDialog(DialogButton.APPLY); }; - dialogContinue.onClick = function(_) { + dialogContinue.onClick = function(_) + { // Dismiss hideDialog(DialogButton.APPLY); }; @@ -70,7 +73,8 @@ class ChartEditorUploadVocalsDialog extends ChartEditorBaseDialog var dropHandler:DialogDropTarget = {component: vocalsEntry, handler: null}; - var onDropFile:String->Void = function(pathStr:String) { + var onDropFile:String->Void = function(pathStr:String) + { trace('Selected file: $pathStr'); var path:Path = new Path(pathStr); @@ -103,42 +107,42 @@ class ChartEditorUploadVocalsDialog extends ChartEditorBaseDialog } }; - vocalsEntry.onClick = function(_event) { - Dialogs.openBinaryFile('Open $charName Vocals', [ - {label: 'Audio File (.ogg)', extension: 'ogg'}], function(selectedFile) { - if (selectedFile != null && selectedFile.bytes != null) + vocalsEntry.onClick = function(_event) + { + Dialogs.openBinaryFile('Open $charName Vocals', [{label: 'Audio File (.ogg)', extension: 'ogg'}], function(selectedFile) + { + if (selectedFile != null && selectedFile.bytes != null) + { + trace('Selected file: ' + selectedFile.name); + + if (chartEditorState.loadVocalsFromBytes(selectedFile.bytes, charKey, this.instId, !this.hasClearedVocals)) { - trace('Selected file: ' + selectedFile.name); + hasClearedVocals = true; + // Tell the user the load was successful. + chartEditorState.success('Loaded Vocals', 'Loaded vocals for $charName (${selectedFile.name}), variation ${chartEditorState.selectedVariation}'); - if (chartEditorState.loadVocalsFromBytes(selectedFile.bytes, charKey, this.instId, !this.hasClearedVocals)) - { - hasClearedVocals = true; - // Tell the user the load was successful. - chartEditorState.success('Loaded Vocals', - 'Loaded vocals for $charName (${selectedFile.name}), variation ${chartEditorState.selectedVariation}'); + #if FEATURE_FILE_DROP + vocalsEntry.vocalsEntryLabel.text = 'Voices for $charName (drag and drop, or click to browse)\nSelected file: ${selectedFile.name}'; + #else + vocalsEntry.vocalsEntryLabel.text = 'Voices for $charName (click to browse)\n${selectedFile.name}'; + #end - #if FEATURE_FILE_DROP - vocalsEntry.vocalsEntryLabel.text = 'Voices for $charName (drag and drop, or click to browse)\nSelected file: ${selectedFile.name}'; - #else - vocalsEntry.vocalsEntryLabel.text = 'Voices for $charName (click to browse)\n${selectedFile.name}'; - #end - - dialogNoVocals.hidden = true; - } - else - { - trace('Failed to load vocal track (${selectedFile.fullPath})'); - - chartEditorState.error('Failed to Load Vocals', - 'Failed to load vocal track (${selectedFile.name}) for variation (${chartEditorState.selectedVariation})'); - - #if FEATURE_FILE_DROP - vocalsEntry.vocalsEntryLabel.text = 'Drag and drop vocals for $charName here, or click to browse.'; - #else - vocalsEntry.vocalsEntryLabel.text = 'Click to browse for vocals for $charName.'; - #end - } + dialogNoVocals.hidden = true; } + else + { + trace('Failed to load vocal track (${selectedFile.fullPath})'); + + chartEditorState.error('Failed to Load Vocals', + 'Failed to load vocal track (${selectedFile.name}) for variation (${chartEditorState.selectedVariation})'); + + #if FEATURE_FILE_DROP + vocalsEntry.vocalsEntryLabel.text = 'Drag and drop vocals for $charName here, or click to browse.'; + #else + vocalsEntry.vocalsEntryLabel.text = 'Click to browse for vocals for $charName.'; + #end + } + } }); } @@ -155,11 +159,10 @@ class ChartEditorUploadVocalsDialog extends ChartEditorBaseDialog public static function build(state:ChartEditorState, charIds:Array, ?closable:Bool, ?modal:Bool):ChartEditorUploadVocalsDialog { - var dialog = new ChartEditorUploadVocalsDialog(state, charIds, - { - closable: closable ?? false, - modal: modal ?? true - }); + var dialog = new ChartEditorUploadVocalsDialog(state, charIds, { + closable: closable ?? false, + modal: modal ?? true + }); for (dropTarget in dialog.dropHandlers) { @@ -296,13 +299,15 @@ class ChartEditorUploadVocalsEntry extends Box vocalsEntryLabel.text = 'Click to browse for vocals for $charName.'; #end - this.onMouseOver = function(_event) { + this.onMouseOver = function(_event) + { // if (this.locked) return; this.swapClass('upload-bg', 'upload-bg-hover'); Cursor.cursorMode = Pointer; } - this.onMouseOut = function(_event) { + this.onMouseOut = function(_event) + { this.swapClass('upload-bg-hover', 'upload-bg'); Cursor.cursorMode = Default; } diff --git a/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx b/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx index 5e70128ad..28d41eb83 100644 --- a/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx +++ b/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx @@ -58,11 +58,10 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog */ public static function build(chartEditorState:ChartEditorState, ?closable:Bool, ?modal:Bool):ChartEditorWelcomeDialog { - var dialog = new ChartEditorWelcomeDialog(chartEditorState, - { - closable: closable ?? false, - modal: modal ?? true - }); + var dialog = new ChartEditorWelcomeDialog(chartEditorState, { + closable: closable ?? false, + modal: modal ?? true + }); dialog.showDialog(modal ?? true); @@ -93,7 +92,8 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog linkRecentChart.tooltip += "\n" + lastModified; #end - linkRecentChart.onClick = function(_event) { + linkRecentChart.onClick = function(_event) + { linkRecentChart.hide(); this.hideDialog(DialogButton.CANCEL); @@ -153,7 +153,8 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog continue; } - this.addTemplateSong(songName, targetSongId, (_) -> { + this.addTemplateSong(songName, targetSongId, (_) -> + { this.hideDialog(DialogButton.CANCEL); // Load song from template diff --git a/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx b/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx index e4220442f..32a689074 100644 --- a/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx +++ b/source/funkin/ui/debug/charting/handlers/ChartEditorDialogHandler.hx @@ -158,7 +158,8 @@ class ChartEditorDialogHandler { var dialog:Null = openDialog(state, CHART_EDITOR_DIALOG_BACKUP_AVAILABLE_LAYOUT, true, true); if (dialog == null) throw 'Could not locate Backup Available dialog'; - dialog.onDialogClosed = function(event) { + dialog.onDialogClosed = function(event) + { state.isHaxeUIDialogOpen = false; if (event.button == DialogButton.APPLY) { @@ -184,14 +185,16 @@ class ChartEditorDialogHandler var buttonCancel:Null