Skip to content

Commit 1808c98

Browse files
Ai can set a scene as first
1 parent 79d10bf commit 1808c98

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

newIDE/app/src/AiGeneration/Utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const useRefreshLimits = (
9595

9696
// All requests are made in orchestrator mode, and sub-agents (explorer, edit)
9797
// are created server-side with the same tools version as the orchestrator.
98-
export const AI_ORCHESTRATOR_TOOLS_VERSION = 'v4';
98+
export const AI_ORCHESTRATOR_TOOLS_VERSION = 'v5';
9999

100100
/**
101101
* A pending request for the user to approve (or refuse) a project-modifying

newIDE/app/src/EditorFunctions/index.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)