diff --git a/Source/Editor/Modules/SceneModule.cs b/Source/Editor/Modules/SceneModule.cs index 9fd860a51..6334225fd 100644 --- a/Source/Editor/Modules/SceneModule.cs +++ b/Source/Editor/Modules/SceneModule.cs @@ -138,8 +138,11 @@ namespace FlaxEditor.Modules public void CreateSceneFile(string path) { // Create a sample scene - var scene = new Scene(); - scene.StaticFlags = StaticFlags.FullyStatic; + var scene = new Scene + { + StaticFlags = StaticFlags.FullyStatic + }; + // var sun = scene.AddChild(); sun.Name = "Sun"; diff --git a/Source/Editor/Modules/UIModule.cs b/Source/Editor/Modules/UIModule.cs index 6b01986a9..6d34114b1 100644 --- a/Source/Editor/Modules/UIModule.cs +++ b/Source/Editor/Modules/UIModule.cs @@ -378,8 +378,10 @@ namespace FlaxEditor.Modules private void InitMainMenu(RootControl mainWindow) { - MainMenu = new MainMenu(mainWindow); - MainMenu.Parent = mainWindow; + MainMenu = new MainMenu(mainWindow) + { + Parent = mainWindow + }; // File MenuFile = MainMenu.AddButton("File"); diff --git a/Source/Editor/Options/Editor.cs b/Source/Editor/Options/Editor.cs index 539cef444..0309187cd 100644 --- a/Source/Editor/Options/Editor.cs +++ b/Source/Editor/Options/Editor.cs @@ -21,9 +21,11 @@ namespace FlaxEditor.Options // Reset options button layout.Space(30); var panel = layout.Space(30); - var resetButton = new Button(4, 4, 100); - resetButton.Text = "Reset"; - resetButton.Parent = panel.ContainerControl; + var resetButton = new Button(4, 4, 100) + { + Text = "Reset", + Parent = panel.ContainerControl + }; resetButton.Clicked += OnResetButtonClicked; } diff --git a/Source/Editor/Options/OptionsModule.cs b/Source/Editor/Options/OptionsModule.cs index 3c501de85..fac8a4a78 100644 --- a/Source/Editor/Options/OptionsModule.cs +++ b/Source/Editor/Options/OptionsModule.cs @@ -212,45 +212,46 @@ namespace FlaxEditor.Options /// The style object. public Style CreateDefaultStyle() { - var style = new Style(); - // Metro Style colors - style.Background = Color.FromBgra(0xFF1C1C1C); - style.LightBackground = Color.FromBgra(0xFF2D2D30); - style.Foreground = Color.FromBgra(0xFFFFFFFF); - style.ForegroundGrey = Color.FromBgra(0xFFA9A9B3); - style.ForegroundDisabled = Color.FromBgra(0xFF787883); - style.BackgroundHighlighted = Color.FromBgra(0xFF54545C); - style.BorderHighlighted = Color.FromBgra(0xFF6A6A75); - style.BackgroundSelected = Color.FromBgra(0xFF007ACC); - style.BorderSelected = Color.FromBgra(0xFF1C97EA); - style.BackgroundNormal = Color.FromBgra(0xFF3F3F46); - style.BorderNormal = Color.FromBgra(0xFF54545C); - style.TextBoxBackground = Color.FromBgra(0xFF333337); - style.TextBoxBackgroundSelected = Color.FromBgra(0xFF3F3F46); + var options = Options; + var style = new Style + { + Background = Color.FromBgra(0xFF1C1C1C), + LightBackground = Color.FromBgra(0xFF2D2D30), + Foreground = Color.FromBgra(0xFFFFFFFF), + ForegroundGrey = Color.FromBgra(0xFFA9A9B3), + ForegroundDisabled = Color.FromBgra(0xFF787883), + BackgroundHighlighted = Color.FromBgra(0xFF54545C), + BorderHighlighted = Color.FromBgra(0xFF6A6A75), + BackgroundSelected = Color.FromBgra(0xFF007ACC), + BorderSelected = Color.FromBgra(0xFF1C97EA), + BackgroundNormal = Color.FromBgra(0xFF3F3F46), + BorderNormal = Color.FromBgra(0xFF54545C), + TextBoxBackground = Color.FromBgra(0xFF333337), + TextBoxBackgroundSelected = Color.FromBgra(0xFF3F3F46), + + // Fonts + FontTitle = options.Interface.TitleFont.GetFont(), + FontLarge = options.Interface.LargeFont.GetFont(), + FontMedium = options.Interface.MediumFont.GetFont(), + FontSmall = options.Interface.SmallFont.GetFont(), + + // Icons + ArrowDown = Editor.Icons.ArrowDown12, + ArrowRight = Editor.Icons.ArrowRight12, + Search = Editor.Icons.Search12, + Settings = Editor.Icons.Settings12, + Cross = Editor.Icons.Cross12, + CheckBoxIntermediate = Editor.Icons.CheckBoxIntermediate12, + CheckBoxTick = Editor.Icons.CheckBoxTick12, + StatusBarSizeGrip = Editor.Icons.StatusBarSizeGrip12, + Translate = Editor.Icons.Translate16, + Rotate = Editor.Icons.Rotate16, + Scale = Editor.Icons.Scale16 + }; style.DragWindow = style.BackgroundSelected * 0.7f; style.ProgressNormal = Color.FromBgra(0xFF0ad328); - // Fonts - var options = Options; - style.FontTitle = options.Interface.TitleFont.GetFont(); - style.FontLarge = options.Interface.LargeFont.GetFont(); - style.FontMedium = options.Interface.MediumFont.GetFont(); - style.FontSmall = options.Interface.SmallFont.GetFont(); - - // Icons - style.ArrowDown = Editor.Icons.ArrowDown12; - style.ArrowRight = Editor.Icons.ArrowRight12; - style.Search = Editor.Icons.Search12; - style.Settings = Editor.Icons.Settings12; - style.Cross = Editor.Icons.Cross12; - style.CheckBoxIntermediate = Editor.Icons.CheckBoxIntermediate12; - style.CheckBoxTick = Editor.Icons.CheckBoxTick12; - style.StatusBarSizeGrip = Editor.Icons.StatusBarSizeGrip12; - style.Translate = Editor.Icons.Translate16; - style.Rotate = Editor.Icons.Rotate16; - style.Scale = Editor.Icons.Scale16; - style.SharedTooltip = new Tooltip(); return style; diff --git a/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs b/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs index e04dd7741..3874b5011 100644 --- a/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs +++ b/Source/Editor/SceneGraph/GUI/ActorTreeNode.cs @@ -386,15 +386,20 @@ namespace FlaxEditor.SceneGraph.GUI public ReparentAction(List actors) { - var allActors = new List(); - allActors.Capacity = Mathf.NextPowerOfTwo(actors.Count); + var allActors = new List + { + Capacity = Mathf.NextPowerOfTwo(actors.Count) + }; + for (int i = 0; i < actors.Count; i++) { GetAllActors(allActors, actors[i]); } - var allScripts = new List