From ae33468004d39eb664ddc6558410db2b68c7f355 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 12 Jun 2026 15:18:15 +0200 Subject: [PATCH 1/2] Fix custom object with circular dependencies were no longer disabled in the new object dialog --- .../src/AssetStore/NewObjectFromScratch.js | 1 - newIDE/app/src/AssetStore/ObjectListItem.js | 26 ++++++++++++++++++- .../app/src/AssetStore/ObjectStoreContext.js | 2 ++ .../src/Utils/GDevelopServices/Extension.js | 7 +++++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/newIDE/app/src/AssetStore/NewObjectFromScratch.js b/newIDE/app/src/AssetStore/NewObjectFromScratch.js index 6cd556c234ac..f61eb4c91e45 100644 --- a/newIDE/app/src/AssetStore/NewObjectFromScratch.js +++ b/newIDE/app/src/AssetStore/NewObjectFromScratch.js @@ -201,7 +201,6 @@ export default function NewObjectFromScratch({ eventsBasedObject ); } - // $FlowFixMe[incompatible-type] return { type: object.type, fullName: object.fullName, diff --git a/newIDE/app/src/AssetStore/ObjectListItem.js b/newIDE/app/src/AssetStore/ObjectListItem.js index 416c6a18dba0..1efcab6c42f5 100644 --- a/newIDE/app/src/AssetStore/ObjectListItem.js +++ b/newIDE/app/src/AssetStore/ObjectListItem.js @@ -79,7 +79,8 @@ export const ObjectListItem = ({ ); }; - const isEnabled = isEngineCompatible; + const isEnabled = + isEngineCompatible && !objectShortHeader.isDependentWithParent; const chooseObject = React.useCallback( () => { @@ -165,6 +166,29 @@ export const ObjectListItem = ({ )} + {objectShortHeader.isDependentWithParent && ( + + This object can't be used here because it would create a + circular dependency with the object being edited. + + } + > + { + e.stopPropagation(); + }} + > + No cycle} + variant="outlined" + /> + + + )} Date: Fri, 12 Jun 2026 15:38:08 +0200 Subject: [PATCH 2/2] Replace the button with a span --- newIDE/app/src/AssetStore/ObjectListItem.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/newIDE/app/src/AssetStore/ObjectListItem.js b/newIDE/app/src/AssetStore/ObjectListItem.js index 1efcab6c42f5..eaf8127d4fc3 100644 --- a/newIDE/app/src/AssetStore/ObjectListItem.js +++ b/newIDE/app/src/AssetStore/ObjectListItem.js @@ -175,18 +175,14 @@ export const ObjectListItem = ({ } > - { - e.stopPropagation(); - }} - > + No cycle} variant="outlined" + onClick={() => {}} /> - + )}