@@ -13,7 +13,6 @@ import { Column, Line } from '../../../UI/Grid';
13
13
import { getExtraObjectsInformation } from '../../../Hints' ;
14
14
import { getObjectTutorialIds } from '../../../Utils/GDevelopServices/Tutorial' ;
15
15
import AlertMessage from '../../../UI/AlertMessage' ;
16
- import { ColumnStackLayout } from '../../../UI/Layout' ;
17
16
import DismissableTutorialMessage from '../../../Hints/DismissableTutorialMessage' ;
18
17
import { mapFor } from '../../../Utils/MapFor' ;
19
18
import ObjectsEditorService from '../../ObjectsEditorService' ;
@@ -42,9 +41,15 @@ import ScrollView, { type ScrollViewInterface } from '../../../UI/ScrollView';
42
41
import FlatButton from '../../../UI/FlatButton' ;
43
42
import RaisedButton from '../../../UI/RaisedButton' ;
44
43
import FlatButtonWithSplitMenu from '../../../UI/FlatButtonWithSplitMenu' ;
45
- import { ResponsiveLineStackLayout , LineStackLayout } from '../../../UI/Layout' ;
44
+ import {
45
+ ResponsiveLineStackLayout ,
46
+ LineStackLayout ,
47
+ ColumnStackLayout ,
48
+ } from '../../../UI/Layout' ;
46
49
import { useResponsiveWindowSize } from '../../../UI/Responsive/ResponsiveWindowMeasurer' ;
47
50
import Add from '../../../UI/CustomSvgIcons/Add' ;
51
+ import Trash from '../../../UI/CustomSvgIcons/Trash' ;
52
+ import Edit from '../../../UI/CustomSvgIcons/ShareExternal' ;
48
53
import Dialog from '../../../UI/Dialog' ;
49
54
import HelpButton from '../../../UI/HelpButton' ;
50
55
import RestoreIcon from '../../../UI/CustomSvgIcons/Restore' ;
@@ -107,7 +112,7 @@ const CustomObjectPropertiesEditor = (props: Props) => {
107
112
unsavedChanges,
108
113
renderObjectNameField,
109
114
isChildObject,
110
- onOpenEventBasedObjectEditor ,
115
+ onOpenEventBasedObjectVariantEditor ,
111
116
onDeleteEventsBasedObjectVariant,
112
117
} = props ;
113
118
@@ -204,8 +209,8 @@ const CustomObjectPropertiesEditor = (props: Props) => {
204
209
205
210
const editVariant = React . useCallback (
206
211
( ) => {
207
- onOpenEventBasedObjectEditor &&
208
- onOpenEventBasedObjectEditor (
212
+ onOpenEventBasedObjectVariantEditor &&
213
+ onOpenEventBasedObjectVariantEditor (
209
214
gd . PlatformExtension . getExtensionFromFullObjectType (
210
215
customObjectConfiguration . getType ( )
211
216
) ,
@@ -215,7 +220,7 @@ const CustomObjectPropertiesEditor = (props: Props) => {
215
220
customObjectConfiguration . getVariantName ( )
216
221
) ;
217
222
} ,
218
- [ customObjectConfiguration , onOpenEventBasedObjectEditor ]
223
+ [ customObjectConfiguration , onOpenEventBasedObjectVariantEditor ]
219
224
) ;
220
225
221
226
const duplicateVariant = React . useCallback (
@@ -329,7 +334,31 @@ const CustomObjectPropertiesEditor = (props: Props) => {
329
334
< Text size = "block-title" > Variant</ Text >
330
335
</ Column >
331
336
</ Line >
332
- < LineStackLayout >
337
+ < ColumnStackLayout expand noMargin >
338
+ < LineStackLayout >
339
+ < FlatButton
340
+ label = { < Trans > Edit</ Trans > }
341
+ leftIcon = { < Edit /> }
342
+ onClick = { editVariant }
343
+ disabled = {
344
+ ! eventBasedObject ||
345
+ getVariant (
346
+ eventBasedObject ,
347
+ customObjectConfiguration
348
+ ) . getAssetStoreAssetId ( ) !== ''
349
+ }
350
+ />
351
+ < FlatButton
352
+ label = { < Trans > Duplicate</ Trans > }
353
+ leftIcon = { < Add /> }
354
+ onClick = { ( ) => setNewVariantDialogOpen ( true ) }
355
+ />
356
+ < FlatButton
357
+ label = { < Trans > Delete</ Trans > }
358
+ leftIcon = { < Trash /> }
359
+ onClick = { deleteVariant }
360
+ />
361
+ </ LineStackLayout >
333
362
< SelectField
334
363
floatingLabelText = { < Trans > Variant</ Trans > }
335
364
value = { getVariantName (
@@ -340,7 +369,6 @@ const CustomObjectPropertiesEditor = (props: Props) => {
340
369
customObjectConfiguration . setVariantName ( value ) ;
341
370
forceUpdate ( ) ;
342
371
} }
343
- fullWidth
344
372
>
345
373
< SelectOption
346
374
key = "default-variant"
@@ -368,26 +396,7 @@ const CustomObjectPropertiesEditor = (props: Props) => {
368
396
}
369
397
) }
370
398
</ SelectField >
371
- < FlatButton
372
- label = { < Trans > Edit</ Trans > }
373
- onClick = { editVariant }
374
- disabled = {
375
- ! eventBasedObject ||
376
- getVariant (
377
- eventBasedObject ,
378
- customObjectConfiguration
379
- ) . getAssetStoreAssetId ( ) !== ''
380
- }
381
- />
382
- < FlatButton
383
- label = { < Trans > Duplicate</ Trans > }
384
- onClick = { ( ) => setNewVariantDialogOpen ( true ) }
385
- />
386
- < FlatButton
387
- label = { < Trans > Delete</ Trans > }
388
- onClick = { deleteVariant }
389
- />
390
- </ LineStackLayout >
399
+ </ ColumnStackLayout >
391
400
392
401
{ ! getVariantName (
393
402
eventBasedObject ,
0 commit comments