From ed5b165fbd75e21f56ddc6f194c30ecfb2821eb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pasteau?= <4895034+ClementPasteau@users.noreply.github.com> Date: Mon, 25 Nov 2024 11:13:39 +0100 Subject: [PATCH] Improvements --- .../ExampleStore/ExampleInformationPage.js | 3 +-- newIDE/app/src/AssetStore/ExampleStore/index.js | 2 +- newIDE/app/src/MainFrame/UseNewProjectDialog.js | 4 ++-- newIDE/app/src/ProjectCreation/AIPromptField.js | 3 +-- .../EmptyAndStartingPointProjects.js | 14 ++++---------- .../EmptyAndStartingPointProjects.module.css | 4 +++- .../src/ProjectCreation/NewProjectSetupDialog.js | 10 +++++----- .../QuickCustomizationGameTiles.js | 2 +- 8 files changed, 18 insertions(+), 24 deletions(-) diff --git a/newIDE/app/src/AssetStore/ExampleStore/ExampleInformationPage.js b/newIDE/app/src/AssetStore/ExampleStore/ExampleInformationPage.js index 3fcb6c1813ab..d7cbeb9650f1 100644 --- a/newIDE/app/src/AssetStore/ExampleStore/ExampleInformationPage.js +++ b/newIDE/app/src/AssetStore/ExampleStore/ExampleInformationPage.js @@ -57,8 +57,7 @@ const ExampleInformationPage = ({ exampleShortHeader }: Props) => { {!isCompatible && ( - Unfortunately, this example requires a newer version of GDevelop to - work. Update GDevelop to be able to open this example. + Download the latest version of GDevelop to check out this example! )} diff --git a/newIDE/app/src/AssetStore/ExampleStore/index.js b/newIDE/app/src/AssetStore/ExampleStore/index.js index 641835df744d..c346b52c60e7 100644 --- a/newIDE/app/src/AssetStore/ExampleStore/index.js +++ b/newIDE/app/src/AssetStore/ExampleStore/index.js @@ -14,7 +14,7 @@ import { useShouldAutofocusInput } from '../../UI/Responsive/ScreenTypeMeasurer' import { type PrivateGameTemplateListingData } from '../../Utils/GDevelopServices/Shop'; import AuthenticatedUserContext from '../../Profile/AuthenticatedUserContext'; import { PrivateGameTemplateStoreContext } from '../PrivateGameTemplates/PrivateGameTemplateStoreContext'; -import { GridList } from '@material-ui/core'; +import GridList from '@material-ui/core/GridList'; import { getExampleAndTemplateTiles } from '../../MainFrame/EditorContainers/HomePage/BuildSection/utils'; import BackgroundText from '../../UI/BackgroundText'; import { ColumnStackLayout } from '../../UI/Layout'; diff --git a/newIDE/app/src/MainFrame/UseNewProjectDialog.js b/newIDE/app/src/MainFrame/UseNewProjectDialog.js index cc60ddeaecec..da16fdafafc8 100644 --- a/newIDE/app/src/MainFrame/UseNewProjectDialog.js +++ b/newIDE/app/src/MainFrame/UseNewProjectDialog.js @@ -37,7 +37,7 @@ type Props = {| storageProviders: Array, |}; -const useExampleOrGameTemplateDialogs = ({ +const useNewProjectDialog = ({ isProjectOpening, newProjectSetupDialogOpen, setNewProjectSetupDialogOpen, @@ -238,4 +238,4 @@ const useExampleOrGameTemplateDialogs = ({ }; }; -export default useExampleOrGameTemplateDialogs; +export default useNewProjectDialog; diff --git a/newIDE/app/src/ProjectCreation/AIPromptField.js b/newIDE/app/src/ProjectCreation/AIPromptField.js index a277315f8078..d5c137331cd3 100644 --- a/newIDE/app/src/ProjectCreation/AIPromptField.js +++ b/newIDE/app/src/ProjectCreation/AIPromptField.js @@ -78,8 +78,7 @@ const AIPromptField = ({ ); const generateProject = React.useCallback( async () => { - if (disabled) return; - if (!profile) return; + if (disabled || !profile) return; onGenerationStarted(); try { diff --git a/newIDE/app/src/ProjectCreation/EmptyAndStartingPointProjects.js b/newIDE/app/src/ProjectCreation/EmptyAndStartingPointProjects.js index 605aa25cd47c..e25ae7dcd0f4 100644 --- a/newIDE/app/src/ProjectCreation/EmptyAndStartingPointProjects.js +++ b/newIDE/app/src/ProjectCreation/EmptyAndStartingPointProjects.js @@ -12,10 +12,10 @@ import { ExampleTile } from '../AssetStore/ShopTiles'; import { ExampleStoreContext } from '../AssetStore/ExampleStore/ExampleStoreContext'; import { type ExampleShortHeader } from '../Utils/GDevelopServices/Example'; import { useResponsiveWindowSize } from '../UI/Responsive/ResponsiveWindowMeasurer'; -import { GridList, GridListTile } from '@material-ui/core'; +import GridList from '@material-ui/core/GridList'; +import GridListTile from '@material-ui/core/GridListTile'; import { shouldValidate } from '../UI/KeyboardShortcuts/InteractionKeys'; import classes from './EmptyAndStartingPointProjects.module.css'; -import classNames from 'classnames'; import { getItemsColumns } from './NewProjectSetupDialog'; const getStyles = (theme: GDevelopTheme) => ({ @@ -43,15 +43,9 @@ const EmptyProjectTile = ({ const { isMobile } = useResponsiveWindowSize(); return ( -
+
): void => { diff --git a/newIDE/app/src/ProjectCreation/EmptyAndStartingPointProjects.module.css b/newIDE/app/src/ProjectCreation/EmptyAndStartingPointProjects.module.css index 41d8cef706c8..e714185eab22 100644 --- a/newIDE/app/src/ProjectCreation/EmptyAndStartingPointProjects.module.css +++ b/newIDE/app/src/ProjectCreation/EmptyAndStartingPointProjects.module.css @@ -17,9 +17,11 @@ .emptyProject:hover { background-color: var(--theme-hover-background-color); + transition: background-color 0.2s; } .emptyProject:focus { - background-color: var(--theme-hover-background-color) + background-color: var(--theme-hover-background-color); + transition: background-color 0.2s; } diff --git a/newIDE/app/src/ProjectCreation/NewProjectSetupDialog.js b/newIDE/app/src/ProjectCreation/NewProjectSetupDialog.js index b0cbcc45d03b..211110279bda 100644 --- a/newIDE/app/src/ProjectCreation/NewProjectSetupDialog.js +++ b/newIDE/app/src/ProjectCreation/NewProjectSetupDialog.js @@ -275,7 +275,7 @@ const NewProjectSetupDialog = ({ receivedGameTemplates, ] ); - const isSelectedGameTemplateOwned = + const noGameTemplateSelectedOrSelectedAndOwned = !selectedPrivateGameTemplateListingData || !!selectedGameTemplatePurchaseUsageType; @@ -288,7 +288,7 @@ const NewProjectSetupDialog = ({ const shouldAllowCreatingProject = !isLoading && (!isOnHomePage && - isSelectedGameTemplateOwned && + noGameTemplateSelectedOrSelectedAndOwned && !needUserAuthenticationForStorage && !hasTooManyCloudProjects && (hasSelectedAStorageProvider || shouldAllowCreatingProjectWithoutSaving)); @@ -461,7 +461,7 @@ const NewProjectSetupDialog = ({ fullHeight={ isOnHomePage || (!!selectedPrivateGameTemplateListingData && - !isSelectedGameTemplateOwned) + !noGameTemplateSelectedOrSelectedAndOwned) } flexColumnBody forceScrollVisible @@ -535,7 +535,7 @@ const NewProjectSetupDialog = ({ )} {!isOnHomePage && selectedPrivateGameTemplateListingData && - !isSelectedGameTemplateOwned && ( + !noGameTemplateSelectedOrSelectedAndOwned && ( )} - {!isOnHomePage && isSelectedGameTemplateOwned && ( + {!isOnHomePage && noGameTemplateSelectedOrSelectedAndOwned && ( {selectedExampleShortHeader ? (