ability to specify startup scenes in the editor settings

This commit is contained in:
Dmitry Stepanov
2026-08-28 22:51:45 +03:00
parent b5a9096a5e
commit 4b82b4934a
2 changed files with 16 additions and 1 deletions
+10 -1
View File
@@ -1034,7 +1034,7 @@ impl Editor {
}
let scenes = SceneContainer::new(&mut engine, &mut settings, message_sender.clone());
let editor = Self {
let mut editor = Self {
docking_manager,
engine,
navmesh_panel,
@@ -1107,6 +1107,15 @@ impl Editor {
property_editors,
};
editor
.settings
.general
.startup_scenes
.retain(|p| p.exists());
for path in editor.settings.general.startup_scenes.iter() {
editor.message_sender.send(Message::LoadScene(path.clone()));
}
if let Some(data) = startup_data {
editor.message_sender.send(Message::Configure {
working_directory: if data.working_directory == PathBuf::default() {
+6
View File
@@ -20,6 +20,7 @@
use crate::fyrox::core::reflect::prelude::*;
use serde::{Deserialize, Serialize};
use std::path::PathBuf;
use strum_macros::{AsRefStr, EnumString, VariantNames};
#[derive(
@@ -81,6 +82,10 @@ pub struct GeneralSettings {
#[serde(default = "default_style")]
pub style: EditorStyle,
/// A list of scenes that will be loaded at the editor start.
#[serde(default)]
pub startup_scenes: Vec<PathBuf>,
}
fn default_style() -> EditorStyle {
@@ -143,6 +148,7 @@ impl Default for GeneralSettings {
generate_previews: default_generate_previews(),
max_log_entries: default_max_log_entries(),
style: EditorStyle::Dark,
startup_scenes: Default::default(),
}
}
}