@@ -11,14 +11,17 @@ import funkin.graphics.FunkinSprite;
1111import funkin .ui .freeplay .charselect .PlayableCharacter ;
1212import openfl .display .BlendMode ;
1313import flixel .group .FlxSpriteGroup ;
14+ import funkin .modding .IScriptedClass .IBPMSyncedScriptedClass ;
15+ import funkin .modding .IScriptedClass .IStateChangingScriptedClass ;
16+ import funkin .modding .events .ScriptEvent ;
1417import funkin .ui .FullScreenScaleMode ;
1518import funkin .util .BitmapUtil ;
1619import openfl .utils .Assets ;
1720
1821/**
1922 * A class for the backing cards so they dont have to be part of freeplayState......
2023 */
21- class BackingCard extends FlxSpriteGroup
24+ class BackingCard extends FlxSpriteGroup implements IBPMSyncedScriptedClass implements IStateChangingScriptedClass
2225{
2326 public var backingTextYeah : FlxAtlasSprite ;
2427 public var orangeBackShit : FunkinSprite ;
@@ -33,12 +36,13 @@ class BackingCard extends FlxSpriteGroup
3336 var _exitMoversCharSel : Null <FreeplayState . ExitMoverData >;
3437
3538 public var instance : FreeplayState ;
39+ public var currentCharacter : String ;
3640
37- public function new (currentCharacter : PlayableCharacter , ? _instance : FreeplayState )
41+ public function new (currentCharacter : String )
3842 {
3943 super ();
4044
41- if ( _instance != null ) instance = _instance ;
45+ this . currentCharacter = currentCharacter ;
4246
4347 var bitmap = BitmapUtil .scalePartByWidth (Assets .getBitmapData (Paths .image (' freeplay/cardGlow' )), FreeplayState .CUTOUT_WIDTH );
4448 cardGlow = new FlxSprite (- 30 , - 30 ).loadGraphic (bitmap );
@@ -128,43 +132,6 @@ class BackingCard extends FlxSpriteGroup
128132 pinkBack .x = 0 ;
129133 }
130134
131- /**
132- * Called in create. Adds sprites and tweens.
133- */
134- public function init (): Void
135- {
136- FlxTween .tween (pinkBack , {x : 0 }, 0.6 , {ease : FlxEase .quartOut });
137- add (pinkBack );
138-
139- add (orangeBackShit );
140-
141- add (alsoOrangeLOL );
142-
143- FlxSpriteUtil .alphaMaskFlxSprite (orangeBackShit , pinkBack , orangeBackShit );
144- orangeBackShit .visible = false ;
145- alsoOrangeLOL .visible = false ;
146-
147- confirmTextGlow .blend = BlendMode .ADD ;
148- confirmTextGlow .visible = false ;
149-
150- confirmGlow .blend = BlendMode .ADD ;
151-
152- confirmGlow .visible = false ;
153- confirmGlow2 .visible = false ;
154-
155- add (confirmGlow2 );
156- add (confirmGlow );
157-
158- add (confirmTextGlow );
159-
160- add (backingTextYeah );
161-
162- cardGlow .blend = BlendMode .ADD ;
163- cardGlow .visible = false ;
164-
165- add (cardGlow );
166- }
167-
168135 /**
169136 * Called after the dj finishes their start animation.
170137 */
@@ -246,6 +213,69 @@ class BackingCard extends FlxSpriteGroup
246213 alsoOrangeLOL .visible = false ;
247214 }
248215
216+ public function onScriptEvent (event : ScriptEvent ): Void {}
217+
218+ /**
219+ * Called in create. Adds sprites and tweens.
220+ */
221+ public function onCreate (event : ScriptEvent ): Void
222+ {
223+ FlxTween .tween (pinkBack , {x : 0 }, 0.6 , {ease : FlxEase .quartOut });
224+ add (pinkBack );
225+
226+ add (orangeBackShit );
227+
228+ add (alsoOrangeLOL );
229+
230+ FlxSpriteUtil .alphaMaskFlxSprite (orangeBackShit , pinkBack , orangeBackShit );
231+ orangeBackShit .visible = false ;
232+ alsoOrangeLOL .visible = false ;
233+
234+ confirmTextGlow .blend = BlendMode .ADD ;
235+ confirmTextGlow .visible = false ;
236+
237+ confirmGlow .blend = BlendMode .ADD ;
238+
239+ confirmGlow .visible = false ;
240+ confirmGlow2 .visible = false ;
241+
242+ add (confirmGlow2 );
243+ add (confirmGlow );
244+
245+ add (confirmTextGlow );
246+
247+ add (backingTextYeah );
248+
249+ cardGlow .blend = BlendMode .ADD ;
250+ cardGlow .visible = false ;
251+
252+ add (cardGlow );
253+ }
254+
255+ public function onDestroy (event : ScriptEvent ): Void {}
256+
257+ public function onUpdate (event : UpdateScriptEvent ): Void {}
258+
259+ public function onStepHit (event : SongTimeScriptEvent ): Void {}
260+
261+ public function onBeatHit (event : SongTimeScriptEvent ): Void {}
262+
263+ public function onStateChangeBegin (event : StateChangeScriptEvent ): Void {}
264+
265+ public function onStateChangeEnd (event : StateChangeScriptEvent ): Void {}
266+
267+ public function onSubStateOpenBegin (event : SubStateScriptEvent ): Void {}
268+
269+ public function onSubStateOpenEnd (event : SubStateScriptEvent ): Void {}
270+
271+ public function onSubStateCloseBegin (event : SubStateScriptEvent ): Void {}
272+
273+ public function onSubStateCloseEnd (event : SubStateScriptEvent ): Void {}
274+
275+ public function onFocusLost (event : FocusScriptEvent ): Void {}
276+
277+ public function onFocusGained (event : FocusScriptEvent ): Void {}
278+
249279 public function centerObjectOnCard (object : flixel. FlxObject )
250280 {
251281 if (pinkBack != null ) object .x = (x + ((pinkBack .width - object .width ) / 2 )) * 0.74 ;
0 commit comments