Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion newIDE/app/src/AssetStore/NewObjectFromScratch.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ export default function NewObjectFromScratch({
eventsBasedObject
);
}
// $FlowFixMe[incompatible-type]
return {
type: object.type,
fullName: object.fullName,
Expand Down
22 changes: 21 additions & 1 deletion newIDE/app/src/AssetStore/ObjectListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ export const ObjectListItem = ({
);
};

const isEnabled = isEngineCompatible;
const isEnabled =
isEngineCompatible && !objectShortHeader.isDependentWithParent;

const chooseObject = React.useCallback(
() => {
Expand Down Expand Up @@ -165,6 +166,25 @@ export const ObjectListItem = ({
</IconButton>
</Tooltip>
)}
{objectShortHeader.isDependentWithParent && (
<Tooltip
title={
<Trans>
This object can't be used here because it would create a
circular dependency with the object being edited.
</Trans>
}
>
<span>
<Chip
size="small"
label={<Trans>No cycle</Trans>}
variant="outlined"
onClick={() => {}}
/>
</span>
</Tooltip>
)}
</LineStackLayout>
<Text
noMargin
Expand Down
2 changes: 2 additions & 0 deletions newIDE/app/src/AssetStore/ObjectStoreContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,8 @@ export const ObjectStoreStateProvider = ({
requiredExtensions: repositoryObjectMetadata.requiredExtensions,

// Attributes from the installed extension
isDependentWithParent:
installedObjectMetadata.isDependentWithParent,

// These ones are less important but its better to use the icon of
// the installed extension since it's used everywhere in the editor.
Expand Down
7 changes: 7 additions & 0 deletions newIDE/app/src/Utils/GDevelopServices/Extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,13 @@ export type ObjectShortHeader = {
* @see adaptObjectHeader
*/
type: string,
/**
* `true` when using the object would create a dependency cycle with the
* edited events-based object.
*
* This attribute is computed for `installed` extensions.
*/
isDependentWithParent?: boolean,
};

/**
Expand Down
Loading