Skip to content

Commit e458e86

Browse files
authored
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.
1 parent 6f8f43d commit e458e86

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

source/funkin/backend/system/Flags.hx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ class Flags {
163163
// Font configuration
164164
public static var DEFAULT_FONT:String = "vcr.ttf";
165165
public static var DEFAULT_FONT_SIZE:Int = 16;
166+
167+
public static var DEFAULT_ALT_ANIM_SUFFIX:String = "-alt";
166168

167169
// to translate these you need to convert them into ids
168170
// Resume -> pause.resume

source/funkin/game/PlayState.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,7 @@ class PlayState extends MusicBeatState
16671667
if (strLine.characters != null) // Alt anim Idle
16681668
for (character in strLine.characters) {
16691669
if (character == null) continue;
1670-
character.idleSuffix = event.params[1] ? "-alt" : "";
1670+
character.idleSuffix = event.params[1] ? strLine.defaultAnimSuffix : "";
16711671
}
16721672
}
16731673
case "Play Animation":

source/funkin/game/StrumLine.hx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ class StrumLine extends FlxTypedGroup<Strum> {
7474
* Which animation suffix on characters that should be used when hitting notes.
7575
*/
7676
public var animSuffix(default, set):String = "";
77+
/**
78+
* The current animation suffix the strumline should use. Note that setting this will only take effect upon the alt. animation being reset.
79+
*/
80+
public var defaultAnimSuffix:String = Flags.DEFAULT_ALT_ANIM_SUFFIX;
7781
/**
7882
* TODO: Write documentation about this being a variable that can help when making multi key
7983
*/
@@ -468,11 +472,11 @@ class StrumLine extends FlxTypedGroup<Strum> {
468472
return animSuffix = str;
469473
}
470474
private inline function set_altAnim(b:Bool):Bool {
471-
animSuffix = b ? "-alt" : "";
475+
animSuffix = b ? defaultAnimSuffix : "";
472476
return b;
473477
}
474478
private inline function get_altAnim():Bool {
475-
return animSuffix == "-alt";
479+
return animSuffix == defaultAnimSuffix;
476480
}
477481
#end
478482
}

0 commit comments

Comments
 (0)