mirror of
https://github.com/4ian/GDevelop.git
synced 2025-10-15 10:19:04 +00:00
Prevent opening variables dialog for objects & groups if there is no object (#7132)
This commit is contained in:
@@ -188,37 +188,43 @@ export default React.forwardRef<ParameterFieldProps, ParameterFieldInterface>(
|
||||
}
|
||||
onInstructionTypeChanged={onInstructionTypeChanged}
|
||||
/>
|
||||
{editorOpen && project && !objectGroup && (
|
||||
<ObjectVariablesDialog
|
||||
project={project}
|
||||
projectScopedContainersAccessor={projectScopedContainersAccessor}
|
||||
objectName={objectName}
|
||||
variablesContainer={variablesContainers[0]}
|
||||
open
|
||||
onCancel={() => setEditorOpen(null)}
|
||||
onApply={onVariableEditorApply}
|
||||
preventRefactoringToDeleteInstructions
|
||||
initiallySelectedVariableName={editorOpen.variableName}
|
||||
shouldCreateInitiallySelectedVariable={editorOpen.shouldCreate}
|
||||
onComputeAllVariableNames={onComputeAllVariableNames}
|
||||
hotReloadPreviewButtonProps={null}
|
||||
/>
|
||||
)}
|
||||
{editorOpen && project && objectGroup && (
|
||||
<ObjectGroupVariablesDialog
|
||||
project={project}
|
||||
projectScopedContainersAccessor={projectScopedContainersAccessor}
|
||||
globalObjectsContainer={globalObjectsContainer}
|
||||
objectsContainer={objectsContainer}
|
||||
objectGroup={objectGroup}
|
||||
onCancel={() => setEditorOpen(null)}
|
||||
onApply={onVariableEditorApply}
|
||||
open
|
||||
initiallySelectedVariableName={editorOpen.variableName}
|
||||
shouldCreateInitiallySelectedVariable={editorOpen.shouldCreate}
|
||||
onComputeAllVariableNames={onComputeAllVariableNames}
|
||||
/>
|
||||
)}
|
||||
{editorOpen &&
|
||||
project &&
|
||||
!!variablesContainers.length &&
|
||||
!objectGroup && (
|
||||
<ObjectVariablesDialog
|
||||
project={project}
|
||||
projectScopedContainersAccessor={projectScopedContainersAccessor}
|
||||
objectName={objectName}
|
||||
variablesContainer={variablesContainers[0]}
|
||||
open
|
||||
onCancel={() => setEditorOpen(null)}
|
||||
onApply={onVariableEditorApply}
|
||||
preventRefactoringToDeleteInstructions
|
||||
initiallySelectedVariableName={editorOpen.variableName}
|
||||
shouldCreateInitiallySelectedVariable={editorOpen.shouldCreate}
|
||||
onComputeAllVariableNames={onComputeAllVariableNames}
|
||||
hotReloadPreviewButtonProps={null}
|
||||
/>
|
||||
)}
|
||||
{editorOpen &&
|
||||
project &&
|
||||
objectGroup &&
|
||||
!!variablesContainers.length && (
|
||||
<ObjectGroupVariablesDialog
|
||||
project={project}
|
||||
projectScopedContainersAccessor={projectScopedContainersAccessor}
|
||||
globalObjectsContainer={globalObjectsContainer}
|
||||
objectsContainer={objectsContainer}
|
||||
objectGroup={objectGroup}
|
||||
onCancel={() => setEditorOpen(null)}
|
||||
onApply={onVariableEditorApply}
|
||||
open
|
||||
initiallySelectedVariableName={editorOpen.variableName}
|
||||
shouldCreateInitiallySelectedVariable={editorOpen.shouldCreate}
|
||||
onComputeAllVariableNames={onComputeAllVariableNames}
|
||||
/>
|
||||
)}
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user