match splash scale with strum scale

This commit is contained in:
TheZoroForce240
2024-08-30 11:15:39 +01:00
parent ba129a9c8c
commit f886e2b34b
3 changed files with 14 additions and 2 deletions
+12
View File
@@ -46,6 +46,10 @@ class SplashGroup extends FlxTypedGroup<FunkinSprite> {
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<FunkinSprite> {
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<FunkinSprite> {
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;
+1 -1
View File
@@ -40,7 +40,7 @@ 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 = 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);
+1 -1
View File
@@ -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<Float> = null; // custom scroll speed per strum
public var noteAngle:Null<Float> = null;