From d50ff73d3ce42ec4b4d11d0662402f81c039f1b3 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 22 Mar 2024 02:47:21 -0400 Subject: [PATCH 01/26] Registries now get added to the Flixel console (and get lazy instantiated so they don't start before the game does) --- source/funkin/data/BaseRegistry.hx | 7 +++++++ source/funkin/data/dialogue/ConversationRegistry.hx | 9 ++++++++- source/funkin/data/dialogue/DialogueBoxRegistry.hx | 9 ++++++++- source/funkin/data/dialogue/SpeakerRegistry.hx | 9 ++++++++- source/funkin/data/level/LevelRegistry.hx | 9 ++++++++- source/funkin/data/notestyle/NoteStyleRegistry.hx | 9 ++++++++- source/funkin/data/song/SongRegistry.hx | 13 ++++++++++--- source/funkin/data/stage/StageRegistry.hx | 9 ++++++++- 8 files changed, 65 insertions(+), 9 deletions(-) diff --git a/source/funkin/data/BaseRegistry.hx b/source/funkin/data/BaseRegistry.hx index ad028fa94..7419d9425 100644 --- a/source/funkin/data/BaseRegistry.hx +++ b/source/funkin/data/BaseRegistry.hx @@ -55,6 +55,13 @@ abstract class BaseRegistry & Constructible(); this.scriptedEntryIds = []; + + // Lazy initialization of singletons should let this get called, + // but we have this check just in case. + if (FlxG.game != null) + { + FlxG.console.registerObject('registry$registryId', this); + } } /** diff --git a/source/funkin/data/dialogue/ConversationRegistry.hx b/source/funkin/data/dialogue/ConversationRegistry.hx index 9186ef786..4a8af2162 100644 --- a/source/funkin/data/dialogue/ConversationRegistry.hx +++ b/source/funkin/data/dialogue/ConversationRegistry.hx @@ -15,7 +15,14 @@ class ConversationRegistry extends BaseRegistry public static final CONVERSATION_DATA_VERSION_RULE:thx.semver.VersionRule = "1.0.x"; - public static final instance:ConversationRegistry = new ConversationRegistry(); + public static var instance(get, never):ConversationRegistry; + static var _instance:Null = null; + + static function get_instance():ConversationRegistry + { + if (_instance == null) _instance = new ConversationRegistry(); + return _instance; + } public function new() { diff --git a/source/funkin/data/dialogue/DialogueBoxRegistry.hx b/source/funkin/data/dialogue/DialogueBoxRegistry.hx index 87205d96c..d07ea6da2 100644 --- a/source/funkin/data/dialogue/DialogueBoxRegistry.hx +++ b/source/funkin/data/dialogue/DialogueBoxRegistry.hx @@ -15,7 +15,14 @@ class DialogueBoxRegistry extends BaseRegistry public static final DIALOGUEBOX_DATA_VERSION_RULE:thx.semver.VersionRule = "1.1.x"; - public static final instance:DialogueBoxRegistry = new DialogueBoxRegistry(); + public static var instance(get, never):DialogueBoxRegistry; + static var _instance:Null = null; + + static function get_instance():DialogueBoxRegistry + { + if (_instance == null) _instance = new DialogueBoxRegistry(); + return _instance; + } public function new() { diff --git a/source/funkin/data/dialogue/SpeakerRegistry.hx b/source/funkin/data/dialogue/SpeakerRegistry.hx index 6bd301dd7..c76c6d766 100644 --- a/source/funkin/data/dialogue/SpeakerRegistry.hx +++ b/source/funkin/data/dialogue/SpeakerRegistry.hx @@ -15,7 +15,14 @@ class SpeakerRegistry extends BaseRegistry public static final SPEAKER_DATA_VERSION_RULE:thx.semver.VersionRule = "1.0.x"; - public static final instance:SpeakerRegistry = new SpeakerRegistry(); + public static var instance(get, never):SpeakerRegistry; + static var _instance:Null = null; + + static function get_instance():SpeakerRegistry + { + if (_instance == null) _instance = new SpeakerRegistry(); + return _instance; + } public function new() { diff --git a/source/funkin/data/level/LevelRegistry.hx b/source/funkin/data/level/LevelRegistry.hx index 96712cba5..e37e78d8c 100644 --- a/source/funkin/data/level/LevelRegistry.hx +++ b/source/funkin/data/level/LevelRegistry.hx @@ -15,7 +15,14 @@ class LevelRegistry extends BaseRegistry public static final LEVEL_DATA_VERSION_RULE:thx.semver.VersionRule = "1.0.x"; - public static final instance:LevelRegistry = new LevelRegistry(); + public static var instance(get, never):LevelRegistry; + static var _instance:Null = null; + + static function get_instance():LevelRegistry + { + if (_instance == null) _instance = new LevelRegistry(); + return _instance; + } public function new() { diff --git a/source/funkin/data/notestyle/NoteStyleRegistry.hx b/source/funkin/data/notestyle/NoteStyleRegistry.hx index ffb9bf490..5e9fa9a3d 100644 --- a/source/funkin/data/notestyle/NoteStyleRegistry.hx +++ b/source/funkin/data/notestyle/NoteStyleRegistry.hx @@ -15,7 +15,14 @@ class NoteStyleRegistry extends BaseRegistry public static final NOTE_STYLE_DATA_VERSION_RULE:thx.semver.VersionRule = "1.0.x"; - public static final instance:NoteStyleRegistry = new NoteStyleRegistry(); + public static var instance(get, never):NoteStyleRegistry; + static var _instance:Null = null; + + static function get_instance():NoteStyleRegistry + { + if (_instance == null) _instance = new NoteStyleRegistry(); + return _instance; + } public function new() { diff --git a/source/funkin/data/song/SongRegistry.hx b/source/funkin/data/song/SongRegistry.hx index e7f74569c..d82e184a5 100644 --- a/source/funkin/data/song/SongRegistry.hx +++ b/source/funkin/data/song/SongRegistry.hx @@ -40,10 +40,17 @@ class SongRegistry extends BaseRegistry } /** - * TODO: What if there was a Singleton macro which created static functions - * that redirected to the instance? + * TODO: What if there was a Singleton macro which automatically created the property for us? */ - public static final instance:SongRegistry = new SongRegistry(); + public static var instance(get, never):SongRegistry; + + static var _instance:Null = null; + + static function get_instance():SongRegistry + { + if (_instance == null) _instance = new SongRegistry(); + return _instance; + } public function new() { diff --git a/source/funkin/data/stage/StageRegistry.hx b/source/funkin/data/stage/StageRegistry.hx index b78292e5b..13a5afb8d 100644 --- a/source/funkin/data/stage/StageRegistry.hx +++ b/source/funkin/data/stage/StageRegistry.hx @@ -15,7 +15,14 @@ class StageRegistry extends BaseRegistry public static final STAGE_DATA_VERSION_RULE:thx.semver.VersionRule = "1.0.x"; - public static final instance:StageRegistry = new StageRegistry(); + public static var instance(get, never):StageRegistry; + static var _instance:Null = null; + + static function get_instance():StageRegistry + { + if (_instance == null) _instance = new StageRegistry(); + return _instance; + } public function new() { From 4524b66170f1c0391c4a719bce7d090ed0415bc3 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 22 Mar 2024 02:47:43 -0400 Subject: [PATCH 02/26] Only show easy/normal/hard in story mode for now --- source/funkin/ui/story/StoryMenuState.hx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/funkin/ui/story/StoryMenuState.hx b/source/funkin/ui/story/StoryMenuState.hx index 9ce110c73..a5e133725 100644 --- a/source/funkin/ui/story/StoryMenuState.hx +++ b/source/funkin/ui/story/StoryMenuState.hx @@ -446,7 +446,11 @@ class StoryMenuState extends MusicBeatState */ function changeDifficulty(change:Int = 0):Void { - var difficultyList:Array = currentLevel.getDifficulties(); + // "For now, NO erect in story mode" -Dave + + var difficultyList:Array = Constants.DEFAULT_DIFFICULTY_LIST; + // Use this line to displays all difficulties + // var difficultyList:Array = currentLevel.getDifficulties(); var currentIndex:Int = difficultyList.indexOf(currentDifficultyId); currentIndex += change; From 2b477c9bd1183ba2a35ced7d22233c9c3f2d722e Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 22 Mar 2024 02:47:56 -0400 Subject: [PATCH 03/26] Make Conductor a lazy instance --- source/funkin/Conductor.hx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/funkin/Conductor.hx b/source/funkin/Conductor.hx index 05c23108f..383a49084 100644 --- a/source/funkin/Conductor.hx +++ b/source/funkin/Conductor.hx @@ -36,7 +36,15 @@ class Conductor * You can also do stuff like store a reference to the Conductor and pass it around or temporarily replace it, * or have a second Conductor running at the same time, or other weird stuff like that if you need to. */ - public static var instance:Conductor = new Conductor(); + public static var instance(get, never):Conductor; + + static var _instance:Null = null; + + static function get_instance():Conductor + { + if (_instance == null) _instance = new Conductor(); + return _instance; + } /** * Signal fired when the current Conductor instance advances to a new measure. @@ -505,6 +513,6 @@ class Conductor */ public static function reset():Void { - Conductor.instance = new Conductor(); + _instance = new Conductor(); } } From aea9213eeaca4686acec8f7cd6e5c3e8f4faf95a Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 22 Mar 2024 03:04:33 -0400 Subject: [PATCH 04/26] Make sure the BPM label gets updated properly --- source/funkin/ui/debug/charting/ChartEditorState.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/ui/debug/charting/ChartEditorState.hx b/source/funkin/ui/debug/charting/ChartEditorState.hx index bdc0d311e..565488da3 100644 --- a/source/funkin/ui/debug/charting/ChartEditorState.hx +++ b/source/funkin/ui/debug/charting/ChartEditorState.hx @@ -4949,7 +4949,7 @@ class ChartEditorState extends UIState // UIState derives from MusicBeatState playbarNoteSnap.text = '1/${noteSnapQuant}'; playbarDifficulty.text = '${selectedDifficulty.toTitleCase()}'; - // playbarBPM.text = 'BPM: ${(Conductor.currentTimeChange?.bpm ?? 0.0)}'; + playbarBPM.text = 'BPM: ${(Conductor.instance.bpm ?? 0.0)}'; } function handlePlayhead():Void From c765249030db27e092a4a544c0f614c0ee306a8f Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 22 Mar 2024 03:04:52 -0400 Subject: [PATCH 05/26] Complain if the main metadata file specifies a variation (like erect) but the game can't find it. --- source/funkin/play/song/Song.hx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/source/funkin/play/song/Song.hx b/source/funkin/play/song/Song.hx index 567c388c7..b0b477ff4 100644 --- a/source/funkin/play/song/Song.hx +++ b/source/funkin/play/song/Song.hx @@ -139,7 +139,16 @@ class Song implements IPlayStateScriptedClass implements IRegistryEntry = fetchVariationMetadata(id, vari); - if (variMeta != null) _metadata.set(variMeta.variation, variMeta); + if (variMeta != null) + { + _metadata.set(variMeta.variation, variMeta); + trace(' Loaded variation: $vari'); + } + else + { + FlxG.log.warn('[SONG] Failed to load variation metadata (${id}:${vari}), is the path correct?'); + trace(' FAILED to load variation: $vari'); + } } } From eb5f853e2cf9df81045effd13f70851d8bed6104 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 22 Mar 2024 03:05:18 -0400 Subject: [PATCH 06/26] Update assets submodule --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 203bb6024..d6f82ec8b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 203bb60249e0a419d473eb6dc1763e62e29ee7fd +Subproject commit d6f82ec8b91823eee809d73e2c4744210a8e7e0b From 28088146eba83d0cb48e91951faf8a8c09d4522d Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 22 Mar 2024 22:17:34 -0400 Subject: [PATCH 07/26] Fix bug where Pico dadbattle was playing over normal dadbattle --- assets | 2 +- source/funkin/play/song/Song.hx | 11 ++++++++--- source/funkin/util/Constants.hx | 5 +++++ 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/assets b/assets index 7cbe6ff4e..9a5767d04 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 7cbe6ff4ed7d976e7c69d6677c4aa84988da0e8d +Subproject commit 9a5767d04203a9cb9857608761646bb6a52b1e13 diff --git a/source/funkin/play/song/Song.hx b/source/funkin/play/song/Song.hx index 567c388c7..6c4f27420 100644 --- a/source/funkin/play/song/Song.hx +++ b/source/funkin/play/song/Song.hx @@ -374,12 +374,17 @@ class Song implements IPlayStateScriptedClass implements IRegistryEntry):Null { - if (variations == null) possibleVariations = variations; + if (possibleVariations == null) + { + possibleVariations = variations; + possibleVariations.sort(SortUtil.defaultsThenAlphabetically.bind(Constants.DEFAULT_VARIATION_LIST)); + } if (diffId == null) diffId = listDifficulties(null, possibleVariations)[0]; - for (variation in variations) + for (variationId in possibleVariations) { - if (difficulties.exists('$diffId-$variation')) return variation; + var variationSuffix = (variationId != Constants.DEFAULT_VARIATION) ? '-$variationId' : ''; + if (difficulties.exists('$diffId$variationSuffix')) return variationId; } return null; diff --git a/source/funkin/util/Constants.hx b/source/funkin/util/Constants.hx index c9b99ed46..c7bc03139 100644 --- a/source/funkin/util/Constants.hx +++ b/source/funkin/util/Constants.hx @@ -157,6 +157,11 @@ class Constants */ public static final DEFAULT_VARIATION:String = 'default'; + /** + * Standard variations used by the game. + */ + public static final DEFAULT_VARIATION_LIST:Array = ['default', 'erect', 'pico']; + /** * The default intensity for camera zooms. */ From 471b015d1ad8a4906be231fb3c75151df50a753c Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 22 Mar 2024 23:46:03 -0400 Subject: [PATCH 08/26] Add some FlxSignals and showVideo/hideVideo --- source/funkin/play/cutscene/VideoCutscene.hx | 71 ++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/source/funkin/play/cutscene/VideoCutscene.hx b/source/funkin/play/cutscene/VideoCutscene.hx index ff56e0919..7e500f05d 100644 --- a/source/funkin/play/cutscene/VideoCutscene.hx +++ b/source/funkin/play/cutscene/VideoCutscene.hx @@ -28,6 +28,31 @@ class VideoCutscene static var vid:FlxVideoSprite; #end + /** + * Called when the video is started. + */ + public static final onVideoStarted:FlxSignal = new FlxSignal(); + + /** + * Called if the video is paused. + */ + public static final onVideoPaused:FlxSignal = new FlxSignal(); + + /** + * Called if the video is resumed. + */ + public static final onVideoResumed:FlxSignal = new FlxSignal(); + + /** + * Called if the video is restarted. onVideoStarted is not called. + */ + public static final onVideoRestarted:FlxSignal = new FlxSignal(); + + /** + * Called when the video is ended or skipped. + */ + public static final onVideoEnded:FlxSignal = new FlxSignal(); + /** * Play a video cutscene. * TODO: Currently this is hardcoded to start the countdown after the video is done. @@ -94,6 +119,8 @@ class VideoCutscene PlayState.instance.add(vid); PlayState.instance.refresh(); + + onVideoStarted.dispatch(); } else { @@ -129,6 +156,8 @@ class VideoCutscene vid.y = 0; // vid.scale.set(0.5, 0.5); }); + + onVideoStarted.dispatch(); } else { @@ -143,6 +172,7 @@ class VideoCutscene if (vid != null) { vid.restartVideo(); + onVideoRestarted.dispatch(); } #end @@ -156,6 +186,8 @@ class VideoCutscene // Resume the video if it was paused. vid.resume(); } + + onVideoRestarted.dispatch(); } #end } @@ -166,6 +198,7 @@ class VideoCutscene if (vid != null) { vid.pauseVideo(); + onVideoPaused.dispatch(); } #end @@ -173,6 +206,41 @@ class VideoCutscene if (vid != null) { vid.pause(); + onVideoPaused.dispatch(); + } + #end + } + + public static function hideVideo():Void + { + #if html5 + if (vid != null) + { + vid.visible = false; + } + #end + + #if hxCodec + if (vid != null) + { + vid.visible = false; + } + #end + } + + public static function showVideo():Void + { + #if html5 + if (vid != null) + { + vid.visible = true; + } + #end + + #if hxCodec + if (vid != null) + { + vid.visible = true; } #end } @@ -183,6 +251,7 @@ class VideoCutscene if (vid != null) { vid.resumeVideo(); + onVideoResumed.dispatch(); } #end @@ -190,6 +259,7 @@ class VideoCutscene if (vid != null) { vid.resume(); + onVideoResumed.dispatch(); } #end } @@ -240,6 +310,7 @@ class VideoCutscene { ease: FlxEase.quadInOut, onComplete: function(twn:FlxTween) { + onVideoEnded.dispatch(); onCutsceneFinish(cutsceneType); } }); From e4a9d25ac01bf65b261076ffad753414967195ef Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Fri, 22 Mar 2024 23:53:29 -0400 Subject: [PATCH 09/26] Syntax fix --- source/funkin/play/cutscene/VideoCutscene.hx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/funkin/play/cutscene/VideoCutscene.hx b/source/funkin/play/cutscene/VideoCutscene.hx index 7e500f05d..3da51185f 100644 --- a/source/funkin/play/cutscene/VideoCutscene.hx +++ b/source/funkin/play/cutscene/VideoCutscene.hx @@ -5,6 +5,7 @@ import flixel.FlxSprite; import flixel.tweens.FlxEase; import flixel.tweens.FlxTween; import flixel.util.FlxColor; +import flixel.util.FlxSignal; import flixel.util.FlxTimer; #if html5 import funkin.graphics.video.FlxVideo; @@ -217,6 +218,7 @@ class VideoCutscene if (vid != null) { vid.visible = false; + blackScreen.visible = false; } #end @@ -224,6 +226,7 @@ class VideoCutscene if (vid != null) { vid.visible = false; + blackScreen.visible = false; } #end } @@ -234,6 +237,7 @@ class VideoCutscene if (vid != null) { vid.visible = true; + blackScreen.visible = false; } #end @@ -241,6 +245,7 @@ class VideoCutscene if (vid != null) { vid.visible = true; + blackScreen.visible = false; } #end } From 8bbb528a9e1326bf01d9a235cadcbc16f0b85b68 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Sat, 23 Mar 2024 13:44:27 -0400 Subject: [PATCH 10/26] Update assets submodule --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 526743915..8b0aa1d56 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 52674391511577300cdb8c08df293ea72099aa82 +Subproject commit 8b0aa1d5633f2f2e7f0eb03498ee71d19cc99564 From 709fbc859443f753b548f23760758d69b734101c Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Sat, 23 Mar 2024 18:11:06 -0400 Subject: [PATCH 11/26] Fix a bug where lag could cause the opponent to miss. --- source/funkin/play/PlayState.hx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 12b290afd..f7bf6fc22 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2089,8 +2089,7 @@ class PlayState extends MusicBeatSubState holdNote.handledMiss = true; // We dropped a hold note. - // Mute vocals and play miss animation, but don't penalize. - vocals.opponentVolume = 0; + // Play miss animation, but don't penalize. currentStage.getOpponent().playSingAnimation(holdNote.noteData.getDirection(), true); } } From a8486a47dfd879e3370f804900cb61ee811b7675 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Sat, 23 Mar 2024 18:22:15 -0400 Subject: [PATCH 12/26] Fix a bug where the album disappears never to return --- source/funkin/ui/freeplay/FreeplayState.hx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index fc11eec28..4e0d7ccf3 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -1013,7 +1013,14 @@ class FreeplayState extends MusicBeatSubState // Set the difficulty star count on the right. albumRoll.setDifficultyStars(daSong?.songRating); - albumRoll.albumId = daSong?.albumId ?? Constants.DEFAULT_ALBUM_ID; + + // Set the album graphic and play the animation if relevant. + var newAlbumId:String = daSong?.albumId ?? Constants.DEFAULT_ALBUM_ID; + if (albumRoll.albumId != newAlbumId) + { + albumRoll.albumId = newAlbumId; + albumRoll.playIntro(); + } } // Clears the cache of songs, frees up memory, they' ll have to be loaded in later tho function clearDaCache(actualSongTho:String) From 138dfd61e8a42e2fe1c1d7c217346e5632c8f687 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Sat, 23 Mar 2024 23:52:08 -0400 Subject: [PATCH 13/26] Fix a bug where the Camera Zoom toggle didn't work. --- source/funkin/play/PlayState.hx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index 12b290afd..6c3d790d7 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -1353,7 +1353,10 @@ class PlayState extends MusicBeatSubState } // Only zoom camera if we are zoomed by less than 35%. - if (FlxG.camera.zoom < (1.35 * defaultCameraZoom) && cameraZoomRate > 0 && Conductor.instance.currentBeat % cameraZoomRate == 0) + if (Preferences.zoomCamera + && FlxG.camera.zoom < (1.35 * defaultCameraZoom) + && cameraZoomRate > 0 + && Conductor.instance.currentBeat % cameraZoomRate == 0) { // Zoom camera in (1.5%) currentCameraZoom += cameraZoomIntensity * defaultCameraZoom; From 2b1fc1e7d722bf5e5663c432c35b4697a389e149 Mon Sep 17 00:00:00 2001 From: Hazel Date: Mon, 25 Mar 2024 16:12:37 +0100 Subject: [PATCH 14/26] bugfix: html5 builds (#418) --- .github/workflows/build-shit.yml | 6 ++++-- assets | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-shit.yml b/.github/workflows/build-shit.yml index 49bab1ac1..e217d1f18 100644 --- a/.github/workflows/build-shit.yml +++ b/.github/workflows/build-shit.yml @@ -13,8 +13,9 @@ jobs: apt update apt install -y sudo git curl unzip - name: Fix git config on posix runner + # this can't be {{ github.workspace }} because that's not docker-aware run: | - git config --global --add safe.directory ${{ github.workspace }} + git config --global --add safe.directory $GITHUB_WORKSPACE - name: Get checkout token uses: actions/create-github-app-token@v1 id: app_token @@ -90,8 +91,9 @@ jobs: runs-on: [self-hosted, macos] steps: - name: Fix git config on posix runner + # this can't be {{ github.workspace }} because that's not docker-aware run: | - git config --global --add safe.directory ${{ github.workspace }} + git config --global --add safe.directory $GITHUB_WORKSPACE - name: Get checkout token uses: actions/create-github-app-token@v1 id: app_token diff --git a/assets b/assets index 8b0aa1d56..526743915 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 8b0aa1d5633f2f2e7f0eb03498ee71d19cc99564 +Subproject commit 52674391511577300cdb8c08df293ea72099aa82 From 275a58e633f18b05320b41441789d58b5b1f4a9a Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 25 Mar 2024 13:42:35 -0400 Subject: [PATCH 15/26] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 9a5767d04..3b6008899 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 9a5767d04203a9cb9857608761646bb6a52b1e13 +Subproject commit 3b6008899aefa1fe952c1cc5ebf9506464a86d3c From 6a5026b7146ce1e7b1986b606662e6e4388e8202 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 25 Mar 2024 15:06:47 -0400 Subject: [PATCH 16/26] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 3e8bea70e..3b6008899 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 3e8bea70e7dcc76df67a0e87b85ef28ed5140371 +Subproject commit 3b6008899aefa1fe952c1cc5ebf9506464a86d3c From a66b746e4393220b03acf53e38a2a7990eac8653 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Mon, 25 Mar 2024 16:01:38 -0400 Subject: [PATCH 17/26] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index d6f82ec8b..8bb6214e1 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit d6f82ec8b91823eee809d73e2c4744210a8e7e0b +Subproject commit 8bb6214e16c823b8b5a522a39b7a7e01d6283abf From 07ad25006008910a4c8c9a706b64267cfbca306f Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 25 Mar 2024 21:08:39 -0400 Subject: [PATCH 18/26] Fix an audio crash when exiting a cutscene --- source/funkin/play/PlayState.hx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/source/funkin/play/PlayState.hx b/source/funkin/play/PlayState.hx index a8cb879a3..169809a63 100644 --- a/source/funkin/play/PlayState.hx +++ b/source/funkin/play/PlayState.hx @@ -2941,7 +2941,10 @@ class PlayState extends MusicBeatSubState if (overrideMusic) { // Stop the music. Do NOT destroy it, something still references it! - FlxG.sound.music.pause(); + if (FlxG.sound.music != null) + { + FlxG.sound.music.pause(); + } if (vocals != null) { vocals.pause(); @@ -2951,7 +2954,10 @@ class PlayState extends MusicBeatSubState else { // Stop and destroy the music. - FlxG.sound.music.pause(); + if (FlxG.sound.music != null) + { + FlxG.sound.music.pause(); + } if (vocals != null) { vocals.destroy(); From f4617cbbda6cb3b62ea7a7bdf351d8d3f366d533 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 25 Mar 2024 21:08:53 -0400 Subject: [PATCH 19/26] Add mac builds with proper arguments --- .vscode/settings.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index 84af3a3fd..13a1862d2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -204,6 +204,21 @@ "label": "HTML5 / Debug (Watch)", "target": "html5", "args": ["-debug", "-watch", "-DFORCE_DEBUG_VERSION"] + }, + { + "label": "macOS / Debug", + "target": "mac", + "args": ["-debug", "-DFORCE_DEBUG_VERSION"] + }, + { + "label": "macOS / Release", + "target": "mac", + "args": ["-release"] + }, + { + "label": "macOS / Release (GitHub Actions)", + "target": "mac", + "args": ["-release", "-DGITHUB_BUILD"] } ], "cmake.configureOnOpen": false, From 90f861628d6869b9b148782ed0ce1c5bf8f66ccc Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 25 Mar 2024 21:09:02 -0400 Subject: [PATCH 20/26] Fix an HTML5 build issue. --- .../ui/debug/anim/DebugBoundingState.hx | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/source/funkin/ui/debug/anim/DebugBoundingState.hx b/source/funkin/ui/debug/anim/DebugBoundingState.hx index 86e84117a..1aa5d6e12 100644 --- a/source/funkin/ui/debug/anim/DebugBoundingState.hx +++ b/source/funkin/ui/debug/anim/DebugBoundingState.hx @@ -1,31 +1,35 @@ package funkin.ui.debug.anim; -import funkin.util.SerializerUtil; -import funkin.play.character.CharacterData; -import flixel.FlxCamera; -import flixel.FlxSprite; -import flixel.FlxState; import flixel.addons.display.FlxGridOverlay; import flixel.addons.ui.FlxInputText; import flixel.addons.ui.FlxUIDropDownMenu; +import flixel.FlxCamera; +import flixel.FlxSprite; +import flixel.FlxState; import flixel.graphics.frames.FlxAtlasFrames; import flixel.graphics.frames.FlxFrame; import flixel.group.FlxGroup; import flixel.math.FlxPoint; import flixel.text.FlxText; import flixel.util.FlxColor; -import funkin.util.MouseUtil; import flixel.util.FlxSpriteUtil; import flixel.util.FlxTimer; +import funkin.audio.FunkinSound; +import funkin.input.Cursor; import funkin.play.character.BaseCharacter; +import funkin.play.character.CharacterData; import funkin.play.character.CharacterData.CharacterDataParser; import funkin.play.character.SparrowCharacter; -import haxe.ui.RuntimeComponentBuilder; +import funkin.ui.mainmenu.MainMenuState; +import funkin.util.MouseUtil; +import funkin.util.SerializerUtil; +import funkin.util.SortUtil; import haxe.ui.components.DropDown; import haxe.ui.core.Component; +import haxe.ui.core.Screen; import haxe.ui.events.ItemEvent; import haxe.ui.events.UIEvent; -import funkin.ui.mainmenu.MainMenuState; +import haxe.ui.RuntimeComponentBuilder; import lime.utils.Assets as LimeAssets; import openfl.Assets; import openfl.events.Event; @@ -33,13 +37,8 @@ import openfl.events.IOErrorEvent; import openfl.geom.Rectangle; import openfl.net.FileReference; import openfl.net.URLLoader; -import funkin.ui.mainmenu.MainMenuState; import openfl.net.URLRequest; import openfl.utils.ByteArray; -import funkin.input.Cursor; -import funkin.play.character.CharacterData.CharacterDataParser; -import funkin.util.SortUtil; -import haxe.ui.core.Screen; using flixel.util.FlxSpriteUtil; From 5ae075e947c1fdbdd50614f0750f02f5b3f47fc2 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 25 Mar 2024 21:09:14 -0400 Subject: [PATCH 21/26] Fix a couple Flixel warnings on the results screen. --- source/funkin/play/ResultState.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index c695b1db4..821f4ba3c 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -109,7 +109,7 @@ class ResultState extends MusicBeatSubState add(gf); var boyfriend:FlxSprite = FunkinSprite.createSparrow(640, -200, 'resultScreen/resultBoyfriendGOOD'); - boyfriend.animation.addByPrefix("fall", "Boyfriend Good", 24, false); + boyfriend.animation.addByPrefix("fall", "Boyfriend Good Anim0", 24, false); boyfriend.visible = false; boyfriend.animation.finishCallback = function(_) { boyfriend.animation.play('fall', true, false, 14); @@ -164,7 +164,7 @@ class ResultState extends MusicBeatSubState add(blackTopBar); var resultsAnim:FunkinSprite = FunkinSprite.createSparrow(-200, -10, "resultScreen/results"); - resultsAnim.animation.addByPrefix("result", "results", 24, false); + resultsAnim.animation.addByPrefix("result", "results instance 1", 24, false); resultsAnim.animation.play("result"); add(resultsAnim); From 368b82846ec0d2b46cf1d9466de7e19aa7eff2f7 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Mon, 25 Mar 2024 21:15:20 -0400 Subject: [PATCH 22/26] Update assets submodule --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 3b6008899..9d2bfff5b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 3b6008899aefa1fe952c1cc5ebf9506464a86d3c +Subproject commit 9d2bfff5b595f6c0b1c3d7228d7cad7430694f57 From 32b21e21b275a1626e8ade58a8a2ef462045660a Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 26 Mar 2024 01:12:22 -0400 Subject: [PATCH 23/26] Update assets submodule --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 526743915..201e342c7 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 52674391511577300cdb8c08df293ea72099aa82 +Subproject commit 201e342c7f879b829446f6caf4e4052bd5852cfb From 8943cd117e6a95e26f01d962966e44ed03c40539 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Tue, 26 Mar 2024 01:12:46 -0400 Subject: [PATCH 24/26] Make the error message a bit better if an Animate atlas fails to parse. --- .../funkin/play/character/AnimateAtlasCharacter.hx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source/funkin/play/character/AnimateAtlasCharacter.hx b/source/funkin/play/character/AnimateAtlasCharacter.hx index 9e7aa98bf..f1dadf3e2 100644 --- a/source/funkin/play/character/AnimateAtlasCharacter.hx +++ b/source/funkin/play/character/AnimateAtlasCharacter.hx @@ -76,10 +76,17 @@ class AnimateAtlasCharacter extends BaseCharacter { trace('Creating Animate Atlas character: ' + this.characterId); - var atlasSprite:FlxAtlasSprite = loadAtlasSprite(); - setSprite(atlasSprite); + try + { + var atlasSprite:FlxAtlasSprite = loadAtlasSprite(); + setSprite(atlasSprite); - loadAnimations(); + loadAnimations(); + } + catch (e) + { + throw "Exception thrown while building FlxAtlasSprite: " + e; + } super.onCreate(event); } From 364652a22f8878b3fa87503ce372b2ab7f2ca039 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 26 Mar 2024 01:28:58 -0400 Subject: [PATCH 25/26] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 9d2bfff5b..366aab684 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 9d2bfff5b595f6c0b1c3d7228d7cad7430694f57 +Subproject commit 366aab68406311782e1c1c7a5e9de0a224ccf6fd From 6d4c2e804fb5e10c8ed93e982207fc61a0534d22 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Tue, 26 Mar 2024 01:30:48 -0400 Subject: [PATCH 26/26] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 201e342c7..5f1726f1b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 201e342c7f879b829446f6caf4e4052bd5852cfb +Subproject commit 5f1726f1b0c11fc747b7473708cf4e5f28be05f1