From de8882e43864c3e2084fca124c6c43c4d7cc00bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Sat, 16 Mar 2024 23:02:13 +0100 Subject: [PATCH] auto intervals check and also on xml --- source/funkin/game/Character.hx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/funkin/game/Character.hx b/source/funkin/game/Character.hx index 2087a91d..3733e7cc 100644 --- a/source/funkin/game/Character.hx +++ b/source/funkin/game/Character.hx @@ -148,9 +148,10 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset script.call("postCreate"); } - public function fixChar(switchAnims:Bool = false) + public function fixChar(switchAnims:Bool = false, autoInterval:Bool = false) { - isDanceLeftDanceRight = (hasAnimation("danceLeft") && hasAnimation("danceRight")); + if (isDanceLeftDanceRight = (hasAnimation("danceLeft") && hasAnimation("danceRight")) && autoInterval) + beatInterval = 1; // alternative to xor operator // for people who dont believe it, heres the truth table @@ -399,7 +400,10 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset if (xml.x.exists("antialiasing")) antialiasing = (xml.x.get("antialiasing") == "true"); if (xml.x.exists("sprite")) sprite = xml.x.get("sprite"); - var tempList = ["isPlayer", "isGF", "x", "y", "gameOverChar", "camx", "camy", "holdTime", "flipX", "icon", "color", "scale", "antialiasing", "sprite"]; + var hasInterval:Bool = xml.x.exists("interval"); + if (hasInterval) beatInterval = Std.parseInt(xml.x.get("interval")); + + var tempList = ["isPlayer", "isGF", "x", "y", "gameOverChar", "camx", "camy", "holdTime", "flipX", "icon", "color", "scale", "antialiasing", "sprite", "interval"]; var atts = [for (i in xml.x.attributes()) i]; for (i in atts) if (!tempList.contains(i)) { @@ -415,7 +419,7 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset XMLUtil.addXMLAnimation(this, anim); } - fixChar(true); + fixChar(true, !hasInterval); dance(); }