From bab0525f9865936db67487b491f290e27c8964b5 Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Mon, 17 Apr 2023 19:10:02 +0200 Subject: [PATCH] fixes --- source/funkin/editors/charter/Charter.hx | 1 - source/funkin/game/Note.hx | 2 +- source/funkin/game/Strum.hx | 2 +- source/funkin/game/StrumLine.hx | 2 ++ source/funkin/system/FunkinSprite.hx | 8 +++++++- source/funkin/utils/XMLUtil.hx | 8 ++++++++ 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/source/funkin/editors/charter/Charter.hx b/source/funkin/editors/charter/Charter.hx index 5b4c3347..55b437d9 100644 --- a/source/funkin/editors/charter/Charter.hx +++ b/source/funkin/editors/charter/Charter.hx @@ -669,7 +669,6 @@ class Charter extends UIState { for(assetPath in [Paths.chart(__song, __diff.toLowerCase()), instPath]) { var path = Assets.getPath(assetPath); var filteredPath = path.substr(0, path.lastIndexOf(assetPath == instPath ? '/song/' : '/charts/')); - trace(filteredPath); saveTo(filteredPath); return; } diff --git a/source/funkin/game/Note.hx b/source/funkin/game/Note.hx index ad442c20..4634ff33 100644 --- a/source/funkin/game/Note.hx +++ b/source/funkin/game/Note.hx @@ -153,11 +153,11 @@ class Note extends FlxSprite } scale.set(event.noteScale, event.noteScale); - updateHitbox(); antialiasing = true; } } + updateHitbox(); if (isSustainNote && prevNote != null) { diff --git a/source/funkin/game/Strum.hx b/source/funkin/game/Strum.hx index 3dfba5e7..bcd95f2c 100644 --- a/source/funkin/game/Strum.hx +++ b/source/funkin/game/Strum.hx @@ -52,7 +52,7 @@ class Strum extends FlxSprite { daNote.angle = daNote.isSustainNote ? daNote.__noteAngle : angle; if (daNote.strumRelativePos) { - daNote.setPosition(daNote.isSustainNote ? ((Note.swagWidth - daNote.width) / 2) : 0, (daNote.strumTime - Conductor.songPosition) * (0.45 * FlxMath.roundDecimal(getScrollSpeed(daNote), 2))); + daNote.setPosition((Note.swagWidth - daNote.width) / 2, (daNote.strumTime - Conductor.songPosition) * (0.45 * FlxMath.roundDecimal(getScrollSpeed(daNote), 2))); if (daNote.isSustainNote) daNote.y += N_WIDTHDIV2; } else { var offset = FlxPoint.get(0, (Conductor.songPosition - daNote.strumTime) * (0.45 * FlxMath.roundDecimal(getScrollSpeed(daNote), 2))); diff --git a/source/funkin/game/StrumLine.hx b/source/funkin/game/StrumLine.hx index 25e11077..c4f7a3bf 100644 --- a/source/funkin/game/StrumLine.hx +++ b/source/funkin/game/StrumLine.hx @@ -197,6 +197,8 @@ class StrumLine extends FlxTypedGroup { babyArrow.updateHitbox(); babyArrow.scrollFactor.set(); + babyArrow.frameOffset.x -= (Note.swagWidth - babyArrow.width) / 2; + if (event.__doAnimation) { babyArrow.y -= 10; diff --git a/source/funkin/system/FunkinSprite.hx b/source/funkin/system/FunkinSprite.hx index 385a86d6..a3b94271 100644 --- a/source/funkin/system/FunkinSprite.hx +++ b/source/funkin/system/FunkinSprite.hx @@ -1,5 +1,6 @@ package funkin.system; +import funkin.utils.XMLUtil.IXMLEvents; import flixel.system.FlxAssets.FlxGraphicAsset; import flixel.addons.effects.FlxSkewedSprite; import haxe.io.Path; @@ -29,7 +30,7 @@ abstract XMLAnimType(Int) } } -class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements IOffsetCompatible +class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements IOffsetCompatible implements IXMLEvents { public var spriteAnimType:XMLAnimType = NONE; public var beatAnims:Array = []; @@ -99,6 +100,11 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I } } + public function onPropertySet(property:String, value:Dynamic) { + if (property.startsWith("velocity") || property.startsWith("acceleration")) + moves = true; + } + public function beatHit(curBeat:Int) { if (beatAnims.length > 0) diff --git a/source/funkin/utils/XMLUtil.hx b/source/funkin/utils/XMLUtil.hx index c1d24cae..f5779218 100644 --- a/source/funkin/utils/XMLUtil.hx +++ b/source/funkin/utils/XMLUtil.hx @@ -42,6 +42,10 @@ class XMLUtil { } if (value == null) return VALUE_NULL; + if (object is IXMLEvents) { + cast(object, IXMLEvents).onPropertySet(property.att.name, value); + } + try { Reflect.setProperty(o, keys[0], value); } catch(e) { @@ -210,4 +214,8 @@ typedef AnimData = { var y:Float; var indices:Array; var animType:XMLAnimType; +} + +interface IXMLEvents { + public function onPropertySet(property:String, value:Dynamic):Void; } \ No newline at end of file