@@ -4566,9 +4566,16 @@ const createScene: EditorFunction = {
45664566 args ,
45674567 'background_color'
45684568 ) ;
4569+ const is_first_scene = SafeExtractor . extractBooleanProperty (
4570+ args ,
4571+ 'is_first_scene'
4572+ ) ;
45694573
45704574 if ( project . hasLayoutNamed ( scene_name ) ) {
45714575 const scene = project . getLayout ( scene_name ) ;
4576+ if ( is_first_scene ) {
4577+ project . setFirstLayout ( scene_name ) ;
4578+ }
45724579 if ( include_ui_layer && ! scene . hasLayerNamed ( 'UI' ) ) {
45734580 scene . insertNewLayer ( 'UI' , scene . getLayersCount ( ) ) ;
45744581 addDefaultLightToLayer ( scene . getLayer ( 'UI' ) ) ;
@@ -4592,6 +4599,9 @@ const createScene: EditorFunction = {
45924599 scene . setBackgroundColor ( colorAsRgb [ 0 ] , colorAsRgb [ 1 ] , colorAsRgb [ 2 ] ) ;
45934600 }
45944601 addDefaultLightToAllLayers ( scene ) ;
4602+ if ( is_first_scene ) {
4603+ project . setFirstLayout ( scene_name ) ;
4604+ }
45954605
45964606 return {
45974607 success : true ,
@@ -4702,6 +4712,7 @@ const inspectScenePropertiesLayersEffects: EditorFunction = {
47024712 scene . getBackgroundColorBlue ( )
47034713 ) ,
47044714 stopSoundsOnStartup : scene . stopSoundsOnStartup ( ) ,
4715+ isFirstScene : project . getFirstLayout ( ) === scene . getName ( ) ,
47054716
47064717 // Also include some project related properties:
47074718 gameResolutionWidth : project . getGameResolutionWidth ( ) ,
@@ -4936,6 +4947,11 @@ const changeScenePropertiesLayersEffectsGroups: EditorFunction = {
49364947 } else if ( isFuzzyMatch ( propertyName , 'gameName' ) ) {
49374948 project . setName ( newValue ) ;
49384949 changes . push ( `Set game name to "${ newValue } ".` ) ;
4950+ } else if ( isFuzzyMatch ( propertyName , 'isFirstScene' ) ) {
4951+ if ( newValue . toLowerCase ( ) === 'true' ) {
4952+ project . setFirstLayout ( scene_name ) ;
4953+ changes . push ( `Set "${ scene_name } " as the first (startup) scene.` ) ;
4954+ }
49394955 } else {
49404956 warnings . push ( `Unknown scene property: "${ propertyName } ". Skipped.` ) ;
49414957 }
0 commit comments