Add ability to set custom default alternate animation suffix (#882)

The alt. animation toggle event currently does not support setting the
suffix directly,
but that's outside of the scope of adding this feature at the moment.
This commit is contained in:
rufius
2026-04-04 13:32:24 +07:00
committed by GitHub
parent 6f8f43d3dc
commit e458e868a4
3 changed files with 9 additions and 3 deletions
+2
View File
@@ -163,6 +163,8 @@ class Flags {
// Font configuration
public static var DEFAULT_FONT:String = "vcr.ttf";
public static var DEFAULT_FONT_SIZE:Int = 16;
public static var DEFAULT_ALT_ANIM_SUFFIX:String = "-alt";
// to translate these you need to convert them into ids
// Resume -> pause.resume
+1 -1
View File
@@ -1667,7 +1667,7 @@ class PlayState extends MusicBeatState
if (strLine.characters != null) // Alt anim Idle
for (character in strLine.characters) {
if (character == null) continue;
character.idleSuffix = event.params[1] ? "-alt" : "";
character.idleSuffix = event.params[1] ? strLine.defaultAnimSuffix : "";
}
}
case "Play Animation":
+6 -2
View File
@@ -74,6 +74,10 @@ class StrumLine extends FlxTypedGroup<Strum> {
* Which animation suffix on characters that should be used when hitting notes.
*/
public var animSuffix(default, set):String = "";
/**
* The current animation suffix the strumline should use. Note that setting this will only take effect upon the alt. animation being reset.
*/
public var defaultAnimSuffix:String = Flags.DEFAULT_ALT_ANIM_SUFFIX;
/**
* TODO: Write documentation about this being a variable that can help when making multi key
*/
@@ -468,11 +472,11 @@ class StrumLine extends FlxTypedGroup<Strum> {
return animSuffix = str;
}
private inline function set_altAnim(b:Bool):Bool {
animSuffix = b ? "-alt" : "";
animSuffix = b ? defaultAnimSuffix : "";
return b;
}
private inline function get_altAnim():Bool {
return animSuffix == "-alt";
return animSuffix == defaultAnimSuffix;
}
#end
}