@@ -2,7 +2,7 @@ package funkin.game;
2
2
3
3
import haxe .xml .Access ;
4
4
5
- class SplashGroup extends FlxTypedGroup <FunkinSprite > {
5
+ class SplashGroup extends FlxTypedGroup <Splash > {
6
6
/**
7
7
* Whenever the splash group has successfully loaded or not.
8
8
*/
@@ -46,7 +46,7 @@ class SplashGroup extends FlxTypedGroup<FunkinSprite> {
46
46
}
47
47
48
48
function createSplash (imagePath : String ) {
49
- var splash = new FunkinSprite ();
49
+ var splash = new Splash ();
50
50
splash .antialiasing = true ;
51
51
splash .active = splash .visible = false ;
52
52
splash .loadSprite (Paths .image (imagePath ));
@@ -56,7 +56,7 @@ class SplashGroup extends FlxTypedGroup<FunkinSprite> {
56
56
return splash ;
57
57
}
58
58
59
- function setupAnims (xml : Access , splash : FunkinSprite ) {
59
+ function setupAnims (xml : Access , splash : Splash ) {
60
60
for (strum in xml .nodes .strum ) {
61
61
var id : Null <Int > = Std .parseInt (strum .att .id );
62
62
if (id != null ) {
@@ -85,12 +85,14 @@ class SplashGroup extends FlxTypedGroup<FunkinSprite> {
85
85
};
86
86
}
87
87
88
- function pregenerateSplashes (splash : FunkinSprite ) {
88
+ function pregenerateSplashes (splash : Splash ) {
89
89
// make 7 additional splashes
90
90
for (i in 0 ... 7 ) {
91
- var spr = FunkinSprite .copyFrom (splash );
91
+ var spr = Splash .copyFrom (splash );
92
92
spr .animation .finishCallback = function (name : String ) {
93
93
spr .active = spr .visible = false ;
94
+ spr .strum = null ;
95
+ spr .strumID = null ;
94
96
};
95
97
add (spr );
96
98
}
@@ -103,11 +105,14 @@ class SplashGroup extends FlxTypedGroup<FunkinSprite> {
103
105
return animationNames [id ][FlxG .random .int (0 , animationNames [id ].length - 1 )];
104
106
}
105
107
106
- var __splash : FunkinSprite ;
108
+ var __splash : Splash ;
107
109
public function showOnStrum (strum : Strum ) {
108
110
if (! valid ) return null ;
109
111
__splash = recycle ();
110
112
113
+ __splash .strum = strum ;
114
+ __splash .strumID = strum. ID ;
115
+
111
116
__splash .cameras = strum .lastDrawCameras ;
112
117
__splash .setPosition (strum .x + ((strum .width - __splash .width ) / 2 ), strum .y + ((strum .height - __splash .height ) / 2 ));
113
118
__splash .active = __splash .visible = true ;
0 commit comments