Skip to content

Commit bd89a08

Browse files
committed
Merge branch 'master' into commit-pixi-spine
2 parents b8246f8 + dd8c040 commit bd89a08

3 files changed

Lines changed: 9 additions & 12 deletions

File tree

newIDE/app/src/ObjectEditor/Editors/SpriteEditor/SpritesList.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

newIDE/app/src/ObjectEditor/Editors/SpriteEditor/index.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff 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
) : (

newIDE/app/src/ObjectGroupsList/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ const ObjectGroupsList = React.forwardRef<Props, ObjectGroupsListInterface>(
446446
const renderGroupMenuTemplate = React.useCallback(
447447
(i18n: I18nType) => (item: TreeViewItem, index: number) =>
448448
item.isRoot || item.isPlaceholder
449-
? null
449+
? []
450450
: [
451451
{
452452
label: i18n._(t`Duplicate`),

0 commit comments

Comments
 (0)