@@ -2,7 +2,7 @@ package funkin.game;
22
33import haxe .xml .Access ;
44
5- class SplashGroup extends FlxTypedGroup <FunkinSprite > {
5+ class SplashGroup extends FlxTypedGroup <Splash > {
66 /**
77 * Whenever the splash group has successfully loaded or not.
88 */
@@ -46,7 +46,7 @@ class SplashGroup extends FlxTypedGroup<FunkinSprite> {
4646 }
4747
4848 function createSplash (imagePath : String ) {
49- var splash = new FunkinSprite ();
49+ var splash = new Splash ();
5050 splash .antialiasing = true ;
5151 splash .active = splash .visible = false ;
5252 splash .loadSprite (Paths .image (imagePath ));
@@ -56,7 +56,7 @@ class SplashGroup extends FlxTypedGroup<FunkinSprite> {
5656 return splash ;
5757 }
5858
59- function setupAnims (xml : Access , splash : FunkinSprite ) {
59+ function setupAnims (xml : Access , splash : Splash ) {
6060 for (strum in xml .nodes .strum ) {
6161 var id : Null <Int > = Std .parseInt (strum .att .id );
6262 if (id != null ) {
@@ -80,18 +80,18 @@ class SplashGroup extends FlxTypedGroup<FunkinSprite> {
8080 a .push (anim .att .name );
8181 }
8282 }
83- splash .animation .finishCallback = function (name : String ) {
84- splash .active = splash .visible = false ;
85- };
83+ splash .animation .finishCallback = (name : String ) -> splash .active = splash .visible = false ;
8684 }
8785
88- function pregenerateSplashes (splash : FunkinSprite ) {
86+ function pregenerateSplashes (splash : Splash ) {
8987 // make 7 additional splashes
9088 for (i in 0 ... 7 ) {
91- var spr = FunkinSprite .copyFrom (splash );
92- spr .animation .finishCallback = function (name : String ) {
89+ var spr = Splash .copyFrom (splash );
90+ spr .animation .finishCallback = (name : String ) -> {
9391 spr .active = spr .visible = false ;
94- };
92+ spr .strum = null ;
93+ spr .strumID = null ;
94+ }
9595 add (spr );
9696 }
9797 }
@@ -103,11 +103,14 @@ class SplashGroup extends FlxTypedGroup<FunkinSprite> {
103103 return animationNames [id ][FlxG .random .int (0 , animationNames [id ].length - 1 )];
104104 }
105105
106- var __splash : FunkinSprite ;
106+ var __splash : Splash ;
107107 public function showOnStrum (strum : Strum ) {
108108 if (! valid ) return null ;
109109 __splash = recycle ();
110110
111+ __splash .strum = strum ;
112+ __splash .strumID = strum. ID ;
113+
111114 __splash .cameras = strum .lastDrawCameras ;
112115 __splash .setPosition (strum .x + ((strum .width - __splash .width ) / 2 ), strum .y + ((strum .height - __splash .height ) / 2 ));
113116 __splash .active = __splash .visible = true ;
0 commit comments