Merge remote-tracking branch 'upstream/main'

This commit is contained in:
Ne_Eo
2024-09-10 00:05:18 +02:00
10 changed files with 22 additions and 16 deletions
+1
View File
@@ -1,3 +1,4 @@
//
import funkin.game.PlayState;
// phillyTrain is automatically added by Stage.hx
+8 -3
View File
@@ -101,7 +101,7 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
if (!debugMode && isAnimFinished()) {
var name = getAnimName() + '-loop';
if (hasAnimation(name))
playAnim(name, false, lastAnimContext);
playAnim(name, null, lastAnimContext);
}
}
@@ -133,7 +133,7 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
// TODO: find a solution without countedBeat
var anim = beatAnims[FlxMath.wrap(countedBeat++, 0, beatAnims.length - 1)];
if (anim.name != null && anim.name != "null" && anim.name != "none")
playAnim(anim.name, anim.forced);
playAnim(anim.name);
}
}
@@ -294,11 +294,16 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
#if REGION
public var lastAnimContext:PlayAnimContext = DANCE;
public function playAnim(AnimName:String, Force:Bool = false, Context:PlayAnimContext = NONE, Reversed:Bool = false, Frame:Int = 0):Void
public function playAnim(AnimName:String, ?Force:Null<Bool>, Context:PlayAnimContext = NONE, Reversed:Bool = false, Frame:Int = 0):Void
{
if (AnimName == null)
return;
if (Force == null) {
var anim = animDatas.get(AnimName);
Force = anim != null && anim.forced;
}
if (animateAtlas != null)
{
@:privateAccess
@@ -26,7 +26,7 @@ final class DirectionAnimEvent extends CancellableEvent {
**/
public var frame:Int;
/**
Force the animation to replay even if it's already playing.
Force the animation to replay even if it's already playing (if it's null it will be forced based on the sprite's data xml, if it has one).
**/
public var force:Bool = true;
public var force:Null<Bool>;
}
@@ -100,9 +100,9 @@ final class NoteHitEvent extends CancellableEvent {
*/
public var ratingAntialiasing:Bool = true;
/**
* Whenever the animation should be forced to play.
* Whenever the animation should be forced to play (if it's null it will be forced based on the sprite's data xml, if it has one).
*/
public var forceAnim:Bool = true;
public var forceAnim:Null<Bool> = null;
/**
* Prevents the default sing animation from being played.
@@ -29,9 +29,9 @@ final class NoteMissEvent extends CancellableEvent {
public var gfSadAnim:String;
public var forceGfAnim:Bool;
/**
* Whenever the animation should be forced to play.
* Whenever the animation should be forced to play (if it's null it will be forced based on the sprite's data xml, if it has one).
*/
public var forceAnim:Bool;
public var forceAnim:Null<Bool>;
/**
* Suffix of the animation. "miss" for miss notes, "-alt" for alt notes, "" for normal ones.
*/
@@ -7,9 +7,9 @@ final class PlayAnimEvent extends CancellableEvent {
public var animName:String;
/**
Whenever the animation will be forced or not.
Whenever the animation will be forced or not (if it's null it will be forced based on the sprite's data xml, if it has one).
**/
public var force:Bool;
public var force:Null<Bool>;
/**
Whenever the animation will play in reverse or not
+2 -2
View File
@@ -218,7 +218,7 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
/**
* Like `playSingAnimUnsafe` but checks if the character has the animation with the suffix part, otherwise it plays the animation without the suffix part.
*/
public function playSingAnim(direction:Int, suffix:String = "", Context:PlayAnimContext = SING, Force:Bool = true, Reversed:Bool = false, Frame:Int = 0)
public function playSingAnim(direction:Int, suffix:String = "", Context:PlayAnimContext = SING, ?Force:Null<Bool> = null, Reversed:Bool = false, Frame:Int = 0)
{
var event = EventManager.get(DirectionAnimEvent).recycle(getSingAnim(direction, suffix), direction, suffix, Context, Reversed, Frame, Force);
script.call("onPlaySingAnim", [event]);
@@ -235,7 +235,7 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
playAnim(event.animName, event.force, event.context, event.reversed, event.frame);
}
public override function playAnim(AnimName:String, Force:Bool = false, Context:PlayAnimContext = NONE, Reversed:Bool = false, Frame:Int = 0) {
public override function playAnim(AnimName:String, ?Force:Bool, Context:PlayAnimContext = NONE, Reversed:Bool = false, Frame:Int = 0) {
var event = EventManager.get(PlayAnimEvent).recycle(AnimName, Force, Reversed, Frame, Context);
script.call("onPlayAnim", [event]);
if (event.cancelled) return;
+1 -1
View File
@@ -1926,7 +1926,7 @@ class PlayState extends MusicBeatState
}
}
class ComboRating {
final class ComboRating {
public var percent:Float;
public var rating:String;
public var color:FlxColor;
@@ -94,7 +94,7 @@ class DialogueBox extends FunkinSprite {
dialogueBoxScript.call("postCreate");
}
public override function playAnim(AnimName:String, Force:Bool = false, Context:PlayAnimContext = NONE, Reversed:Bool = false, Frame:Int = 0) {
public override function playAnim(AnimName:String, ?Force:Bool, Context:PlayAnimContext = NONE, Reversed:Bool = false, Frame:Int = 0) {
var event = EventManager.get(PlayAnimEvent).recycle(AnimName, Force, Reversed, Frame, Context);
dialogueBoxScript.call("onPlayAnim", [event]);
if(event.cancelled) return;
@@ -61,7 +61,7 @@ class DialogueCharacter extends FunkinSprite {
dialogueCharScript.call("postCreate");
}
public override function playAnim(AnimName:String, Force:Bool = false, Context:PlayAnimContext = NONE, Reversed:Bool = false, Frame:Int = 0) {
public override function playAnim(AnimName:String, ?Force:Bool, Context:PlayAnimContext = NONE, Reversed:Bool = false, Frame:Int = 0) {
var event = EventManager.get(PlayAnimEvent).recycle(AnimName, Force, Reversed, Frame, Context);
dialogueCharScript.call("playAnim", [event]);
if(event.cancelled) return;