File tree Expand file tree Collapse file tree
newIDE/app/src/ObjectEditor/Editors/SpriteEditor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -628,6 +628,8 @@ const SpritesList = ({
628628 onClick = { ( ) => {
629629 onAddSprite ( resourceSources [ 0 ] ) ;
630630 } }
631+ // The event-based object editor gives an empty list.
632+ disabled = { resourceSources . length === 0 }
631633 label = { < Trans > Add a sprite</ Trans > }
632634 icon = { < Add /> }
633635 primary
Original file line number Diff line number Diff line change @@ -672,7 +672,9 @@ export default function SpriteEditor({
672672 < I18n >
673673 { ( { i18n } ) => (
674674 < >
675- { spriteConfiguration . getAnimationsCount ( ) === 0 ? (
675+ { spriteConfiguration . getAnimationsCount ( ) === 0 &&
676+ // The event-based object editor gives an empty list.
677+ imageResourceExternalEditors . length > 0 ? (
676678 < Column noMargin expand justifyContent = "center" >
677679 < EmptyPlaceholder
678680 title = { < Trans > Add your first animation</ Trans > }
@@ -691,16 +693,9 @@ export default function SpriteEditor({
691693 onAction = { ( ) => {
692694 importImages ( ) ;
693695 } }
694- onSecondaryAction = {
695- imageResourceExternalEditors . length
696- ? ( ) => {
697- createAnimationWith (
698- i18n ,
699- imageResourceExternalEditors [ 0 ]
700- ) ;
701- }
702- : undefined
703- }
696+ onSecondaryAction = { ( ) => {
697+ createAnimationWith ( i18n , imageResourceExternalEditors [ 0 ] ) ;
698+ } }
704699 />
705700 </ Column >
706701 ) : (
You can’t perform that action at this time.
0 commit comments