From f886e2b34bafe469b8117488476fa6c18e2cf09c Mon Sep 17 00:00:00 2001 From: TheZoroForce240 <86524550+TheZoroForce240@users.noreply.github.com> Date: Fri, 30 Aug 2024 11:15:39 +0100 Subject: [PATCH] match splash scale with strum scale --- source/funkin/game/SplashGroup.hx | 12 ++++++++++++ source/funkin/game/SplashHandler.hx | 2 +- source/funkin/game/Strum.hx | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/source/funkin/game/SplashGroup.hx b/source/funkin/game/SplashGroup.hx index ffa9f135..b3565df7 100644 --- a/source/funkin/game/SplashGroup.hx +++ b/source/funkin/game/SplashGroup.hx @@ -46,6 +46,10 @@ class SplashGroup extends FlxTypedGroup { maxSize = 8; } + var _scale:Float = 1.0; + var _alpha:Float = 1.0; + var _antialiasing:Bool = true; + function createSplash(imagePath:String) { var splash = new FunkinSprite(); splash.antialiasing = true; @@ -54,6 +58,9 @@ class SplashGroup extends FlxTypedGroup { if (xml.has.scale) splash.scale.scale(Std.parseFloat(xml.att.scale).getDefault(1)); if (xml.has.alpha) splash.alpha = Std.parseFloat(xml.att.alpha).getDefault(1); if (xml.has.antialiasing) splash.antialiasing = xml.att.antialiasing == "true"; + _scale = splash.scale.x; + _alpha = splash.alpha; + _antialiasing = splash.antialiasing; return splash; } @@ -109,6 +116,11 @@ class SplashGroup extends FlxTypedGroup { if (!valid) return null; __splash = recycle(); + @:privateAccess + __splash.scale.x = __splash.scale.y = _scale * strum.strumLine.strumScale; + __splash.alpha = _alpha; + __splash.antialiasing = _antialiasing; + __splash.cameras = strum.lastDrawCameras; __splash.setPosition(strum.x + ((strum.width - __splash.width) / 2), strum.y + ((strum.height - __splash.height) / 2)); __splash.active = __splash.visible = true; diff --git a/source/funkin/game/SplashHandler.hx b/source/funkin/game/SplashHandler.hx index 1776bdb8..cc68f238 100644 --- a/source/funkin/game/SplashHandler.hx +++ b/source/funkin/game/SplashHandler.hx @@ -40,7 +40,7 @@ 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 = funkin.backend.scripting.EventManager.get(funkin.backend.scripting.events.DynamicEvent).recycle(__grp.showOnStrum(strum), strum, __grp); event = PlayState.instance.scripts.event("onSplashShown", event); if (!event.cancelled) add(event.value1); diff --git a/source/funkin/game/Strum.hx b/source/funkin/game/Strum.hx index 4bc8091e..cb8477a8 100644 --- a/source/funkin/game/Strum.hx +++ b/source/funkin/game/Strum.hx @@ -14,7 +14,7 @@ class Strum extends FlxSprite { public var cpu = false; // Unused public var lastHit:Float = -5000; - public var strumLine = null; + public var strumLine:StrumLine = null; public var scrollSpeed:Null = null; // custom scroll speed per strum public var noteAngle:Null = null;