diff --git a/source/funkin/ui/freeplay/CapsuleOptionsMenu.hx b/source/funkin/ui/freeplay/CapsuleOptionsMenu.hx index 59d392e7f..92beaca91 100644 --- a/source/funkin/ui/freeplay/CapsuleOptionsMenu.hx +++ b/source/funkin/ui/freeplay/CapsuleOptionsMenu.hx @@ -121,7 +121,7 @@ class CapsuleOptionsMenu extends FlxSpriteGroup if (leftArrow.moveShitDownTimer != null) leftArrow.moveShitDownTimer.cancel(); if (rightArrow.moveShitDownTimer != null) rightArrow.moveShitDownTimer.cancel(); capsuleMenuBG.animation.onFinish.add(function(_) { - parent.cleanupCapsuleOptionsMenu(); + parent.cleanupInstSelectMenu(); queueDestroy = true; }); } diff --git a/source/funkin/ui/freeplay/FreeplayState.hx b/source/funkin/ui/freeplay/FreeplayState.hx index a66b8b985..b9650f4d3 100644 --- a/source/funkin/ui/freeplay/FreeplayState.hx +++ b/source/funkin/ui/freeplay/FreeplayState.hx @@ -2553,12 +2553,12 @@ class FreeplayState extends MusicBeatSubState var instrumentalChoices:Array = ['default', 'random']; #if !mobile - capsuleOptionsMenu = new CapsuleOptionsMenu(this, randomCapsule.targetPos.x + 175, randomCapsule.targetPos.y + 115, instrumentalChoices); - capsuleOptionsMenu.cameras = [funnyCam]; - capsuleOptionsMenu.zIndex = 10000; - add(capsuleOptionsMenu); + instSelectMenu = new CapsuleOptionsMenu(this, randomCapsule.targetPos.x + 175, randomCapsule.targetPos.y + 115, instrumentalChoices); + instSelectMenu.cameras = [funnyCam]; + instSelectMenu.zIndex = 10000; + add(instSelectMenu); - capsuleOptionsMenu.onConfirm = function(instChoice:String) { + instSelectMenu.onConfirm = function(instChoice:String) { capsuleOnConfirmRandom(availableSongCapsules, instChoice); } #else @@ -2571,7 +2571,7 @@ class FreeplayState extends MusicBeatSubState */ function capsuleOnConfirmRandom(availableSongCapsules:Array, instChoice:String):Void { - cleanupCapsuleOptionsMenu(); + cleanupInstSelectMenu(); var targetSongCap:SongMenuItem = FlxG.random.getObject(availableSongCapsules); // Seeing if I can do an animation... @@ -2677,26 +2677,26 @@ class FreeplayState extends MusicBeatSubState { uiStateMachine.transition(Interacting); - capsuleOptionsMenu = new CapsuleOptionsMenu(this, cap.targetPos.x + 175, cap.targetPos.y + 115, instrumentalIds); - capsuleOptionsMenu.cameras = [funnyCam]; - capsuleOptionsMenu.zIndex = 10000; - add(capsuleOptionsMenu); + instSelectMenu = new CapsuleOptionsMenu(this, cap.targetPos.x + 175, cap.targetPos.y + 115, instrumentalIds); + instSelectMenu.cameras = [funnyCam]; + instSelectMenu.zIndex = 10000; + add(instSelectMenu); - capsuleOptionsMenu.onConfirm = function(targetInstId:String) { + instSelectMenu.onConfirm = function(targetInstId:String) { capsuleOnConfirmDefault(cap, targetInstId); }; } - var capsuleOptionsMenu:Null = null; + var instSelectMenu:Null = null; - public function cleanupCapsuleOptionsMenu():Void + public function cleanupInstSelectMenu():Void { uiStateMachine.transition(Idle); - if (capsuleOptionsMenu != null) + if (instSelectMenu != null) { - remove(capsuleOptionsMenu); - capsuleOptionsMenu = null; + remove(instSelectMenu); + instSelectMenu = null; } }