splash show event

This commit is contained in:
TheZoroForce240
2024-09-18 16:03:06 +02:00
committed by Ne_Eo
parent 38f6e8676c
commit 032c3a174f
2 changed files with 27 additions and 2 deletions
@@ -0,0 +1,23 @@
package funkin.backend.scripting.events;
import funkin.game.SplashGroup;
import funkin.game.Strum;
final class SplashShowEvent extends CancellableEvent {
/**
Splash name/type
**/
public var splashName:String;
/**
Splash that is shown
**/
public var splash:FunkinSprite;
/**
Strum that the splash is shown on
**/
public var strum:Strum;
/**
Splash group that the splash is from
**/
public var group:SplashGroup;
}
+4 -2
View File
@@ -1,5 +1,7 @@
package funkin.game;
import funkin.backend.scripting.events.SplashShowEvent;
class SplashHandler extends FlxTypedGroup<FunkinSprite> {
/**
* Map containing all of the splashes group.
@@ -40,10 +42,10 @@ class SplashHandler extends FlxTypedGroup<FunkinSprite> {
var __grp:SplashGroup;
public function showSplash(name:String, strum:Strum) {
__grp = getSplashGroup(name);
var event = funkin.backend.scripting.EventManager.get(funkin.backend.scripting.events.DynamicEvent).recycle(__grp.showOnStrum(strum), strum);
var event = EventManager.get(SplashShowEvent).recycle(name, __grp.showOnStrum(strum), strum, __grp);
event = PlayState.instance.scripts.event("onSplashShown", event);
if (!event.cancelled)
add(event.value1);
add(event.splash);
// max 8 rendered splashes
while(members.length > 8)