From cdd78818a7f9ca47b95fd9d24e7df21231c118e9 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 12 Sep 2024 15:20:12 -0400 Subject: [PATCH 01/22] Update assets submodule and changelog --- CHANGELOG.md | 9 ++++++++- art | 2 +- assets | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22a36fa8e..a2031ba24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,8 +29,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Implemented support for a new Instrumental Selector in Freeplay - Beating a Pico remix lets you use that instrumental when playing as Boyfriend - Added the first batch of Erect Stages! These graphical overhauls of the original stages will be used when playing Erect remixes and Pico remixes + - Week 1 Erect Stage + - Week 2 Erect Stage + - Week 3 Erect Stage + - Week 4 Erect Stage + - Week 5 Erect Stage + - Weekend 1 Erect Stage +- Implemented alternate animations and music for Pico in the results screen. + - These display on Pico remixes, as well as when playing Weekend 1. - Implemented support for scripted Note Kinds. You can use HScript define a different note style to display for these notes as well as custom behavior. (community feature by lemz1) -- Implemented a new Strumline Background option, to display a darkened background behind the strumline with your choice of opacity. - Implemented support for Numeric and Selector options in the Options menu. (community feature by FlooferLand) ## Changed - Girlfriend and Nene now perform previously unused animations when you achieve a large combo, or drop a large combo. diff --git a/art b/art index 0bb988c49..42ac06e51 160000 --- a/art +++ b/art @@ -1 +1 @@ -Subproject commit 0bb988c49788fd25a230b56dd9e4448838bc79c9 +Subproject commit 42ac06e51207bda89144fd20a407ed3c3e0c6673 diff --git a/assets b/assets index bd4e2421c..90865213b 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit bd4e2421c87c31e244bc9c162850b842582c5de4 +Subproject commit 90865213be704f88df8398f28b8880c13f468546 From b2b16ff2d310169c8390329c2546af6556346789 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 12 Sep 2024 15:31:58 -0400 Subject: [PATCH 02/22] Update vocal delay again --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 90865213b..934468c04 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 90865213be704f88df8398f28b8880c13f468546 +Subproject commit 934468c0472504c282b12c63b473e9f74b5b4517 From 386dc22d7b24464a63a4f95c6fa2aa8cc854da86 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 12 Sep 2024 15:34:16 -0400 Subject: [PATCH 03/22] Debug hotkey properly resets char select cutscene --- source/funkin/ui/mainmenu/MainMenuState.hx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/funkin/ui/mainmenu/MainMenuState.hx b/source/funkin/ui/mainmenu/MainMenuState.hx index 4e416abeb..13d68da6d 100644 --- a/source/funkin/ui/mainmenu/MainMenuState.hx +++ b/source/funkin/ui/mainmenu/MainMenuState.hx @@ -437,7 +437,10 @@ class MainMenuState extends MusicBeatState if (FlxG.keys.pressed.CONTROL && FlxG.keys.pressed.ALT && FlxG.keys.pressed.SHIFT && FlxG.keys.justPressed.N) { @:privateAccess - funkin.save.Save.instance.data.unlocks.charactersSeen = ["bf"]; + { + funkin.save.Save.instance.data.unlocks.charactersSeen = ["bf"]; + funkin.save.Save.instance.data.unlocks.oldChar = false; + } } if (FlxG.keys.pressed.CONTROL && FlxG.keys.pressed.ALT && FlxG.keys.pressed.SHIFT && FlxG.keys.justPressed.E) From e5673549cf7c17c58dfc340279c4ac0ed4377dd7 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 12 Sep 2024 15:38:20 -0400 Subject: [PATCH 04/22] Fix issues with the difficulty selector showing non-existant difficulties in Freeplay --- source/funkin/ui/freeplay/FreeplayState.hx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index a908e54c6..ec80a1ff6 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -354,10 +354,6 @@ class FreeplayState extends MusicBeatSubState if (availableDifficultiesForSong.length == 0) continue; songs.push(new FreeplaySongData(levelId, songId, song, displayedVariations)); - for (difficulty in availableDifficultiesForSong) - { - diffIdsTotal.pushUnique(difficulty); - } for (difficulty in unsuffixedDifficulties) { diffIdsTotal.pushUnique(difficulty); @@ -1764,12 +1760,13 @@ class FreeplayState extends MusicBeatSubState var songScore:Null = Save.instance.getSongScore(daSong.songId, suffixedDifficulty); intendedScore = songScore?.score ?? 0; intendedCompletion = songScore == null ? 0.0 : ((songScore.tallies.sick + songScore.tallies.good) / songScore.tallies.totalNotes); - rememberedDifficulty = currentDifficulty; + rememberedDifficulty = suffixedDifficulty; } else { intendedScore = 0; intendedCompletion = 0.0; + rememberedDifficulty = currentDifficulty; } if (intendedCompletion == Math.POSITIVE_INFINITY || intendedCompletion == Math.NEGATIVE_INFINITY || Math.isNaN(intendedCompletion)) From 721cecd271fb8b40fe1ed26ee7908d94bd1f522e Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Thu, 12 Sep 2024 15:38:44 -0400 Subject: [PATCH 05/22] add preference option for framerate capping --- source/Main.hx | 11 ++--- source/funkin/Preferences.hx | 53 +++++++++++++++++++++ source/funkin/save/Save.hx | 7 +++ source/funkin/ui/options/PreferencesMenu.hx | 6 +++ 4 files changed, 69 insertions(+), 8 deletions(-) diff --git a/source/Main.hx b/source/Main.hx index 7f7d25235..724b118f8 100644 --- a/source/Main.hx +++ b/source/Main.hx @@ -67,14 +67,9 @@ class Main extends Sprite function init(?event:Event):Void { #if web - untyped js.Syntax.code(" - window.requestAnimationFrame = function(callback, element) { - var currTime = new Date().getTime(); - var timeToCall = 0; - var id = window.setTimeout(function() { callback(currTime + timeToCall); }, - timeToCall); - return id; - }"); + // set this variable (which is a function) from the lime version at lime/_internal/backend/html5/HTML5Application.hx + // The framerate cap will more thoroughly initialize via Preferences in InitState.hx + funkin.Preferences.lockedFramerateFunction = untyped js.Syntax.code("window.requestAnimationFrame"); #end if (hasEventListener(Event.ADDED_TO_STAGE)) diff --git a/source/funkin/Preferences.hx b/source/funkin/Preferences.hx index b2050c6a2..daeded897 100644 --- a/source/funkin/Preferences.hx +++ b/source/funkin/Preferences.hx @@ -128,6 +128,48 @@ class Preferences return value; } + public static var unlockedFramerate(get, set):Bool; + + static function get_unlockedFramerate():Bool + { + return Save?.instance?.options?.unlockedFramerate; + } + + static function set_unlockedFramerate(value:Bool):Bool + { + if (value != Save.instance.options.unlockedFramerate) + { + #if web + toggleFramerateCap(value); + #end + } + + var save:Save = Save.instance; + save.options.unlockedFramerate = value; + save.flush(); + return value; + } + + #if web + // We create a haxe version of this just for readability. + // We use these to override `window.requestAnimationFrame` in Javascript to uncap the framerate / "animation" request rate + // Javascript is crazy since u can just do stuff like that lol + + public static function unlockedFramerateFunction(callback, element) + { + var currTime = Date.now().getTime(); + var timeToCall = 0; + var id = js.Browser.window.setTimeout(function() { + callback(currTime + timeToCall); + }, timeToCall); + return id; + } + + // Lime already implements their own little framerate cap, so we can just use that + // This also gets set in the init function in Main.hx, since we need to definitely override it + public static var lockedFramerateFunction = untyped js.Syntax.code("window.requestAnimationFrame"); + #end + /** * Loads the user's preferences from the save data and apply them. */ @@ -137,6 +179,17 @@ class Preferences FlxG.autoPause = Preferences.autoPause; // Apply the debugDisplay setting (enables the FPS and RAM display). toggleDebugDisplay(Preferences.debugDisplay); + #if web + toggleFramerateCap(Preferences.unlockedFramerate); + #end + } + + static function toggleFramerateCap(unlocked:Bool):Void + { + #if web + var framerateFunction = unlocked ? unlockedFramerateFunction : lockedFramerateFunction; + untyped js.Syntax.code("window.requestAnimationFrame = framerateFunction;"); + #end } static function toggleDebugDisplay(show:Bool):Void diff --git a/source/funkin/save/Save.hx b/source/funkin/save/Save.hx index 1fa283b26..4b1649c5b 100644 --- a/source/funkin/save/Save.hx +++ b/source/funkin/save/Save.hx @@ -97,6 +97,7 @@ class Save autoPause: true, inputOffset: 0, audioVisualOffset: 0, + unlockedFramerate: false, controls: { @@ -1171,6 +1172,12 @@ typedef SaveDataOptions = */ var audioVisualOffset:Int; + /** + * If we want the framerate to be unlocked on HTML5. + * @default `false + */ + var unlockedFramerate:Bool; + var controls: { var p1: diff --git a/source/funkin/ui/options/PreferencesMenu.hx b/source/funkin/ui/options/PreferencesMenu.hx index 5fbefceed..eb7b88792 100644 --- a/source/funkin/ui/options/PreferencesMenu.hx +++ b/source/funkin/ui/options/PreferencesMenu.hx @@ -72,6 +72,12 @@ class PreferencesMenu extends Page createPrefItemCheckbox('Auto Pause', 'Automatically pause the game when it loses focus', function(value:Bool):Void { Preferences.autoPause = value; }, Preferences.autoPause); + + #if web + createPrefItemCheckbox('Unlocked Framerate', 'Enable to unlock the framerate', function(value:Bool):Void { + Preferences.unlockedFramerate = value; + }, Preferences.unlockedFramerate); + #end } override function update(elapsed:Float):Void From 3970189fe92dbbdac9256687174f1a9953ee83cf Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 12 Sep 2024 15:43:40 -0400 Subject: [PATCH 06/22] Ensure save data gets flushed when you see a character --- source/funkin/save/Save.hx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/funkin/save/Save.hx b/source/funkin/save/Save.hx index 1fa283b26..43b7667da 100644 --- a/source/funkin/save/Save.hx +++ b/source/funkin/save/Save.hx @@ -407,6 +407,9 @@ class Save return data.unlocks.charactersSeen; } + /** + * Marks whether the player has seen the spotlight animation, which should only display once per save file ever. + */ public var oldChar(get, set):Bool; function get_oldChar():Bool @@ -416,7 +419,9 @@ class Save function set_oldChar(value:Bool):Bool { - return data.unlocks.oldChar = value; + data.unlocks.oldChar = value; + flush(); + return data.unlocks.oldChar; } /** @@ -425,7 +430,11 @@ class Save */ public function addCharacterSeen(character:String):Void { - if (!data.unlocks.charactersSeen.contains(character)) data.unlocks.charactersSeen.push(character); + if (!data.unlocks.charactersSeen.contains(character)) + { + data.unlocks.charactersSeen.push(character); + flush(); + } } /** From a9667c54f377a1207b70ba163ceebd8f239a5822 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 12 Sep 2024 15:48:41 -0400 Subject: [PATCH 07/22] Fix FlxAtlasSprite completion handling and music looping --- source/funkin/audio/FunkinSound.hx | 2 ++ .../funkin/graphics/adobeanimate/FlxAtlasSprite.hx | 9 +++++++-- source/funkin/play/ResultState.hx | 6 ++---- source/funkin/play/scoring/Scoring.hx | 13 ------------- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/source/funkin/audio/FunkinSound.hx b/source/funkin/audio/FunkinSound.hx index 18a0b4da2..dae31cd07 100644 --- a/source/funkin/audio/FunkinSound.hx +++ b/source/funkin/audio/FunkinSound.hx @@ -340,6 +340,8 @@ class FunkinSound extends FlxSound implements ICloneable if (songMusicData != null) { Conductor.instance.mapTimeChanges(songMusicData.timeChanges); + + if (songMusicData.looped != null && params.loop == null) params.loop = songMusicData.looped; } else { diff --git a/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx b/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx index f245afec7..952fa8b71 100644 --- a/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx +++ b/source/funkin/graphics/adobeanimate/FlxAtlasSprite.hx @@ -185,11 +185,12 @@ class FlxAtlasSprite extends FlxAnimate // Move to the first frame of the animation. // goToFrameLabel(id); trace('Playing animation $id'); - if (this.anim.symbolDictionary.exists(id) || (this.anim.getByName(id) != null)) + if ((id == null || id == "") || this.anim.symbolDictionary.exists(id) || (this.anim.getByName(id) != null)) { this.anim.play(id, restart, false, startFrame); - if (id == "Boyfriend DJ fist pump" || startFrame == 4) trace("PUMP COMMAND: " + anim.curFrame); + this.currentAnimation = anim.curSymbol.name; + fr = null; } // Only call goToFrameLabel if there is a frame label with that name. This prevents annoying warnings! @@ -316,6 +317,10 @@ class FlxAtlasSprite extends FlxAnimate { onAnimationComplete.dispatch(currentAnimation); } + else + { + onAnimationComplete.dispatch(''); + } } var prevFrames:Map = []; diff --git a/source/funkin/play/ResultState.hx b/source/funkin/play/ResultState.hx index e0ac3579d..739df167d 100644 --- a/source/funkin/play/ResultState.hx +++ b/source/funkin/play/ResultState.hx @@ -418,8 +418,7 @@ class ResultState extends MusicBeatSubState { startingVolume: 1.0, overrideExisting: true, - restartTrack: true, - loop: rank.shouldMusicLoop() + restartTrack: true }); }); } @@ -429,8 +428,7 @@ class ResultState extends MusicBeatSubState { startingVolume: 1.0, overrideExisting: true, - restartTrack: true, - loop: rank.shouldMusicLoop() + restartTrack: true }); } }); diff --git a/source/funkin/play/scoring/Scoring.hx b/source/funkin/play/scoring/Scoring.hx index 6c9f9bd97..dae098638 100644 --- a/source/funkin/play/scoring/Scoring.hx +++ b/source/funkin/play/scoring/Scoring.hx @@ -577,19 +577,6 @@ enum abstract ScoringRank(String) } } - public function shouldMusicLoop():Bool - { - switch (abstract) - { - case PERFECT_GOLD | PERFECT | EXCELLENT | GREAT | GOOD: - return true; - case SHIT: - return false; - default: - return false; - } - } - public function getHorTextAsset() { switch (abstract) From f7f311d6f2dc356b363efc8c2f6d7cdf50fd4e35 Mon Sep 17 00:00:00 2001 From: FabsTheFabs Date: Thu, 12 Sep 2024 21:07:40 +0100 Subject: [PATCH 08/22] assets submod....... --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index bd4e2421c..e9cb3eb69 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit bd4e2421c87c31e244bc9c162850b842582c5de4 +Subproject commit e9cb3eb6922b60f43ab25b4695acfd15893ae96e From 33df8936b10e5ee216f6c3817550945993d9466c Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Thu, 12 Sep 2024 16:41:14 -0400 Subject: [PATCH 09/22] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 934468c04..7b5fc3055 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 934468c0472504c282b12c63b473e9f74b5b4517 +Subproject commit 7b5fc3055235c401dd711da9617b3719df1dcf27 From 1ee351c83d13b1c616ac3751675389943a715f83 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Thu, 12 Sep 2024 16:42:57 -0400 Subject: [PATCH 10/22] art submod --- art | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/art b/art index 42ac06e51..0dee03f11 160000 --- a/art +++ b/art @@ -1 +1 @@ -Subproject commit 42ac06e51207bda89144fd20a407ed3c3e0c6673 +Subproject commit 0dee03f11afc01c2883da223fa10405f7011dd33 From a4e977f60f531b90699473640be2ff0027c26b78 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Thu, 12 Sep 2024 16:45:20 -0400 Subject: [PATCH 11/22] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index e9cb3eb69..8762fd51c 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit e9cb3eb6922b60f43ab25b4695acfd15893ae96e +Subproject commit 8762fd51c26abdc9a45657eab9018aa48e972cd6 From 395de4ee9571daab95fc8f32bf7fb1c309d7d0b0 Mon Sep 17 00:00:00 2001 From: CheemsAndFriends Date: Thu, 12 Sep 2024 22:53:01 +0200 Subject: [PATCH 12/22] Char select subs stuff --- assets | 2 +- .../ui/charSelect/CharSelectSubState.hx | 142 ++++++++++++------ 2 files changed, 94 insertions(+), 50 deletions(-) diff --git a/assets b/assets index 26ab9a1dc..ff425d983 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 26ab9a1dc8eec563717711b290c21d0e9e56a005 +Subproject commit ff425d983e3b017b3a7dc241f03ae51f1fae9116 diff --git a/source/funkin/ui/charSelect/CharSelectSubState.hx b/source/funkin/ui/charSelect/CharSelectSubState.hx index e075abca3..b83b3a6af 100644 --- a/source/funkin/ui/charSelect/CharSelectSubState.hx +++ b/source/funkin/ui/charSelect/CharSelectSubState.hx @@ -35,63 +35,58 @@ import openfl.filters.ShaderFilter; import funkin.util.FramesJSFLParser; import funkin.util.FramesJSFLParser.FramesJSFLInfo; import funkin.util.FramesJSFLParser.FramesJSFLFrame; +import funkin.graphics.FunkinSprite; class CharSelectSubState extends MusicBeatSubState { var cursor:FlxSprite; + var cursorBlue:FlxSprite; var cursorDarkBlue:FlxSprite; - var grpCursors:FlxTypedGroup; - var cursorConfirmed:FlxSprite; var cursorDenied:FlxSprite; - var cursorX:Int = 0; var cursorY:Int = 0; - var cursorFactor:Float = 110; var cursorOffsetX:Float = -16; var cursorOffsetY:Float = -48; - var cursorLocIntended:FlxPoint = new FlxPoint(0, 0); var lerpAmnt:Float = 0.95; - var tmrFrames:Int = 60; - var currentStage:Stage; - var playerChill:CharSelectPlayer; var playerChillOut:CharSelectPlayer; var gfChill:CharSelectGF; var gfChillOut:CharSelectGF; - var barthing:FlxAtlasSprite; var dipshitBacking:FlxSprite; var chooseDipshit:FlxSprite; var dipshitBlur:FlxSprite; var transitionGradient:FlxSprite; - var curChar(default, set):String = "pico"; var nametag:Nametag; var camFollow:FlxObject; var autoFollow:Bool = false; - var availableChars:Map = new Map(); var pressedSelect:Bool = false; - var selectTimer:FlxTimer = new FlxTimer(); + var selectSound:FunkinSound; var unlockSound:FunkinSound; + var lockedSound:FunkinSound; + var introSound:FunkinSound; + var staticSound:FunkinSound; var charSelectCam:FunkinCamera; var selectedBizz:Array = [ - new DropShadowFilter(0, 0, 0xFFFFFF, 1, 2, 2, 21, 1, false, false, false), + new DropShadowFilter(0, 0, 0xFFFFFF, 1, 2, 2, 19, 1, false, false, false), new DropShadowFilter(5, 45, 0x000000, 1, 2, 2, 1, 1, false, false, false) ]; var bopInfo:FramesJSFLInfo; + var blackScreen:FunkinSprite; public function new() { @@ -125,11 +120,6 @@ class CharSelectSubState extends MusicBeatSubState override public function create():Void { - openSubState(new IntroSubState()); - subStateClosed.addOnce((_) -> { - camera.flash(); - checkNewChar(); - }); super.create(); bopInfo = FramesJSFLParser.parse(Paths.file("images/charSelect/iconBopInfo/iconBopInfo.txt")); @@ -140,7 +130,7 @@ class CharSelectSubState extends MusicBeatSubState add(bg); var crowd:FlxAtlasSprite = new FlxAtlasSprite(0, 0, Paths.animateAtlas("charSelect/crowd")); - crowd.anim.play(""); + crowd.anim.play(); crowd.scrollFactor.set(0.3, 0.3); add(crowd); @@ -301,8 +291,25 @@ class CharSelectSubState extends MusicBeatSubState unlockSound.volume = 0; unlockSound.play(true); - FlxG.sound.defaultSoundGroup.add(unlockSound); - FlxG.sound.list.add(unlockSound); + lockedSound = new FunkinSound(); + lockedSound.loadEmbedded(Paths.sound('CS_locked')); + lockedSound.pitch = 1; + + lockedSound.volume = 1.; + + FlxG.sound.defaultSoundGroup.add(lockedSound); + FlxG.sound.list.add(lockedSound); + + staticSound = new FunkinSound(); + staticSound.loadEmbedded(Paths.sound('static loop')); + staticSound.pitch = 1; + + staticSound.looped = true; + + staticSound.volume = 0.6; + + FlxG.sound.defaultSoundGroup.add(staticSound); + FlxG.sound.list.add(staticSound); // playing it here to preload it. not doing this makes a super awkward pause at the end of the intro // TODO: probably make an intro thing for funkinSound itself that preloads the next audio? @@ -365,6 +372,34 @@ class CharSelectSubState extends MusicBeatSubState FlxG.camera.follow(camFollow, LOCKON, 0.01); } }); + + var blackScreen = new FunkinSprite().makeSolidColor(FlxG.width * 2, FlxG.height * 2, 0xFF000000); + blackScreen.x = -(FlxG.width * 0.5); + blackScreen.y = -(FlxG.height * 0.5); + add(blackScreen); + + introSound = new FunkinSound(); + introSound.loadEmbedded(Paths.sound('CS_Lights')); + introSound.pitch = 1; + introSound.volume = 0; + + FlxG.sound.defaultSoundGroup.add(introSound); + FlxG.sound.list.add(introSound); + + openSubState(new IntroSubState()); + subStateClosed.addOnce((_) -> { + remove(blackScreen); + if (!Save.instance.oldChar) + { + camera.flash(); + + introSound.volume = 1; + introSound.play(true); + } + checkNewChar(); + + Save.instance.oldChar = true; + }); } function checkNewChar():Void @@ -396,7 +431,6 @@ class CharSelectSubState extends MusicBeatSubState var grpIcons:FlxSpriteGroup; var grpXSpread(default, set):Float = 107; var grpYSpread(default, set):Float = 127; - var nonLocks = []; function initLocks():Void @@ -426,9 +460,9 @@ class CharSelectSubState extends MusicBeatSubState var temp:Lock = new Lock(0, 0, i); temp.ID = 1; - temp.onAnimationComplete.add(function(anim) { - if (anim == "unlock") playerChill.playAnimation("unlock", true); - }); + // temp.onAnimationComplete.add(function(anim) { + // if (anim == "unlock") playerChill.playAnimation("unlock", true); + // }); grpIcons.add(temp); } @@ -443,7 +477,7 @@ class CharSelectSubState extends MusicBeatSubState { var index = nonLocks[0]; - // pressedSelect = true; + pressedSelect = true; var copy = 3; @@ -505,7 +539,7 @@ class CharSelectSubState extends MusicBeatSubState updateIconPositions(); playerChillOut.onAnimationComplete.addOnce((_) -> if (_ == "death") { - sync = false; + // sync = false; playerChillOut.visible = false; playerChillOut.switchChar(char); }); @@ -515,6 +549,9 @@ class CharSelectSubState extends MusicBeatSubState { pressedSelect = false; @:bypassAccessor curChar = char; + + staticSound.stop(); + FunkinSound.playMusic('stayFunky', { startingVolume: 1, @@ -561,15 +598,13 @@ class CharSelectSubState extends MusicBeatSubState } var sync:Bool = false; - var syncLock:Lock = null; - var audioBizz:Float = 0; function syncAudio(elapsed:Float):Void { @:privateAccess - if (sync && !unlockSound.paused) + if (sync && unlockSound.time > 0) { // if (playerChillOut.anim.framerate > 0) // { @@ -580,14 +615,12 @@ class CharSelectSubState extends MusicBeatSubState playerChillOut.anim._tick = 0; if (syncLock != null) syncLock.anim._tick = 0; - trace(unlockSound.time); - - if ((unlockSound.time - audioBizz) >= (delay * 1000)) + if ((unlockSound.time - audioBizz) >= ((delay) * 100)) { if (syncLock != null) syncLock.anim._tick = delay; playerChillOut.anim._tick = delay; - audioBizz += delay * 1000; + audioBizz += delay * 100; } } } @@ -734,11 +767,14 @@ class CharSelectSubState extends MusicBeatSubState cursorY = -1; } - if (availableChars.exists(getCurrentSelected()) && Save.instance.charactersSeen.contains(availableChars[getCurrentSelected()])) + if (autoFollow + && availableChars.exists(getCurrentSelected()) + && Save.instance.charactersSeen.contains(availableChars[getCurrentSelected()])) { + gfChill.visible = true; curChar = availableChars.get(getCurrentSelected()); - if (controls.ACCEPT) + if (!pressedSelect && controls.ACCEPT) { cursorConfirmed.visible = true; cursorConfirmed.x = cursor.x - 2; @@ -752,7 +788,7 @@ 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.playAnimation("select"); - gfChill.playAnimation("confirm"); + gfChill.playAnimation("confirm", true, false, true); pressedSelect = true; selectTimer.start(1.5, (_) -> { // pressedSelect = false; @@ -775,29 +811,37 @@ class CharSelectSubState extends MusicBeatSubState FlxTween.tween(FlxG.sound.music, {pitch: 1.0, volume: 1.0}, 1, {ease: FlxEase.quartInOut}); playerChill.playAnimation("deselect"); gfChill.playAnimation("deselect"); + pressedSelect = false; FlxTween.tween(FlxG.sound.music, {pitch: 1.0}, 1, { ease: FlxEase.quartInOut, onComplete: (_) -> { - playerChill.playAnimation("idle", true, false, true); - gfChill.playAnimation("idle", true, false, true); + if (playerChill.getCurrentAnimation() == "deselect loop start" || playerChill.getCurrentAnimation() == "deselect") + { + playerChill.playAnimation("idle", true, false, true); + gfChill.playAnimation("idle", true, false, true); + } } }); - pressedSelect = false; selectTimer.cancel(); } } - else + else if (autoFollow) { curChar = "locked"; + gfChill.visible = false; + if (controls.ACCEPT) { cursorDenied.visible = true; cursorDenied.x = cursor.x - 2; cursorDenied.y = cursor.y - 4; - playerChill.playAnimation("cannot select", true); + playerChill.playAnimation("cannot select Label", true); + + lockedSound.play(true); + cursorDenied.animation.play("idle", true); cursorDenied.animation.finishCallback = (_) -> { cursorDenied.visible = false; @@ -831,13 +875,9 @@ class CharSelectSubState extends MusicBeatSubState } var bopTimer:Float = 0; - var delay = 1 / 24; - var bopFr = 0; - var bopPlay:Bool = false; - var bopRefX:Float = 0; var bopRefY:Float = 0; @@ -957,10 +997,10 @@ class CharSelectSubState extends MusicBeatSubState memb.filters = selectedBizz; memb.scale.set(2.6, 2.6); } - if (controls.ACCEPT && memb.animation.curAnim.name == "confirm") memb.animation.play("confirm"); - if (pressedSelect && controls.BACK) + if (pressedSelect && memb.animation.curAnim.name == "idle") memb.animation.play("confirm"); + if (autoFollow && !pressedSelect && memb.animation.curAnim.name != "idle") { - memb.animation.play("confirm", true, true); + memb.animation.play("confirm", false, true); member.animation.finishCallback = (_) -> { member.animation.play("idle"); member.animation.finishCallback = null; @@ -991,6 +1031,10 @@ class CharSelectSubState extends MusicBeatSubState curChar = value; + if (value == "locked") staticSound.play(); + else + staticSound.stop(); + nametag.switchChar(value); playerChill.visible = false; playerChillOut.visible = true; From f0ac09f949f7f56789e08ceaacbbbdb456a8ad03 Mon Sep 17 00:00:00 2001 From: CheemsAndFriends Date: Thu, 12 Sep 2024 22:53:11 +0200 Subject: [PATCH 13/22] Art master bizz --- art | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/art b/art index 1206249aa..0bb988c49 160000 --- a/art +++ b/art @@ -1 +1 @@ -Subproject commit 1206249aa65e13df2d6a196c35222f768ad4a3f4 +Subproject commit 0bb988c49788fd25a230b56dd9e4448838bc79c9 From 2a9814e03061ee6b18dc61a93d17b5616eae46d1 Mon Sep 17 00:00:00 2001 From: CheemsAndFriends Date: Thu, 12 Sep 2024 22:58:31 +0200 Subject: [PATCH 14/22] port SAVE from develop --- source/funkin/save/Save.hx | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/source/funkin/save/Save.hx b/source/funkin/save/Save.hx index 80b05e5ac..43b7667da 100644 --- a/source/funkin/save/Save.hx +++ b/source/funkin/save/Save.hx @@ -125,6 +125,7 @@ class Save { // Default to having seen the default character. charactersSeen: ["bf"], + oldChar: false }, optionsChartEditor: @@ -406,13 +407,34 @@ class Save return data.unlocks.charactersSeen; } + /** + * Marks whether the player has seen the spotlight animation, which should only display once per save file ever. + */ + public var oldChar(get, set):Bool; + + function get_oldChar():Bool + { + return data.unlocks.oldChar; + } + + function set_oldChar(value:Bool):Bool + { + data.unlocks.oldChar = value; + flush(); + return data.unlocks.oldChar; + } + /** * When we've seen a character unlock, add it to the list of characters seen. * @param character */ public function addCharacterSeen(character:String):Void { - if (!data.unlocks.charactersSeen.contains(character)) data.unlocks.charactersSeen.push(character); + if (!data.unlocks.charactersSeen.contains(character)) + { + data.unlocks.charactersSeen.push(character); + flush(); + } } /** @@ -1027,6 +1049,12 @@ typedef SaveDataUnlocks = * add it to this list so that we don't show it again. */ var charactersSeen:Array; + + /** + * This is a conditional when the player enters the character state + * For the first time ever + */ + var oldChar:Bool; } /** From 6dca858fd7370d23626d76b64c50eedafc36519c Mon Sep 17 00:00:00 2001 From: CheemsAndFriends Date: Thu, 12 Sep 2024 23:13:30 +0200 Subject: [PATCH 15/22] Introbizz --- source/funkin/ui/charSelect/IntroSubState.hx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/source/funkin/ui/charSelect/IntroSubState.hx b/source/funkin/ui/charSelect/IntroSubState.hx index 04503cbb9..8706013b0 100644 --- a/source/funkin/ui/charSelect/IntroSubState.hx +++ b/source/funkin/ui/charSelect/IntroSubState.hx @@ -20,8 +20,6 @@ class IntroSubState extends MusicBeatSubState { static final ATTRACT_VIDEO_PATH:String = Paths.stripLibrary(Paths.videos('introSelect')); - var introSound:FunkinSound = null; - public override function create():Void { // Pause existing music. @@ -40,15 +38,6 @@ class IntroSubState extends MusicBeatSubState trace('Playing native video ${ATTRACT_VIDEO_PATH}'); playVideoNative(ATTRACT_VIDEO_PATH); #end - - introSound = new FunkinSound(); - introSound.loadEmbedded(Paths.sound('CS_Lights')); - introSound.pitch = 1; - - FlxG.sound.defaultSoundGroup.add(introSound); - FlxG.sound.list.add(introSound); - - introSound.play(true); } #if html5 From a4bdeeaf5f9b3a7aa57a87c6d28b190e860e7749 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 12 Sep 2024 17:13:40 -0400 Subject: [PATCH 16/22] Update polymod to fix a crash on missing imports --- hmm.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hmm.json b/hmm.json index 50b81bb85..d967a69b3 100644 --- a/hmm.json +++ b/hmm.json @@ -194,7 +194,7 @@ "name": "polymod", "type": "git", "dir": null, - "ref": "96cfc5fa693b017e47f7cb13b765cc68698fa6b6", + "ref": "0fbdf27fe124549730accd540cec8a183f8652c0", "url": "https://github.com/larsiusprime/polymod" }, { From ae6f431b6a9f7a05bf819c908794a16b2fb073f2 Mon Sep 17 00:00:00 2001 From: EliteMasterEric Date: Thu, 12 Sep 2024 17:13:46 -0400 Subject: [PATCH 17/22] Update credits --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index 8762fd51c..dd2aab796 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 8762fd51c26abdc9a45657eab9018aa48e972cd6 +Subproject commit dd2aab796d2a54cf01c534402aa922da1f820080 From 34d1c568ea949740837bd7c1c4e9a685e4187d94 Mon Sep 17 00:00:00 2001 From: CheemsAndFriends Date: Thu, 12 Sep 2024 23:22:20 +0200 Subject: [PATCH 18/22] locked fixin --- assets | 2 +- source/funkin/ui/charSelect/CharSelectPlayer.hx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets b/assets index ff425d983..6b97a5ce8 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit ff425d983e3b017b3a7dc241f03ae51f1fae9116 +Subproject commit 6b97a5ce8bb09944e466bc6c342139462820f81f diff --git a/source/funkin/ui/charSelect/CharSelectPlayer.hx b/source/funkin/ui/charSelect/CharSelectPlayer.hx index 710bdd45a..b6319f16d 100644 --- a/source/funkin/ui/charSelect/CharSelectPlayer.hx +++ b/source/funkin/ui/charSelect/CharSelectPlayer.hx @@ -27,7 +27,7 @@ class CharSelectPlayer extends FlxAtlasSprite implements IBPMSyncedScriptedClass case "deselect": playAnimation("deselect loop start", true, false, true); - case "slidein idle point", "cannot select", "unlock": + case "slidein idle point", "cannot select Label", "unlock": playAnimation("idle", true, false, false); case "idle": trace('Waiting for onBeatHit'); From 703e8992882b8b3e70a74e74c31aa5e52137d6c2 Mon Sep 17 00:00:00 2001 From: FabsTheFabs Date: Thu, 12 Sep 2024 22:43:12 +0100 Subject: [PATCH 19/22] apply shader filter --- source/funkin/ui/charSelect/CharSelectSubState.hx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/funkin/ui/charSelect/CharSelectSubState.hx b/source/funkin/ui/charSelect/CharSelectSubState.hx index bd55bfdd9..00e15a299 100644 --- a/source/funkin/ui/charSelect/CharSelectSubState.hx +++ b/source/funkin/ui/charSelect/CharSelectSubState.hx @@ -324,6 +324,9 @@ class CharSelectSubState extends MusicBeatSubState // FlxG.camera.follow(camFollow, LOCKON, 0.01); FlxG.camera.follow(camFollow, LOCKON); + var fadeShaderFilter:ShaderFilter = new ShaderFilter(fadeShader); + FlxG.camera.filters = [fadeShaderFilter]; + var temp:FlxSprite = new FlxSprite(); temp.loadGraphic(Paths.image('charSelect/placement')); add(temp); From 1e9c6f0c4cabaaf439e493c619dc65f564e0a7c7 Mon Sep 17 00:00:00 2001 From: CheemsAndFriends Date: Fri, 13 Sep 2024 00:31:52 +0200 Subject: [PATCH 20/22] Add Char Select stuff --- assets | 2 +- source/funkin/ui/charSelect/CharSelectSubState.hx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/assets b/assets index 6b97a5ce8..f4cf1d372 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 6b97a5ce8bb09944e466bc6c342139462820f81f +Subproject commit f4cf1d3721155e16ab4e547b6baabc1238b66dae diff --git a/source/funkin/ui/charSelect/CharSelectSubState.hx b/source/funkin/ui/charSelect/CharSelectSubState.hx index b83b3a6af..6839d5a21 100644 --- a/source/funkin/ui/charSelect/CharSelectSubState.hx +++ b/source/funkin/ui/charSelect/CharSelectSubState.hx @@ -291,6 +291,9 @@ class CharSelectSubState extends MusicBeatSubState unlockSound.volume = 0; unlockSound.play(true); + FlxG.sound.defaultSoundGroup.add(unlockSound); + FlxG.sound.list.add(unlockSound); + lockedSound = new FunkinSound(); lockedSound.loadEmbedded(Paths.sound('CS_locked')); lockedSound.pitch = 1; @@ -404,7 +407,7 @@ class CharSelectSubState extends MusicBeatSubState function checkNewChar():Void { - if (nonLocks.length > 0) selectTimer.start(0.5, (_) -> { + if (nonLocks.length > 0) selectTimer.start(2, (_) -> { unLock(); }); else From 2dc4e13b001de00318884dbbf635e26240586622 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Thu, 12 Sep 2024 19:08:13 -0400 Subject: [PATCH 21/22] assets submod --- assets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets b/assets index dd2aab796..41d20d45d 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit dd2aab796d2a54cf01c534402aa922da1f820080 +Subproject commit 41d20d45d7503aaf1dfac825239620cffb512166 From 47f3c6f00a18b50a614ffd09f9200ee18c89f499 Mon Sep 17 00:00:00 2001 From: Cameron Taylor Date: Thu, 12 Sep 2024 19:56:04 -0400 Subject: [PATCH 22/22] vid sizing --- source/funkin/ui/charSelect/IntroSubState.hx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/funkin/ui/charSelect/IntroSubState.hx b/source/funkin/ui/charSelect/IntroSubState.hx index 261b7b35c..2c2908473 100644 --- a/source/funkin/ui/charSelect/IntroSubState.hx +++ b/source/funkin/ui/charSelect/IntroSubState.hx @@ -41,10 +41,10 @@ class IntroSubState extends MusicBeatSubState playVideoNative(LIGHTS_VIDEO_PATH); #end - // Im TOO lazy to even care, so uh, yep - FlxG.camera.zoom = 0.66666666666666666666666666666667; - vid.x = -(FlxG.width - (FlxG.width * FlxG.camera.zoom)); - vid.y = -((FlxG.height - (FlxG.height * FlxG.camera.zoom)) * 0.75); + // // Im TOO lazy to even care, so uh, yep + // FlxG.camera.zoom = 0.66666666666666666666666666666667; + // vid.x = -(FlxG.width - (FlxG.width * FlxG.camera.zoom)); + // vid.y = -((FlxG.height - (FlxG.height * FlxG.camera.zoom)) * 0.75); } #if html5