From 5b7e567eb24727c987f6e6fc8de1d76f71613fda Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Wed, 1 Apr 2026 14:21:22 -0400 Subject: [PATCH] Rewrite string literals to use single quotes --- source/Main.hx | 2 +- source/Postbuild.hx | 10 +- source/cpp/vm/tracy/TracyProfiler.hx | 2 +- source/funkin/Conductor.hx | 10 +- source/funkin/FunkinMemory.hx | 124 +++++++-------- source/funkin/Paths.hx | 16 +- source/funkin/Preferences.hx | 28 ++-- source/funkin/api/newgrounds/Leaderboards.hx | 148 +++++++++--------- .../audio/waveform/WaveformDataParser.hx | 8 +- source/funkin/data/DataParse.hx | 6 +- source/funkin/data/animation/AnimationData.hx | 8 +- source/funkin/data/character/CharacterData.hx | 10 +- .../data/dialogue/ConversationRegistry.hx | 4 +- .../funkin/data/dialogue/DialogueBoxData.hx | 4 +- .../data/dialogue/DialogueBoxRegistry.hx | 4 +- .../funkin/data/dialogue/SpeakerRegistry.hx | 4 +- source/funkin/data/event/SongEventRegistry.hx | 4 +- source/funkin/data/event/SongEventSchema.hx | 12 +- .../funkin/data/freeplay/player/PlayerData.hx | 14 +- .../data/notestyle/NoteStyleRegistry.hx | 4 +- .../data/song/importer/ChartManifestData.hx | 2 +- .../data/song/importer/OsuManiaImporter.hx | 18 +-- .../data/song/importer/StepManiaData.hx | 14 +- .../data/song/importer/StepManiaImporter.hx | 132 ++++++++-------- source/funkin/data/stage/StageData.hx | 8 +- source/funkin/data/stage/StageRegistry.hx | 4 +- .../funkin/external/android/CallbackUtil.hx | 6 +- .../graphics/shaders/GaussianBlurShader.hx | 4 +- source/funkin/graphics/shaders/Grayscale.hx | 4 +- .../graphics/shaders/InverseDotsShader.hx | 4 +- .../funkin/graphics/shaders/LeftMaskShader.hx | 2 +- .../funkin/graphics/shaders/MosaicEffect.hx | 2 +- .../shaders/RuntimeCustomBlendShader.hx | 8 +- .../graphics/shaders/RuntimeRainShader.hx | 2 +- source/funkin/group/FunkinGroup.hx | 6 +- source/funkin/input/Cursor.hx | 30 ++-- source/funkin/mobile/ui/FunkinBackButton.hx | 10 +- source/funkin/mobile/ui/FunkinButton.hx | 10 +- source/funkin/mobile/ui/FunkinHitbox.hx | 20 +-- .../mobile/ui/mainmenu/FunkinOptionsButton.hx | 10 +- .../mobile/ui/options/ControlsSchemeMenu.hx | 4 +- .../ui/options/objects/HitboxShowcase.hx | 2 +- .../ui/options/objects/SchemeMenuButton.hx | 2 +- source/funkin/mobile/util/AdMobUtil.hx | 14 +- source/funkin/mobile/util/FNFCProvider.hx | 4 +- .../funkin/mobile/util/InAppPurchasesUtil.hx | 6 +- source/funkin/mobile/util/WebViewUtil.hx | 4 +- source/funkin/modding/events/ScriptEvent.hx | 36 ++--- source/funkin/modding/module/ModuleHandler.hx | 4 +- source/funkin/play/GameOverSubState.hx | 8 +- source/funkin/play/PauseSubState.hx | 22 +-- source/funkin/play/PlayState.hx | 44 +++--- source/funkin/play/character/BaseCharacter.hx | 16 +- .../play/cutscene/dialogue/Conversation.hx | 14 +- .../play/cutscene/dialogue/DialogueBox.hx | 8 +- .../funkin/play/cutscene/dialogue/Speaker.hx | 4 +- .../funkin/play/event/FocusCameraSongEvent.hx | 26 +-- .../play/event/PlayAnimationSongEvent.hx | 8 +- source/funkin/play/event/ScrollSpeedEvent.hx | 8 +- .../play/event/SetCameraBopSongEvent.hx | 6 +- .../play/event/SetHealthIconSongEvent.hx | 6 +- .../play/event/SetTargetBopSpeedEvent.hx | 6 +- .../funkin/play/event/ZoomCameraSongEvent.hx | 8 +- source/funkin/play/notes/NoteHoldCover.hx | 6 +- source/funkin/play/notes/NoteSprite.hx | 8 +- source/funkin/play/notes/Strumline.hx | 4 +- source/funkin/play/notes/SustainTrail.hx | 10 +- .../notes/notekind/NonScoreableNoteKind.hx | 2 +- source/funkin/play/stage/Stage.hx | 2 +- source/funkin/ui/MusicBeatState.hx | 6 +- source/funkin/ui/MusicBeatSubState.hx | 8 +- .../ui/charSelect/CharSelectSubState.hx | 92 +++++------ source/funkin/ui/charSelect/IntroSubState.hx | 4 +- source/funkin/ui/credits/CreditsState.hx | 8 +- source/funkin/ui/debug/WaveformTestState.hx | 6 +- source/funkin/ui/debug/anim/FlxAnimateTest.hx | 16 +- .../ui/debug/charting/ChartEditorState.hx | 74 ++++----- .../components/ChartEditorHoldNoteSprite.hx | 8 +- .../charting/dialogs/ChartEditorBaseDialog.hx | 8 +- .../dialogs/ChartEditorUploadChartDialog.hx | 8 +- .../dialogs/ChartEditorUploadVocalsDialog.hx | 10 +- .../dialogs/ChartEditorWelcomeDialog.hx | 14 +- .../toolboxes/ChartEditorDifficultyToolbox.hx | 30 ++-- .../toolboxes/ChartEditorEventDataToolbox.hx | 34 ++-- .../toolboxes/ChartEditorFreeplayToolbox.hx | 10 +- .../toolboxes/ChartEditorMetadataToolbox.hx | 16 +- .../toolboxes/ChartEditorNoteDataToolbox.hx | 8 +- .../toolboxes/ChartEditorOffsetsToolbox.hx | 28 ++-- .../debug/dialogue/ConversationDebugState.hx | 6 +- .../components/ExitConfirmDialog.hx | 10 +- .../stageeditor/components/FindObjDialog.hx | 20 +-- .../stageeditor/components/NewObjDialog.hx | 24 +-- .../StageEditorObjectPropertiesToolbox.hx | 12 +- .../funkin/ui/freeplay/CapsuleOptionsMenu.hx | 2 +- source/funkin/ui/freeplay/FreeplayState.hx | 62 ++++---- source/funkin/ui/freeplay/SongMenuItem.hx | 32 ++-- .../ui/freeplay/backcards/NewCharacterCard.hx | 16 +- .../ui/freeplay/dj/AnimateAtlasFreeplayDJ.hx | 6 +- .../ui/freeplay/dj/MultiSparrowFreeplayDJ.hx | 6 +- .../funkin/ui/freeplay/dj/PackerFreeplayDJ.hx | 6 +- .../ui/freeplay/dj/SparrowFreeplayDJ.hx | 6 +- .../ui/haxeui/FlxGamepadActionInputSource.hx | 4 +- .../ui/haxeui/components/CharacterPlayer.hx | 6 +- source/funkin/ui/story/LevelTitle.hx | 4 +- source/funkin/ui/story/StoryMenuState.hx | 6 +- source/funkin/ui/title/AttractState.hx | 4 +- .../util/plugins/EvacuateDebugPlugin.hx | 4 +- .../funkin/util/plugins/ForceCrashPlugin.hx | 6 +- source/funkin/util/plugins/MemoryGCPlugin.hx | 4 +- .../util/plugins/ReloadAssetsDebugPlugin.hx | 12 +- .../funkin/util/plugins/ScreenshotPlugin.hx | 8 +- 111 files changed, 831 insertions(+), 833 deletions(-) diff --git a/source/Main.hx b/source/Main.hx index 5c5b70cce..d6192f69d 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -106,7 +106,7 @@ class Main extends Sprite var context = stage.window.context.type; if (context != WEBGL && context != OPENGL && context != OPENGLES) { - var tech:String = #if web "WebGL" #elseif desktop "OpenGL" #else "OpenGL ES" #end; + var tech:String = #if web 'WebGL' #elseif desktop 'OpenGL' #else 'OpenGL ES' #end; var requiredVersion:String = #if web '$tech 1.0 or newer' #elseif desktop '$tech 3.0 or newer' #else '$tech 2.0 or newer' #end; var desc:String = 'Failed to initialize the $tech rendering context!\n\n'; #if web diff --git a/source/Postbuild.hx b/source/Postbuild.hx index c63d88557..d616673f1 100644 --- a/source/Postbuild.hx +++ b/source/Postbuild.hx @@ -36,7 +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; @@ -44,13 +44,13 @@ class Postbuild for (u in units) { - var value:Float = (u.name == "second") ? Math.round(remaining * factor) / factor : Math.floor(remaining / u.secs); + var value:Float = (u.name == 'second') ? Math.round(remaining * factor) / factor : Math.floor(remaining / u.secs); - if (u.name != "second") remaining %= u.secs; + if (u.name != 'second') remaining %= u.secs; - if (value > 0 || (u.name == "second" && parts.length == 0)) parts.push('${value} ${u.name}${value == 1 ? "" : "s"}'); + if (value > 0 || (u.name == 'second' && parts.length == 0)) parts.push('${value} ${u.name}${value == 1 ? "" : "s"}'); } - return parts.join(" "); + return parts.join(' '); } } diff --git a/source/cpp/vm/tracy/TracyProfiler.hx b/source/cpp/vm/tracy/TracyProfiler.hx index 4dc91c166..3b1b3728a 100644 --- a/source/cpp/vm/tracy/TracyProfiler.hx +++ b/source/cpp/vm/tracy/TracyProfiler.hx @@ -6,7 +6,7 @@ package cpp.vm.tracy; #if (!HXCPP_TRACY) -#error "This class cannot be used without -D HXCPP_TRACY" +#error 'This class cannot be used without -D HXCPP_TRACY' #end enum abstract PlotFormatType(cpp.UInt8) from cpp.UInt8 to cpp.UInt8 { diff --git a/source/funkin/Conductor.hx b/source/funkin/Conductor.hx index 23701c4a4..af190bb0b 100644 --- a/source/funkin/Conductor.hx +++ b/source/funkin/Conductor.hx @@ -362,7 +362,7 @@ class Conductor static function get_instance():Conductor { if (Conductor._instance == null) set_instance(new Conductor()); - if (Conductor._instance == null) throw "Could not initialize singleton Conductor!"; + if (Conductor._instance == null) throw 'Could not initialize singleton Conductor!'; return Conductor._instance; } @@ -849,7 +849,7 @@ class Conductor * @param type The type of length to return. Either "step", "beat", or "measure" works, along with their first character. * @return The length of a step/beat/measure in milliseconds. */ - public function getTypeLengthAtMs(ms:Float, type:String = "beat"):Float + public function getTypeLengthAtMs(ms:Float, type:String = 'beat'):Float { if (timeChanges.length == 0) return 0; var wantedTimeChange:SongTimeChange = timeChanges[0]; @@ -868,11 +868,11 @@ class Conductor var wantedBeatLengthMs:Float = ((Constants.SECS_PER_MIN / wantedTimeChange.bpm) * Constants.MS_PER_SEC) * (4 / wantedTimeChange.timeSignatureDen); return switch (type.toLowerCase()) { - case "measure", "m": + case 'measure', 'm': wantedBeatLengthMs * wantedTimeChange.timeSignatureNum; - case "beat", "b": + case 'beat', 'b': wantedBeatLengthMs; - case "step", "s": + case 'step', 's': wantedBeatLengthMs / Constants.STEPS_PER_BEAT; default: wantedBeatLengthMs; diff --git a/source/funkin/FunkinMemory.hx b/source/funkin/FunkinMemory.hx index 42d032c9c..23c6d8f61 100644 --- a/source/funkin/FunkinMemory.hx +++ b/source/funkin/FunkinMemory.hx @@ -23,7 +23,7 @@ class FunkinMemory static var permanentCachedSounds:Map = []; static var currentCachedSounds:Map = []; static var previousCachedSounds:Map = []; - static var purgeFilter:Array = ["/week", "/characters", "/charSelect", "/results"]; + static var purgeFilter:Array = ['/week', '/characters', '/charSelect', '/results']; /** * Caches textures that are always required. @@ -34,42 +34,42 @@ class FunkinMemory for (file in allImages) { - if (!(file.endsWith(".png") #if FEATURE_COMPRESSED_TEXTURES || file.endsWith(".astc") #end) - || file.contains("chart-editor") - || !file.contains("ui/")) + if (!(file.endsWith('.png') #if FEATURE_COMPRESSED_TEXTURES || file.endsWith('.astc') #end) + || file.contains('chart-editor') + || !file.contains('ui/')) { continue; } - file = file.replace(" ", ""); // Handle stray spaces. + file = file.replace(' ', ''); // Handle stray spaces. - if (file.contains("shared") || Assets.exists('shared:$file', AssetType.IMAGE)) + if (file.contains('shared') || Assets.exists('shared:$file', AssetType.IMAGE)) { file = 'shared:$file'; } permanentCacheTexture(file); } - permanentCacheTexture(Paths.image("healthBar")); - permanentCacheTexture(Paths.image("menuDesat")); - permanentCacheTexture(Paths.image("notes", "shared")); - permanentCacheTexture(Paths.image("noteSplashes", "shared")); - permanentCacheTexture(Paths.image("noteStrumline", "shared")); - permanentCacheTexture(Paths.image("NOTE_hold_assets")); + permanentCacheTexture(Paths.image('healthBar')); + permanentCacheTexture(Paths.image('menuDesat')); + permanentCacheTexture(Paths.image('notes', 'shared')); + permanentCacheTexture(Paths.image('noteSplashes', 'shared')); + permanentCacheTexture(Paths.image('noteStrumline', 'shared')); + permanentCacheTexture(Paths.image('NOTE_hold_assets')); // dude - permanentCacheTexture(Paths.image("fonts/bold", null)); - permanentCacheTexture(Paths.image("fonts/default", null)); - permanentCacheTexture(Paths.image("fonts/freeplay-clear", null)); + permanentCacheTexture(Paths.image('fonts/bold', null)); + permanentCacheTexture(Paths.image('fonts/default', null)); + permanentCacheTexture(Paths.image('fonts/freeplay-clear', null)); var allSounds:Array = Assets.list(AssetType.SOUND); for (file in allSounds) { - if (!file.endsWith(".ogg") || !file.contains("countdown/")) continue; + if (!file.endsWith('.ogg') || !file.contains('countdown/')) continue; - file = file.replace(" ", ""); + file = file.replace(' ', ''); - if (file.contains("shared") || Assets.exists('shared:$file', AssetType.SOUND)) + if (file.contains('shared') || Assets.exists('shared:$file', AssetType.SOUND)) { file = 'shared:$file'; } @@ -77,19 +77,19 @@ class FunkinMemory permanentCacheSound(file); } - permanentCacheSound(Paths.sound("cancelMenu")); - permanentCacheSound(Paths.sound("confirmMenu")); - permanentCacheSound(Paths.sound("screenshot")); - permanentCacheSound(Paths.sound("scrollMenu")); - permanentCacheSound(Paths.sound("soundtray/Voldown")); - permanentCacheSound(Paths.sound("soundtray/VolMAX")); - permanentCacheSound(Paths.sound("soundtray/Volup")); - permanentCacheSound(Paths.music("freakyMenu/freakyMenu")); - permanentCacheSound(Paths.music("offsetsLoop/offsetsLoop")); - permanentCacheSound(Paths.music("offsetsLoop/drumsLoop")); - permanentCacheSound(Paths.sound("missnote1", "shared")); - permanentCacheSound(Paths.sound("missnote2", "shared")); - permanentCacheSound(Paths.sound("missnote3", "shared")); + permanentCacheSound(Paths.sound('cancelMenu')); + permanentCacheSound(Paths.sound('confirmMenu')); + permanentCacheSound(Paths.sound('screenshot')); + permanentCacheSound(Paths.sound('scrollMenu')); + permanentCacheSound(Paths.sound('soundtray/Voldown')); + permanentCacheSound(Paths.sound('soundtray/VolMAX')); + permanentCacheSound(Paths.sound('soundtray/Volup')); + permanentCacheSound(Paths.music('freakyMenu/freakyMenu')); + permanentCacheSound(Paths.music('offsetsLoop/offsetsLoop')); + permanentCacheSound(Paths.music('offsetsLoop/drumsLoop')); + permanentCacheSound(Paths.sound('missnote1', 'shared')); + permanentCacheSound(Paths.sound('missnote2', 'shared')); + permanentCacheSound(Paths.sound('missnote3', 'shared')); } /** @@ -173,7 +173,7 @@ class FunkinMemory /** * Prepares the cache for purging unused textures. */ - public inline static function preparePurgeTextureCache():Void + public static inline function preparePurgeTextureCache():Void { previousCachedTextures = currentCachedTextures.copy(); @@ -201,7 +201,7 @@ class FunkinMemory continue; } - if (graphicKey.contains("fonts")) continue; + if (graphicKey.contains('fonts')) continue; var graphic:Null = previousCachedTextures.get(graphicKey); if (graphic != null) @@ -225,7 +225,7 @@ class FunkinMemory { var obj:Null = FlxG.bitmap.get(key); - if (obj == null || (obj.persist && permanentCachedTextures.exists(key)) || key.contains("fonts")) + if (obj == null || (obj.persist && permanentCachedTextures.exists(key)) || key.contains('fonts')) { continue; } @@ -249,7 +249,7 @@ class FunkinMemory * Forces the GPU to load and upload a FlxGraphic. * @param graphic The graphic to force render. */ - private static function forceRender(graphic:FlxGraphic):Void + static function forceRender(graphic:FlxGraphic):Void { if (graphic == null) return; @@ -284,30 +284,30 @@ class FunkinMemory public static function cacheNoteStyle(style:NoteStyle):Void { // TODO: Texture paths should fall back to the default values. - cacheTexture(Paths.image(style.getNoteAssetPath() ?? "note")); - cacheTexture(style.getHoldNoteAssetPath() ?? "noteHold"); - cacheTexture(Paths.image(style.getStrumlineAssetPath() ?? "strumline")); - cacheTexture(Paths.image(style.getSplashAssetPath() ?? "noteSplash")); + cacheTexture(Paths.image(style.getNoteAssetPath() ?? 'note')); + cacheTexture(style.getHoldNoteAssetPath() ?? 'noteHold'); + cacheTexture(Paths.image(style.getStrumlineAssetPath() ?? 'strumline')); + cacheTexture(Paths.image(style.getSplashAssetPath() ?? 'noteSplash')); - cacheTexture(Paths.image(style.getHoldCoverDirectionAssetPath(LEFT) ?? "LEFT")); - cacheTexture(Paths.image(style.getHoldCoverDirectionAssetPath(RIGHT) ?? "RIGHT")); - cacheTexture(Paths.image(style.getHoldCoverDirectionAssetPath(UP) ?? "UP")); - cacheTexture(Paths.image(style.getHoldCoverDirectionAssetPath(DOWN) ?? "DOWN")); + cacheTexture(Paths.image(style.getHoldCoverDirectionAssetPath(LEFT) ?? 'LEFT')); + cacheTexture(Paths.image(style.getHoldCoverDirectionAssetPath(RIGHT) ?? 'RIGHT')); + cacheTexture(Paths.image(style.getHoldCoverDirectionAssetPath(UP) ?? 'UP')); + cacheTexture(Paths.image(style.getHoldCoverDirectionAssetPath(DOWN) ?? 'DOWN')); // cacheTexture(Paths.image(style.buildCountdownSpritePath(THREE) ?? "THREE")); - cacheTexture(Paths.image(style.buildCountdownSpritePath(TWO) ?? "TWO")); - cacheTexture(Paths.image(style.buildCountdownSpritePath(ONE) ?? "ONE")); - cacheTexture(Paths.image(style.buildCountdownSpritePath(GO) ?? "GO")); + cacheTexture(Paths.image(style.buildCountdownSpritePath(TWO) ?? 'TWO')); + cacheTexture(Paths.image(style.buildCountdownSpritePath(ONE) ?? 'ONE')); + cacheTexture(Paths.image(style.buildCountdownSpritePath(GO) ?? 'GO')); - cacheSound(style.getCountdownSoundPath(THREE) ?? "THREE"); - cacheSound(style.getCountdownSoundPath(TWO) ?? "TWO"); - cacheSound(style.getCountdownSoundPath(ONE) ?? "ONE"); - cacheSound(style.getCountdownSoundPath(GO) ?? "GO"); + cacheSound(style.getCountdownSoundPath(THREE) ?? 'THREE'); + cacheSound(style.getCountdownSoundPath(TWO) ?? 'TWO'); + cacheSound(style.getCountdownSoundPath(ONE) ?? 'ONE'); + cacheSound(style.getCountdownSoundPath(GO) ?? 'GO'); - cacheTexture(Paths.image(style.buildJudgementSpritePath("sick") ?? 'sick')); - cacheTexture(Paths.image(style.buildJudgementSpritePath("good") ?? 'good')); - cacheTexture(Paths.image(style.buildJudgementSpritePath("bad") ?? 'bad')); - cacheTexture(Paths.image(style.buildJudgementSpritePath("shit") ?? 'shit')); + cacheTexture(Paths.image(style.buildJudgementSpritePath('sick') ?? 'sick')); + cacheTexture(Paths.image(style.buildJudgementSpritePath('good') ?? 'good')); + cacheTexture(Paths.image(style.buildJudgementSpritePath('bad') ?? 'bad')); + cacheTexture(Paths.image(style.buildJudgementSpritePath('shit') ?? 'shit')); cacheTexture(Paths.image(style.buildComboNumSpritePath(0) ?? '0')); cacheTexture(Paths.image(style.buildComboNumSpritePath(1) ?? '1')); @@ -400,10 +400,10 @@ class FunkinMemory previousCachedSounds.remove(key); } } - Assets.cache.clear("songs"); - Assets.cache.clear("music"); + Assets.cache.clear('songs'); + Assets.cache.clear('music'); // Felt lazy. - var key = Paths.music("freakyMenu/freakyMenu"); + var key = Paths.music('freakyMenu/freakyMenu'); var sound:Null = Assets.getSound(key, true); if (sound != null) { @@ -424,8 +424,8 @@ class FunkinMemory @:privateAccess for (key in FlxG.bitmap._cache.keys()) { - if (!key.contains("freeplay")) continue; - if (permanentCachedTextures.exists(key) || key.contains("fonts")) continue; + if (!key.contains('freeplay')) continue; + if (permanentCachedTextures.exists(key) || key.contains('fonts')) continue; keysToRemove.push(key); } @@ -458,8 +458,8 @@ class FunkinMemory @:privateAccess for (key in FlxG.bitmap._cache.keys()) { - if (!key.contains("stickers")) continue; - if (permanentCachedTextures.exists(key) || key.contains("fonts")) continue; + if (!key.contains('stickers')) continue; + if (permanentCachedTextures.exists(key) || key.contains('fonts')) continue; keysToRemove.push(key); } @@ -483,7 +483,7 @@ class FunkinMemory * Sends a trace with fancy ANSI colors. * @param message The message to log. */ - private static function log(message:String):Void + static function log(message:String):Void { trace(' MEMORY '.bg_bright_lilac().bold() + ' ${message}'); } diff --git a/source/funkin/Paths.hx b/source/funkin/Paths.hx index cddc1ea09..7aca56972 100644 --- a/source/funkin/Paths.hx +++ b/source/funkin/Paths.hx @@ -107,7 +107,7 @@ class Paths implements ConsoleClass return getPath('data/$key.json', TEXT, library); } - public static function srt(key:String, ?library:String, ?directory:String = "data/"):String + public static function srt(key:String, ?library:String, ?directory:String = 'data/'):String { return getPath('$directory$key.srt', TEXT, library); } @@ -181,10 +181,10 @@ class Paths implements ConsoleClass public static function getAnimateAtlas(key:String, ?library:String, settings:AtlasSpriteSettings):FlxAnimateFrames { - var assetLibrary:String = library ?? ""; - var graphicKey:String = ""; + var assetLibrary:String = library ?? ''; + var graphicKey:String = ''; - if (assetLibrary != "") + if (assetLibrary != '') { graphicKey = Paths.animateAtlas(key, assetLibrary); } @@ -229,8 +229,8 @@ class Paths implements ConsoleClass enum abstract PathsFunction(String) { - var MUSIC; - var INST; - var VOICES; - var SOUND; + public var MUSIC; + public var INST; + public var VOICES; + public var SOUND; } diff --git a/source/funkin/Preferences.hx b/source/funkin/Preferences.hx index 19d0912d8..f153d5252 100644 --- a/source/funkin/Preferences.hx +++ b/source/funkin/Preferences.hx @@ -215,13 +215,13 @@ class Preferences static function get_hapticsMode():HapticsMode { - var value = Save?.instance?.options?.hapticsMode ?? "All"; + var value = Save?.instance?.options?.hapticsMode ?? 'All'; return switch (value) { - case "None": + case 'None': HapticsMode.NONE; - case "Notes Only": + case 'Notes Only': HapticsMode.NOTES_ONLY; default: HapticsMode.ALL; @@ -235,11 +235,11 @@ class Preferences switch (value) { case HapticsMode.NONE: - string = "None"; + string = 'None'; case HapticsMode.NOTES_ONLY: - string = "Notes Only"; + string = 'Notes Only'; default: - string = "All"; + string = 'All'; }; var save:Save = Save.instance; @@ -347,15 +347,15 @@ class Preferences #if (mobile || web) return lime.ui.WindowVSyncMode.OFF; #else - var value = Save?.instance?.options?.vsyncMode ?? "Off"; + var value = Save?.instance?.options?.vsyncMode ?? 'Off'; return switch (value) { - case "Off": + case 'Off': lime.ui.WindowVSyncMode.OFF; - case "On": + case 'On': lime.ui.WindowVSyncMode.ON; - case "Adaptive": + case 'Adaptive': lime.ui.WindowVSyncMode.ADAPTIVE; default: lime.ui.WindowVSyncMode.OFF; @@ -373,13 +373,13 @@ class Preferences switch (value) { case lime.ui.WindowVSyncMode.OFF: - string = "Off"; + string = 'Off'; case lime.ui.WindowVSyncMode.ON: - string = "On"; + string = 'On'; case lime.ui.WindowVSyncMode.ADAPTIVE: - string = "Adaptive"; + string = 'Adaptive'; default: - string = "Off"; + string = 'Off'; }; WindowUtil.setVSyncMode(value); diff --git a/source/funkin/api/newgrounds/Leaderboards.hx b/source/funkin/api/newgrounds/Leaderboards.hx index d4eeb8a30..fc75bd865 100644 --- a/source/funkin/api/newgrounds/Leaderboards.hx +++ b/source/funkin/api/newgrounds/Leaderboards.hx @@ -331,21 +331,21 @@ enum abstract Leaderboard(Int) from Int to Int { switch (levelId) { - case "week1": + case 'week1': return StoryWeek1; - case "week2": + case 'week2': return StoryWeek2; - case "week3": + case 'week3': return StoryWeek3; - case "week4": + case 'week4': return StoryWeek4; - case "week5": + case 'week5': return StoryWeek5; - case "week6": + case 'week6': return StoryWeek6; - case "week7": + case 'week7': return StoryWeek7; - case "weekend1": + case 'weekend1': return StoryWeekend1; // Collab 1 has only one song. default: @@ -371,153 +371,153 @@ enum abstract Leaderboard(Int) from Int to Int } else if (Constants.DEFAULT_DIFFICULTY_LIST_ERECT.contains(difficulty)) { - variation = "erect"; + variation = 'erect'; } switch (variation) { - case "pico": + case 'pico': switch (songId) { - case "bopeebo": + case 'bopeebo': return BopeeboPicoMix; - case "fresh": + case 'fresh': return FreshPicoMix; - case "dadbattle": + case 'dadbattle': return DadBattlePicoMix; - case "spookeez": + case 'spookeez': return SpookeezPicoMix; - case "south": + case 'south': return SouthPicoMix; - case "pico": + case 'pico': return PicoPicoMix; - case "philly-nice": + case 'philly-nice': return PhillyNicePicoMix; - case "blammed": + case 'blammed': return BlammedPicoMix; - case "cocoa": + case 'cocoa': return CocoaPicoMix; - case "eggnog": + case 'eggnog': return EggnogPicoMix; - case "senpai": + case 'senpai': return SenpaiPicoMix; - case "roses": + case 'roses': return RosesPicoMix; - case "ugh": + case 'ugh': return UghPicoMix; - case "guns": + case 'guns': return GunsPicoMix; - case "stress": + case 'stress': return StressPicoMix; default: return Unknown; } - case "bf": + case 'bf': switch (songId) { - case "darnell": + case 'darnell': return DarnellBFMix; - case "lit-up": + case 'lit-up': return LitUpBFMix; default: return Unknown; } - case "erect": + case 'erect': switch (songId) { - case "bopeebo": + case 'bopeebo': return BopeeboErect; - case "fresh": + case 'fresh': return FreshErect; - case "dadbattle": + case 'dadbattle': return DadBattleErect; - case "spookeez": + case 'spookeez': return SpookeezErect; - case "south": + case 'south': return SouthErect; - case "pico": + case 'pico': return PicoErect; - case "philly-nice": + case 'philly-nice': return PhillyNiceErect; - case "blammed": + case 'blammed': return BlammedErect; - case "satin-panties": + case 'satin-panties': return SatinPantiesErect; - case "high": + case 'high': return HighErect; - case "cocoa": + case 'cocoa': return CocoaErect; - case "eggnog": + case 'eggnog': return EggnogErect; - case "senpai": + case 'senpai': return SenpaiErect; - case "roses": + case 'roses': return RosesErect; - case "thorns": + case 'thorns': return ThornsErect; - case "ugh": + case 'ugh': return UghErect; - case "darnell": + case 'darnell': return DarnellErect; default: return Unknown; } - case "default": + case 'default': switch (songId) { - case "tutorial": + case 'tutorial': return Tutorial; - case "bopeebo": + case 'bopeebo': return Bopeebo; - case "fresh": + case 'fresh': return Fresh; - case "dadbattle": + case 'dadbattle': return DadBattle; - case "spookeez": + case 'spookeez': return Spookeez; - case "south": + case 'south': return South; - case "monster": + case 'monster': return Monster; - case "pico": + case 'pico': return Pico; - case "philly-nice": + case 'philly-nice': return PhillyNice; - case "blammed": + case 'blammed': return Blammed; - case "satin-panties": + case 'satin-panties': return SatinPanties; - case "high": + case 'high': return High; - case "milf": + case 'milf': return MILF; - case "cocoa": + case 'cocoa': return Cocoa; - case "eggnog": + case 'eggnog': return Eggnog; - case "winter-horrorland": + case 'winter-horrorland': return WinterHorrorland; - case "senpai": + case 'senpai': return Senpai; - case "roses": + case 'roses': return Roses; - case "thorns": + case 'thorns': return Thorns; - case "ugh": + case 'ugh': return Ugh; - case "guns": + case 'guns': return Guns; - case "stress": + case 'stress': return Stress; - case "darnell": + case 'darnell': return Darnell; - case "lit-up": + case 'lit-up': return LitUp; - case "2hot": + case '2hot': return TwoHot; - case "blazin": + case 'blazin': return Blazin; - case "spaghetti": + case 'spaghetti': return Spaghetti; default: return Unknown; diff --git a/source/funkin/audio/waveform/WaveformDataParser.hx b/source/funkin/audio/waveform/WaveformDataParser.hx index c668d104e..26388e140 100644 --- a/source/funkin/audio/waveform/WaveformDataParser.hx +++ b/source/funkin/audio/waveform/WaveformDataParser.hx @@ -3,13 +3,13 @@ package funkin.audio.waveform; @:nullSafety class WaveformDataParser { - @:native("int16_max") + @:native('int16_max') static final INT16_MAX:Int = 32767; - @:native("int16_min") + @:native('int16_min') static final INT16_MIN:Int = -32768; - @:native("int8_max") + @:native('int8_max') static final INT8_MAX:Int = 127; - @:native("int8_min") + @:native('int8_min') static final INT8_MIN:Int = -128; public static function interpretFlxSound(sound:Null):Null diff --git a/source/funkin/data/DataParse.hx b/source/funkin/data/DataParse.hx index ef5c0ef9e..c249ae94c 100644 --- a/source/funkin/data/DataParse.hx +++ b/source/funkin/data/DataParse.hx @@ -34,7 +34,7 @@ class DataParse switch (json.value) { case JString(s): - if (s == "") throw 'Expected property $name to be non-empty.'; + if (s == '') throw 'Expected property $name to be non-empty.'; return s; default: throw 'Expected property $name to be a string, but it was ${json.value}.'; @@ -52,7 +52,7 @@ class DataParse switch (json.value) { case JString(s): - if (s == "") throw 'Expected version property $name to be non-empty.'; + if (s == '') throw 'Expected version property $name to be non-empty.'; return s; default: throw 'Expected version property $name to be a string, but it was ${json.value}.'; @@ -70,7 +70,7 @@ class DataParse switch (json.value) { case JString(s): - if (s == "") throw 'Expected version rule property $name to be non-empty.'; + if (s == '') throw 'Expected version rule property $name to be non-empty.'; return s; default: throw 'Expected version rule property $name to be a string, but it was ${json.value}.'; diff --git a/source/funkin/data/animation/AnimationData.hx b/source/funkin/data/animation/AnimationData.hx index 84310284f..aa2601007 100644 --- a/source/funkin/data/animation/AnimationData.hx +++ b/source/funkin/data/animation/AnimationData.hx @@ -3,7 +3,7 @@ package funkin.data.animation; @:nullSafety class AnimationDataUtil { - public static function toNamed(data:UnnamedAnimationData, name:String = ""):AnimationData + public static function toNamed(data:UnnamedAnimationData, name:String = ''):AnimationData { return { name: name, @@ -23,7 +23,7 @@ class AnimationDataUtil * @param name (adds index to name) * @return Array */ - public static function toNamedArray(data:Array, name:String = ""):Array + public static function toNamedArray(data:Array, name:String = ''):Array { return data.mapi(function(animItem, ind) return toNamed(animItem, '$name$ind')); } @@ -138,7 +138,7 @@ typedef UnnamedAnimationData = * Only available for texture atlases. * Options: "framelabel", "symbol" */ - @:default("framelabel") @:optional + @:default('framelabel') @:optional var animType:String; /** @@ -146,7 +146,7 @@ typedef UnnamedAnimationData = * Only available for multi-sparrow and multi-animateatlas characters. * Options: "sparrow", "animateatlas" */ - @:default("") @:optional + @:default('') @:optional var renderType:String; /** diff --git a/source/funkin/data/character/CharacterData.hx b/source/funkin/data/character/CharacterData.hx index 1fcb34921..651838b81 100644 --- a/source/funkin/data/character/CharacterData.hx +++ b/source/funkin/data/character/CharacterData.hx @@ -322,11 +322,11 @@ class CharacterDataParser */ public static function getCharPixelIconAsset(char:String):Null { - var charPath:String = "freeplay/icons/"; + var charPath:String = 'freeplay/icons/'; - final charIDParts:Array = char.split("-"); - var iconName:String = ""; - var lastValidIconName:String = ""; + final charIDParts:Array = char.split('-'); + var iconName:String = ''; + var lastValidIconName:String = ''; for (i in 0...charIDParts.length) { iconName += charIDParts[i]; @@ -465,7 +465,7 @@ class CharacterDataParser public static final DEFAULT_SCROLL:Array = [0, 0]; 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_ANIMTYPE:String = 'framelabel'; public static final DEFAULT_ATLASSETTINGS:funkin.data.stage.StageData.TextureAtlasData = { swfMode: true, cacheOnLoad: false, diff --git a/source/funkin/data/dialogue/ConversationRegistry.hx b/source/funkin/data/dialogue/ConversationRegistry.hx index 7cbdd9b5a..87eea097b 100644 --- a/source/funkin/data/dialogue/ConversationRegistry.hx +++ b/source/funkin/data/dialogue/ConversationRegistry.hx @@ -13,9 +13,9 @@ class ConversationRegistry extends BaseRegistry; @:optional @:default(false) var applyStageMatrix:Bool; - @:optional @:default("BOYFRIEND") + @:optional @:default('BOYFRIEND') var text1:String; - @:optional @:default("HOT BLOODED IN MORE WAYS THAN ONE") + @:optional @:default('HOT BLOODED IN MORE WAYS THAN ONE') var text2:String; - @:optional @:default("PROTECT YO NUTS") + @:optional @:default('PROTECT YO NUTS') var text3:String; @:jignored var animationMap:Map; @@ -117,9 +117,9 @@ class PlayerFreeplayDJData @:optional public var atlasSettings:funkin.data.stage.StageData.TextureAtlasData; - @:optional @:default("animateatlas") + @:optional @:default('animateatlas') public var renderType:Null; - @:optional @:default("") + @:optional @:default('') public var scriptClass:Null; @:optional @:default(false) public var useAnimatePosition:Bool; @@ -331,7 +331,7 @@ typedef PlayerResultsAnimationData = var scriptClass:Null; @:optional @:default([0, 0]) var offsets:Array; - @:optional @:default("both") + @:optional @:default('both') var filter:String; @:optional @:default(500) var zIndex:Int; diff --git a/source/funkin/data/notestyle/NoteStyleRegistry.hx b/source/funkin/data/notestyle/NoteStyleRegistry.hx index 243de9e55..c60e97719 100644 --- a/source/funkin/data/notestyle/NoteStyleRegistry.hx +++ b/source/funkin/data/notestyle/NoteStyleRegistry.hx @@ -14,9 +14,9 @@ class NoteStyleRegistry extends BaseRegistry|]/g; diff --git a/source/funkin/data/song/importer/OsuManiaImporter.hx b/source/funkin/data/song/importer/OsuManiaImporter.hx index b27bd86cf..3d0a4f2c4 100644 --- a/source/funkin/data/song/importer/OsuManiaImporter.hx +++ b/source/funkin/data/song/importer/OsuManiaImporter.hx @@ -13,16 +13,16 @@ class OsuManiaImporter { public static function parseOsuFile(osuContent:String):OsuManiaData { - var lines:Array = osuContent.split("\n"); + var lines:Array = osuContent.split('\n'); var result:Dynamic = {}; var currentSection:String = null; - var nonCSVLikeSections = ["General", "Editor", "Metadata", "Difficulty"]; + var nonCSVLikeSections = ['General', 'Editor', 'Metadata', 'Difficulty']; for (line in lines) { line = StringTools.trim(line); - if (line == "" || StringTools.startsWith(line, "//")) continue; + if (line == '' || StringTools.startsWith(line, '//')) continue; // Section header like [General] var sectionRegex = ~/^\[(.+)\]$/; @@ -44,9 +44,9 @@ class OsuManiaImporter // Key-value pairs (INI style) if (currentSection != null && nonCSVLikeSections.contains(currentSection)) { - var parts:Array = line.split(":"); + var parts:Array = line.split(':'); var key:String = StringTools.trim(parts.shift()); - var value:Any = parseValue(StringTools.trim(parts.join(":"))); + var value:Any = parseValue(StringTools.trim(parts.join(':'))); if (Reflect.field(result, currentSection) == null) Reflect.setField(result, currentSection, { }); Reflect.setField(Reflect.field(result, currentSection), key, value); @@ -113,7 +113,7 @@ class OsuManiaImporter if (result.length == 0) { result.push(new SongTimeChange(0, Constants.DEFAULT_BPM)); - trace("[WARN] No BPM points found, resulting to default BPM..."); + trace('[WARN] No BPM points found, resulting to default BPM...'); } return result; @@ -169,7 +169,7 @@ class OsuManiaImporter { return timingLines.map(function(line:String):TimingPoint { - var parts = line.split(","); + var parts = line.split(','); var time = Std.parseFloat(parts[0]); var beatLength = Std.parseFloat(parts[1]); var meter = Std.parseInt(parts[2]); @@ -187,7 +187,7 @@ class OsuManiaImporter { return hitObjectsLines.map(function(line:String):ManiaHitObject { - var parts = line.split(","); + var parts = line.split(','); var x:Int = Std.parseInt(parts[0]); var time:Int = Std.parseInt(parts[2]); @@ -195,7 +195,7 @@ class OsuManiaImporter var hasHold:Bool = (type & 128) == 128; var noteD:Int = Std.int(x / (512 / columns)); - var holdEndTime:Null = hasHold ? Std.parseInt(parts[5].split(":")[0]) : null; + var holdEndTime:Null = hasHold ? Std.parseInt(parts[5].split(':')[0]) : null; var holdDuration:Int = (holdEndTime != null) ? (holdEndTime - time) : 0; diff --git a/source/funkin/data/song/importer/StepManiaData.hx b/source/funkin/data/song/importer/StepManiaData.hx index c98f8682f..c9134162c 100644 --- a/source/funkin/data/song/importer/StepManiaData.hx +++ b/source/funkin/data/song/importer/StepManiaData.hx @@ -47,15 +47,15 @@ class StepNote this.column = column; switch (t) { - case "2": + case '2': this.type = StepManiaNoteType.Head; - case "3": + case '3': this.type = StepManiaNoteType.Tail; - case "4": + case '4': this.type = StepManiaNoteType.Roll; - case "M": + case 'M': this.type = StepManiaNoteType.Mine; - case "F": + case 'F': this.type = StepManiaNoteType.Fake; default: this.type = StepManiaNoteType.Tap; @@ -75,9 +75,9 @@ class StepDifficulty { switch (chartTypeStr) { - case "dance-single": + case 'dance-single': return StepManiaChartType.DanceSingle; - case "dance-double": + case 'dance-double': return StepManiaChartType.DanceDouble; default: return StepManiaChartType.Unknown; diff --git a/source/funkin/data/song/importer/StepManiaImporter.hx b/source/funkin/data/song/importer/StepManiaImporter.hx index c9b3fda17..078d4ce56 100644 --- a/source/funkin/data/song/importer/StepManiaImporter.hx +++ b/source/funkin/data/song/importer/StepManiaImporter.hx @@ -22,46 +22,46 @@ enum StepStateEnum class StepManiaImporter { - private static var readDiffMetadata:Map = new Map(); + static var readDiffMetadata:Map = new Map(); static function parseMetadataLine(line:String, result:StepManiaData):StepManiaData { - var parts:Array = line.split(":"); + var parts:Array = line.split(':'); if (parts.length != 2) return result; var key:String = StringTools.trim(parts[0]); var value:String = StringTools.trim(parts[1]); // remove trailing ; on value - if (StringTools.endsWith(value, ";")) value = value.substr(0, value.length - 1); + if (StringTools.endsWith(value, ';')) value = value.substr(0, value.length - 1); switch (key) { - case "TITLE": + case 'TITLE': result.Metadata.Title = value; - case "ARTIST": + case 'ARTIST': result.Metadata.Artist = value; - case "GENRE": + case 'GENRE': result.Metadata.Genre = value; - case "CREDIT": - if (result.Metadata.Credit == "") result.Metadata.Credit = value; + case 'CREDIT': + if (result.Metadata.Credit == '') result.Metadata.Credit = value; else // .ssc - readDiffMetadata.set("CREDIT", value); - case "BANNER": + readDiffMetadata.set('CREDIT', value); + case 'BANNER': result.Metadata.Banner = value; - case "BACKGROUND": + case 'BACKGROUND': result.Metadata.Background = value; - case "OFFSET": + case 'OFFSET': result.Metadata.Offset = Std.parseFloat(value); - case "SAMPLESTART": + case 'SAMPLESTART': result.Metadata.SampleStart = Std.parseFloat(value); // .ssc - case "STEPSTYPE": - readDiffMetadata.set("STEPSTYPE", value); - case "DESCRIPTION": - readDiffMetadata.set("DESCRIPTION", value); - case "DIFFICULTY": - readDiffMetadata.set("DIFFICULTY", value); + case 'STEPSTYPE': + readDiffMetadata.set('STEPSTYPE', value); + case 'DESCRIPTION': + readDiffMetadata.set('DESCRIPTION', value); + case 'DIFFICULTY': + readDiffMetadata.set('DIFFICULTY', value); } return result; @@ -70,22 +70,22 @@ class StepManiaImporter static function parseTimingPointLine(line:String):Array { // Remove #BPMS: prefix if present - if (StringTools.startsWith(line, "#BPMS:")) line = line.substr(6); + if (StringTools.startsWith(line, '#BPMS:')) line = line.substr(6); - var parts:Array = line.split(","); + var parts:Array = line.split(','); var stepTimingPoints:Array = []; for (i in 0...parts.length) { // Split the = - var split = parts[i].split("="); + var split = parts[i].split('='); if (split.length != 2) continue; var beat:Float = Std.parseFloat(StringTools.trim(split[0])); // Check if split[i + 1] has ; and remove it var bpmSplit = split[1]; - if (StringTools.endsWith(bpmSplit, ";")) bpmSplit = bpmSplit.substr(0, bpmSplit.length - 1); + if (StringTools.endsWith(bpmSplit, ';')) bpmSplit = bpmSplit.substr(0, bpmSplit.length - 1); var tp:StepTimingPoint = new StepTimingPoint(Std.parseFloat(bpmSplit), beat); stepTimingPoints.push(tp); @@ -97,22 +97,22 @@ class StepManiaImporter static function parseStopsLine(line:String):Array { // Remove #STOPS: prefix if present - if (StringTools.startsWith(line, "#STOPS:")) line = line.substr(7); + if (StringTools.startsWith(line, '#STOPS:')) line = line.substr(7); // Same as timing points - var parts:Array = line.split(","); + var parts:Array = line.split(','); var stepStopPoints:Array = []; for (i in 0...parts.length) { // Split the = - var split = parts[i].split("="); + var split = parts[i].split('='); if (split.length != 2) continue; var beat:Float = Std.parseFloat(StringTools.trim(split[0])); // Check if split[i + 1] has ; and remove it var durSplit = split[1]; - if (StringTools.endsWith(durSplit, ";")) durSplit = durSplit.substr(0, durSplit.length - 1); + if (StringTools.endsWith(durSplit, ';')) durSplit = durSplit.substr(0, durSplit.length - 1); var tp:StepStop = new StepStop(beat, Std.parseFloat(durSplit)); stepStopPoints.push(tp); @@ -137,7 +137,7 @@ class StepManiaImporter for (j in 0...lines[i].length) { var char:String = lines[i].charAt(j); - if (char != "0") + if (char != '0') { var stepNote:StepNote = new StepNote(char, beat, j); stepNotes.push(stepNote); @@ -256,11 +256,11 @@ class StepManiaImporter var metaValue = readDiffMetadata.get(metaKey); switch (metaKey) { - case "STEPSTYPE": + case 'STEPSTYPE': workingDiff.type = workingDiff.parseChartType(metaValue); - case "DIFFICULTY": + case 'DIFFICULTY': workingDiff.name = metaValue; - case "CREDIT": + case 'CREDIT': workingDiff.charter = metaValue; // DESCRIPTION is ignored for now } @@ -301,7 +301,7 @@ class StepManiaImporter public static function parseStepManiaFile(stepContent:String):StepManiaData { readDiffMetadata = new Map(); - var lines:Array = stepContent.split("\n"); + var lines:Array = stepContent.split('\n'); var currentMeasure:Int = 0; var measure:Array = []; @@ -312,12 +312,12 @@ class StepManiaImporter var result:StepManiaData = { Metadata: { - Title: "", - Artist: "", - Genre: "", - Credit: "", - Banner: "", - Background: "", + Title: '', + Artist: '', + Genre: '', + Credit: '', + Banner: '', + Background: '', Offset: 0, SampleStart: 0 }, @@ -331,25 +331,25 @@ class StepManiaImporter for (line in lines) { line = StringTools.trim(line); - if (line == "") continue; - if (StringTools.startsWith(line, "//")) continue; // Comment line + if (line == '') continue; + if (StringTools.startsWith(line, '//')) continue; // Comment line switch (state) { case StepStateEnum.Metadata: - if (StringTools.startsWith(line, "#BPMS:")) + if (StringTools.startsWith(line, '#BPMS:')) { state = StepStateEnum.TimingPoints; result = parseBPMS(line, result); - if (StringTools.endsWith(line, ";")) state = StepStateEnum.Metadata; + if (StringTools.endsWith(line, ';')) state = StepStateEnum.Metadata; } - else if (StringTools.startsWith(line, "#STOPS:")) + else if (StringTools.startsWith(line, '#STOPS:')) { state = StepStateEnum.Stops; result = parseStops(line, result); - if (StringTools.endsWith(line, ";")) state = StepStateEnum.Metadata; + if (StringTools.endsWith(line, ';')) state = StepStateEnum.Metadata; } - else if (StringTools.startsWith(line, "#NOTES:")) + else if (StringTools.startsWith(line, '#NOTES:')) { if (workingDiff != null) { @@ -358,7 +358,7 @@ class StepManiaImporter } // Start new difficulty - workingDiff = new StepDifficulty("", "", 0, ""); + workingDiff = new StepDifficulty('', '', 0, ''); workingDiff.notes = []; headerLines = 0; @@ -366,44 +366,44 @@ class StepManiaImporter measure = []; state = StepStateEnum.Notes; } - else if (StringTools.startsWith(line, "#")) result = parseMetadataLine(line.substr(1), result); + else if (StringTools.startsWith(line, '#')) result = parseMetadataLine(line.substr(1), result); case StepStateEnum.TimingPoints: - if (line == ";") state = StepStateEnum.Metadata; + if (line == ';') state = StepStateEnum.Metadata; else { result = parseBPMS(line, result); - if (StringTools.endsWith(line, ";")) state = StepStateEnum.Metadata; + if (StringTools.endsWith(line, ';')) state = StepStateEnum.Metadata; } case StepStateEnum.Stops: - if (line == ";") state = StepStateEnum.Metadata; + if (line == ';') state = StepStateEnum.Metadata; else { result = parseStops(line, result); - if (StringTools.endsWith(line, ";")) state = StepStateEnum.Metadata; + if (StringTools.endsWith(line, ';')) state = StepStateEnum.Metadata; } case StepStateEnum.Notes: - if (line == "#NOTES:") continue; + if (line == '#NOTES:') continue; // remove comments in line (if any) ie, "0000 // some comment" - var commentIndex = line.indexOf("//"); + var commentIndex = line.indexOf('//'); if (commentIndex != -1) line = StringTools.trim(line.substr(0, commentIndex)); - if (StringTools.contains(line, ":")) // header + if (StringTools.contains(line, ':')) // header { switch (headerLines) { case 0: // First line is chart type - var chartTypeStr = StringTools.trim(line).replace(":", ""); + var chartTypeStr = StringTools.trim(line).replace(':', ''); workingDiff.type = workingDiff.parseChartType(chartTypeStr); case 1: // Second line is charter - workingDiff.charter = StringTools.trim(line).replace(":", ""); + workingDiff.charter = StringTools.trim(line).replace(':', ''); case 2: // Third line is difficulty name - workingDiff.name = StringTools.trim(line).replace(":", ""); + workingDiff.name = StringTools.trim(line).replace(':', ''); case 3: // Fourth line is difficulty rating - workingDiff.difficultyRating = Std.parseInt(StringTools.trim(line).replace(":", "")); + workingDiff.difficultyRating = Std.parseInt(StringTools.trim(line).replace(':', '')); // we dont care about the rest lol } headerLines++; @@ -412,7 +412,7 @@ class StepManiaImporter // we're reading StepNote data now // start gathering measures until we hit a , - if (line == "," || line == ";") + if (line == ',' || line == ';') { // end of measure var stepNotesInMeasure = parseMeasure(measure, currentMeasure); @@ -421,7 +421,7 @@ class StepManiaImporter measure = []; currentMeasure++; // end of StepNotes section - if (line == ";") state = StepStateEnum.Metadata; + if (line == ';') state = StepStateEnum.Metadata; } else { @@ -505,7 +505,7 @@ class StepManiaImporter } else { - trace("[WARN] Unknown StepMania chart type when converting notes."); + trace('[WARN] Unknown StepMania chart type when converting notes.'); return result; } @@ -520,8 +520,8 @@ class StepManiaImporter } var snd:SongNoteData = new SongNoteData(time, stepNote.column, 0); - if (stepNote.type == StepManiaNoteType.Mine) snd.kind = "mine"; - else if (stepNote.type == StepManiaNoteType.Fake) snd.kind = "fake"; + if (stepNote.type == StepManiaNoteType.Mine) snd.kind = 'mine'; + else if (stepNote.type == StepManiaNoteType.Fake) snd.kind = 'fake'; if (stepNote.type == StepManiaNoteType.Tail) { var length:Float = 0; @@ -569,7 +569,7 @@ class StepManiaImporter { if (diff.type == StepManiaChartType.Unknown) { - trace("[WARN] Skipping unknown StepMania chart type. Name: " + diff.name); + trace('[WARN] Skipping unknown StepMania chart type. Name: ' + diff.name); continue; // skip unknown chart types } difficulties.push(diff.name); @@ -578,7 +578,7 @@ class StepManiaImporter metadata.playData.difficulties = difficulties; - metadata.charter = songData.Metadata.Credit != "" ? songData.Metadata.Credit : null; + metadata.charter = songData.Metadata.Credit != '' ? songData.Metadata.Credit : null; // TimeChanges metadata.timeChanges = []; @@ -606,7 +606,7 @@ class StepManiaImporter { if (diff.type == StepManiaChartType.Unknown) { - trace("[WARN] Skipping unknown StepMania chart type. Name: " + diff.name); + trace('[WARN] Skipping unknown StepMania chart type. Name: ' + diff.name); continue; // skip unknown chart types } scrollsMap.set(diff.name, Constants.DEFAULT_SCROLLSPEED); diff --git a/source/funkin/data/stage/StageData.hx b/source/funkin/data/stage/StageData.hx index a9dad3d98..da93b048f 100644 --- a/source/funkin/data/stage/StageData.hx +++ b/source/funkin/data/stage/StageData.hx @@ -17,7 +17,7 @@ class StageData public var characters:StageDataCharacters; @:default(1.0) @:optional public var cameraZoom:Null; - @:default("shared") @:optional + @:default('shared') @:optional public var directory:Null; public function new() @@ -181,7 +181,7 @@ typedef StageDataProp = * Options: "sparrow", "packer", "animateatlas" * @default "sparrow" */ - @:default("sparrow") @:optional + @:default('sparrow') @:optional var animType:String; /** @@ -196,7 +196,7 @@ typedef StageDataProp = * Just like in photoshop. * @default Nothing. */ - @:default("") @:optional + @:default('') @:optional var blend:String; /** @@ -204,7 +204,7 @@ typedef StageDataProp = * White overlays, or the ones with the value #FFFFFF, do not appear. * @default `#FFFFFF` */ - @:default("#FFFFFF") @:optional + @:default('#FFFFFF') @:optional var color:String; /** diff --git a/source/funkin/data/stage/StageRegistry.hx b/source/funkin/data/stage/StageRegistry.hx index 954e2dd57..3fd913ae6 100644 --- a/source/funkin/data/stage/StageRegistry.hx +++ b/source/funkin/data/stage/StageRegistry.hx @@ -13,9 +13,9 @@ class StageRegistry extends BaseRegistry imp * Handle breaking changes by incrementing this value * and adding migration to the `migrateStageData()` function. */ - public static final STAGE_DATA_VERSION:thx.semver.Version = "1.0.2"; + public static final STAGE_DATA_VERSION:thx.semver.Version = '1.0.2'; - public static final STAGE_DATA_VERSION_RULE:thx.semver.VersionRule = ">=1.0.0 <1.1.0"; + public static final STAGE_DATA_VERSION_RULE:thx.semver.VersionRule = '>=1.0.0 <1.1.0'; public function new() { diff --git a/source/funkin/external/android/CallbackUtil.hx b/source/funkin/external/android/CallbackUtil.hx index 999bb91f3..edc83c799 100644 --- a/source/funkin/external/android/CallbackUtil.hx +++ b/source/funkin/external/android/CallbackUtil.hx @@ -8,7 +8,7 @@ import haxe.ds.Map; /** * A Utility class to handle Android API level callbacks and events. */ -class CallbackUtil #if (lime >= "8.0.0") implements JNISafety #end +class CallbackUtil #if (lime >= '8.0.0') implements JNISafety #end { /** * The result code for `DATA_FOLDER_CLOSED` activity. @@ -71,7 +71,7 @@ class CallbackUtil #if (lime >= "8.0.0") implements JNISafety #end @:noCompletion @:keep - #if (lime >= "8.0.0") + #if (lime >= '8.0.0') @:runOnMainThread #end private function dispatchCallback(callbackName:String, arguments:Array) @@ -82,7 +82,7 @@ class CallbackUtil #if (lime >= "8.0.0") implements JNISafety #end if (!__callbacksFields.exists(callbackName)) { - __callbacksFields.set(callbackName, Reflect.field(field, "dispatch")); + __callbacksFields.set(callbackName, Reflect.field(field, 'dispatch')); } Reflect.callMethod(field, __callbacksFields.get(callbackName), arguments); } diff --git a/source/funkin/graphics/shaders/GaussianBlurShader.hx b/source/funkin/graphics/shaders/GaussianBlurShader.hx index 570e1cbdb..2fd8d53db 100644 --- a/source/funkin/graphics/shaders/GaussianBlurShader.hx +++ b/source/funkin/graphics/shaders/GaussianBlurShader.hx @@ -12,13 +12,13 @@ class GaussianBlurShader extends FlxRuntimeShader public function new(amount:Float = 1.0) { - super(Assets.getText(Paths.frag("gaussianBlur"))); + super(Assets.getText(Paths.frag('gaussianBlur'))); setAmount(amount); } public function setAmount(value:Float):Void { this.amount = value; - this.setFloat("_amount", amount); + this.setFloat('_amount', amount); } } diff --git a/source/funkin/graphics/shaders/Grayscale.hx b/source/funkin/graphics/shaders/Grayscale.hx index afd3c2124..3a29dfc7e 100644 --- a/source/funkin/graphics/shaders/Grayscale.hx +++ b/source/funkin/graphics/shaders/Grayscale.hx @@ -9,13 +9,13 @@ class Grayscale extends FlxRuntimeShader public function new(amount:Float = 1) { - super(Assets.getText(Paths.frag("grayscale"))); + super(Assets.getText(Paths.frag('grayscale'))); setAmount(amount); } public function setAmount(value:Float):Void { amount = value; - this.setFloat("_amount", amount); + this.setFloat('_amount', amount); } } diff --git a/source/funkin/graphics/shaders/InverseDotsShader.hx b/source/funkin/graphics/shaders/InverseDotsShader.hx index 79cb1bc6b..4297619f1 100644 --- a/source/funkin/graphics/shaders/InverseDotsShader.hx +++ b/source/funkin/graphics/shaders/InverseDotsShader.hx @@ -12,13 +12,13 @@ class InverseDotsShader extends FlxRuntimeShader public function new(amount:Float = 1.0) { - super(Assets.getText(Paths.frag("InverseDots"))); + super(Assets.getText(Paths.frag('InverseDots'))); setAmount(amount); } public function setAmount(value:Float):Void { this.amount = value; - this.setFloat("_amount", amount); + this.setFloat('_amount', amount); } } diff --git a/source/funkin/graphics/shaders/LeftMaskShader.hx b/source/funkin/graphics/shaders/LeftMaskShader.hx index 872f0a1d0..8c46a3a9d 100644 --- a/source/funkin/graphics/shaders/LeftMaskShader.hx +++ b/source/funkin/graphics/shaders/LeftMaskShader.hx @@ -25,7 +25,7 @@ class LeftMaskShader extends FlxShader function set_frameUV(uv:FlxRect):FlxRect { - trace("SETTING FRAMEUV"); + trace('SETTING FRAMEUV'); trace(uv); uvFrameX.value[0] = uv.left; diff --git a/source/funkin/graphics/shaders/MosaicEffect.hx b/source/funkin/graphics/shaders/MosaicEffect.hx index 451535aec..43c859c5d 100644 --- a/source/funkin/graphics/shaders/MosaicEffect.hx +++ b/source/funkin/graphics/shaders/MosaicEffect.hx @@ -17,6 +17,6 @@ class MosaicEffect extends FlxRuntimeShader public function setBlockSize(w:Float, h:Float) { blockSize.set(w, h); - setFloatArray("uBlocksize", [w, h]); + setFloatArray('uBlocksize', [w, h]); } } diff --git a/source/funkin/graphics/shaders/RuntimeCustomBlendShader.hx b/source/funkin/graphics/shaders/RuntimeCustomBlendShader.hx index 7b41d6fe0..90c2cbe80 100644 --- a/source/funkin/graphics/shaders/RuntimeCustomBlendShader.hx +++ b/source/funkin/graphics/shaders/RuntimeCustomBlendShader.hx @@ -10,7 +10,7 @@ class RuntimeCustomBlendShader extends RuntimePostEffectShader function set_sourceSwag(value:BitmapData):BitmapData { - this.setBitmapData("sourceSwag", value); + this.setBitmapData('sourceSwag', value); return sourceSwag = value; } @@ -18,7 +18,7 @@ class RuntimeCustomBlendShader extends RuntimePostEffectShader function set_backgroundSwag(value:BitmapData):BitmapData { - this.setBitmapData("backgroundSwag", value); + this.setBitmapData('backgroundSwag', value); return backgroundSwag = value; } @@ -27,12 +27,12 @@ class RuntimeCustomBlendShader extends RuntimePostEffectShader function set_blendSwag(value:BlendMode):BlendMode { - this.setInt("blendMode", cast value); + this.setInt('blendMode', cast value); return blendSwag = value; } public function new() { - super(Assets.getText("assets/shaders/customBlend.frag")); + super(Assets.getText('assets/shaders/customBlend.frag')); } } diff --git a/source/funkin/graphics/shaders/RuntimeRainShader.hx b/source/funkin/graphics/shaders/RuntimeRainShader.hx index a576795e2..b1339baa0 100644 --- a/source/funkin/graphics/shaders/RuntimeRainShader.hx +++ b/source/funkin/graphics/shaders/RuntimeRainShader.hx @@ -96,7 +96,7 @@ class RuntimeRainShader extends RuntimePostEffectShader function set_rainColor(color:FlxColor):FlxColor { - this.setFloatArray("uRainColor", [color.red / 255, color.green / 255, color.blue / 255]); + this.setFloatArray('uRainColor', [color.red / 255, color.green / 255, color.blue / 255]); return rainColor = color; } diff --git a/source/funkin/group/FunkinGroup.hx b/source/funkin/group/FunkinGroup.hx index 014bf0da3..cfadaadeb 100644 --- a/source/funkin/group/FunkinGroup.hx +++ b/source/funkin/group/FunkinGroup.hx @@ -677,7 +677,7 @@ class FunkinGroup extends FlxSprite override public function makeGraphic(Width:Int, Height:Int, Color:Int = FlxColor.WHITE, Unique:Bool = false, ?Key:String):FlxSprite { #if FLX_DEBUG - throw "This function is not supported in FunkinGroup"; + throw 'This function is not supported in FunkinGroup'; #end return this; } @@ -689,7 +689,7 @@ class FunkinGroup extends FlxSprite override public function loadGraphicFromSprite(Sprite:FlxSprite):FlxSprite { #if FLX_DEBUG - throw "This function is not supported in FunkinGroup"; + throw 'This function is not supported in FunkinGroup'; #end return this; } @@ -712,7 +712,7 @@ class FunkinGroup extends FlxSprite AutoBuffer:Bool = false, ?Key:String):FlxSprite { #if FLX_DEBUG - throw "This function is not supported in FunkinGroup"; + throw 'This function is not supported in FunkinGroup'; #end return this; } diff --git a/source/funkin/input/Cursor.hx b/source/funkin/input/Cursor.hx index 3f183a7d6..fa1778312 100644 --- a/source/funkin/input/Cursor.hx +++ b/source/funkin/input/Cursor.hx @@ -48,91 +48,91 @@ class Cursor } public static final CURSOR_DEFAULT_PARAMS:CursorParams = { - graphic: "assets/images/cursor/cursor-default.png", + 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", + 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", + 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", + 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", + 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", + 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", + 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", + 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", + 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", + 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", + 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", + 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", + graphic: 'assets/images/cursor/cursor-scroll.png', scale: 0.2, offsetX: -15, offsetY: -15, @@ -239,14 +239,14 @@ class Cursor } } - private static inline function applyGraphic(graphic:BitmapData, params:CursorParams):Void + static inline function applyGraphic(graphic:BitmapData, params:CursorParams):Void { FlxG.mouse.load(graphic, params.scale, params.offsetX, params.offsetY); } static function onCursorError(cursorMode:CursorMode, error:String):Void { - trace("Failed to load cursor graphic for cursor mode " + cursorMode + ": " + error); + trace('Failed to load cursor graphic for cursor mode ' + cursorMode + ': ' + error); } #if FEATURE_HAXEUI diff --git a/source/funkin/mobile/ui/FunkinBackButton.hx b/source/funkin/mobile/ui/FunkinBackButton.hx index f2c3825c9..26fa8de87 100644 --- a/source/funkin/mobile/ui/FunkinBackButton.hx +++ b/source/funkin/mobile/ui/FunkinBackButton.hx @@ -42,9 +42,9 @@ class FunkinBackButton extends FunkinButton { super(x, y); - frames = Paths.getSparrowAtlas("backButton"); - animation.addByIndices('idle', 'back', [0], "", 24, false); - animation.addByIndices('hold', 'back', [5], "", 24, false); + frames = Paths.getSparrowAtlas('backButton'); + animation.addByIndices('idle', 'back', [0], '', 24, false); + animation.addByIndices('hold', 'back', [5], '', 24, false); animation.addByIndices('confirm', 'back', [ 6, 7, @@ -63,8 +63,8 @@ class FunkinBackButton extends FunkinButton 20, 21, 22 - ], "", 24, false); - animation.play("idle"); + ], '', 24, false); + animation.play('idle'); scale.set(0.7, 0.7); updateHitbox(); diff --git a/source/funkin/mobile/ui/FunkinButton.hx b/source/funkin/mobile/ui/FunkinButton.hx index d010462c9..adad1f173 100644 --- a/source/funkin/mobile/ui/FunkinButton.hx +++ b/source/funkin/mobile/ui/FunkinButton.hx @@ -18,8 +18,8 @@ import haxe.ds.Map; */ enum abstract FunkinButtonStatus(Int) from Int to Int { - var NORMAL = 0; - var PRESSED = 1; + public var NORMAL = 0; + public var PRESSED = 1; } /** @@ -148,7 +148,7 @@ class FunkinButton extends FunkinSprite implements IFlxInput /** * Called by the game state when the state is changed (if this object belongs to the state). */ - public override function destroy():Void + override public function destroy():Void { deadZones = FlxDestroyUtil.destroyArray(deadZones); currentInput = null; @@ -164,7 +164,7 @@ class FunkinButton extends FunkinSprite implements IFlxInput /** * Called by the game loop automatically, handles touch over and click detection. */ - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); @@ -376,7 +376,7 @@ class FunkinButton extends FunkinSprite implements IFlxInput } #if FLX_DEBUG - public override function drawDebugOnCamera(camera:FlxCamera):Void + override public function drawDebugOnCamera(camera:FlxCamera):Void { if (polygon != null && polygon.length >= 6 && polygon.length % 2 == 0) { diff --git a/source/funkin/mobile/ui/FunkinHitbox.hx b/source/funkin/mobile/ui/FunkinHitbox.hx index 1dda6bb9c..67bfce5d9 100644 --- a/source/funkin/mobile/ui/FunkinHitbox.hx +++ b/source/funkin/mobile/ui/FunkinHitbox.hx @@ -171,7 +171,7 @@ class FunkinHint extends FunkinButton hsvShader.hue = hue; } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); @@ -193,7 +193,7 @@ class FunkinHint extends FunkinButton } } - public override function draw():Void + override public function draw():Void { super.draw(); @@ -205,7 +205,7 @@ class FunkinHint extends FunkinButton } #if FLX_DEBUG - public override function drawDebug():Void + override public function drawDebug():Void { super.drawDebug(); @@ -216,7 +216,7 @@ class FunkinHint extends FunkinButton /** * Cleans up memory used by the `FunkinHint`. */ - public override function destroy():Void + override public function destroy():Void { if (alphaTween != null) alphaTween = FlxDestroyUtil.destroy(alphaTween); @@ -248,11 +248,11 @@ class FunkinHint extends FunkinButton enum abstract FunkinHitboxControlSchemes(String) from String to String { - var FourLanes = 'Four Lanes'; - var DoubleThumbTriangle = 'Double Thumb Triangle'; - var DoubleThumbSquare = 'Double Thumb Square'; - var DoubleThumbDPad = 'Double Thumb DPad'; - var Arrows = 'Arrows'; + public var FourLanes = 'Four Lanes'; + public var DoubleThumbTriangle = 'Double Thumb Triangle'; + public var DoubleThumbSquare = 'Double Thumb Square'; + public var DoubleThumbDPad = 'Double Thumb DPad'; + public var Arrows = 'Arrows'; } /** @@ -696,7 +696,7 @@ class FunkinHitbox extends FlxTypedSpriteGroup /** * Cleans up memory used by the `FunkinHitbox`. */ - public override function destroy():Void + override public function destroy():Void { if (trackedInputs != null && trackedInputs.length > 0) ControlsHandler.removeCachedInput(PlayerSettings.player1.controls, trackedInputs); diff --git a/source/funkin/mobile/ui/mainmenu/FunkinOptionsButton.hx b/source/funkin/mobile/ui/mainmenu/FunkinOptionsButton.hx index 32ed28441..cd29d5cda 100644 --- a/source/funkin/mobile/ui/mainmenu/FunkinOptionsButton.hx +++ b/source/funkin/mobile/ui/mainmenu/FunkinOptionsButton.hx @@ -35,9 +35,9 @@ class FunkinOptionsButton extends FunkinButton { super(x, y); - frames = Paths.getSparrowAtlas("mainmenu/optionsButton"); - animation.addByIndices('idle', 'options', [0], "", 24, false); - animation.addByIndices('hold', 'options', [3], "", 24, false); + frames = Paths.getSparrowAtlas('mainmenu/optionsButton'); + animation.addByIndices('idle', 'options', [0], '', 24, false); + animation.addByIndices('hold', 'options', [3], '', 24, false); animation.addByIndices('confirm', 'options', [ 4, 5, @@ -52,8 +52,8 @@ class FunkinOptionsButton extends FunkinButton 14, 15, 16 - ], "", 24, false); - animation.play("idle"); + ], '', 24, false); + animation.play('idle'); scale.set(0.7, 0.7); updateHitbox(); diff --git a/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx b/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx index 6d5af1562..9b47a6f35 100644 --- a/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx +++ b/source/funkin/mobile/ui/options/ControlsSchemeMenu.hx @@ -92,7 +92,7 @@ class ControlsSchemeMenu extends MusicBeatSubState */ var hsv:HSVShader = new HSVShader(); - public override function create():Void + override public function create():Void { super.create(); @@ -338,7 +338,7 @@ class ControlsSchemeMenu extends MusicBeatSubState */ var originX:Float; - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); diff --git a/source/funkin/mobile/ui/options/objects/HitboxShowcase.hx b/source/funkin/mobile/ui/options/objects/HitboxShowcase.hx index 035477e25..e5fe784ad 100644 --- a/source/funkin/mobile/ui/options/objects/HitboxShowcase.hx +++ b/source/funkin/mobile/ui/options/objects/HitboxShowcase.hx @@ -108,7 +108,7 @@ class HitboxShowcase extends FlxSpriteGroup } } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); diff --git a/source/funkin/mobile/ui/options/objects/SchemeMenuButton.hx b/source/funkin/mobile/ui/options/objects/SchemeMenuButton.hx index 1e09c4fd6..cf707be66 100644 --- a/source/funkin/mobile/ui/options/objects/SchemeMenuButton.hx +++ b/source/funkin/mobile/ui/options/objects/SchemeMenuButton.hx @@ -59,7 +59,7 @@ class SchemeMenuButton extends FlxSpriteGroup if (onClick != null) onSelect.add(onClick); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); diff --git a/source/funkin/mobile/util/AdMobUtil.hx b/source/funkin/mobile/util/AdMobUtil.hx index fe7148af9..0ec1d5c04 100644 --- a/source/funkin/mobile/util/AdMobUtil.hx +++ b/source/funkin/mobile/util/AdMobUtil.hx @@ -27,7 +27,7 @@ class AdMobUtil /** * The AdMob Interstitial Preload ID used for loading interstitial ads. */ - static final ADMOB_INTERSTITIAL_PRELOAD_ID:String = "FNF_INTERSTITIAL_PRELOAD_ID"; + static final ADMOB_INTERSTITIAL_PRELOAD_ID:String = 'FNF_INTERSTITIAL_PRELOAD_ID'; /** * The number of interstitial ads to preload and keep in buffer for AdMob. @@ -38,28 +38,28 @@ class AdMobUtil * AdMob publisher ID used for the application. */ #if NO_TESTING_ADS - @:envField({mandatoryIfDefined: "FEATURE_MOBILE_ADVERTISEMENTS"}) + @:envField({mandatoryIfDefined: 'FEATURE_MOBILE_ADVERTISEMENTS'}) static final ADMOB_PUBLISHER:Null; #else - static final ADMOB_PUBLISHER:Null = "ca-app-pub-3940256099942544"; + static final ADMOB_PUBLISHER:Null = 'ca-app-pub-3940256099942544'; #end /** * Ad unit ID for displaying banner ads. */ #if NO_TESTING_ADS - @:envField({mandatoryIfDefined: "FEATURE_MOBILE_ADVERTISEMENTS"}) + @:envField({mandatoryIfDefined: 'FEATURE_MOBILE_ADVERTISEMENTS'}) static final ADMOB_BANNER_AD_UNIT_ID:Null; #else - static final ADMOB_BANNER_AD_UNIT_ID:Null = #if android "9214589741" #elseif ios "2435281174" #else null #end; + static final ADMOB_BANNER_AD_UNIT_ID:Null = #if android '9214589741' #elseif ios '2435281174' #else null #end; #end /** * Ad unit ID for displaying interstitial ads. */ #if NO_TESTING_ADS - @:envField({mandatoryIfDefined: "FEATURE_MOBILE_ADVERTISEMENTS"}) + @:envField({mandatoryIfDefined: 'FEATURE_MOBILE_ADVERTISEMENTS'}) static final ADMOB_INTERSTITIAL_AD_UNIT_ID:Null; #else - static final ADMOB_INTERSTITIAL_AD_UNIT_ID:Null = #if android "1033173712" #elseif ios "4411468910" #else null #end; + static final ADMOB_INTERSTITIAL_AD_UNIT_ID:Null = #if android '1033173712' #elseif ios '4411468910' #else null #end; #end /** diff --git a/source/funkin/mobile/util/FNFCProvider.hx b/source/funkin/mobile/util/FNFCProvider.hx index c7be27dea..55730bdac 100644 --- a/source/funkin/mobile/util/FNFCProvider.hx +++ b/source/funkin/mobile/util/FNFCProvider.hx @@ -34,7 +34,7 @@ class FNFCProvider public static function queryFNFC():Null { #if ios - final fileURL:Null = System.getHint("IOS_UIApplicationLaunchOptionsURLKey"); + final fileURL:Null = System.getHint('IOS_UIApplicationLaunchOptionsURLKey'); if (fileURL != null && fileURL.length > 0) getFNFCFromURL(fileURL); #elseif android final staticField = JNIUtil.createStaticField('funkin/extensions/FNFCExtension', 'lastFNFC', 'Ljava/lang/String;'); @@ -65,7 +65,7 @@ class FNFCProvider trace('[$event] $value'); switch (event) { - case "FNFC_RESULTS": + case 'FNFC_RESULTS': onFNFCOpen.dispatch(value); default: } diff --git a/source/funkin/mobile/util/InAppPurchasesUtil.hx b/source/funkin/mobile/util/InAppPurchasesUtil.hx index f30a4707c..28c94a7ab 100644 --- a/source/funkin/mobile/util/InAppPurchasesUtil.hx +++ b/source/funkin/mobile/util/InAppPurchasesUtil.hx @@ -66,7 +66,7 @@ class InAppPurchasesUtil IAPAndroid.onBillingServiceDisconnected.add(function():Void { - trace("Billing service disconnected!"); + trace('Billing service disconnected!'); }); IAPAndroid.onProductDetailsResponse.add(function(result:IAPResult, productDetails:Array):Void @@ -130,9 +130,9 @@ class InAppPurchasesUtil IAPIOS.onPurchasesUpdated.add(function(purchases:Array):Void { handlePurchases(purchases); - trace("iOS purchases updated: " + purchases.length); + trace('iOS purchases updated: ' + purchases.length); hasInitialized = true; - trace("hasInitialized: " + hasInitialized); + trace('hasInitialized: ' + hasInitialized); }); IAPIOS.init(); diff --git a/source/funkin/mobile/util/WebViewUtil.hx b/source/funkin/mobile/util/WebViewUtil.hx index ce53fc77b..b0abc2950 100644 --- a/source/funkin/mobile/util/WebViewUtil.hx +++ b/source/funkin/mobile/util/WebViewUtil.hx @@ -29,7 +29,7 @@ class WebViewUtil { if (!WebView.isOpened()) { - var protocol:Array = url.split("://"); + var protocol:Array = url.split('://'); if (protocol.length == 1) { @@ -37,7 +37,7 @@ class WebViewUtil } else if (protocol[0] != 'http' && protocol[0] != 'https') { - throw "openURL can only open http and https links."; + throw 'openURL can only open http and https links.'; } function onButtonClicked():Void diff --git a/source/funkin/modding/events/ScriptEvent.hx b/source/funkin/modding/events/ScriptEvent.hx index 48094ce2e..ddf9b7b48 100644 --- a/source/funkin/modding/events/ScriptEvent.hx +++ b/source/funkin/modding/events/ScriptEvent.hx @@ -124,7 +124,7 @@ class NoteScriptEvent extends ScriptEvent this.healthChange = healthChange; } - public override function toString():String + override public function toString():String { return 'NoteScriptEvent(type=' + type + ', cancelable=' + cancelable + ', note=' + note + ', comboCount=' + comboCount + ')'; } @@ -169,7 +169,7 @@ class HitNoteScriptEvent extends NoteScriptEvent this.hitDiff = hitDiff; } - public override function toString():String + override public function toString():String { return 'HitNoteScriptEvent(note=' + note + ', comboCount=' + comboCount + ', judgement=' + judgement + ', score=' + score + ', isComboBreak=' + isComboBreak + ', hitDiff=' + hitDiff + ', doesNotesplash=' + doesNotesplash + ')'; @@ -223,7 +223,7 @@ class GhostMissNoteScriptEvent extends ScriptEvent this.playAnim = true; } - public override function toString():String + override public function toString():String { return 'GhostMissNoteScriptEvent(dir=' + dir + ', hasPossibleNotes=' + hasPossibleNotes + ')'; } @@ -266,7 +266,7 @@ class HoldNoteScriptEvent extends NoteScriptEvent this.isComboBreak = isComboBreak; } - public override function toString():String + override public function toString():String { return 'HoldNoteScriptEvent(type=$type, holdNote=$holdNote, healthChange=$healthChange, score=$score, isComboBreak=$isComboBreak, cancelable=$cancelable)'; } @@ -289,7 +289,7 @@ class SongEventScriptEvent extends ScriptEvent this.eventData = eventData; } - public override function toString():String + override public function toString():String { return 'SongEventScriptEvent(event=' + eventData + ')'; } @@ -312,7 +312,7 @@ class UpdateScriptEvent extends ScriptEvent this.elapsed = elapsed; } - public override function toString():String + override public function toString():String { return 'UpdateScriptEvent(elapsed=$elapsed)'; } @@ -341,7 +341,7 @@ class SongTimeScriptEvent extends ScriptEvent this.step = step; } - public override function toString():String + override public function toString():String { return 'SongTimeScriptEvent(type=' + type + ', beat=' + beat + ', step=' + step + ')'; } @@ -364,7 +364,7 @@ class CountdownScriptEvent extends ScriptEvent this.step = step; } - public override function toString():String + override public function toString():String { return 'CountdownScriptEvent(type=' + type + ', step=' + step + ')'; } @@ -386,7 +386,7 @@ class DialogueScriptEvent extends ScriptEvent this.conversation = conversation; } - public override function toString():String + override public function toString():String { return 'DialogueScriptEvent(type=$type, conversation=$conversation)'; } @@ -408,7 +408,7 @@ class KeyboardInputScriptEvent extends ScriptEvent this.event = event; } - public override function toString():String + override public function toString():String { return 'KeyboardInputScriptEvent(type=' + type + ', event=' + event + ')'; } @@ -467,7 +467,7 @@ class SongLoadScriptEvent extends ScriptEvent this.events = events; } - public override function toString():String + override public function toString():String { var noteStr = notes == null ? 'null' : 'Array(' + notes.length + ')'; var eventStr = events == null ? 'null' : 'Array(' + events.length + ')'; @@ -491,7 +491,7 @@ class SongRetryEvent extends ScriptEvent this.difficulty = difficulty; } - public override function toString():String + override public function toString():String { return 'SongRetryEvent(difficulty=$difficulty)'; } @@ -513,7 +513,7 @@ class StateChangeScriptEvent extends ScriptEvent this.targetState = targetState; } - public override function toString():String + override public function toString():String { return 'StateChangeScriptEvent(type=' + type + ', targetState=' + targetState + ')'; } @@ -529,7 +529,7 @@ class FocusScriptEvent extends ScriptEvent super(type, false); } - public override function toString():String + override public function toString():String { return 'FocusScriptEvent(type=' + type + ')'; } @@ -563,7 +563,7 @@ class CapsuleScriptEvent extends ScriptEvent this.variationId = variationId; } - public override function toString():String + override public function toString():String { var songName = this.capsule.freeplayData?.fullSongName ?? 'Random'; return 'CapsuleScriptEvent(type=$type, capsule=$songName)'; @@ -580,7 +580,7 @@ class FreeplayScriptEvent extends ScriptEvent super(type, false); } - public override function toString():String + override public function toString():String { return 'FreeplayScriptEvent(type=' + type + ')'; } @@ -602,7 +602,7 @@ class CharacterSelectScriptEvent extends ScriptEvent this.characterId = characterId; } - public override function toString():String + override public function toString():String { return 'CharacterSelectScriptEvent(type=' + type + ')'; } @@ -624,7 +624,7 @@ class SubStateScriptEvent extends ScriptEvent this.targetState = targetState; } - public override function toString():String + override public function toString():String { return 'SubStateScriptEvent(type=' + type + ', targetState=' + targetState + ')'; } diff --git a/source/funkin/modding/module/ModuleHandler.hx b/source/funkin/modding/module/ModuleHandler.hx index 52aeccd7e..faeaa1368 100644 --- a/source/funkin/modding/module/ModuleHandler.hx +++ b/source/funkin/modding/module/ModuleHandler.hx @@ -26,7 +26,7 @@ class ModuleHandler { // Clear any stages that are cached if there were any. clearModuleCache(); - trace("[MODULEHANDLER] Loading module cache..."); + trace('[MODULEHANDLER] Loading module cache...'); var scriptedModuleClassNames:Array = ScriptedModule.listScriptClasses(); trace(' Instantiating ${scriptedModuleClassNames.length} modules...'); @@ -47,7 +47,7 @@ class ModuleHandler } reorderModuleCache(); - trace("[MODULEHANDLER] Module cache loaded."); + trace('[MODULEHANDLER] Module cache loaded.'); } public static function buildModuleCallbacks():Void diff --git a/source/funkin/play/GameOverSubState.hx b/source/funkin/play/GameOverSubState.hx index 602e82f38..c0e5cd0ea 100644 --- a/source/funkin/play/GameOverSubState.hx +++ b/source/funkin/play/GameOverSubState.hx @@ -129,7 +129,7 @@ class GameOverSubState extends MusicBeatSubState blueballed = false; } - public override function create():Void + override public function create():Void { if (instance != null) { @@ -457,7 +457,7 @@ class GameOverSubState extends MusicBeatSubState } } - public override function dispatchEvent(event:ScriptEvent):Void + override public function dispatchEvent(event:ScriptEvent):Void { super.dispatchEvent(event); @@ -613,7 +613,7 @@ class GameOverSubState extends MusicBeatSubState var hasPlayedDeathQuote:Bool = false; - public override function destroy():Void + override public function destroy():Void { super.destroy(); if (gameOverMusic != null) @@ -625,7 +625,7 @@ class GameOverSubState extends MusicBeatSubState instance = null; } - public override function toString():String + override public function toString():String { return 'GameOverSubState'; } diff --git a/source/funkin/play/PauseSubState.hx b/source/funkin/play/PauseSubState.hx index 5f0ca2a40..61ef5d869 100644 --- a/source/funkin/play/PauseSubState.hx +++ b/source/funkin/play/PauseSubState.hx @@ -271,7 +271,7 @@ class PauseSubState extends MusicBeatSubState /** * Called when the state is first loaded. */ - public override function create():Void + override public function create():Void { // Add banner ad when game is state is first loaded. #if FEATURE_MOBILE_ADVERTISEMENTS @@ -303,7 +303,7 @@ class PauseSubState extends MusicBeatSubState * Called every frame. * @param elapsed The time elapsed since the last frame, in seconds. */ - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); @@ -313,7 +313,7 @@ class PauseSubState extends MusicBeatSubState /** * Called when the state is closed. */ - public override function destroy():Void + override public function destroy():Void { // #if FEATURE_MOBILE_ADVERTISEMENTS // extension.admob.Admob.onEvent.remove(onBannerEvent); @@ -385,7 +385,7 @@ class PauseSubState extends MusicBeatSubState /** * Called when the game loses focus. Used to temporarily pause the sound. */ - public override function onFocusLost():Void + override public function onFocusLost():Void { super.onFocusLost(); if (Preferences.autoPause) pauseMusic.pause(); @@ -394,7 +394,7 @@ class PauseSubState extends MusicBeatSubState /** * Called when the game loses focus. Used to temporarily pause the sound. */ - public override function onFocus():Void + override public function onFocus():Void { super.onFocus(); if (Preferences.autoPause) pauseMusic.resume(); @@ -414,9 +414,9 @@ class PauseSubState extends MusicBeatSubState add(background); #if mobile - pauseButton = FunkinSprite.createSparrow(0, 0, "pauseButton"); - pauseButton.animation.addByIndices('idle', 'pause', [0], "", 24, false); - pauseButton.animation.addByIndices('hold', 'pause', [5], "", 24, false); + 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, @@ -445,10 +445,10 @@ class PauseSubState extends MusicBeatSubState 30, 31, 32 - ], "", 24, false); + ], '', 24, false); pauseButton.scale.set(0.8, 0.8); pauseButton.updateHitbox(); - pauseButton.animation.play("confirm"); + pauseButton.animation.play('confirm'); pauseButton.setPosition((FlxG.width - pauseButton.width) - 35, 35); pauseCircle = FunkinSprite.create(0, 0, 'pauseCircle'); @@ -614,7 +614,7 @@ class PauseSubState extends MusicBeatSubState #if mobile HapticUtil.vibrate(0, 0.05, 0.5); - pauseButton.animation.play("confirm"); + pauseButton.animation.play('confirm'); pauseCircle.scale.set(0.84 * 1.4, 0.8 * 1.4); pauseCircle.alpha = 0.4; FlxTween.tween(pauseCircle.scale, {x: 0.84 * 0.8, y: 0.8 * 0.8}, 0.4, {ease: FlxEase.backInOut}); diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index a5c9aa559..4e36b599a 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -754,7 +754,7 @@ class PlayState extends MusicBeatSubState lastParams = params; // Apply parameters. - currentSong = params.targetSong ?? throw "targetSong should not be null"; + currentSong = params.targetSong ?? throw 'targetSong should not be null'; if (params.targetDifficulty != null) currentDifficulty = params.targetDifficulty; previousDifficulty = currentDifficulty; if (params.targetVariation != null) currentVariation = params.targetVariation; @@ -827,7 +827,7 @@ class PlayState extends MusicBeatSubState * Called when the PlayState is switched to. */ @:nullSafety(Off) - public override function create():Void + override public function create():Void { if (instance != null) { @@ -904,7 +904,7 @@ class PlayState extends MusicBeatSubState addHitbox(false); if (hitbox != null) { - hitbox.isPixel = currentChart.noteStyle == "pixel"; + hitbox.isPixel = currentChart.noteStyle == 'pixel'; if (Preferences.controlsScheme == FunkinHitboxControlSchemes.Arrows) { @@ -1028,7 +1028,7 @@ class PlayState extends MusicBeatSubState return true; } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { if (criticalFailure) return; @@ -1147,7 +1147,7 @@ class PlayState extends MusicBeatSubState Conductor.instance.update(Conductor.instance.songPosition + elapsed * 1000, false); if (Conductor.instance.songPosition >= (startTimestamp + Conductor.instance.combinedOffset)) { - trace("started song at " + Conductor.instance.songPosition); + trace('started song at ' + Conductor.instance.songPosition); startSong(); } } @@ -1508,7 +1508,7 @@ class PlayState extends MusicBeatSubState } } - public override function dispatchEvent(event:ScriptEvent):Void + override public function dispatchEvent(event:ScriptEvent):Void { // ORDER: Module, Song, Events, Notes, Stage, Conversation, Characters // Modules should get the first chance to cancel the event. @@ -1538,7 +1538,7 @@ class PlayState extends MusicBeatSubState * Function called before opening a new substate. * @param subState The substate to open. */ - public override function openSubState(subState:FlxSubState):Void + override public function openSubState(subState:FlxSubState):Void { if (shouldSubstatePause) { @@ -1619,7 +1619,7 @@ class PlayState extends MusicBeatSubState * Function called before closing the current substate. * @param subState */ - public override function closeSubState():Void + override public function closeSubState():Void { if (shouldSubstatePause) { @@ -1731,7 +1731,7 @@ class PlayState extends MusicBeatSubState /** * Function called when the game window gains focus. */ - public override function onFocus():Void + override public function onFocus():Void { if (VideoCutscene.isPlaying() #if !mobile && Preferences.autoPause #end && isGamePaused) VideoCutscene.pauseVideo(); #if html5 @@ -1772,7 +1772,7 @@ class PlayState extends MusicBeatSubState /** * Function called when the game window loses focus. */ - public override function onFocusLost():Void + override public function onFocusLost():Void { #if html5 if (Preferences.autoPause) VideoCutscene.pauseVideo(); @@ -1824,7 +1824,7 @@ class PlayState extends MusicBeatSubState funkin.modding.PolymodHandler.forceReloadAssets(); if (lastParams == null) { - throw "No lastParams to refer to"; + throw 'No lastParams to refer to'; } lastParams.targetSong = SongRegistry.instance.fetchEntry(currentSong.id, {variation: currentVariation}) ?? throw "Could not load current song from ID. This shouldn't happen!"; @@ -1909,7 +1909,7 @@ class PlayState extends MusicBeatSubState || Math.abs(playerVoicesError) > RESYNC_THRESHOLD || Math.abs(opponentVoicesError) > RESYNC_THRESHOLD)) { - trace("VOCALS NEED RESYNC"); + trace('VOCALS NEED RESYNC'); if (vocals != null) { trace(playerVoicesError); @@ -1927,7 +1927,7 @@ class PlayState extends MusicBeatSubState return true; } - public override function destroy():Void + override public function destroy():Void { performCleanup(); @@ -1943,9 +1943,9 @@ class PlayState extends MusicBeatSubState super.destroy(); } - public override function initConsoleHelpers():Void + override public function initConsoleHelpers():Void { - FlxG.console.registerFunction("debugUnbindCameraZoom", () -> + FlxG.console.registerFunction('debugUnbindCameraZoom', () -> { debugUnbindCameraZoom = !debugUnbindCameraZoom; }); @@ -2283,7 +2283,7 @@ class PlayState extends MusicBeatSubState playerStrumline.x = (FlxG.width - playerStrumline.width) / 2 + Constants.STRUMLINE_X_OFFSET; playerStrumline.y = (FlxG.height - playerStrumline.height) * 0.95 - Constants.STRUMLINE_Y_OFFSET; - if (currentChart?.noteStyle != "pixel") + if (currentChart?.noteStyle != 'pixel') { #if android playerStrumline.y += 10; #end } @@ -2297,8 +2297,8 @@ class PlayState extends MusicBeatSubState function initPauseSprites() { - pauseButton.animation.addByIndices('idle', 'back', [0], "", 24, false); - pauseButton.animation.addByIndices('hold', 'back', [5], "", 24, false); + pauseButton.animation.addByIndices('idle', 'back', [0], '', 24, false); + pauseButton.animation.addByIndices('hold', 'back', [5], '', 24, false); pauseButton.animation.addByIndices('confirm', 'back', [ 6, 7, @@ -2327,10 +2327,10 @@ class PlayState extends MusicBeatSubState 30, 31, 32 - ], "", 24, false); + ], '', 24, false); pauseButton.scale.set(0.8, 0.8); pauseButton.updateHitbox(); - pauseButton.animation.play("idle"); + pauseButton.animation.play('idle'); pauseButton.setPosition((FlxG.width - pauseButton.width) - 35, 35); if (camControls != null) pauseButton.cameras = [camControls]; @@ -2434,7 +2434,7 @@ class PlayState extends MusicBeatSubState { if (currentChart == null) { - trace("WARNING: Difficulty data for RPC is null."); + trace('WARNING: Difficulty data for RPC is null.'); } var discordRPCDifficulty = PlayState.instance?.currentDifficulty?.replace('-', ' ')?.toTitleCase() ?? '???'; return '${currentChart?.songName ?? '???'} [${discordRPCDifficulty}]'; @@ -3703,7 +3703,7 @@ class PlayState extends MusicBeatSubState } } - public override function close():Void + override public function close():Void { criticalFailure = true; // Stop game updates. performCleanup(); diff --git a/source/funkin/play/character/BaseCharacter.hx b/source/funkin/play/character/BaseCharacter.hx index 7419b152f..e7cbf7dd1 100644 --- a/source/funkin/play/character/BaseCharacter.hx +++ b/source/funkin/play/character/BaseCharacter.hx @@ -171,7 +171,7 @@ class BaseCharacter extends Bopper this.characterId = id; - ignoreExclusionPref = ["sing"]; + ignoreExclusionPref = ['sing']; _data = CharacterDataParser.fetchCharacterData(this.characterId); if (_data == null) @@ -383,7 +383,7 @@ class BaseCharacter extends Bopper } } - public override function onUpdate(event:UpdateScriptEvent):Void + override public function onUpdate(event:UpdateScriptEvent):Void { super.onUpdate(event); @@ -544,7 +544,7 @@ class BaseCharacter extends Bopper * Every time a note is hit, check if the note is from the same strumline. * If it is, then play the sing animation. */ - public override function onNoteHit(event:HitNoteScriptEvent) + override public function onNoteHit(event:HitNoteScriptEvent):Void { super.onNoteHit(event); // If another script cancelled the event, don't do anything. @@ -599,7 +599,7 @@ class BaseCharacter extends Bopper * Every time a note is missed, check if the note is from the same strumline. * If it is, then play the sing animation. */ - public override function onNoteMiss(event:NoteScriptEvent) + override public function onNoteMiss(event:NoteScriptEvent) { super.onNoteMiss(event); @@ -622,7 +622,7 @@ class BaseCharacter extends Bopper } } - public override function onNoteHoldDrop(event:HoldNoteScriptEvent) + override public function onNoteHoldDrop(event:HoldNoteScriptEvent) { super.onNoteHoldDrop(event); @@ -680,7 +680,7 @@ class BaseCharacter extends Bopper /** * Every time a wrong key is pressed, play the miss animation if we are Boyfriend. */ - public override function onNoteGhostMiss(event:GhostMissNoteScriptEvent):Void + override public function onNoteGhostMiss(event:GhostMissNoteScriptEvent):Void { super.onNoteGhostMiss(event); @@ -697,7 +697,7 @@ class BaseCharacter extends Bopper } } - public override function onDestroy(event:ScriptEvent):Void + override public function onDestroy(event:ScriptEvent):Void { this.characterType = OTHER; } @@ -717,7 +717,7 @@ class BaseCharacter extends Bopper playAnimation(anim, true); } - public override function playAnimation(name:String, restart:Bool = false, ignoreOther:Bool = false, reversed:Bool = false):Void + override public function playAnimation(name:String, restart:Bool = false, ignoreOther:Bool = false, reversed:Bool = false):Void { if (tempVocals) { diff --git a/source/funkin/play/cutscene/dialogue/Conversation.hx b/source/funkin/play/cutscene/dialogue/Conversation.hx index 205a80cf4..6ddff53d1 100644 --- a/source/funkin/play/cutscene/dialogue/Conversation.hx +++ b/source/funkin/play/cutscene/dialogue/Conversation.hx @@ -72,7 +72,7 @@ class Conversation extends FlxSpriteGroup implements IDialogueScriptedClass impl function get_currentDialogueLineString():String { // TODO: Replace "" with some placeholder text? - return currentDialogueEntryData?.text[currentDialogueLine] ?? ""; + return currentDialogueEntryData?.text[currentDialogueLine] ?? ''; } /** @@ -116,7 +116,7 @@ class Conversation extends FlxSpriteGroup implements IDialogueScriptedClass impl { if (_data == null) return; - if (_data.music == null || (_data.music.asset ?? "") == "") return; + if (_data.music == null || (_data.music.asset ?? '') == '') return; music = FunkinSound.load(Paths.music(_data.music.asset), 0.0, true, true, true); var fadeTime:Float = _data.music.fadeTime ?? 0.0; @@ -190,7 +190,7 @@ class Conversation extends FlxSpriteGroup implements IDialogueScriptedClass impl refresh(); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); @@ -199,7 +199,7 @@ class Conversation extends FlxSpriteGroup implements IDialogueScriptedClass impl function showCurrentSpeaker():Void { - var nextSpeakerId:String = currentDialogueEntryData?.speaker ?? ""; + var nextSpeakerId:String = currentDialogueEntryData?.speaker ?? ''; // Skip the next steps if the current speaker is already displayed. if ((currentSpeaker != null && currentSpeaker.alive) && nextSpeakerId == currentSpeaker.id) return; @@ -251,7 +251,7 @@ class Conversation extends FlxSpriteGroup implements IDialogueScriptedClass impl function showCurrentDialogueBox():Void { - var nextDialogueBoxId:String = currentDialogueEntryData?.box ?? ""; + var nextDialogueBoxId:String = currentDialogueEntryData?.box ?? ''; // Skip the next steps if the current dialogue box is already displayed. if ((currentDialogueBox != null && currentDialogueBox.alive) && nextDialogueBoxId == currentDialogueBox.id) return; @@ -621,7 +621,7 @@ class Conversation extends FlxSpriteGroup implements IDialogueScriptedClass impl * Calls `kill()` on the group's members and then on the group itself. * You can revive this group later via `revive()` after this. */ - public override function revive():Void + override public function revive():Void { super.revive(); this.alpha = 1; @@ -632,7 +632,7 @@ class Conversation extends FlxSpriteGroup implements IDialogueScriptedClass impl * Calls `kill()` on the group's members and then on the group itself. * You can revive this group later via `revive()` after this. */ - public override function kill():Void + override public function kill():Void { _skipTransformChildren = true; alive = false; diff --git a/source/funkin/play/cutscene/dialogue/DialogueBox.hx b/source/funkin/play/cutscene/dialogue/DialogueBox.hx index f88611b45..6070d90dd 100644 --- a/source/funkin/play/cutscene/dialogue/DialogueBox.hx +++ b/source/funkin/play/cutscene/dialogue/DialogueBox.hx @@ -202,7 +202,7 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple * Calls `kill()` on the group's members and then on the group itself. * You can revive this group later via `revive()` after this. */ - public override function kill():Void + override public function kill():Void { super.kill(); if (this.boxSprite != null) @@ -218,7 +218,7 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple this.clear(); } - public override function revive():Void + override public function revive():Void { super.revive(); @@ -271,7 +271,7 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple * For example, if an animation was defined as having the indexes [3, 0, 1, 2], * then the first callback would have frameNumber = 0 and frameIndex = 3. */ - function onAnimationFrame(name:String = "", frameNumber:Int = -1, frameIndex:Int = -1):Void + function onAnimationFrame(name:String = '', frameNumber:Int = -1, frameIndex:Int = -1):Void { // Do nothing by default. // This can be overridden by, for example, scripts, @@ -363,7 +363,7 @@ class DialogueBox extends FlxSpriteGroup implements IDialogueScriptedClass imple */ public function getCurrentAnimation():String { - if (this.animation == null || this.animation.curAnim == null) return ""; + if (this.animation == null || this.animation.curAnim == null) return ''; return this.animation.curAnim.name; } diff --git a/source/funkin/play/cutscene/dialogue/Speaker.hx b/source/funkin/play/cutscene/dialogue/Speaker.hx index e8e969af9..6e988943f 100644 --- a/source/funkin/play/cutscene/dialogue/Speaker.hx +++ b/source/funkin/play/cutscene/dialogue/Speaker.hx @@ -100,12 +100,12 @@ class Speaker extends FlxSprite implements IDialogueScriptedClass implements IRe * Calls `kill()` on the group's members and then on the group itself. * You can revive this group later via `revive()` after this. */ - public override function kill():Void + override public function kill():Void { super.kill(); } - public override function revive():Void + override public function revive():Void { super.revive(); diff --git a/source/funkin/play/event/FocusCameraSongEvent.hx b/source/funkin/play/event/FocusCameraSongEvent.hx index 0b518e1d8..e9d7afddf 100644 --- a/source/funkin/play/event/FocusCameraSongEvent.hx +++ b/source/funkin/play/event/FocusCameraSongEvent.hx @@ -62,7 +62,7 @@ class FocusCameraSongEvent extends SongEvent static final DEFAULT_CAMERA_EASE:String = 'CLASSIC'; static final DEFAULT_TARGET:Int = 0; // Boyfriend - public override function handleEvent(data:SongEventData):Void + override public function handleEvent(data:SongEventData):Void { // Does nothing if there is no PlayState camera or stage. if (PlayState.instance == null || PlayState.instance.currentStage == null) return; @@ -86,7 +86,7 @@ class FocusCameraSongEvent extends SongEvent if (ease == null) ease = DEFAULT_CAMERA_EASE; // No linear in defaults lol var easeDir:String = data.getString('easeDir') ?? SongEvent.DEFAULT_EASE_DIR; - if (SongEvent.EASE_TYPE_DIR_REGEX.match(ease) || ease == "linear") easeDir = ""; + if (SongEvent.EASE_TYPE_DIR_REGEX.match(ease) || ease == 'linear') easeDir = ''; var currentStage = PlayState.instance.currentStage; @@ -158,7 +158,7 @@ class FocusCameraSongEvent extends SongEvent } } - public override function getTitle():String + override public function getTitle():String { return 'Focus Camera'; } @@ -172,31 +172,31 @@ class FocusCameraSongEvent extends SongEvent * } * @return SongEventSchema */ - public override function getEventSchema():SongEventSchema + override public function getEventSchema():SongEventSchema { return new SongEventSchema([ { - name: "char", - title: "Target", + name: 'char', + title: 'Target', defaultValue: DEFAULT_TARGET, type: SongEventFieldType.ENUM, - keys: ["Position" => -1, "Player" => 0, "Opponent" => 1, "Girlfriend" => 2] + keys: ['Position' => -1, 'Player' => 0, 'Opponent' => 1, 'Girlfriend' => 2] }, { - name: "x", - title: "X Position", + name: 'x', + title: 'X Position', defaultValue: DEFAULT_X_POSITION, step: 10.0, type: SongEventFieldType.FLOAT, - units: "px" + units: 'px' }, { - name: "y", - title: "Y Position", + name: 'y', + title: 'Y Position', defaultValue: DEFAULT_Y_POSITION, step: 10.0, type: SongEventFieldType.FLOAT, - units: "px" + units: 'px' }, { name: 'duration', diff --git a/source/funkin/play/event/PlayAnimationSongEvent.hx b/source/funkin/play/event/PlayAnimationSongEvent.hx index 319fbed5c..450a8658c 100644 --- a/source/funkin/play/event/PlayAnimationSongEvent.hx +++ b/source/funkin/play/event/PlayAnimationSongEvent.hx @@ -22,7 +22,7 @@ class PlayAnimationSongEvent extends SongEvent static final DEFAULT_ANIM:String = 'idle'; static final DEFAULT_FORCE:Bool = false; - public override function handleEvent(data:SongEventData):Void + override public function handleEvent(data:SongEventData):Void { // Does nothing if there is no PlayState camera or stage. if (PlayState.instance == null || PlayState.instance.currentStage == null) return; @@ -75,9 +75,9 @@ class PlayAnimationSongEvent extends SongEvent } } - public override function getTitle():String + override public function getTitle():String { - return "Play Animation"; + return 'Play Animation'; } /** @@ -89,7 +89,7 @@ class PlayAnimationSongEvent extends SongEvent * } * @return SongEventSchema */ - public override function getEventSchema():SongEventSchema + override public function getEventSchema():SongEventSchema { return new SongEventSchema([ { diff --git a/source/funkin/play/event/ScrollSpeedEvent.hx b/source/funkin/play/event/ScrollSpeedEvent.hx index ee66b2ff2..164022682 100644 --- a/source/funkin/play/event/ScrollSpeedEvent.hx +++ b/source/funkin/play/event/ScrollSpeedEvent.hx @@ -39,7 +39,7 @@ class ScrollSpeedEvent extends SongEvent static final DEFAULT_ABSOLUTE:Bool = false; static final DEFAULT_STRUMLINE:String = 'both'; // my special little trick - public override function handleEvent(data:SongEventData):Void + override public function handleEvent(data:SongEventData):Void { // Does nothing if there is no PlayState. if (PlayState.instance == null) return; @@ -51,7 +51,7 @@ class ScrollSpeedEvent extends SongEvent var ease:String = data.getString('ease') ?? SongEvent.DEFAULT_EASE; var easeDir:String = data.getString('easeDir') ?? SongEvent.DEFAULT_EASE_DIR; - if (SongEvent.EASE_TYPE_DIR_REGEX.match(ease) || ease == "linear") easeDir = ""; + if (SongEvent.EASE_TYPE_DIR_REGEX.match(ease) || ease == 'linear') easeDir = ''; var strumline:String = data.getString('strumline') ?? DEFAULT_STRUMLINE; @@ -91,7 +91,7 @@ class ScrollSpeedEvent extends SongEvent } } - public override function getTitle():String + override public function getTitle():String { return 'Scroll Speed'; } @@ -108,7 +108,7 @@ class ScrollSpeedEvent extends SongEvent * } * @return SongEventSchema */ - public override function getEventSchema():SongEventSchema + override public function getEventSchema():SongEventSchema { return new SongEventSchema([ { diff --git a/source/funkin/play/event/SetCameraBopSongEvent.hx b/source/funkin/play/event/SetCameraBopSongEvent.hx index a88a6b344..3888a1d55 100644 --- a/source/funkin/play/event/SetCameraBopSongEvent.hx +++ b/source/funkin/play/event/SetCameraBopSongEvent.hx @@ -37,7 +37,7 @@ class SetCameraBopSongEvent extends SongEvent }); } - public override function handleEvent(data:SongEventData):Void + override public function handleEvent(data:SongEventData):Void { // Does nothing if there is no PlayState camera or stage. if (PlayState.instance == null) return; @@ -53,7 +53,7 @@ class SetCameraBopSongEvent extends SongEvent trace('Set camera zoom rate to ${PlayState.instance.cameraZoomRate}'); } - public override function getTitle():String + override public function getTitle():String { return 'Set Camera Bop'; } @@ -67,7 +67,7 @@ class SetCameraBopSongEvent extends SongEvent * ``` * @return SongEventSchema */ - public override function getEventSchema():SongEventSchema + override public function getEventSchema():SongEventSchema { return new SongEventSchema([ { diff --git a/source/funkin/play/event/SetHealthIconSongEvent.hx b/source/funkin/play/event/SetHealthIconSongEvent.hx index e94fc219b..1355fe04f 100644 --- a/source/funkin/play/event/SetHealthIconSongEvent.hx +++ b/source/funkin/play/event/SetHealthIconSongEvent.hx @@ -42,7 +42,7 @@ class SetHealthIconSongEvent extends SongEvent static final DEFAULT_X_OFFSET:Float = 0.0; static final DEFAULT_Y_OFFSET:Float = 0.0; - public override function handleEvent(data:SongEventData):Void + override public function handleEvent(data:SongEventData):Void { // Does nothing if there is no PlayState. if (PlayState.instance == null) return; @@ -83,12 +83,12 @@ class SetHealthIconSongEvent extends SongEvent } } - public override function getTitle():String + override public function getTitle():String { return 'Set Health Icon'; } - public override function getEventSchema():SongEventSchema + override public function getEventSchema():SongEventSchema { return new SongEventSchema([ { diff --git a/source/funkin/play/event/SetTargetBopSpeedEvent.hx b/source/funkin/play/event/SetTargetBopSpeedEvent.hx index 1f59c22ef..64ce256fd 100644 --- a/source/funkin/play/event/SetTargetBopSpeedEvent.hx +++ b/source/funkin/play/event/SetTargetBopSpeedEvent.hx @@ -21,7 +21,7 @@ class SetTargetBopSpeedSongEvent extends SongEvent static final DEFAULT_TARGET:String = 'boyfriend'; - public override function handleEvent(data:SongEventData):Void + override public function handleEvent(data:SongEventData):Void { // Does nothing if there is no PlayState camera or stage. if (PlayState.instance == null || PlayState.instance.currentStage == null) return; @@ -71,7 +71,7 @@ class SetTargetBopSpeedSongEvent extends SongEvent } } - public override function getTitle():String + override public function getTitle():String { return "Set Target Bop Speed"; } @@ -85,7 +85,7 @@ class SetTargetBopSpeedSongEvent extends SongEvent * ``` * @return SongEventSchema */ - public override function getEventSchema():SongEventSchema + override public function getEventSchema():SongEventSchema { return new SongEventSchema([ { diff --git a/source/funkin/play/event/ZoomCameraSongEvent.hx b/source/funkin/play/event/ZoomCameraSongEvent.hx index a678715d2..44b55cc04 100644 --- a/source/funkin/play/event/ZoomCameraSongEvent.hx +++ b/source/funkin/play/event/ZoomCameraSongEvent.hx @@ -34,7 +34,7 @@ class ZoomCameraSongEvent extends SongEvent public static final DEFAULT_DURATION:Float = 4.0; public static final DEFAULT_MODE:String = 'direct'; - public override function handleEvent(data:SongEventData):Void + override public function handleEvent(data:SongEventData):Void { // Does nothing if there is no PlayState camera or stage. if (PlayState.instance == null || PlayState.instance.currentStage == null) return; @@ -57,7 +57,7 @@ class ZoomCameraSongEvent extends SongEvent var ease:String = data.getString('ease') ?? SongEvent.DEFAULT_EASE; var easeDir:String = data.getString('easeDir') ?? SongEvent.DEFAULT_EASE_DIR; - if (SongEvent.EASE_TYPE_DIR_REGEX.match(ease) || ease == "linear") easeDir = ""; + if (SongEvent.EASE_TYPE_DIR_REGEX.match(ease) || ease == 'linear') easeDir = ''; // If it's a string, check the value. switch (ease) @@ -83,7 +83,7 @@ class ZoomCameraSongEvent extends SongEvent return (wideScale.x - 1) * scale.x + (wideScale.y - 1) * scale.y; } - public override function getTitle():String + override public function getTitle():String { return 'Zoom Camera'; } @@ -99,7 +99,7 @@ class ZoomCameraSongEvent extends SongEvent * } * @return SongEventSchema */ - public override function getEventSchema():SongEventSchema + override public function getEventSchema():SongEventSchema { return new SongEventSchema([ { diff --git a/source/funkin/play/notes/NoteHoldCover.hx b/source/funkin/play/notes/NoteHoldCover.hx index 5f1c63e86..69ed3fe7e 100644 --- a/source/funkin/play/notes/NoteHoldCover.hx +++ b/source/funkin/play/notes/NoteHoldCover.hx @@ -41,7 +41,7 @@ class NoteHoldCover extends FlxTypedSpriteGroup } } - public override function update(elapsed):Void + override public function update(elapsed):Void { super.update(elapsed); } @@ -65,7 +65,7 @@ class NoteHoldCover extends FlxTypedSpriteGroup glow.animation.play('holdCoverEnd${direction.colorName.toTitleCase()}'); } - public override function kill():Void + override public function kill():Void { super.kill(); @@ -77,7 +77,7 @@ class NoteHoldCover extends FlxTypedSpriteGroup if (sparks != null) sparks.visible = false; } - public override function revive():Void + override public function revive():Void { super.revive(); diff --git a/source/funkin/play/notes/NoteSprite.hx b/source/funkin/play/notes/NoteSprite.hx index 359681280..560749e78 100644 --- a/source/funkin/play/notes/NoteSprite.hx +++ b/source/funkin/play/notes/NoteSprite.hx @@ -210,7 +210,7 @@ class NoteSprite extends FunkinSprite /** * Call this to override how debug bounding boxes are drawn for this sprite. */ - public override function drawDebugOnCamera(camera:flixel.FlxCamera):Void + override public function drawDebugOnCamera(camera:flixel.FlxCamera):Void { if (!camera.visible || !camera.exists || !isOnScreen(camera)) return; @@ -246,7 +246,7 @@ class NoteSprite extends FunkinSprite if (hue != 1.0) this.shader = this.hsvShader; } - public override function revive():Void + override public function revive():Void { super.revive(); this.visible = true; @@ -267,12 +267,12 @@ class NoteSprite extends FunkinSprite this.hsvShader.value = 1.0; } - public override function kill():Void + override public function kill():Void { super.kill(); } - public override function destroy():Void + override public function destroy():Void { // This function should ONLY get called as you leave PlayState entirely. // Otherwise, we want the game to keep reusing note sprites to save memory. diff --git a/source/funkin/play/notes/Strumline.hx b/source/funkin/play/notes/Strumline.hx index 6f827560b..a9cbda821 100644 --- a/source/funkin/play/notes/Strumline.hx +++ b/source/funkin/play/notes/Strumline.hx @@ -317,7 +317,7 @@ class Strumline extends FlxSpriteGroup return KEY_COUNT * Strumline.NOTE_SPACING * noteSpacingScale * strumlineScale.x; } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); @@ -773,7 +773,7 @@ class Strumline extends FlxSpriteGroup for (dir in DIRECTIONS) { - if (isKeyHeld(dir) && getByDirection(dir).getCurrentAnimation() == "static") + if (isKeyHeld(dir) && getByDirection(dir).getCurrentAnimation() == 'static') { playPress(dir); } diff --git a/source/funkin/play/notes/SustainTrail.hx b/source/funkin/play/notes/SustainTrail.hx index 067270724..40ec06aa1 100644 --- a/source/funkin/play/notes/SustainTrail.hx +++ b/source/funkin/play/notes/SustainTrail.hx @@ -97,7 +97,7 @@ class SustainTrail extends FlxSprite */ public var uvtData:DrawData = new DrawData(); - private var zoom:Float = 1; + var zoom:Float = 1; /** * What part of the trail's end actually represents the end of the note. @@ -286,7 +286,7 @@ class SustainTrail extends FlxSprite updateHitbox(); } - public override function updateHitbox():Void + override public function updateHitbox():Void { width = graphicWidth; height = graphicHeight; @@ -428,11 +428,11 @@ class SustainTrail extends FlxSprite #end } - public override function kill():Void + override public function kill():Void { super.kill(); - if (!((cover?.animation?.name ?? "").startsWith("holdCoverEnd"))) cover?.playEnd(); + if (!((cover?.animation?.name ?? '').startsWith('holdCoverEnd'))) cover?.playEnd(); strumTime = 0; noteDirection = 0; sustainLength = 0; @@ -443,7 +443,7 @@ class SustainTrail extends FlxSprite missedNote = false; } - public override function revive():Void + override public function revive():Void { super.revive(); diff --git a/source/funkin/play/notes/notekind/NonScoreableNoteKind.hx b/source/funkin/play/notes/notekind/NonScoreableNoteKind.hx index 7db2ab340..67d071ad2 100644 --- a/source/funkin/play/notes/notekind/NonScoreableNoteKind.hx +++ b/source/funkin/play/notes/notekind/NonScoreableNoteKind.hx @@ -13,7 +13,7 @@ class NonScoreableNoteKind extends NoteKind scoreable = false; } - public override function onNoteMiss(event:NoteScriptEvent):Void + override public function onNoteMiss(event:NoteScriptEvent):Void { event.note.visible = false; event.cancel(); diff --git a/source/funkin/play/stage/Stage.hx b/source/funkin/play/stage/Stage.hx index e38baa416..c168a09ef 100644 --- a/source/funkin/play/stage/Stage.hx +++ b/source/funkin/play/stage/Stage.hx @@ -810,7 +810,7 @@ class Stage extends FlxSpriteGroup implements IPlayStateScriptedClass implements { } - public override function kill() + override public function kill() { _skipTransformChildren = true; alive = false; diff --git a/source/funkin/ui/MusicBeatState.hx b/source/funkin/ui/MusicBeatState.hx index 0ff0a3634..d8ec58400 100644 --- a/source/funkin/ui/MusicBeatState.hx +++ b/source/funkin/ui/MusicBeatState.hx @@ -145,7 +145,7 @@ class MusicBeatState extends FlxTransitionableState implements IEventHandler dispatchEvent(new ScriptEvent(STATE_CREATE)); } - public override function destroy():Void + override public function destroy():Void { super.destroy(); @@ -275,7 +275,7 @@ class MusicBeatState extends FlxTransitionableState implements IEventHandler } } - public override function openSubState(targetSubState:FlxSubState):Void + override public function openSubState(targetSubState:FlxSubState):Void { var event = new SubStateScriptEvent(SUBSTATE_OPEN_BEGIN, targetSubState, true); @@ -291,7 +291,7 @@ class MusicBeatState extends FlxTransitionableState implements IEventHandler dispatchEvent(new SubStateScriptEvent(SUBSTATE_OPEN_END, targetState, true)); } - public override function closeSubState():Void + override public function closeSubState():Void { var event = new SubStateScriptEvent(SUBSTATE_CLOSE_BEGIN, this.subState, true); diff --git a/source/funkin/ui/MusicBeatSubState.hx b/source/funkin/ui/MusicBeatSubState.hx index bd51fe377..ddc29b363 100644 --- a/source/funkin/ui/MusicBeatSubState.hx +++ b/source/funkin/ui/MusicBeatSubState.hx @@ -122,7 +122,7 @@ class MusicBeatSubState extends FlxSubState implements IEventHandler initConsoleHelpers(); } - public override function destroy():Void + override public function destroy():Void { super.destroy(); @@ -146,7 +146,7 @@ class MusicBeatSubState extends FlxSubState implements IEventHandler } // Display Conductor info in the watch window. - FlxG.watch.addQuick("musicTime", FlxG.sound.music?.time ?? 0.0); + FlxG.watch.addQuick('musicTime', FlxG.sound.music?.time ?? 0.0); Conductor.watchQuick(conductorInUse); dispatchEvent(new UpdateScriptEvent(elapsed)); @@ -275,7 +275,7 @@ class MusicBeatSubState extends FlxSubState implements IEventHandler } } - public override function openSubState(targetSubState:FlxSubState):Void + override public function openSubState(targetSubState:FlxSubState):Void { var event = new SubStateScriptEvent(SUBSTATE_OPEN_BEGIN, targetSubState, true); @@ -291,7 +291,7 @@ class MusicBeatSubState extends FlxSubState implements IEventHandler dispatchEvent(new SubStateScriptEvent(SUBSTATE_OPEN_END, targetState, true)); } - public override function closeSubState():Void + override public function closeSubState():Void { var event = new SubStateScriptEvent(SUBSTATE_CLOSE_BEGIN, this.subState, true); diff --git a/source/funkin/ui/charSelect/CharSelectSubState.hx b/source/funkin/ui/charSelect/CharSelectSubState.hx index 806b72e85..4b30a8187 100644 --- a/source/funkin/ui/charSelect/CharSelectSubState.hx +++ b/source/funkin/ui/charSelect/CharSelectSubState.hx @@ -90,7 +90,7 @@ class CharSelectSubState extends MusicBeatSubState public function new(?params:CharSelectSubStateParams) { super(); - rememberedChar = params?.character ?? ""; + rememberedChar = params?.character ?? ''; cutoutSize = FullScreenScaleMode.gameCutoutSize.x / 2; @@ -155,10 +155,10 @@ class CharSelectSubState extends MusicBeatSubState loadAvailableCharacters(); - bopInfo = FramesJSFLParser.parse(Paths.file("images/charSelect/iconBopInfo/iconBopInfo.txt")); + bopInfo = FramesJSFLParser.parse(Paths.file('images/charSelect/iconBopInfo/iconBopInfo.txt')); if (bopInfo == null) { - trace(" ERROR ".bg_red().bold() + " Failed to load data for bopInfo, is the path provided correct?"); + trace(' ERROR '.bg_red().bold() + ' Failed to load data for bopInfo, is the path provided correct?'); } var bg:FunkinSprite = new FunkinSprite(cutoutSize + -153, -140); @@ -166,7 +166,7 @@ class CharSelectSubState extends MusicBeatSubState bg.scrollFactor.set(0.1, 0.1); add(bg); - var crowd:FunkinSprite = FunkinSprite.createTextureAtlas(cutoutSize, 0, "charSelect/crowd", { + var crowd:FunkinSprite = FunkinSprite.createTextureAtlas(cutoutSize, 0, 'charSelect/crowd', { applyStageMatrix: true }); crowd.anim.play(''); @@ -174,7 +174,7 @@ class CharSelectSubState extends MusicBeatSubState crowd.scrollFactor.set(0.3, 0.3); add(crowd); - var stageSpr:FunkinSprite = FunkinSprite.createTextureAtlas(cutoutSize - 2, 1, "charSelect/charSelectStage", { + var stageSpr:FunkinSprite = FunkinSprite.createTextureAtlas(cutoutSize - 2, 1, 'charSelect/charSelectStage', { applyStageMatrix: true }); stageSpr.anim.play(''); @@ -186,7 +186,7 @@ class CharSelectSubState extends MusicBeatSubState curtains.scrollFactor.set(1.4, 1.4); add(curtains); - barthing.loadTextureAtlas("charSelect/barThing", { + barthing.loadTextureAtlas('charSelect/barThing', { applyStageMatrix: true }); barthing.anim.play(''); @@ -241,7 +241,7 @@ class CharSelectSubState extends MusicBeatSubState setCursorPosition(DEFAULT_CURSOR_INDEX, true); } - var speakers:FunkinSprite = FunkinSprite.createTextureAtlas(cutoutSize - 10, 0, "charSelect/charSelectSpeakers", { + var speakers:FunkinSprite = FunkinSprite.createTextureAtlas(cutoutSize - 10, 0, 'charSelect/charSelectSpeakers', { applyStageMatrix: true }); speakers.anim.play(''); @@ -255,16 +255,16 @@ class CharSelectSubState extends MusicBeatSubState fgBlur.blend = BlendMode.MULTIPLY; add(fgBlur); - dipshitBlur.frames = Paths.getSparrowAtlas("charSelect/dipshitBlur"); - dipshitBlur.animation.addByPrefix('idle', "CHOOSE vertical offset instance 1", 24, true); + dipshitBlur.frames = Paths.getSparrowAtlas('charSelect/dipshitBlur'); + dipshitBlur.animation.addByPrefix('idle', 'CHOOSE vertical offset instance 1', 24, true); dipshitBlur.blend = BlendMode.ADD; - dipshitBlur.animation.play("idle"); + dipshitBlur.animation.play('idle'); add(dipshitBlur); - dipshitBacking.frames = Paths.getSparrowAtlas("charSelect/dipshitBacking"); - dipshitBacking.animation.addByPrefix('idle', "CHOOSE horizontal offset instance 1", 24, true); + dipshitBacking.frames = Paths.getSparrowAtlas('charSelect/dipshitBacking'); + dipshitBacking.animation.addByPrefix('idle', 'CHOOSE horizontal offset instance 1', 24, true); dipshitBacking.blend = BlendMode.ADD; - dipshitBacking.animation.play("idle"); + dipshitBacking.animation.play('idle'); add(dipshitBacking); dipshitBacking.y += 210; @@ -295,13 +295,13 @@ class CharSelectSubState extends MusicBeatSubState nametag.scrollFactor.set(); FlxG.debugger.addTrackerProfile(new TrackerProfile(FunkinSprite, [ - "x", - "y", - "alpha", - "scale", - "blend" + 'x', + 'y', + 'alpha', + 'scale', + 'blend' ])); - FlxG.debugger.addTrackerProfile(new TrackerProfile(FlxSound, ["pitch", "volume"])); + FlxG.debugger.addTrackerProfile(new TrackerProfile(FlxSound, ['pitch', 'volume'])); add(cursors); @@ -350,7 +350,7 @@ class CharSelectSubState extends MusicBeatSubState FlxTween.tween(member, {y: member.y - 300}, 1, {ease: FlxEase.expoOut}); } - FlxG.debugger.addTrackerProfile(new TrackerProfile(CharSelectSubState, ["curChar", "grpXSpread", "grpYSpread"])); + FlxG.debugger.addTrackerProfile(new TrackerProfile(CharSelectSubState, ['curChar', 'grpXSpread', 'grpYSpread'])); FlxG.debugger.track(this); add(camFollow); @@ -488,7 +488,7 @@ class CharSelectSubState extends MusicBeatSubState { add(grpIcons); - FlxG.debugger.addTrackerProfile(new TrackerProfile(FlxSpriteGroup, ["x", "y"])); + FlxG.debugger.addTrackerProfile(new TrackerProfile(FlxSpriteGroup, ['x', 'y'])); for (i in 0...9) { @@ -558,12 +558,12 @@ class CharSelectSubState extends MusicBeatSubState { var lock:Lock = cast grpIcons.group.members[index]; - lock.anim.play("unlock"); + lock.anim.play('unlock'); lock.anim.onFrameChange.add(function(animName:String, frame:Int, index:Int) { if (frame == 40) { - playerChillOut.anim.play("death"); + playerChillOut.anim.play('death'); } }); @@ -574,7 +574,7 @@ class CharSelectSubState extends MusicBeatSubState { var char:String = availableChars.get(index) ?? Constants.DEFAULT_CHARACTER; camera.flash(0xFFFFFFFF, 0.1); - playerChill.anim.play("unlock"); + playerChill.anim.play('unlock'); playerChill.visible = true; var id = grpIcons.members.indexOf(lock); @@ -594,7 +594,7 @@ class CharSelectSubState extends MusicBeatSubState bopPlay = true; updateIconPositions(); - playerChillOut.anim.onFinish.addOnce((_) -> if (_ == "death") + playerChillOut.anim.onFinish.addOnce((_) -> if (_ == 'death') { // sync = false; playerChillOut.visible = false; @@ -762,7 +762,7 @@ class CharSelectSubState extends MusicBeatSubState mobileAccept = true; } - trace("Index: " + i + ", Row: " + cursorY + ", Column: " + cursorX); + trace('Index: ' + i + ', Row: ' + cursorY + ', Column: ' + cursorX); break; } } @@ -866,18 +866,18 @@ class CharSelectSubState extends MusicBeatSubState FlxTween.globalManager.cancelTweensOf(FlxG.sound.music); FlxTween.tween(FlxG.sound.music, {pitch: 1.0, volume: 1.0}, 1, {ease: FlxEase.quartInOut}); - playerChill.anim.play("deselect"); - gfChill.anim.play("deselect"); + playerChill.anim.play('deselect'); + gfChill.anim.play('deselect'); pressedSelect = false; FlxTween.tween(FlxG.sound.music, {pitch: 1.0}, 1, { ease: FlxEase.quartInOut, onComplete: (_) -> { - if (playerChill.getCurrentAnimation() == "deselect loop start" || playerChill.getCurrentAnimation() == "deselect") + if (playerChill.getCurrentAnimation() == 'deselect loop start' || playerChill.getCurrentAnimation() == 'deselect') { - playerChill.anim.play("idle", true); + playerChill.anim.play('idle', true); playerChill.anim.curAnim.looped = true; - gfChill.anim.play("idle", true); + gfChill.anim.play('idle', true); gfChill.anim.curAnim.looped = true; } } @@ -906,8 +906,8 @@ class CharSelectSubState extends MusicBeatSubState FlxTween.tween(FlxG.sound.music, {pitch: 0.1}, 1, {ease: FlxEase.quadInOut}); FlxTween.tween(FlxG.sound.music, {volume: 0.0}, 1.5, {ease: FlxEase.quadInOut}); - playerChill.anim.play("select"); - gfChill.anim.play("confirm", true); + playerChill.anim.play('select'); + gfChill.anim.play('confirm', true); gfChill.anim.curAnim.looped = true; pressedSelect = true; @@ -924,13 +924,13 @@ class CharSelectSubState extends MusicBeatSubState } else { - curChar = "locked"; + curChar = 'locked'; gfChill.visible = false; if (allowInput && (controls.ACCEPT_P || mobileAccept)) { - playerChill.anim.play("cannot select Label", true); + playerChill.anim.play('cannot select Label', true); lockedSound.play(true); HapticUtil.vibrate(0, 0.2); @@ -963,7 +963,7 @@ class CharSelectSubState extends MusicBeatSubState { backButton.enabled = false; backButton.alpha = 1; - backButton.animation.play("confirm"); + backButton.animation.play('confirm'); } #end @@ -1011,7 +1011,7 @@ class CharSelectSubState extends MusicBeatSubState } } - public override function dispatchEvent(event:ScriptEvent):Void + override public function dispatchEvent(event:ScriptEvent):Void { // super.dispatchEvent(event) dispatches event to module scripts. super.dispatchEvent(event); @@ -1053,7 +1053,7 @@ class CharSelectSubState extends MusicBeatSubState } } - private function updateLockAnims():Void + function updateLockAnims():Void { for (index => member in grpIcons.group.members) { @@ -1065,15 +1065,15 @@ class CharSelectSubState extends MusicBeatSubState { switch (lock.getCurrentAnimation()) { - case "idle": - lock.anim.play("selected"); - case "selected" | "clicked": - if (controls.ACCEPT_P || mobileAccept) lock.anim.play("clicked", true); + case 'idle': + lock.anim.play('selected'); + case 'selected' | 'clicked': + if (controls.ACCEPT_P || mobileAccept) lock.anim.play('clicked', true); } } else { - lock.anim.play("idle"); + lock.anim.play('idle'); } case 0: var memb:PixelatedIcon = cast member; @@ -1097,7 +1097,7 @@ class CharSelectSubState extends MusicBeatSubState if (pressedSelect && memb.animation.curAnim?.name == 'idle') memb.animation.play('confirm'); if (autoFollow && !pressedSelect && memb.animation.curAnim?.name != 'idle') { - memb.animation.play("confirm", false, true); + memb.animation.play('confirm', false, true); var onFinish:String->Void; onFinish = (_) -> @@ -1161,7 +1161,7 @@ class CharSelectSubState extends MusicBeatSubState curChar = value; - if (value == "locked") staticSound.play(); + if (value == 'locked') staticSound.play(); else staticSound.stop(); @@ -1171,7 +1171,7 @@ class CharSelectSubState extends MusicBeatSubState gfChill.visible = false; playerChill.visible = false; playerChillOut.visible = true; - playerChillOut.anim.play("slideout"); + playerChillOut.anim.play('slideout'); playerChillOut.anim.onFrameChange.removeAll(); playerChillOut.anim.onFrameChange.add(function(animName:String, frameNumber:Int, index:Int) diff --git a/source/funkin/ui/charSelect/IntroSubState.hx b/source/funkin/ui/charSelect/IntroSubState.hx index 1a068535e..1272aa3e9 100644 --- a/source/funkin/ui/charSelect/IntroSubState.hx +++ b/source/funkin/ui/charSelect/IntroSubState.hx @@ -22,7 +22,7 @@ class IntroSubState extends MusicBeatSubState static final LIGHTS_VIDEO_PATH:String = Paths.videos('introSelect'); #end - public override function create():Void + override public function create():Void { if (Save.instance.oldChar.value) { @@ -119,7 +119,7 @@ class IntroSubState extends MusicBeatSubState } #end - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); diff --git a/source/funkin/ui/credits/CreditsState.hx b/source/funkin/ui/credits/CreditsState.hx index 85b0b2ca1..451c200c1 100644 --- a/source/funkin/ui/credits/CreditsState.hx +++ b/source/funkin/ui/credits/CreditsState.hx @@ -91,7 +91,7 @@ class CreditsState extends MusicBeatState super(); } - public override function create():Void + override public function create():Void { super.create(); @@ -135,8 +135,6 @@ class CreditsState extends MusicBeatState creditsGroup.x = Math.max(funkin.ui.FullScreenScaleMode.gameNotchSize.x, SCREEN_PAD); creditsGroup.y = STARTING_HEIGHT; - // buildCreditsGroup(); - add(creditsGroup); // Music @@ -256,7 +254,7 @@ class CreditsState extends MusicBeatState creditsLineY += CREDITS_FONT_SIZE * 2.5; } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); @@ -299,7 +297,7 @@ class CreditsState extends MusicBeatState FlxG.switchState(() -> new MainMenuState()); } - public override function destroy():Void + override public function destroy():Void { super.destroy(); } diff --git a/source/funkin/ui/debug/WaveformTestState.hx b/source/funkin/ui/debug/WaveformTestState.hx index e7b203bbd..51debba8c 100644 --- a/source/funkin/ui/debug/WaveformTestState.hx +++ b/source/funkin/ui/debug/WaveformTestState.hx @@ -24,7 +24,7 @@ class WaveformTestState extends MusicBeatState var polygonSprite:MeshRender; var vertexCount:Int = 3; - public override function create():Void + override public function create():Void { super.create(); @@ -65,7 +65,7 @@ class WaveformTestState extends MusicBeatState // drawWaveform(time, duration); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); @@ -180,7 +180,7 @@ class WaveformTestState extends MusicBeatState polygonSprite.add_tri(centerVertex, lastVertex, firstVertex); } - public override function destroy():Void + override public function destroy():Void { super.destroy(); } diff --git a/source/funkin/ui/debug/anim/FlxAnimateTest.hx b/source/funkin/ui/debug/anim/FlxAnimateTest.hx index ad49f42f2..707e136d7 100644 --- a/source/funkin/ui/debug/anim/FlxAnimateTest.hx +++ b/source/funkin/ui/debug/anim/FlxAnimateTest.hx @@ -20,11 +20,11 @@ class FlxAnimateTest extends MusicBeatState implements ConsoleClass this.bgColor = 0xFF999999; } - public override function create():Void + override public function create():Void { super.create(); - sprite = FunkinSprite.createTextureAtlas(0, 0, "charSelect/bfChill", { + 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) @@ -33,7 +33,7 @@ class FlxAnimateTest extends MusicBeatState implements ConsoleClass add(sprite); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); @@ -42,10 +42,10 @@ class FlxAnimateTest extends MusicBeatState implements ConsoleClass if (FlxG.keys.anyJustPressed([A, LEFT])) sprite.anim.curAnim.curFrame--; if (FlxG.keys.anyJustPressed([D, RIGHT])) sprite.anim.curAnim.curFrame++; - if (FlxG.keys.justPressed.Q) sprite.anim.play("slidein idle point", true); - if (FlxG.keys.justPressed.W) sprite.anim.play("slidein", true); - if (FlxG.keys.justPressed.E) sprite.anim.play("death", true); - if (FlxG.keys.justPressed.R) sprite.anim.play("cannot select Label", true); - if (FlxG.keys.justPressed.T) sprite.anim.play("idle", true); + if (FlxG.keys.justPressed.Q) sprite.anim.play('slidein idle point', true); + if (FlxG.keys.justPressed.W) sprite.anim.play('slidein', true); + if (FlxG.keys.justPressed.E) sprite.anim.play('death', true); + if (FlxG.keys.justPressed.R) sprite.anim.play('cannot select Label', true); + if (FlxG.keys.justPressed.T) sprite.anim.play('idle', true); } } diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index 2fbcb42f2..234502d18 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -131,7 +131,7 @@ using Lambda; */ // @:nullSafety -@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/main-view.xml")) +@:build(haxe.ui.ComponentBuilder.build('assets/exclude/data/ui/chart-editor/main-view.xml')) class ChartEditorState extends UIState // UIState derives from MusicBeatState { /** @@ -2422,7 +2422,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState this.params = params; } - public override function dispatchEvent(event:ScriptEvent):Void + override public function dispatchEvent(event:ScriptEvent):Void { super.dispatchEvent(event); @@ -2460,7 +2460,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState } } - public override function reloadAssets() + override public function reloadAssets() { // If PlayState isn't open, do a regular reload. if (!isPlaytesting) @@ -2801,7 +2801,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState gridGhostNote = new ChartEditorNoteSprite(this, true); gridGhostNote.alpha = 0.6; - gridGhostNote.noteData = new SongNoteData(0, 0, 0, "", []); + gridGhostNote.noteData = new SongNoteData(0, 0, 0, '', []); gridGhostNote.visible = false; add(gridGhostNote); gridGhostNote.zIndex = 21; @@ -3128,12 +3128,12 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState buttonSelectOpponent = new Button(); buttonSelectOpponent.allowFocus = false; - buttonSelectOpponent.text = "Opponent"; // Default text. + buttonSelectOpponent.text = 'Opponent'; // Default text. buttonSelectOpponent.x = GRID_X_POS; buttonSelectOpponent.y = GRID_INITIAL_Y_POS - NOTE_SELECT_BUTTON_HEIGHT; buttonSelectOpponent.width = GRID_SIZE * 4; buttonSelectOpponent.height = NOTE_SELECT_BUTTON_HEIGHT; - buttonSelectOpponent.tooltip = "Click to set selection to all notes on this side.\nShift-click to add all notes on this side to selection."; + buttonSelectOpponent.tooltip = 'Click to set selection to all notes on this side./nShift-click to add all notes on this side to selection.'; buttonSelectOpponent.zIndex = 110; add(buttonSelectOpponent); @@ -3153,12 +3153,12 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState buttonSelectPlayer = new Button(); buttonSelectPlayer.allowFocus = false; - buttonSelectPlayer.text = "Player"; // Default text. + buttonSelectPlayer.text = 'Player'; // Default text. buttonSelectPlayer.x = buttonSelectOpponent.x + buttonSelectOpponent.width; buttonSelectPlayer.y = buttonSelectOpponent.y; buttonSelectPlayer.width = GRID_SIZE * 4; buttonSelectPlayer.height = NOTE_SELECT_BUTTON_HEIGHT; - buttonSelectPlayer.tooltip = "Click to set selection to all notes on this side.\nShift-click to add all notes on this side to selection."; + buttonSelectPlayer.tooltip = 'Click to set selection to all notes on this side./nShift-click to add all notes on this side to selection.'; buttonSelectPlayer.zIndex = 110; add(buttonSelectPlayer); @@ -3179,12 +3179,12 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState buttonSelectEvent = new Button(); buttonSelectEvent.allowFocus = false; buttonSelectEvent.icon = Paths.image('ui/chart-editor/events/Default'); - buttonSelectEvent.iconPosition = "top"; + buttonSelectEvent.iconPosition = 'top'; buttonSelectEvent.x = buttonSelectPlayer.x + buttonSelectPlayer.width; buttonSelectEvent.y = buttonSelectPlayer.y; buttonSelectEvent.width = GRID_SIZE; buttonSelectEvent.height = NOTE_SELECT_BUTTON_HEIGHT; - buttonSelectEvent.tooltip = "Click to set selection to all events.\nShift-click to add all events to selection."; + buttonSelectEvent.tooltip = 'Click to set selection to all events./nShift-click to add all events to selection.'; buttonSelectEvent.zIndex = 110; add(buttonSelectEvent); @@ -3692,7 +3692,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState ]); this.infoWithActions('Auto-Save', 'Chart auto-saved to ${absoluteBackupsPath}.', [ { - text: "Open In Folder", + text: 'Open In Folder', callback: openBackupsFolder, } ]); @@ -3764,7 +3764,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState CrashHandler.criticalErrorSignal.remove(onWindowCrash); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { // Override F4 behavior to include the autosave. if (FlxG.keys.justPressed.F4 && !criticalFailure) @@ -3816,7 +3816,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState /** * Function called when the game window loses focus. */ - public override function onFocusLost():Void + override public function onFocusLost():Void { super.onFocusLost(); @@ -3830,7 +3830,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState /** * Function called when the game window regains focus. */ - public override function onFocus():Void + override public function onFocus():Void { super.onFocus(); @@ -4161,7 +4161,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState eventSprite.parentState = this; // trace('Creating new Event... (${renderedEvents.members.length})'); - if (eventData?.value != null && (eventData.getString("ease") != null && eventData.getInt("easeDir") == null)) + if (eventData?.value != null && (eventData.getString('ease') != null && eventData.getInt('easeDir') == null)) { eventData.value = migrateEventEaseDirectionFields(eventData.value); } @@ -4505,7 +4505,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState var currentPositionMeasureFlooredInMs:Float = Conductor.instance.getMeasureTimeInMs(Math.floor(currentPositionMeasure)); var targetScrollPosition:Float = 0; if (FlxMath.inBounds(playheadPosition, currentPositionMeasureFlooredInMs - 1, - currentPositionMeasureFlooredInMs + Conductor.instance.getTypeLengthAtMs(playheadPosition, "step"))) + currentPositionMeasureFlooredInMs + Conductor.instance.getTypeLengthAtMs(playheadPosition, 'step'))) { targetScrollPosition = Conductor.instance.getMeasureTimeInMs(Math.floor(currentPositionMeasure - 1)); } @@ -4674,8 +4674,8 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState function handleCursor():Void { // Mouse sounds - if (FlxG.mouse.justPressed) FunkinSound.playOnce(Paths.sound("chartingSounds/ClickDown")); - if (FlxG.mouse.justReleased) FunkinSound.playOnce(Paths.sound("chartingSounds/ClickUp")); + if (FlxG.mouse.justPressed) FunkinSound.playOnce(Paths.sound('chartingSounds/ClickDown')); + if (FlxG.mouse.justReleased) FunkinSound.playOnce(Paths.sound('chartingSounds/ClickUp')); // Note: If a menu is open in HaxeUI, don't handle cursor behavior. var shouldHandleCursor:Bool = !(isHaxeUIFocused || playbarHeadDragging || isHaxeUIDialogOpen) @@ -4704,7 +4704,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState // and fall back to the default cursor if none of the conditions are met. var targetCursorMode:Null = null; - if (gridTiledSprite == null) throw "ERROR: Tried to handle cursor, but gridTiledSprite is null! Check ChartEditorState.buildGrid()"; + if (gridTiledSprite == null) throw 'ERROR: Tried to handle cursor, but gridTiledSprite is null! Check ChartEditorState.buildGrid()'; var overlapsGrid:Bool = FlxG.mouse.overlaps(gridTiledSprite); @@ -5541,7 +5541,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState if (gridGhostNote != null) gridGhostNote.visible = false; if (gridGhostHoldNote != null) gridGhostHoldNote.visible = false; - if (gridGhostEvent == null) throw "ERROR: Tried to handle cursor, but gridGhostEvent is null! Check ChartEditorState.buildGrid()"; + if (gridGhostEvent == null) throw 'ERROR: Tried to handle cursor, but gridGhostEvent is null! Check ChartEditorState.buildGrid()'; var eventData:SongEventData = gridGhostEvent.eventData != null ? gridGhostEvent.eventData : new SongEventData(cursorMs, eventKindToPlace, null); @@ -5561,7 +5561,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState { if (gridGhostEvent != null) gridGhostEvent.visible = false; - if (gridGhostNote == null) throw "ERROR: Tried to handle cursor, but gridGhostNote is null! Check ChartEditorState.buildGrid()"; + if (gridGhostNote == null) throw 'ERROR: Tried to handle cursor, but gridGhostNote is null! Check ChartEditorState.buildGrid()'; var noteData:SongNoteData = gridGhostNote.noteData != null ? gridGhostNote.noteData : new SongNoteData(cursorMs, cursorColumn, 0, noteKindToPlace, ChartEditorState.cloneNoteParams(noteParamsToPlace)); @@ -5766,7 +5766,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState */ function handlePlaybar():Void { - if (playbarHeadLayout == null) throw "ERROR: Tried to handle playbar, but playbarHeadLayout is null!"; + if (playbarHeadLayout == null) throw 'ERROR: Tried to handle playbar, but playbarHeadLayout is null!'; if (Conductor.instance == null || playbarSongRemaining == null) return; @@ -5834,7 +5834,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState // Look for notes within 1 step of the playhead. var notesAtPos:Array = SongDataUtils.getNotesInTimeRange(currentSongChartNoteData, playheadSnappedMs, - playheadSnappedMs + Conductor.instance.getTypeLengthAtMs(playheadSnappedMs, "step") * noteSnapRatio); + playheadSnappedMs + Conductor.instance.getTypeLengthAtMs(playheadSnappedMs, 'step') * noteSnapRatio); notesAtPos = SongDataUtils.getNotesWithData(notesAtPos, [column]); if (notesAtPos.length == 0 && !removeNoteInstead) @@ -5866,7 +5866,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState // Look for events within 1 step of the playhead. var eventsAtPos:Array = SongDataUtils.getEventsInTimeRange(currentSongChartEventData, playheadSnappedMs, - playheadSnappedMs + Conductor.instance.getTypeLengthAtMs(playheadSnappedMs, "step") * noteSnapRatio); + playheadSnappedMs + Conductor.instance.getTypeLengthAtMs(playheadSnappedMs, 'step') * noteSnapRatio); eventsAtPos = SongDataUtils.getEventsWithKind(eventsAtPos, ['FocusCamera']); if (eventsAtPos.length == 0 && !removeEventInstead) @@ -6494,11 +6494,11 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState FlxG.watch.addQuick('scrollPosInPixels', scrollPositionInPixels); FlxG.watch.addQuick('playheadPosInPixels', playheadPositionInPixels); - FlxG.watch.addQuick("tapNotesRendered", renderedNotes?.members?.length); - FlxG.watch.addQuick("holdNotesRendered", renderedHoldNotes?.members?.length); - FlxG.watch.addQuick("eventsRendered", renderedEvents?.members?.length); - FlxG.watch.addQuick("notesSelected", currentNoteSelection?.length); - FlxG.watch.addQuick("eventsSelected", currentEventSelection?.length); + FlxG.watch.addQuick('tapNotesRendered', renderedNotes?.members?.length); + FlxG.watch.addQuick('holdNotesRendered', renderedHoldNotes?.members?.length); + FlxG.watch.addQuick('eventsRendered', renderedEvents?.members?.length); + FlxG.watch.addQuick('notesSelected', currentNoteSelection?.length); + FlxG.watch.addQuick('eventsSelected', currentEventSelection?.length); } function handlePostUpdate():Void @@ -6691,7 +6691,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState function buildSelectionSquare():ChartEditorSelectionSquareSprite { if (selectionSquareBitmap == null) - throw "ERROR: Tried to build selection square, but selectionSquareBitmap is null! Check ChartEditorThemeHandler.updateSelectionSquare()"; + throw 'ERROR: Tried to build selection square, but selectionSquareBitmap is null! Check ChartEditorThemeHandler.updateSelectionSquare()'; // FlxG.bitmapLog.add(selectionSquareBitmap, "selectionSquareBitmap"); var result = new ChartEditorSelectionSquareSprite(this); @@ -7056,7 +7056,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState ]); this.infoWithActions('Auto-Save', 'Chart auto-saved to ${absoluteBackupsPath}.', [ { - text: "Open In Folder", + text: 'Open In Folder', callback: openBackupsFolder, } ]); @@ -7314,7 +7314,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState { switch (data.eventKind) { - case "PlayAnimation": + case 'PlayAnimation': switch (data.getString('target').toLowerCase().trim()) { case 'boyfriend' | 'bf' | 'player': @@ -7616,17 +7616,17 @@ enum abstract ChartEditorLiveInputStyle(String) /** * No hotkeys to place notes at the playbar. */ - var None; + public var None; /** * 1/2/3/4 to place notes on opponent's side, 5/6/7/8 to place notes on player's side. */ - var NumberKeys; + public var NumberKeys; /** * WASD to place notes on opponent's side, Arrow keys to place notes on player's side. */ - var WASDKeys; + public var WASDKeys; } typedef ChartEditorParams = @@ -7665,10 +7665,10 @@ enum abstract ChartEditorTheme(String) /** * The default theme for the chart editor. */ - var Light; + public var Light; /** * A theme which introduces darker colors. */ - var Dark; + public var Dark; } diff --git a/source/funkin/ui/debug/charting/components/ChartEditorHoldNoteSprite.hx b/source/funkin/ui/debug/charting/components/ChartEditorHoldNoteSprite.hx index b2644f9a1..b355f8620 100644 --- a/source/funkin/ui/debug/charting/components/ChartEditorHoldNoteSprite.hx +++ b/source/funkin/ui/debug/charting/components/ChartEditorHoldNoteSprite.hx @@ -118,7 +118,7 @@ class ChartEditorHoldNoteSprite extends SustainTrail setup(); } - public override function updateHitbox():Void + override public function updateHitbox():Void { // Expand the clickable hitbox to the full column width, then nudge to the left to re-center it. width = ChartEditorState.GRID_SIZE; @@ -151,7 +151,7 @@ class ChartEditorHoldNoteSprite extends SustainTrail /** * Call this to override how debug bounding boxes are drawn for this sprite. */ - public override function drawDebugOnCamera(camera:flixel.FlxCamera):Void + override public function drawDebugOnCamera(camera:flixel.FlxCamera):Void { if (!camera.visible || !camera.exists || !isOnScreen(camera)) return; @@ -179,14 +179,14 @@ class ChartEditorHoldNoteSprite extends SustainTrail updateHitbox(); } - public override function revive():Void + override public function revive():Void { super.revive(); setup(); } - public override function kill():Void + override public function kill():Void { super.kill(); diff --git a/source/funkin/ui/debug/charting/dialogs/ChartEditorBaseDialog.hx b/source/funkin/ui/debug/charting/dialogs/ChartEditorBaseDialog.hx index 9d35d7103..d95b6d657 100644 --- a/source/funkin/ui/debug/charting/dialogs/ChartEditorBaseDialog.hx +++ b/source/funkin/ui/debug/charting/dialogs/ChartEditorBaseDialog.hx @@ -28,7 +28,7 @@ class ChartEditorBaseDialog extends Dialog this.onDialogClosed = event -> onClose(event); } - public override function showDialog(modal:Bool = true):Void + override public function showDialog(modal:Bool = true):Void { super.showDialog(modal); fadeInComponent(this, 1); @@ -71,7 +71,7 @@ class ChartEditorBaseDialog extends Dialog } static final OVERLAY_EASE_DURATION:Float = 0.2; - static final OVERLAY_EASE_TYPE:String = "easeOut"; + static final OVERLAY_EASE_TYPE:String = 'easeOut'; function fadeInDialogOverlay():Void { @@ -93,8 +93,8 @@ class ChartEditorBaseDialog extends Dialog function fadeInComponent(component:Component, fadeTo:Float = 1):Void { var builder = new AnimationBuilder(component, OVERLAY_EASE_DURATION, OVERLAY_EASE_TYPE); - builder.setPosition(0, "opacity", 0, true); // 0% absolute - builder.setPosition(100, "opacity", fadeTo, true); + builder.setPosition(0, 'opacity', 0, true); // 0% absolute + builder.setPosition(100, 'opacity', fadeTo, true); trace('Fading in dialog component...'); builder.play(); diff --git a/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadChartDialog.hx b/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadChartDialog.hx index db07c501e..2bef8bbe6 100644 --- a/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadChartDialog.hx +++ b/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadChartDialog.hx @@ -10,7 +10,7 @@ import haxe.ui.containers.dialogs.Dialog.DialogButton; import haxe.ui.containers.dialogs.Dialog.DialogEvent; // @:nullSafety // TODO: Fix null safety when used with HaxeUI build macros. -@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/dialogs/upload-chart.xml")) @:access(funkin.ui.debug.charting.ChartEditorState) +@:build(haxe.ui.ComponentBuilder.build('assets/exclude/data/ui/chart-editor/dialogs/upload-chart.xml')) @:access(funkin.ui.debug.charting.ChartEditorState) class ChartEditorUploadChartDialog extends ChartEditorBaseDialog { var dropHandlers:Array = []; @@ -56,7 +56,7 @@ class ChartEditorUploadChartDialog extends ChartEditorBaseDialog return dialog; } - public override function onClose(event:DialogEvent):Void + override public function onClose(event:DialogEvent):Void { super.onClose(event); @@ -72,13 +72,13 @@ class ChartEditorUploadChartDialog extends ChartEditorBaseDialog } } - public override function lock():Void + override public function lock():Void { super.lock(); this.dialogCancel.disabled = true; } - public override function unlock():Void + override public function unlock():Void { super.unlock(); this.dialogCancel.disabled = false; diff --git a/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadVocalsDialog.hx b/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadVocalsDialog.hx index 275eb0f6b..caa4207c9 100644 --- a/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadVocalsDialog.hx +++ b/source/funkin/ui/debug/charting/dialogs/ChartEditorUploadVocalsDialog.hx @@ -17,7 +17,7 @@ import haxe.ui.core.Component; // @:nullSafety // TODO: Fix null safety when used with HaxeUI build macros. -@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/dialogs/upload-vocals.xml")) @:access(funkin.ui.debug.charting.ChartEditorState) +@:build(haxe.ui.ComponentBuilder.build('assets/exclude/data/ui/chart-editor/dialogs/upload-vocals.xml')) @:access(funkin.ui.debug.charting.ChartEditorState) class ChartEditorUploadVocalsDialog extends ChartEditorBaseDialog { var dropHandlers:Array = []; @@ -171,7 +171,7 @@ class ChartEditorUploadVocalsDialog extends ChartEditorBaseDialog return dialog; } - public override function onClose(event:DialogEvent):Void + override public function onClose(event:DialogEvent):Void { super.onClose(event); @@ -187,13 +187,13 @@ class ChartEditorUploadVocalsDialog extends ChartEditorBaseDialog } } - public override function lock():Void + override public function lock():Void { super.lock(); this.dialogCancel.disabled = true; } - public override function unlock():Void + override public function unlock():Void { super.unlock(); this.dialogCancel.disabled = false; @@ -245,7 +245,7 @@ class ChartEditorUploadVocalsDialog extends ChartEditorBaseDialog } } -@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/dialogs/upload-vocals-entry.xml")) +@:build(haxe.ui.ComponentBuilder.build('assets/exclude/data/ui/chart-editor/dialogs/upload-vocals-entry.xml')) class ChartEditorUploadVocalsEntry extends Box { public var vocalsEntryLabel:Label; diff --git a/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx b/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx index 1ff254281..b41308649 100644 --- a/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx +++ b/source/funkin/ui/debug/charting/dialogs/ChartEditorWelcomeDialog.hx @@ -17,7 +17,7 @@ import haxe.ui.events.MouseEvent; * Builds and opens a dialog letting the user create a new chart, open a recent chart, or load from a template. * Opens when the chart editor first opens. */ -@:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/dialogs/welcome.xml")) @:access(funkin.ui.debug.charting.ChartEditorState) +@:build(haxe.ui.ComponentBuilder.build('assets/exclude/data/ui/chart-editor/dialogs/welcome.xml')) @:access(funkin.ui.debug.charting.ChartEditorState) class ChartEditorWelcomeDialog extends ChartEditorBaseDialog { /** @@ -32,8 +32,8 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog this.splashCreateFromSongBasicOnly.onClick = _ -> onClickLinkCreateBasicOnly(); this.splashCreateFromSongErectOnly.onClick = _ -> onClickLinkCreateErectOnly(); this.splashCreateFromSongBasicErect.onClick = _ -> onClickLinkCreateBasicErect(); - this.splashImportChartLegacy.onClick = _ -> onClickLinkImport("legacy"); - this.splashImportChartOsuMania.onClick = _ -> onClickLinkImport("osumania"); + this.splashImportChartLegacy.onClick = _ -> onClickLinkImport('legacy'); + this.splashImportChartOsuMania.onClick = _ -> onClickLinkImport('osumania'); this.splashImportChartStepMania.onClick = _ -> onClickLinkImport('stepmania'); // Add items to the Recent Charts list @@ -67,7 +67,7 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog return dialog; } - public override function onClose(event:DialogEvent):Void + override public function onClose(event:DialogEvent):Void { super.onClose(event); } @@ -80,7 +80,7 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog { var linkRecentChart:Link = new Link(); - var fileNamePattern:EReg = new EReg("([^/\\\\]+)$", ""); + var fileNamePattern:EReg = new EReg('([^/\\\\]+)$', ''); var fileName:String = fileNamePattern.match(chartPath) ? fileNamePattern.matched(1) : chartPath; linkRecentChart.text = fileName; @@ -94,8 +94,8 @@ class ChartEditorWelcomeDialog extends ChartEditorBaseDialog } else { - var lastModified:String = "Last Modified: " + sys.FileSystem.stat(chartPath).mtime.toString(); - linkRecentChart.tooltip += "\n" + lastModified; + var lastModified:String = 'Last Modified: ' + sys.FileSystem.stat(chartPath).mtime.toString(); + linkRecentChart.tooltip += '\n' + lastModified; } #end diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorDifficultyToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorDifficultyToolbox.hx index 793e41fa2..290b1e9b6 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorDifficultyToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorDifficultyToolbox.hx @@ -30,7 +30,7 @@ import haxe.ui.events.UIEvent; * and adding/removing variations and difficulties. */ // @:nullSafety // TODO: Fix null safety when used with HaxeUI build macros. -@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/difficulty.xml")) +@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build('assets/exclude/data/ui/chart-editor/toolboxes/difficulty.xml')) class ChartEditorDifficultyToolbox extends ChartEditorBaseToolbox { var difficultyToolboxTree:TreeView; @@ -103,7 +103,7 @@ class ChartEditorDifficultyToolbox extends ChartEditorBaseToolbox } } - Dialogs.messageBox("Are you sure? This cannot be undone.", "Remove Difficulty", MessageBoxType.TYPE_YESNO, callback); + Dialogs.messageBox('Are you sure? This cannot be undone.', 'Remove Difficulty', MessageBoxType.TYPE_YESNO, callback); }; difficultyToolboxSaveMetadata.onClick = function(_:UIEvent) @@ -114,12 +114,12 @@ class ChartEditorDifficultyToolbox extends ChartEditorBaseToolbox { switch (notification) { - case "success": - chartEditorState.success("Saved Metadata", 'Successfully wrote file (${chartEditorState.currentSongId}$vari-metadata.json).'); - case "info": - chartEditorState.info("Canceled Save Metadata", '(${chartEditorState.currentSongId}$vari-metadata.json)'); - case "error": - chartEditorState.error("Failure", 'Failed to write file (${chartEditorState.currentSongId}$vari-metadata.json).'); + case 'success': + chartEditorState.success('Saved Metadata', 'Successfully wrote file (${chartEditorState.currentSongId}$vari-metadata.json).'); + case 'info': + chartEditorState.info('Canceled Save Metadata', '(${chartEditorState.currentSongId}$vari-metadata.json)'); + case 'error': + chartEditorState.error('Failure', 'Failed to write file (${chartEditorState.currentSongId}$vari-metadata.json).'); } }); }; @@ -132,12 +132,12 @@ class ChartEditorDifficultyToolbox extends ChartEditorBaseToolbox { switch (notification) { - case "success": - chartEditorState.success("Saved Chart Data", 'Successfully wrote file (${chartEditorState.currentSongId}$vari-chart.json).'); - case "info": - chartEditorState.info("Canceled Save Chart Data", '(${chartEditorState.currentSongId}$vari-chart.json)'); - case "error": - chartEditorState.error("Failure", 'Failed to write file (${chartEditorState.currentSongId}$vari-chart.json).'); + case 'success': + chartEditorState.success('Saved Chart Data', 'Successfully wrote file (${chartEditorState.currentSongId}$vari-chart.json).'); + case 'info': + chartEditorState.info('Canceled Save Chart Data', '(${chartEditorState.currentSongId}$vari-chart.json)'); + case 'error': + chartEditorState.error('Failure', 'Failed to write file (${chartEditorState.currentSongId}$vari-chart.json).'); } }); }; @@ -315,7 +315,7 @@ class ChartEditorDifficultyToolbox extends ChartEditorBaseToolbox } } - public override function refresh():Void + override public function refresh():Void { super.refresh(); diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorEventDataToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorEventDataToolbox.hx index 994081268..0df1fb61a 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorEventDataToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorEventDataToolbox.hx @@ -31,7 +31,7 @@ import flixel.FlxG; /** * The toolbox which allows modifying information like Song Title, Scroll Speed, Characters/Stages, and starting BPM. */ -@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/event-data.xml")) +@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build('assets/exclude/data/ui/chart-editor/toolboxes/event-data.xml')) class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox { var toolboxEventsEventKind:DropDown; @@ -142,7 +142,7 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox } } - public override function refresh():Void + override public function refresh():Void { super.refresh(); @@ -249,7 +249,7 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox // Add a label for the data field. var label:Label = new Label(); label.text = field.title; - label.verticalAlign = "center"; + label.verticalAlign = 'center'; label.percentWidth = 50; hbox.addComponent(label); @@ -338,17 +338,17 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox inputBox.percentWidth = 50; if (field.type != FRAME) inputBox.addComponent(input); - if (field.type == ENUM && (field.name == "ease" || field.name == "easeDir")) + if (field.type == ENUM && (field.name == 'ease' || field.name == 'easeDir')) { _needEasePreview = true; } // Add a unit label if applicable. - if (field.units != null && field.units != "") + if (field.units != null && field.units != '') { var units:Label = new Label(); units.text = field.units; - units.verticalAlign = "center"; + units.verticalAlign = 'center'; inputBox.addComponent(units); } @@ -420,26 +420,26 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox if (easeGraphImage == null) { easeGraphImage = new Image(); - easeGraphImage.id = "easeGraph"; + easeGraphImage.id = 'easeGraph'; easeGraphImage.width = 100; easeGraphImage.height = 100; easeGraphImage.hidden = true; - easeGraphImage.verticalAlign = "bottom"; + easeGraphImage.verticalAlign = 'bottom'; } if (easeDotImage == null) { easeDotImage = new Image(); - easeDotImage.id = "easeDot"; + easeDotImage.id = 'easeDot'; easeDotImage.width = 16; easeDotImage.height = 100; easeDotImage.hidden = true; - easeDotImage.verticalAlign = "bottom"; + easeDotImage.verticalAlign = 'bottom'; } var easeHBox = new HBox(); easeHBox.percentWidth = 100; easeHBox.height = 100; - easeHBox.verticalAlign = "bottom"; + easeHBox.verticalAlign = 'bottom'; easeHBox.addComponent(easeGraphImage); easeHBox.addComponent(easeDotImage); @@ -458,14 +458,14 @@ class ChartEditorEventDataToolbox extends ChartEditorBaseToolbox { if (easeGraphImage == null || easeDotImage == null) return; - final easeVal:Null = chartEditorState.eventDataToPlace.get("ease"); - final easeDirVal:Null = chartEditorState.eventDataToPlace.get("easeDir"); - final easeStr:String = easeVal == null ? "linear" : easeVal; - final easeDirStr:String = easeDirVal == null ? "In" : easeDirVal; - final key:String = easeStr + (easeDirStr == "" ? "" : easeDirStr); + final easeVal:Null = chartEditorState.eventDataToPlace.get('ease'); + final easeDirVal:Null = chartEditorState.eventDataToPlace.get('easeDir'); + final easeStr:String = easeVal == null ? 'linear' : easeVal; + final easeDirStr:String = easeDirVal == null ? 'In' : easeDirVal; + final key:String = easeStr + (easeDirStr == '' ? '' : easeDirStr); // Hide preview when easing indicates a non-visual/legacy type such as "classic" - if (easeStr != null && easeStr.toLowerCase().indexOf("classic") != -1) + if (easeStr != null && easeStr.toLowerCase().indexOf('classic') != -1) { _dotTimer?.cancel(); _pauseTimer?.cancel(); diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorFreeplayToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorFreeplayToolbox.hx index 9724da6ca..4075867c1 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorFreeplayToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorFreeplayToolbox.hx @@ -21,7 +21,7 @@ import haxe.ui.events.UIEvent; * The toolbox which allows modifying information like Song Title, Scroll Speed, Characters/Stages, and starting BPM. */ // @:nullSafety // TODO: Fix null safety when used with HaxeUI build macros. -@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/freeplay.xml")) +@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build('assets/exclude/data/ui/chart-editor/toolboxes/freeplay.xml')) class ChartEditorFreeplayToolbox extends ChartEditorBaseToolbox { var waveformContainer:Absolute; @@ -300,7 +300,7 @@ class ChartEditorFreeplayToolbox extends ChartEditorBaseToolbox var tickLabel:Label = new Label(); tickLabel.text = formatTime(tickTime); - tickLabel.styleNames = "offset-ticks-label"; + tickLabel.styleNames = 'offset-ticks-label'; tickLabel.height = labelHeight; // Positioning within offsetTicksContainer is absolute (relative to the container itself). tickLabel.top = labelYPos; @@ -313,7 +313,7 @@ class ChartEditorFreeplayToolbox extends ChartEditorBaseToolbox function formatTime(seconds:Float):String { - if (seconds <= 0) return "0.0"; + if (seconds <= 0) return '0.0'; var integerSeconds = Math.floor(seconds); var decimalSeconds = Math.floor((seconds - integerSeconds) * 10); @@ -570,7 +570,7 @@ class ChartEditorFreeplayToolbox extends ChartEditorBaseToolbox audioPreviewTracks.pause(); } - public override function update(elapsed:Float) + override public function update(elapsed:Float) { super.update(elapsed); @@ -640,7 +640,7 @@ class ChartEditorFreeplayToolbox extends ChartEditorBaseToolbox } } - public override function refresh():Void + override public function refresh():Void { super.refresh(); diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx index d6f4759f5..3e2ea9752 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorMetadataToolbox.hx @@ -27,7 +27,7 @@ import haxe.ui.events.UIEvent; * The toolbox which allows modifying information like Song Title, Scroll Speed, Characters/Stages, and starting BPM. */ // @:nullSafety // TODO: Fix null safety when used with HaxeUI build macros. -@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/metadata.xml")) +@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build('assets/exclude/data/ui/chart-editor/toolboxes/metadata.xml')) class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox { var inputSongId:TextField; @@ -360,7 +360,7 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox return currentTimeChange; } - public override function refresh():Void + override public function refresh():Void { super.refresh(); @@ -383,21 +383,21 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox var stage:Null = StageRegistry.instance.fetchEntry(stageId); if (inputStage != null) { - inputStage.value = (stage != null) ? {id: stage.id, text: stage.stageName} : {id: "mainStage", text: "Main Stage"}; + inputStage.value = (stage != null) ? {id: stage.id, text: stage.stageName} : {id: 'mainStage', text: 'Main Stage'}; } var noteStyleId:String = chartEditorState.currentSongNoteStyle; var noteStyle:Null = NoteStyleRegistry.instance.fetchEntry(noteStyleId); if (inputNoteStyle != null) { - inputNoteStyle.value = (noteStyle != null) ? {id: noteStyle.id, text: noteStyle.getName()} : {id: "Funkin", text: "Funkin'"}; + inputNoteStyle.value = (noteStyle != null) ? {id: noteStyle.id, text: noteStyle.getName()} : {id: 'Funkin', text: "Funkin'"}; } var albumId:String = chartEditorState.currentSongAlbum; var album:Null = AlbumRegistry.instance.fetchEntry(albumId); if (inputAlbum != null) { - inputAlbum.value = (album != null) ? {id: album.id, text: album.getAlbumName()} : {id: "volume1", text: "Volume 1"}; + inputAlbum.value = (album != null) ? {id: album.id, text: album.getAlbumName()} : {id: 'volume1', text: 'Volume 1'}; } var LIMIT = 6; @@ -411,7 +411,7 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox else { buttonCharacterOpponent.icon = null; - buttonCharacterOpponent.text = "None"; + buttonCharacterOpponent.text = 'None'; } var charDataGirlfriend:Null = CharacterDataParser.fetchCharacterData(chartEditorState.currentSongMetadata.playData.characters.girlfriend); @@ -423,7 +423,7 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox else { buttonCharacterGirlfriend.icon = null; - buttonCharacterGirlfriend.text = "None"; + buttonCharacterGirlfriend.text = 'None'; } var charDataPlayer:Null = CharacterDataParser.fetchCharacterData(chartEditorState.currentSongMetadata.playData.characters.player); @@ -435,7 +435,7 @@ class ChartEditorMetadataToolbox extends ChartEditorBaseToolbox else { buttonCharacterPlayer.icon = null; - buttonCharacterPlayer.text = "None"; + buttonCharacterPlayer.text = 'None'; } } diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorNoteDataToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorNoteDataToolbox.hx index 5d382d4b0..b1c523acb 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorNoteDataToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorNoteDataToolbox.hx @@ -17,7 +17,7 @@ import funkin.data.song.SongData.NoteParamData; /** * The toolbox which allows modifying information like Note Kind. */ -@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/note-data.xml")) +@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build('assets/exclude/data/ui/chart-editor/toolboxes/note-data.xml')) class ChartEditorNoteDataToolbox extends ChartEditorBaseToolbox { // 100 is the height used in note-data.xml @@ -141,7 +141,7 @@ class ChartEditorNoteDataToolbox extends ChartEditorBaseToolbox toolboxNotesCustomKind.resumeEvent(UIEvent.CHANGE, true, true); } - public override function refresh():Void + override public function refresh():Void { super.refresh(); @@ -202,8 +202,8 @@ class ChartEditorNoteDataToolbox extends ChartEditorBaseToolbox var paramLabel:Label = new Label(); paramLabel.value = param.description; - paramLabel.verticalAlign = "center"; - paramLabel.horizontalAlign = "right"; + paramLabel.verticalAlign = 'center'; + paramLabel.horizontalAlign = 'right'; var paramComponent:Component = null; diff --git a/source/funkin/ui/debug/charting/toolboxes/ChartEditorOffsetsToolbox.hx b/source/funkin/ui/debug/charting/toolboxes/ChartEditorOffsetsToolbox.hx index a6c17ac5d..101722a1c 100644 --- a/source/funkin/ui/debug/charting/toolboxes/ChartEditorOffsetsToolbox.hx +++ b/source/funkin/ui/debug/charting/toolboxes/ChartEditorOffsetsToolbox.hx @@ -21,7 +21,7 @@ import haxe.ui.events.UIEvent; */ // @:nullSafety // TODO: Fix null safety when used with HaxeUI build macros. -@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build("assets/exclude/data/ui/chart-editor/toolboxes/offsets.xml")) +@:access(funkin.ui.debug.charting.ChartEditorState) @:build(haxe.ui.ComponentBuilder.build('assets/exclude/data/ui/chart-editor/toolboxes/offsets.xml')) class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox { var waveformContainer:Absolute; @@ -319,7 +319,7 @@ class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox var tickLabel:Label = new Label(); tickLabel.text = formatTime(tickTime); - tickLabel.styleNames = "offset-ticks-label"; + tickLabel.styleNames = 'offset-ticks-label'; tickLabel.height = labelHeight; // Positioning within offsetTicksContainer is absolute (relative to the container itself). tickLabel.top = labelYPos; @@ -332,7 +332,7 @@ class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox function formatTime(seconds:Float):String { - if (seconds <= 0) return "0.0"; + if (seconds <= 0) return '0.0'; var integerSeconds = Math.floor(seconds); var decimalSeconds = Math.floor((seconds - integerSeconds) * 10); @@ -618,21 +618,21 @@ class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox if (trackInst != null) { trackInst.muted = true; - offsetInstrumentalMute.text = trackInst.muted ? "Unmute" : "Mute"; + offsetInstrumentalMute.text = trackInst.muted ? 'Unmute' : 'Mute'; } case Waveform.PLAYER: var trackPlayer = audioPreviewTracks.members[1]; if (trackPlayer != null) { trackPlayer.muted = true; - offsetPlayerMute.text = trackPlayer.muted ? "Unmute" : "Mute"; + offsetPlayerMute.text = trackPlayer.muted ? 'Unmute' : 'Mute'; } case Waveform.OPPONENT: var trackOpponent = audioPreviewTracks.members[2]; if (trackOpponent != null) { trackOpponent.muted = true; - offsetOpponentMute.text = trackOpponent.muted ? "Unmute" : "Mute"; + offsetOpponentMute.text = trackOpponent.muted ? 'Unmute' : 'Mute'; } } } @@ -646,21 +646,21 @@ class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox if (trackInst != null) { trackInst.muted = false; - offsetInstrumentalMute.text = trackInst.muted ? "Unmute" : "Mute"; + offsetInstrumentalMute.text = trackInst.muted ? 'Unmute' : 'Mute'; } case Waveform.PLAYER: var trackPlayer = audioPreviewTracks.members[1]; if (trackPlayer != null) { trackPlayer.muted = false; - offsetPlayerMute.text = trackPlayer.muted ? "Unmute" : "Mute"; + offsetPlayerMute.text = trackPlayer.muted ? 'Unmute' : 'Mute'; } case Waveform.OPPONENT: var trackOpponent = audioPreviewTracks.members[2]; if (trackOpponent != null) { trackOpponent.muted = false; - offsetOpponentMute.text = trackOpponent.muted ? "Unmute" : "Mute"; + offsetOpponentMute.text = trackOpponent.muted ? 'Unmute' : 'Mute'; } } } @@ -674,21 +674,21 @@ class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox if (trackInst != null) { trackInst.muted = !trackInst.muted; - offsetInstrumentalMute.text = trackInst.muted ? "Unmute" : "Mute"; + offsetInstrumentalMute.text = trackInst.muted ? 'Unmute' : 'Mute'; } case Waveform.PLAYER: var trackPlayer = audioPreviewTracks.members[1]; if (trackPlayer != null) { trackPlayer.muted = !trackPlayer.muted; - offsetPlayerMute.text = trackPlayer.muted ? "Unmute" : "Mute"; + offsetPlayerMute.text = trackPlayer.muted ? 'Unmute' : 'Mute'; } case Waveform.OPPONENT: var trackOpponent = audioPreviewTracks.members[2]; if (trackOpponent != null) { trackOpponent.muted = !trackOpponent.muted; - offsetOpponentMute.text = trackOpponent.muted ? "Unmute" : "Mute"; + offsetOpponentMute.text = trackOpponent.muted ? 'Unmute' : 'Mute'; } } } @@ -716,7 +716,7 @@ class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox } } - public override function update(elapsed:Float) + override public function update(elapsed:Float) { super.update(elapsed); @@ -793,7 +793,7 @@ class ChartEditorOffsetsToolbox extends ChartEditorBaseToolbox // Math.min(waveformScrollview.hscrollPos + waveformScrollview.width, waveformContainer.width)); } - public override function refresh():Void + override public function refresh():Void { super.refresh(); diff --git a/source/funkin/ui/debug/dialogue/ConversationDebugState.hx b/source/funkin/ui/debug/dialogue/ConversationDebugState.hx index 6a23358e5..bb8fc6e18 100644 --- a/source/funkin/ui/debug/dialogue/ConversationDebugState.hx +++ b/source/funkin/ui/debug/dialogue/ConversationDebugState.hx @@ -24,7 +24,7 @@ class ConversationDebugState extends MusicBeatState Paths.setCurrentLevel('week6'); } - public override function create():Void + override public function create():Void { super.create(); startConversation(); @@ -52,13 +52,13 @@ class ConversationDebugState extends MusicBeatState conversation = null; } - public override function dispatchEvent(event:ScriptEvent):Void + override public function dispatchEvent(event:ScriptEvent):Void { // Dispatch event to conversation script. ScriptEventDispatcher.callEvent(conversation, event); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); diff --git a/source/funkin/ui/debug/stageeditor/components/ExitConfirmDialog.hx b/source/funkin/ui/debug/stageeditor/components/ExitConfirmDialog.hx index 8385a6b68..f930bbeb8 100644 --- a/source/funkin/ui/debug/stageeditor/components/ExitConfirmDialog.hx +++ b/source/funkin/ui/debug/stageeditor/components/ExitConfirmDialog.hx @@ -3,7 +3,7 @@ package funkin.ui.debug.stageeditor.components; #if FEATURE_STAGE_EDITOR import haxe.ui.containers.dialogs.Dialog; -@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/stage-editor/dialogs/exit-confirm.xml")) +@:build(haxe.ui.macros.ComponentMacros.build('assets/exclude/data/ui/stage-editor/dialogs/exit-confirm.xml')) class ExitConfirmDialog extends Dialog { var onComplete:Void->Void = null; @@ -14,15 +14,15 @@ class ExitConfirmDialog extends Dialog onComplete = onComp; - buttons = DialogButton.CANCEL | "{{Proceed}}"; - defaultButton = "{{Proceed}}"; + buttons = DialogButton.CANCEL | '{{Proceed}}'; + defaultButton = '{{Proceed}}'; destroyOnClose = true; } - public override function validateDialog(button:DialogButton, fn:Bool->Void) + override public function validateDialog(button:DialogButton, fn:Bool->Void) { - if (button == "{{Proceed}}" && onComplete != null) + if (button == '{{Proceed}}' && onComplete != null) { onComplete(); } diff --git a/source/funkin/ui/debug/stageeditor/components/FindObjDialog.hx b/source/funkin/ui/debug/stageeditor/components/FindObjDialog.hx index 163502026..06fc54300 100644 --- a/source/funkin/ui/debug/stageeditor/components/FindObjDialog.hx +++ b/source/funkin/ui/debug/stageeditor/components/FindObjDialog.hx @@ -5,7 +5,7 @@ import haxe.ui.containers.dialogs.Dialog; import haxe.ui.components.TextField; import haxe.ui.components.CheckBox; -@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/stage-editor/dialogs/find-object.xml")) +@:build(haxe.ui.macros.ComponentMacros.build('assets/exclude/data/ui/stage-editor/dialogs/find-object.xml')) class FindObjDialog extends Dialog { var stageEditorState:StageEditorState; @@ -15,7 +15,7 @@ class FindObjDialog extends Dialog var checkWord:CheckBox; var checkCaps:CheckBox; - override public function new(state:StageEditorState, searchFor:String = "") + override public function new(state:StageEditorState, searchFor:String = '') { super(); @@ -32,8 +32,8 @@ class FindObjDialog extends Dialog top = 20; left = FlxG.width - width - 20; - buttons = DialogButton.CANCEL | "{{Find Next}}"; - defaultButton = "{{Find Next}}"; + buttons = DialogButton.CANCEL | '{{Find Next}}'; + defaultButton = '{{Find Next}}'; } public function updateIndicator() @@ -63,23 +63,23 @@ class FindObjDialog extends Dialog if (assets.length > 0) { - indicator.text = "Selected: " + (assets.indexOf(stageEditorState.selectedSprite) + 1) + " / " + assets.length; + indicator.text = 'Selected: ' + (assets.indexOf(stageEditorState.selectedSprite) + 1) + ' / ' + assets.length; } else { - indicator.text = "No Matches Found"; + indicator.text = 'No Matches Found'; } - if (field.text != "" && field.text != null) indicator.show(); + if (field.text != '' && field.text != null) indicator.show(); else indicator.hide(); } - public override function validateDialog(button:DialogButton, fn:Bool->Void) + override public function validateDialog(button:DialogButton, fn:Bool->Void) { var done = true; - if (button == "{{Find Next}}") + if (button == '{{Find Next}}') { done = false; @@ -91,7 +91,7 @@ class FindObjDialog extends Dialog if (curSelected >= assets.length) curSelected = 0; stageEditorState.selectedSprite = assets[curSelected]; - indicator.text = "Selected: " + (assets.indexOf(stageEditorState.selectedSprite) + 1) + " / " + assets.length; + indicator.text = 'Selected: ' + (assets.indexOf(stageEditorState.selectedSprite) + 1) + ' / ' + assets.length; stageEditorState.camFollow.x = assets[curSelected].getMidpoint().x; stageEditorState.camFollow.y = assets[curSelected].getMidpoint().y; diff --git a/source/funkin/ui/debug/stageeditor/components/NewObjDialog.hx b/source/funkin/ui/debug/stageeditor/components/NewObjDialog.hx index 6c61911a2..b62bf9c55 100644 --- a/source/funkin/ui/debug/stageeditor/components/NewObjDialog.hx +++ b/source/funkin/ui/debug/stageeditor/components/NewObjDialog.hx @@ -7,7 +7,7 @@ import openfl.display.BitmapData; import haxe.ui.notifications.NotificationType; import haxe.ui.notifications.NotificationManager; -@:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/stage-editor/dialogs/new-object.xml")) +@:build(haxe.ui.macros.ComponentMacros.build('assets/exclude/data/ui/stage-editor/dialogs/new-object.xml')) class NewObjDialog extends Dialog { public var bitmapName:Null = null; @@ -24,33 +24,33 @@ class NewObjDialog extends Dialog field.onChange = function(_) { - field.removeClasses(["invalid-value", "valid-value"]); + field.removeClasses(['invalid-value', 'valid-value']); } - buttons = DialogButton.CANCEL | "{{Create}}"; - defaultButton = "{{Create}}"; + buttons = DialogButton.CANCEL | '{{Create}}'; + defaultButton = '{{Create}}'; destroyOnClose = true; } - public override function validateDialog(button:DialogButton, fn:Bool->Void) + override public function validateDialog(button:DialogButton, fn:Bool->Void) { var done = true; - if (button == "{{Create}}") + if (button == '{{Create}}') { var objNames = [ for (obj in StageEditorState.instance.spriteArray) obj.name ]; - if (field.text == "" || field.text == null || objNames.contains(field.text)) + if (field.text == '' || field.text == null || objNames.contains(field.text)) { - field.swapClass("invalid-value", "valid-value"); + field.swapClass('invalid-value', 'valid-value'); done = false; NotificationManager.instance.addNotification({ - title: "Problem Creating an Object", - body: objNames.contains(field.text) ? "Object with the Name " + field.text + " already exists!" : "Invalid Object Name!", + title: 'Problem Creating an Object', + body: objNames.contains(field.text) ? 'Object with the Name ' + field.text + ' already exists!' : 'Invalid Object Name!', type: NotificationType.Error }); } @@ -80,8 +80,8 @@ class NewObjDialog extends Dialog stageEditorState.saved = false; NotificationManager.instance.addNotification({ - title: "Object Creating Successful", - body: "Successfully created an Object with the Name " + field.text + "!", + title: 'Object Creating Successful', + body: 'Successfully created an Object with the Name ' + field.text + '!', type: NotificationType.Success }); } diff --git a/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectPropertiesToolbox.hx b/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectPropertiesToolbox.hx index 7012abc15..56c1eb03e 100644 --- a/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectPropertiesToolbox.hx +++ b/source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectPropertiesToolbox.hx @@ -11,7 +11,7 @@ import haxe.ui.util.Color; import flixel.util.FlxColor; import haxe.ui.events.UIEvent; -@:access(funkin.ui.debug.stageeditor.StageEditorState) @:build(haxe.ui.macros.ComponentMacros.build("assets/exclude/data/ui/stage-editor/toolboxes/object-properties.xml")) +@:access(funkin.ui.debug.stageeditor.StageEditorState) @:build(haxe.ui.macros.ComponentMacros.build('assets/exclude/data/ui/stage-editor/toolboxes/object-properties.xml')) class StageEditorObjectPropertiesToolbox extends StageEditorDefaultToolbox { var linkedObj:StageEditorObject = null; @@ -36,7 +36,7 @@ class StageEditorObjectPropertiesToolbox extends StageEditorDefaultToolbox super(state); // Initialize the custom DropDown view. - DropDownBuilder.HANDLER_MAP.set("objTint", Type.getClassName(ObjectTintHandler)); + DropDownBuilder.HANDLER_MAP.set('objTint', Type.getClassName(ObjectTintHandler)); // Numeric callbacks. objPosX.onChange = function(_) @@ -122,7 +122,7 @@ class StageEditorObjectPropertiesToolbox extends StageEditorDefaultToolbox { if (linkedObj != null) { - linkedObj.blend = (objBlend.selectedItem?.text ?? "NONE") == "NONE" ? null : AssetDataHandler.blendFromString(objBlend.selectedItem.text); + linkedObj.blend = (objBlend.selectedItem?.text ?? 'NONE') == 'NONE' ? null : AssetDataHandler.blendFromString(objBlend.selectedItem.text); } } @@ -169,7 +169,7 @@ class StageEditorObjectPropertiesToolbox extends StageEditorDefaultToolbox objFlipY.selected = false; objBlend.selectedIndex = 0; - objTint.selectedItem = Color.fromString("white"); + objTint.selectedItem = Color.fromString('white'); return; } @@ -190,7 +190,7 @@ class StageEditorObjectPropertiesToolbox extends StageEditorDefaultToolbox if (objFlipX.selected != linkedObj.flipX) objFlipX.selected = linkedObj.flipX; if (objFlipY.selected != linkedObj.flipY) objFlipY.selected = linkedObj.flipY; - var blendMode:String = Std.string(linkedObj.blend) ?? "NONE"; + var blendMode:String = Std.string(linkedObj.blend) ?? 'NONE'; if (objBlend.selectedItem != blendMode.toUpperCase()) objBlend.selectedItem = blendMode.toUpperCase(); var objColor:Color = Color.fromComponents(linkedObj.color.red, linkedObj.color.green, linkedObj.color.blue, linkedObj.color.alpha); @@ -219,7 +219,7 @@ private class ObjectTintHandler extends DropDownHandler return _view; } - public override function prepare(_) + override public function prepare(_) { super.prepare(_); if (_view != null) _view.currentColor = _cachedSelectedColor; diff --git a/source/funkin/ui/freeplay/CapsuleOptionsMenu.hx b/source/funkin/ui/freeplay/CapsuleOptionsMenu.hx index ccdb8ab6c..a263f2059 100644 --- a/source/funkin/ui/freeplay/CapsuleOptionsMenu.hx +++ b/source/funkin/ui/freeplay/CapsuleOptionsMenu.hx @@ -71,7 +71,7 @@ class CapsuleOptionsMenu extends FlxSpriteGroup capsuleMenuBG.animation.play('open', true); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index 686cf2949..596bfdc15 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -306,7 +306,7 @@ class FreeplayState extends MusicBeatSubState var allScriptedCards:Array = ScriptedBackingCard.listScriptClasses(); for (cardClass in allScriptedCards) { - var card:BackingCard = ScriptedBackingCard.scriptInit(cardClass, "unknown"); + var card:BackingCard = ScriptedBackingCard.scriptInit(cardClass, 'unknown'); if (card.currentCharacter == currentCharacterId) { backingCardPrep = card; @@ -548,7 +548,7 @@ class FreeplayState extends MusicBeatSubState ostName.shader = new StrokeShader(0xFFFFFFFF, 2, 2); charSelectHint.alignment = CENTER; - charSelectHint.font = "5by7"; + charSelectHint.font = '5by7'; charSelectHint.color = 0xFF5F5F5F; #if FEATURE_TOUCH_CONTROLS if (ControlsHandler.hasExternalInputDevice) @@ -863,7 +863,7 @@ class FreeplayState extends MusicBeatSubState * Dispatches script events to all relevant scripted classes. * @param event */ - public override function dispatchEvent(event:ScriptEvent):Void + override public function dispatchEvent(event:ScriptEvent):Void { // Dispatch to scripted modules. super.dispatchEvent(event); @@ -884,23 +884,23 @@ class FreeplayState extends MusicBeatSubState @:privateAccess public function createFreeplayDJ(x:Float, y:Float, characterId:String):Void { - final renderType:String = (currentCharacter?.getFreeplayDJData()?.renderType ?? "animateatlas").trim().toLowerCase(); - final scriptClass:String = (currentCharacter?.getFreeplayDJData()?.scriptClass ?? "").trim(); + final renderType:String = (currentCharacter?.getFreeplayDJData()?.renderType ?? 'animateatlas').trim().toLowerCase(); + final scriptClass:String = (currentCharacter?.getFreeplayDJData()?.scriptClass ?? '').trim(); switch (renderType) { - case "animateatlas": - dj = (scriptClass != "") ? (ScriptedAnimateAtlasFreeplayDJ.scriptInit(scriptClass, x, y, + case 'animateatlas': + dj = (scriptClass != '') ? (ScriptedAnimateAtlasFreeplayDJ.scriptInit(scriptClass, x, y, characterId)) : (new AnimateAtlasFreeplayDJ(x, y, characterId)); - case "sparrow": - dj = (scriptClass != "") ? (ScriptedSparrowFreeplayDJ.scriptInit(scriptClass, x, y, characterId)) : (new SparrowFreeplayDJ(x, y, characterId)); + case 'sparrow': + dj = (scriptClass != '') ? (ScriptedSparrowFreeplayDJ.scriptInit(scriptClass, x, y, characterId)) : (new SparrowFreeplayDJ(x, y, characterId)); case 'multisparrow': - dj = (scriptClass != "") ? (ScriptedMultiSparrowFreeplayDJ.scriptInit(scriptClass, x, y, + dj = (scriptClass != '') ? (ScriptedMultiSparrowFreeplayDJ.scriptInit(scriptClass, x, y, characterId)) : (new MultiSparrowFreeplayDJ(x, y, characterId)); case 'packer': - dj = (scriptClass != "") ? (ScriptedPackerFreeplayDJ.scriptInit(scriptClass, x, y, characterId)) : (new PackerFreeplayDJ(x, y, characterId)); + dj = (scriptClass != '') ? (ScriptedPackerFreeplayDJ.scriptInit(scriptClass, x, y, characterId)) : (new PackerFreeplayDJ(x, y, characterId)); case 'custom': - dj = (scriptClass != "") ? (ScriptedBaseFreeplayDJ.scriptInit(scriptClass, x, y, characterId)) : { + dj = (scriptClass != '') ? (ScriptedBaseFreeplayDJ.scriptInit(scriptClass, x, y, characterId)) : { // force-skip intro only in fallback, since you can specify onIntroDone.dispatch in ScriptedBaseFreeplayDJ, and this is goddamn fallback forceSkipIntro = true; new BaseFreeplayDJ(x, y, characterId); @@ -1134,10 +1134,10 @@ class FreeplayState extends MusicBeatSubState HapticUtil.increasingVibrate(Constants.MIN_VIBRATION_AMPLITUDE, Constants.MAX_VIBRATION_AMPLITUDE, 0.6); rankCamera.zoom = 1.85; - FlxTween.tween(rankCamera, {"zoom": 1.8}, 0.6, {ease: FlxEase.sineIn}); + FlxTween.tween(rankCamera, {'zoom': 1.8}, 0.6, {ease: FlxEase.sineIn}); funnyCam.zoom = 1.15; - FlxTween.tween(funnyCam, {"zoom": 1.1}, 0.6, {ease: FlxEase.sineIn}); + FlxTween.tween(funnyCam, {'zoom': 1.1}, 0.6, {ease: FlxEase.sineIn}); capsuleToRank.cameras = [rankCamera]; // capsuleToRank.targetPos.set((FlxG.width / 2) - (capsuleToRank.width / 2), @@ -1163,13 +1163,13 @@ class FreeplayState extends MusicBeatSubState capsuleToRank.ranking.animation.play(fromResults.newRank.getFreeplayRankIconAsset(), true); } - FlxTween.tween(capsuleToRank.ranking, {"scale.x": 0.9, "scale.y": 0.9}, 0.1); + FlxTween.tween(capsuleToRank.ranking, {'scale.x': 0.9, 'scale.y': 0.9}, 0.1); if (fromResults != null && fromResults.newRank != null) { capsuleToRank.blurredRanking.animation.play(fromResults.newRank.getFreeplayRankIconAsset(), true); } - FlxTween.tween(capsuleToRank.blurredRanking, {"scale.x": 0.9, "scale.y": 0.9}, 0.1); + FlxTween.tween(capsuleToRank.blurredRanking, {'scale.x': 0.9, 'scale.y': 0.9}, 0.1); new FlxTimer().start(0.1, _ -> { @@ -1203,12 +1203,12 @@ class FreeplayState extends MusicBeatSubState } rankCamera.zoom = 1.3; - FlxTween.tween(rankCamera, {"zoom": 1.5}, 0.3, {ease: FlxEase.backInOut}); + FlxTween.tween(rankCamera, {'zoom': 1.5}, 0.3, {ease: FlxEase.backInOut}); capsuleToRank.x -= 10; capsuleToRank.y -= 20; - FlxTween.tween(funnyCam, {"zoom": 1.05}, 0.3, {ease: FlxEase.elasticOut}); + FlxTween.tween(funnyCam, {'zoom': 1.05}, 0.3, {ease: FlxEase.elasticOut}); capsuleToRank.angle = -3; FlxTween.tween(capsuleToRank, {angle: 0}, 0.5, {ease: FlxEase.backOut}); @@ -1218,8 +1218,8 @@ class FreeplayState extends MusicBeatSubState new FlxTimer().start(0.4, _ -> { - FlxTween.tween(funnyCam, {"zoom": 1}, 0.8, {ease: FlxEase.sineIn}); - FlxTween.tween(rankCamera, {"zoom": 1.2}, 0.8, {ease: FlxEase.backIn}); + FlxTween.tween(funnyCam, {'zoom': 1}, 0.8, {ease: FlxEase.sineIn}); + FlxTween.tween(rankCamera, {'zoom': 1.2}, 0.8, {ease: FlxEase.backIn}); FlxTween.tween(capsuleToRank, {x: originalPos.x - 7, y: originalPos.y - 80}, 0.8 + 0.5, {ease: FlxEase.quartIn}); }); @@ -1266,8 +1266,8 @@ class FreeplayState extends MusicBeatSubState rankCamera.zoom = 0.8; funnyCam.zoom = 0.8; - FlxTween.tween(rankCamera, {"zoom": 1}, 1, {ease: FlxEase.elasticOut}); - FlxTween.tween(funnyCam, {"zoom": 1}, 0.8, {ease: FlxEase.elasticOut}); + FlxTween.tween(rankCamera, {'zoom': 1}, 1, {ease: FlxEase.elasticOut}); + FlxTween.tween(funnyCam, {'zoom': 1}, 0.8, {ease: FlxEase.elasticOut}); for (index => capsule in grpCapsules.members) { @@ -1645,7 +1645,7 @@ class FreeplayState extends MusicBeatSubState { if (!uiStateMachine.canInteract()) { - backButton.animation.play("idle"); + backButton.animation.play('idle'); backButton.alpha = backButton.restingOpacity; } backButton.enabled = uiStateMachine.canInteract(); @@ -1664,7 +1664,7 @@ class FreeplayState extends MusicBeatSubState { FlxG.switchState(() -> FreeplayState.build({ { - character: currentCharacterId == "pico" ? Constants.DEFAULT_CHARACTER : "pico", + character: currentCharacterId == 'pico' ? Constants.DEFAULT_CHARACTER : 'pico', } })); } @@ -1675,8 +1675,8 @@ class FreeplayState extends MusicBeatSubState playRankAnim: true, oldRank: currentCapsule.ranking.rank, newRank: PERFECT_GOLD, - songId: "tutorial", - difficultyId: "hard" + songId: 'tutorial', + difficultyId: 'hard' }, currentCapsule); } #end // ^<-- FEATURE_DEBUG_FUNCTIONS @@ -2223,7 +2223,7 @@ class FreeplayState extends MusicBeatSubState } #end - public override function destroy():Void + override public function destroy():Void { super.destroy(); // remove and destroy freeplay camera @@ -2241,7 +2241,7 @@ class FreeplayState extends MusicBeatSubState if (backButton != null) { backButton.alpha = 1; - backButton.animation.play("confirm"); + backButton.animation.play('confirm'); } #end uiStateMachine.transition(Exiting); @@ -2792,7 +2792,7 @@ class FreeplayState extends MusicBeatSubState switch (currentCharacterId) { // Toggles the bool that allows vibration on update. - case "pico": + case 'pico': allowPicoBulletsVibration = true; new FlxTimer().start(0.5, function(tmr) { @@ -2928,7 +2928,7 @@ class FreeplayState extends MusicBeatSubState if (!prepForNewRank && curSelected != prevSelected) FunkinSound.playOnce(Paths.sound('scrollMenu'), 0.4); - var songScore:Null = Save.instance.getSongScore(currentCapsule.freeplayData?.data.id ?? "", currentDifficulty, currentVariation); + var songScore:Null = Save.instance.getSongScore(currentCapsule.freeplayData?.data.id ?? '', currentDifficulty, currentVariation); intendedScore = songScore?.score ?? 0; intendedCompletion = Scoring.tallyCompletion(songScore?.tallies); @@ -3171,7 +3171,7 @@ class DifficultySelector extends FlxSprite this.whiteShader = new PureColor(FlxColor.WHITE); this.whiteShader.colorSet = true; - this.frames = Paths.getSparrowAtlas(styleData?.getSelectorAssetKey() ?? "freeplay/freeplaySelector"); + this.frames = Paths.getSparrowAtlas(styleData?.getSelectorAssetKey() ?? 'freeplay/freeplaySelector'); animation.addByPrefix('shine', 'arrow pointer loop', 24); animation.play('shine'); diff --git a/source/funkin/ui/freeplay/SongMenuItem.hx b/source/funkin/ui/freeplay/SongMenuItem.hx index 1b3ffd9e9..1dd5e359b 100644 --- a/source/funkin/ui/freeplay/SongMenuItem.hx +++ b/source/funkin/ui/freeplay/SongMenuItem.hx @@ -247,7 +247,7 @@ class SongMenuItem extends FlxSpriteGroup var levelId:String = this.freeplayData.levelId; var levelIdData:Level = LevelRegistry.instance.fetchEntry(levelId); - var levelIdClean:String = ""; + var levelIdClean:String = ''; if (levelIdData.getCapsuleTitle() != null) { @@ -269,9 +269,9 @@ class SongMenuItem extends FlxSpriteGroup var previousChar:String = levelId.charAt(i - 1); var currentChar:String = levelId.charAt(i); - if (previousChar.toLowerCase() == previousChar && currentChar.toLowerCase() != currentChar) levelIdClean += " "; - if (Std.parseInt(previousChar) == null && Std.parseInt(currentChar) != null) levelIdClean += " "; - if (Std.parseInt(previousChar) != null && Std.parseInt(currentChar) == null) levelIdClean += " "; + if (previousChar.toLowerCase() == previousChar && currentChar.toLowerCase() != currentChar) levelIdClean += ' '; + if (Std.parseInt(previousChar) == null && Std.parseInt(currentChar) != null) levelIdClean += ' '; + if (Std.parseInt(previousChar) != null && Std.parseInt(currentChar) == null) levelIdClean += ' '; levelIdClean += currentChar; } @@ -795,7 +795,7 @@ class SongMenuItem extends FlxSpriteGroup songText.alpha = isSelected ? 1 : 0.6; songText.blurredText.visible = isSelected ? true : false; capsule.offset.x = isSelected ? 0 : -5; - capsule.animation.play(isSelected ? "selected" : "unselected"); + capsule.animation.play(isSelected ? 'selected' : 'unselected'); ranking.alpha = isSelected ? 1 : 0.7; favIcon.alpha = isSelected ? 1 : 0.6; favIconBlurred.alpha = isSelected ? 1 : 0; @@ -806,7 +806,7 @@ class SongMenuItem extends FlxSpriteGroup if (selected && songText.tooLong) songText.initMove(); } - public override function kill():Void + override public function kill():Void { super.kill(); @@ -923,16 +923,16 @@ class CapsuleNumber extends FlxSprite public var baseX:Float = 0; var numToString:Array = [ - "ZERO", - "ONE", - "TWO", - "THREE", - "FOUR", - "FIVE", - "SIX", - "SEVEN", - "EIGHT", - "NINE" + 'ZERO', + 'ONE', + 'TWO', + 'THREE', + 'FOUR', + 'FIVE', + 'SIX', + 'SEVEN', + 'EIGHT', + 'NINE' ]; public function new(x:Float, y:Float, big:Bool = false, ?initDigit:Int = 0) diff --git a/source/funkin/ui/freeplay/backcards/NewCharacterCard.hx b/source/funkin/ui/freeplay/backcards/NewCharacterCard.hx index fe5687c97..0b2a7562b 100644 --- a/source/funkin/ui/freeplay/backcards/NewCharacterCard.hx +++ b/source/funkin/ui/freeplay/backcards/NewCharacterCard.hx @@ -28,7 +28,7 @@ class NewCharacterCard extends BackingCard public var friendFoe2:BGScrollingText; public var newUnlock3:BGScrollingText; - public override function applyExitMovers(?exitMovers:FreeplayState.ExitMoverData, ?exitMoversCharSel:FreeplayState.ExitMoverData):Void + override public function applyExitMovers(?exitMovers:FreeplayState.ExitMoverData, ?exitMoversCharSel:FreeplayState.ExitMoverData):Void { super.applyExitMovers(exitMovers, exitMoversCharSel); if (exitMovers == null || exitMoversCharSel == null) return; @@ -74,7 +74,7 @@ class NewCharacterCard extends BackingCard }); } - public override function introDone():Void + override public function introDone():Void { // pinkBack.color = 0xFFFFD863; @@ -94,10 +94,10 @@ class NewCharacterCard extends BackingCard lightLayer3.visible = true; cardGlow.visible = true; - FlxTween.tween(cardGlow, {alpha: 0, "scale.x": 1.2, "scale.y": 1.2}, 0.45, {ease: FlxEase.sineOut}); + FlxTween.tween(cardGlow, {alpha: 0, 'scale.x': 1.2, 'scale.y': 1.2}, 0.45, {ease: FlxEase.sineOut}); } - public override function enterCharSel():Void + override public function enterCharSel():Void { FlxTween.tween(friendFoe, {speed: 0}, 0.8, {ease: FlxEase.sineIn}); FlxTween.tween(newUnlock1, {speed: 0}, 0.8, {ease: FlxEase.sineIn}); @@ -107,7 +107,7 @@ class NewCharacterCard extends BackingCard FlxTween.tween(newUnlock3, {speed: 0}, 0.8, {ease: FlxEase.sineIn}); } - public override function onCreate(event:ScriptEvent):Void + override public function onCreate(event:ScriptEvent):Void { FlxTween.tween(pinkBack, {x: 0}, 0.6, {ease: FlxEase.quartOut}); add(pinkBack); @@ -120,7 +120,7 @@ class NewCharacterCard extends BackingCard confirmGlow.visible = false; confirmGlow2.visible = false; - friendFoe = new BGScrollingText(0, 163, "COULD IT BE A NEW FRIEND? OR FOE??", FlxG.width, true, 43); + friendFoe = new BGScrollingText(0, 163, 'COULD IT BE A NEW FRIEND? OR FOE??', FlxG.width, true, 43); newUnlock1 = new BGScrollingText(-440, 215, 'NEW UNLOCK!', FlxG.width / 2, true, 80); waiting = new BGScrollingText(0, 286, "SOMEONE'S WAITING!", FlxG.width / 2, true, 43); newUnlock2 = new BGScrollingText(-220, 331, 'NEW UNLOCK!', FlxG.width / 2, true, 80); @@ -234,7 +234,7 @@ class NewCharacterCard extends BackingCard } } - public override function disappear():Void + override public function disappear():Void { FlxTween.color(pinkBack, 0.25, 0xFF05020E, 0xFFFFD0D5, {ease: FlxEase.quadOut}); @@ -256,6 +256,6 @@ class NewCharacterCard extends BackingCard cardGlow.visible = true; cardGlow.alpha = 1; cardGlow.scale.set(1, 1); - FlxTween.tween(cardGlow, {alpha: 0, "scale.x": 1.2, "scale.y": 1.2}, 0.25, {ease: FlxEase.sineOut}); + FlxTween.tween(cardGlow, {alpha: 0, 'scale.x': 1.2, 'scale.y': 1.2}, 0.25, {ease: FlxEase.sineOut}); } } diff --git a/source/funkin/ui/freeplay/dj/AnimateAtlasFreeplayDJ.hx b/source/funkin/ui/freeplay/dj/AnimateAtlasFreeplayDJ.hx index 21c993605..b3fec7d47 100644 --- a/source/funkin/ui/freeplay/dj/AnimateAtlasFreeplayDJ.hx +++ b/source/funkin/ui/freeplay/dj/AnimateAtlasFreeplayDJ.hx @@ -52,7 +52,7 @@ class AnimateAtlasFreeplayDJ extends BaseFreeplayDJ log('Successfully loaded ${animationNames.length} animations for ${characterId}'); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { switch (currentState) { @@ -108,7 +108,7 @@ class AnimateAtlasFreeplayDJ extends BaseFreeplayDJ } else { - FlxG.log.warn("Unrecognized animation in FistPumpIntro: " + getCurrentAnimation()); + FlxG.log.warn('Unrecognized animation in FistPumpIntro: ' + getCurrentAnimation()); } case FistPump: @@ -133,7 +133,7 @@ class AnimateAtlasFreeplayDJ extends BaseFreeplayDJ } else { - FlxG.log.warn("Unrecognized animation in FistPump: " + getCurrentAnimation()); + FlxG.log.warn('Unrecognized animation in FistPump: ' + getCurrentAnimation()); } case IdleEasterEgg: diff --git a/source/funkin/ui/freeplay/dj/MultiSparrowFreeplayDJ.hx b/source/funkin/ui/freeplay/dj/MultiSparrowFreeplayDJ.hx index 4b2f7d5f4..9d4967f95 100644 --- a/source/funkin/ui/freeplay/dj/MultiSparrowFreeplayDJ.hx +++ b/source/funkin/ui/freeplay/dj/MultiSparrowFreeplayDJ.hx @@ -81,7 +81,7 @@ class MultiSparrowFreeplayDJ extends BaseFreeplayDJ log('[MULTISPARROWDJ] Successfully loaded ${animationList.length} animations for ${characterId}'); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { switch (currentState) { @@ -137,7 +137,7 @@ class MultiSparrowFreeplayDJ extends BaseFreeplayDJ } else { - FlxG.log.warn("Unrecognized animation in FistPumpIntro: " + getCurrentAnimation()); + FlxG.log.warn('Unrecognized animation in FistPumpIntro: ' + getCurrentAnimation()); } case FistPump: @@ -162,7 +162,7 @@ class MultiSparrowFreeplayDJ extends BaseFreeplayDJ } else { - FlxG.log.warn("Unrecognized animation in FistPump: " + getCurrentAnimation()); + FlxG.log.warn('Unrecognized animation in FistPump: ' + getCurrentAnimation()); } case IdleEasterEgg: diff --git a/source/funkin/ui/freeplay/dj/PackerFreeplayDJ.hx b/source/funkin/ui/freeplay/dj/PackerFreeplayDJ.hx index 9d7e436de..21588087d 100644 --- a/source/funkin/ui/freeplay/dj/PackerFreeplayDJ.hx +++ b/source/funkin/ui/freeplay/dj/PackerFreeplayDJ.hx @@ -54,7 +54,7 @@ class PackerFreeplayDJ extends BaseFreeplayDJ log('[PACKERDJ] Successfully loaded ${animationList.length} animations for ${characterId}'); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { switch (currentState) { @@ -110,7 +110,7 @@ class PackerFreeplayDJ extends BaseFreeplayDJ } else { - FlxG.log.warn("Unrecognized animation in FistPumpIntro: " + getCurrentAnimation()); + FlxG.log.warn('Unrecognized animation in FistPumpIntro: ' + getCurrentAnimation()); } case FistPump: @@ -135,7 +135,7 @@ class PackerFreeplayDJ extends BaseFreeplayDJ } else { - FlxG.log.warn("Unrecognized animation in FistPump: " + getCurrentAnimation()); + FlxG.log.warn('Unrecognized animation in FistPump: ' + getCurrentAnimation()); } case IdleEasterEgg: diff --git a/source/funkin/ui/freeplay/dj/SparrowFreeplayDJ.hx b/source/funkin/ui/freeplay/dj/SparrowFreeplayDJ.hx index 6e27032b5..4894d104d 100644 --- a/source/funkin/ui/freeplay/dj/SparrowFreeplayDJ.hx +++ b/source/funkin/ui/freeplay/dj/SparrowFreeplayDJ.hx @@ -54,7 +54,7 @@ class SparrowFreeplayDJ extends BaseFreeplayDJ log('[SPARROWDJ] Successfully loaded ${animationList.length} animations for ${characterId}'); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { switch (currentState) { @@ -110,7 +110,7 @@ class SparrowFreeplayDJ extends BaseFreeplayDJ } else { - FlxG.log.warn("Unrecognized animation in FistPumpIntro: " + getCurrentAnimation()); + FlxG.log.warn('Unrecognized animation in FistPumpIntro: ' + getCurrentAnimation()); } case FistPump: @@ -135,7 +135,7 @@ class SparrowFreeplayDJ extends BaseFreeplayDJ } else { - FlxG.log.warn("Unrecognized animation in FistPump: " + getCurrentAnimation()); + FlxG.log.warn('Unrecognized animation in FistPump: ' + getCurrentAnimation()); } case IdleEasterEgg: diff --git a/source/funkin/ui/haxeui/FlxGamepadActionInputSource.hx b/source/funkin/ui/haxeui/FlxGamepadActionInputSource.hx index 731f28211..13a1219ea 100644 --- a/source/funkin/ui/haxeui/FlxGamepadActionInputSource.hx +++ b/source/funkin/ui/haxeui/FlxGamepadActionInputSource.hx @@ -26,7 +26,7 @@ class FlxGamepadActionInputSource extends FlxBasic FlxG.plugins.addPlugin(this); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); @@ -44,7 +44,7 @@ class FlxGamepadActionInputSource extends FlxBasic } } - public override function destroy():Void + override public function destroy():Void { super.destroy(); FlxG.plugins.remove(this); diff --git a/source/funkin/ui/haxeui/components/CharacterPlayer.hx b/source/funkin/ui/haxeui/components/CharacterPlayer.hx index 30cdfa1a2..92543b80f 100644 --- a/source/funkin/ui/haxeui/components/CharacterPlayer.hx +++ b/source/funkin/ui/haxeui/components/CharacterPlayer.hx @@ -61,7 +61,7 @@ class CharacterPlayer extends Box function get_charName():String { - return character?.characterName ?? "Unknown"; + return character?.characterName ?? 'Unknown'; } // possible haxeui bug: if listener is added after event is dispatched, event is "lost"... is it smart to "collect and redispatch"? Not sure @@ -273,7 +273,7 @@ class CharacterPlayer extends Box @:access(funkin.ui.haxeui.components.CharacterPlayer) @:access(funkin.play.character.BaseCharacter) private class Layout extends DefaultLayout { - public override function resizeChildren():Void + override public function resizeChildren():Void { super.resizeChildren(); @@ -287,7 +287,7 @@ private class Layout extends DefaultLayout character.cornerPosition.set(0, 0); } - public override function calcAutoSize(?exclusions:Array):Size + override public function calcAutoSize(?exclusions:Array):Size { var player:CharacterPlayer = cast(_component, CharacterPlayer); var character:BaseCharacter = player.character; diff --git a/source/funkin/ui/story/LevelTitle.hx b/source/funkin/ui/story/LevelTitle.hx index c3cc98098..195f83f30 100644 --- a/source/funkin/ui/story/LevelTitle.hx +++ b/source/funkin/ui/story/LevelTitle.hx @@ -21,7 +21,7 @@ class LevelTitle extends FlxSpriteGroup this.level = level; - if (this.level == null) throw "Level cannot be null!"; + if (this.level == null) throw 'Level cannot be null!'; buildLevelTitle(); buildLevelLock(); @@ -46,7 +46,7 @@ class LevelTitle extends FlxSpriteGroup var flashTick:Float = 0; final flashFramerate:Float = 20; - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { this.y = MathUtil.smoothLerpPrecision(y, targetY, elapsed, 0.451); diff --git a/source/funkin/ui/story/StoryMenuState.hx b/source/funkin/ui/story/StoryMenuState.hx index fd204a4f7..b9ebd92b7 100644 --- a/source/funkin/ui/story/StoryMenuState.hx +++ b/source/funkin/ui/story/StoryMenuState.hx @@ -169,7 +169,7 @@ class StoryMenuState extends MusicBeatState updateProps(); // x on tracklistText is set/updated later, we dont need to init it - tracklistText = new FlxText(0, levelBackground.x + levelBackground.height + 100, 0, "Tracks", 32); + tracklistText = new FlxText(0, levelBackground.x + levelBackground.height + 100, 0, 'Tracks', 32); tracklistText.setFormat('VCR OSD Mono', 32); tracklistText.alignment = CENTER; tracklistText.color = 0xFFE55777; @@ -543,7 +543,7 @@ class StoryMenuState extends MusicBeatState function funnyMusicThing():Void { - if (currentDifficultyId == "nightmare") + if (currentDifficultyId == 'nightmare') { FlxG.sound.music.fadeOut(FADE_OUT_TIME, 0.0); } @@ -553,7 +553,7 @@ class StoryMenuState extends MusicBeatState } } - public override function dispatchEvent(event:ScriptEvent):Void + override public function dispatchEvent(event:ScriptEvent):Void { // super.dispatchEvent(event) dispatches event to module scripts. super.dispatchEvent(event); diff --git a/source/funkin/ui/title/AttractState.hx b/source/funkin/ui/title/AttractState.hx index b38a50d44..6bffe6a18 100644 --- a/source/funkin/ui/title/AttractState.hx +++ b/source/funkin/ui/title/AttractState.hx @@ -47,7 +47,7 @@ class AttractState extends MusicBeatState var pie:FlxRadialGauge; var holdDelta:Float = 0; - public override function create():Void + override public function create():Void { // Pause existing music. if (FlxG.sound.music != null) @@ -153,7 +153,7 @@ class AttractState extends MusicBeatState } #end - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); diff --git a/source/funkin/util/plugins/EvacuateDebugPlugin.hx b/source/funkin/util/plugins/EvacuateDebugPlugin.hx index 54e12300e..c376d4a30 100644 --- a/source/funkin/util/plugins/EvacuateDebugPlugin.hx +++ b/source/funkin/util/plugins/EvacuateDebugPlugin.hx @@ -19,7 +19,7 @@ class EvacuateDebugPlugin extends FlxBasic FlxG.plugins.addPlugin(new EvacuateDebugPlugin()); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); @@ -29,7 +29,7 @@ class EvacuateDebugPlugin extends FlxBasic } } - public override function destroy():Void + override public function destroy():Void { super.destroy(); } diff --git a/source/funkin/util/plugins/ForceCrashPlugin.hx b/source/funkin/util/plugins/ForceCrashPlugin.hx index 62533fba4..05874395c 100644 --- a/source/funkin/util/plugins/ForceCrashPlugin.hx +++ b/source/funkin/util/plugins/ForceCrashPlugin.hx @@ -19,7 +19,7 @@ class ForceCrashPlugin extends FlxBasic FlxG.plugins.addPlugin(new ForceCrashPlugin()); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); @@ -27,11 +27,11 @@ class ForceCrashPlugin extends FlxBasic if (InputUtil.allPressedWithDebounce([CONTROL, ALT, SHIFT, L])) { // TODO: Make this message 87% funnier. - throw "DEBUG: Crashing the game via debug keybind!"; + throw 'DEBUG: Crashing the game via debug keybind!'; } } - public override function destroy():Void + override public function destroy():Void { super.destroy(); } diff --git a/source/funkin/util/plugins/MemoryGCPlugin.hx b/source/funkin/util/plugins/MemoryGCPlugin.hx index 44dc486d1..12c7f1ecc 100644 --- a/source/funkin/util/plugins/MemoryGCPlugin.hx +++ b/source/funkin/util/plugins/MemoryGCPlugin.hx @@ -18,7 +18,7 @@ class MemoryGCPlugin extends FlxBasic FlxG.plugins.addPlugin(new MemoryGCPlugin()); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); @@ -30,7 +30,7 @@ class MemoryGCPlugin extends FlxBasic } } - public override function destroy():Void + override public function destroy():Void { super.destroy(); } diff --git a/source/funkin/util/plugins/ReloadAssetsDebugPlugin.hx b/source/funkin/util/plugins/ReloadAssetsDebugPlugin.hx index 928d2dcbb..7fb839c8f 100644 --- a/source/funkin/util/plugins/ReloadAssetsDebugPlugin.hx +++ b/source/funkin/util/plugins/ReloadAssetsDebugPlugin.hx @@ -30,7 +30,7 @@ class ReloadAssetsDebugPlugin extends FlxBasic FlxG.plugins.addPlugin(new ReloadAssetsDebugPlugin()); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { super.update(elapsed); @@ -44,7 +44,7 @@ class ReloadAssetsDebugPlugin extends FlxBasic } } - public override function destroy():Void + override public function destroy():Void { super.destroy(); @@ -56,7 +56,7 @@ class ReloadAssetsDebugPlugin extends FlxBasic #end } - var path:String = ""; + var path:String = ''; @:noCompletion function reload():Void @@ -68,7 +68,7 @@ class ReloadAssetsDebugPlugin extends FlxBasic var s:ScriptedMusicBeatState = cast FlxG.state; @:privateAccess path = s._asc.fullyQualifiedName; - trace("Current scripted state path: " + path); + trace('Current scripted state path: ' + path); } if ((state is MusicBeatState || state is MusicBeatSubState) && !isScripted) state.reloadAssets(); @@ -76,10 +76,10 @@ class ReloadAssetsDebugPlugin extends FlxBasic { funkin.modding.PolymodHandler.forceReloadAssets(); - trace("Reloaded assets, checking for scripted state. Scripted: " + isScripted + ", Path: " + path); + trace('Reloaded assets, checking for scripted state. Scripted: ' + isScripted + ', Path: ' + path); if (isScripted) { - trace("Reloading scripted state: " + path); + trace('Reloading scripted state: ' + path); var state:Dynamic = ScriptedMusicBeatState.scriptInit(path); FlxG.switchState(state); } diff --git a/source/funkin/util/plugins/ScreenshotPlugin.hx b/source/funkin/util/plugins/ScreenshotPlugin.hx index 1dcd3ebd8..dcd78ba8b 100644 --- a/source/funkin/util/plugins/ScreenshotPlugin.hx +++ b/source/funkin/util/plugins/ScreenshotPlugin.hx @@ -139,7 +139,7 @@ class ScreenshotPlugin extends FlxBasic CrashHandler.criticalErrorSignal.add(onWindowCrash); } - public override function update(elapsed:Float):Void + override public function update(elapsed:Float):Void { if (asyncLoop != null) { @@ -155,7 +155,7 @@ class ScreenshotPlugin extends FlxBasic { if (screenshotBuffer != []) { - trace("finished processing screenshot buffer"); + trace('finished processing screenshot buffer'); screenshotBuffer = []; screenshotNameBuffer = []; } @@ -489,7 +489,7 @@ class ScreenshotPlugin extends FlxBasic * @param screenShotNum Used for the delay save option, to space out the saving of the images. * @param delaySave If true, the image gets saved with the screenShotNum as the delay. */ - function saveScreenshot(bitmap:Bitmap, targetPath = "image", screenShotNum:Int = 0, delaySave:Bool = true):Void + function saveScreenshot(bitmap:Bitmap, targetPath = 'image', screenShotNum:Int = 0, delaySave:Bool = true):Void { #if !web makeScreenshotPath(); @@ -545,7 +545,7 @@ class ScreenshotPlugin extends FlxBasic var a:js.html.AnchorElement = cast js.Browser.document.createElement('a'); js.Browser.document.body.appendChild(a); a.style.display = 'none'; - a.href = bitmap.bitmapData.image.src.toDataURL("image/png"); + a.href = bitmap.bitmapData.image.src.toDataURL('image/png'); a.download = targetPath; a.click();