From 032c3a174f68aedd58760a100f2ce6b6e29dd9f0 Mon Sep 17 00:00:00 2001 From: TheZoroForce240 <86524550+TheZoroForce240@users.noreply.github.com> Date: Fri, 30 Aug 2024 11:49:40 +0100 Subject: [PATCH] splash show event --- .../scripting/events/SplashShowEvent.hx | 23 +++++++++++++++++++ source/funkin/game/SplashHandler.hx | 6 +++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 source/funkin/backend/scripting/events/SplashShowEvent.hx 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)