diff --git a/source/funkin/backend/scripting/events/SplashShowEvent.hx b/source/funkin/backend/scripting/events/SplashShowEvent.hx new file mode 100644 index 00000000..46504d44 --- /dev/null +++ b/source/funkin/backend/scripting/events/SplashShowEvent.hx @@ -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; +} \ No newline at end of file diff --git a/source/funkin/game/SplashHandler.hx b/source/funkin/game/SplashHandler.hx index 1776bdb8..31a06234 100644 --- a/source/funkin/game/SplashHandler.hx +++ b/source/funkin/game/SplashHandler.hx @@ -1,5 +1,7 @@ package funkin.game; +import funkin.backend.scripting.events.SplashShowEvent; + class SplashHandler extends FlxTypedGroup { /** * Map containing all of the splashes group. @@ -40,10 +42,10 @@ class SplashHandler extends FlxTypedGroup { 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)