@@ -333,6 +333,7 @@ class CharacterEditorState extends UIState
333
333
ghost .frames .frames = char .frames .frames ;
334
334
ghost .animation .copyFrom (char .animation );
335
335
setGhostFrame ();
336
+ ghost .setPosition (char .x , char .y );
336
337
}
337
338
338
339
private function setAntiAliasing ()
@@ -530,12 +531,14 @@ class CharacterEditorState extends UIState
530
531
531
532
function updateAnimText ()
532
533
{
534
+ /*
533
535
charToLoad.text = char.data.char;
534
536
charAssets.text = char.data.assets[0];
535
537
charIcon.text = char.data.icon;
536
538
charRed.pos = char.data.rgb[0];
537
539
charGreen.pos = char.data.rgb[1];
538
540
charBlue.pos = char.data.rgb[2];
541
+ */
539
542
animName .text = curAnim .name ;
540
543
animFPS .pos = curAnim .frameRate == null ? 24 : curAnim .frameRate ;
541
544
animPrefix .text = curAnim .prefix ;
@@ -623,30 +626,38 @@ class CharacterEditorState extends UIState
623
626
624
627
function updateAnim ()
625
628
{
626
- if (! char . animation . exists (animName .text ))
629
+ if (! animList . toString (). contains (animName .text ))
627
630
return ;
628
- final indices : Array <String > = animIndices .text .split (' ,' );
629
- var newIndices : Array <Int > = [];
630
- if (indices .length > 1 )
631
+ try
631
632
{
632
- for (i in indices )
633
- newIndices .push (Std .parseInt (i ));
633
+ final indices : Array <String > = animIndices .text .split (' ,' );
634
+ var newIndices : Array <Int > = [];
635
+ if (indices .length > 1 )
636
+ {
637
+ for (i in indices )
638
+ newIndices .push (Std .parseInt (i ));
639
+ }
640
+ curAnim = char .data .animations [curAnimSelected ];
641
+ curAnim .name = animName .text ;
642
+ curAnim .frameRate = animFPS .pos == 0 ? 24 : Std .int (animFPS .pos );
643
+ curAnim .prefix = animPrefix .text ;
644
+ curAnim .frameIndices = newIndices ;
645
+ curAnim .looped = animLooped .selected ;
646
+ char .playAnim (char .data .animations [0 ].name , true );
647
+ char .animation .remove (curAnim .name );
648
+ addAnimation (curAnim .name , curAnim .prefix , curAnim .frameRate , curAnim .looped , newIndices );
649
+ reloadTexts ();
650
+ switchAnim ();
651
+ }
652
+ catch (e )
653
+ {
654
+ Debug .logError (e );
634
655
}
635
- curAnim = char .data .animations [curAnimSelected ];
636
- curAnim .name = animName .text ;
637
- curAnim .frameRate = animFPS .pos == 0 ? 24 : Std .int (animFPS .pos );
638
- curAnim .prefix = animPrefix .text ;
639
- curAnim .frameIndices = newIndices ;
640
- curAnim .looped = animLooped .selected ;
641
- char .animation .remove (animName .text );
642
- addAnimation (curAnim .name , curAnim .prefix , curAnim .frameRate , curAnim .looped , newIndices );
643
- reloadTexts ();
644
- switchAnim ();
645
656
}
646
657
647
658
function removeAnim ()
648
659
{
649
- if (( ! animList .toString ().contains (animName .text ) || ! char . animation . exists ( animName . text ) ) || animList .length - 1 < 1 )
660
+ if (! animList .toString ().contains (animName .text ) || animList .length - 1 < 1 )
650
661
return ;
651
662
// wack bullshit
652
663
final name = animList [curAnimSelected ].name ;
0 commit comments