mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-11 22:50:08 +00:00
ability to specify startup scenes in the editor settings
This commit is contained in:
+10
-1
@@ -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() {
|
||||
|
||||
@@ -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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user