splash show event
This commit is contained in:
@@ -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;
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user