File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -108,11 +108,19 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
108108 }
109109
110110 public function swapLeftRightAnimations () {
111- CoolUtil .switchAnimFrames (animation .getByName (' singRIGHT' ), animation .getByName (' singLEFT' ));
112- CoolUtil .switchAnimFrames (animation .getByName (' singRIGHTmiss' ), animation .getByName (' singLEFTmiss' ));
111+ // Find all "alternate" poses
112+ var variants = [' ' ]; // Pre-fill with empty string
113+ var pose = ' singRIGHT' ; // Any "sing" animation string could work, really
114+ for (a in xml .nodes .anim ) {
115+ if (a .att .name != pose && StringTools .startsWith (a .att .name , pose )) {
116+ variants .push (a .att .name .substring (pose .length ));
117+ }
118+ }
113119
114- switchOffset (' singLEFT' , ' singRIGHT' );
115- switchOffset (' singLEFTmiss' , ' singRIGHTmiss' );
120+ for (i in variants ) {
121+ CoolUtil .switchAnimFrames (animation .getByName (' singRIGHT $i ' ), animation .getByName (' singLEFT $i ' ));
122+ switchOffset (' singLEFT $i ' , ' singRIGHT $i ' );
123+ }
116124
117125 __swappedLeftRightAnims = true ;
118126 }
You can’t perform that action at this time.
0 commit comments