From f652beb382fb6d9a886657452e312f9196d4bc40 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 9 Oct 2023 20:04:21 -0400 Subject: [PATCH] Fix several merge errors. --- assets | 2 +- hmm.json | 8 ++++---- source/funkin/FreeplayState.hx | 10 ++++++++-- source/funkin/freeplayStuff/DJBoyfriend.hx | 2 +- source/funkin/freeplayStuff/SongMenuItem.hx | 19 +++++++++++++++++-- source/funkin/play/song/Song.hx | 2 +- 6 files changed, 32 insertions(+), 11 deletions(-) diff --git a/assets b/assets index 386dcac52..4ee0c341f 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 386dcac52e7b8ddc8cc4ad3864bd8d51f01564d1 +Subproject commit 4ee0c341fd213017b98314d47d28f08b8e1d4289 diff --git a/hmm.json b/hmm.json index e830ff435..3f420ac48 100644 --- a/hmm.json +++ b/hmm.json @@ -4,14 +4,14 @@ "name": "discord_rpc", "type": "git", "dir": null, - "ref": "2d83fa8", + "ref": "2d83fa863ef0c1eace5f1cf67c3ac315d1a3a8a5", "url": "https://github.com/Aidan63/linc_discord-rpc" }, { "name": "flixel", "type": "git", "dir": null, - "ref": "32cee07a", + "ref": "32cee07a0e5f21e590a4b21234603b2cd5898b10", "url": "https://github.com/EliteMasterEric/flixel" }, { @@ -32,7 +32,7 @@ "name": "flxanimate", "type": "git", "dir": null, - "ref": "dd2903f", + "ref": "dd2903f7dc7024335b981edf2a770760cec912e1", "url": "https://github.com/ninjamuffin99/flxanimate" }, { @@ -75,7 +75,7 @@ "name": "hxCodec", "type": "git", "dir": null, - "ref": "c8c47e7", + "ref": "c8c47e706ad82a423783006ed901b6d93c89a421", "url": "https://github.com/polybiusproxy/hxCodec" }, { diff --git a/source/funkin/FreeplayState.hx b/source/funkin/FreeplayState.hx index 9ad364215..3ae32c2e4 100644 --- a/source/funkin/FreeplayState.hx +++ b/source/funkin/FreeplayState.hx @@ -13,6 +13,7 @@ import flixel.addons.ui.FlxInputText; import flixel.group.FlxGroup.FlxTypedGroup; import flixel.group.FlxGroup; import flixel.group.FlxSpriteGroup; +import flixel.system.debug.watch.Tracker.TrackerProfile; import flixel.input.touch.FlxTouch; import flixel.math.FlxAngle; import flixel.math.FlxMath; @@ -31,6 +32,7 @@ import funkin.freeplayStuff.DJBoyfriend; import funkin.freeplayStuff.FreeplayScore; import funkin.freeplayStuff.LetterSort; import funkin.freeplayStuff.SongMenuItem; +import funkin.freeplayStuff.DifficultyStars; import funkin.play.HealthIcon; import funkin.play.PlayState; import funkin.shaderslmfao.AngleMask; @@ -118,8 +120,8 @@ class FreeplayState extends MusicBeatSubState #if debug isDebug = true; - addSong('Test', 'tutorial', 'bf-pixel'); - addSong('Pyro', 'weekend1', 'darnell'); + // addSong('Test', 'tutorial', 'bf-pixel'); + // addSong('Pyro', 'weekend1', 'darnell'); #end // var initSonglist = CoolUtil.coolTextFile(Paths.txt('freeplaySonglist')); @@ -995,6 +997,10 @@ class FreeplayState extends MusicBeatSubState FlxG.sound.play(Paths.sound('confirmMenu')); dj.confirm(); + // Load and cache the song's charts. + // TODO: Do this in the loading state. + targetSong.cacheCharts(true); + new FlxTimer().start(1, function(tmr:FlxTimer) { LoadingState.loadAndSwitchState(new PlayState( { diff --git a/source/funkin/freeplayStuff/DJBoyfriend.hx b/source/funkin/freeplayStuff/DJBoyfriend.hx index 58318df15..ba0ce464d 100644 --- a/source/funkin/freeplayStuff/DJBoyfriend.hx +++ b/source/funkin/freeplayStuff/DJBoyfriend.hx @@ -206,7 +206,7 @@ class DJBoyfriend extends FlxAtlasSprite cartoonSnd.play(true, FlxG.random.float(0, cartoonSnd.length)); } - var cartoonList:Array = Assets.list().filter(function(path) return path.startsWith("assets/sounds/cartoons/")); + var cartoonList:Array = openfl.utils.Assets.list().filter(function(path) return path.startsWith("assets/sounds/cartoons/")); function getRandomFlashToon():String { diff --git a/source/funkin/freeplayStuff/SongMenuItem.hx b/source/funkin/freeplayStuff/SongMenuItem.hx index 5c022121a..5fd7eb576 100644 --- a/source/funkin/freeplayStuff/SongMenuItem.hx +++ b/source/funkin/freeplayStuff/SongMenuItem.hx @@ -159,8 +159,9 @@ class SongMenuItem extends FlxSpriteGroup } /** - * [Description] - * @param char Should be songCharacter, and will get translated to the correct path via switch + * Set the character displayed next to this song in the freeplay menu. + * @param char The character ID used by this song. + * If the character has no freeplay icon, a warning will be thrown and nothing will display. */ public function setCharacter(char:String) { @@ -184,6 +185,12 @@ class SongMenuItem extends FlxSpriteGroup charPath += char + "pixel"; } + if (!openfl.utils.Assets.exists(Paths.image(charPath))) + { + trace('[WARN] Character ${char} has no freeplay icon.'); + return; + } + pixelIcon.loadGraphic(Paths.image(charPath)); pixelIcon.scale.x = pixelIcon.scale.y = 2; pixelIcon.origin.x = 100; @@ -312,6 +319,14 @@ class SongMenuItem extends FlxSpriteGroup return (index * ((height * realScaled) + 10)) + 120; } + /** + * Merely a helper function to call set_selected, to make sure that the alpha is correct on the rankings/selections + */ + public function selectedAlpha():Void + { + selected = selected; + } + function set_selected(value:Bool):Bool { // cute one liners, lol! diff --git a/source/funkin/play/song/Song.hx b/source/funkin/play/song/Song.hx index f3fc89a86..d11c7744b 100644 --- a/source/funkin/play/song/Song.hx +++ b/source/funkin/play/song/Song.hx @@ -117,7 +117,7 @@ class Song implements IPlayStateScriptedClass implements IRegistryEntry, variations:Array, charts:Map, validScore:Bool = false):Song { - var result:Song = new Song(songId, true); + var result:Song = new Song(songId); result._metadata.clear(); for (meta in metadata)