From 40cd38911d97ad039d571dcf8878ceee58c073a1 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Tue, 24 Sep 2019 15:58:24 -0400 Subject: [PATCH] idk --- .../UniversalEditor.UserInterface/Engine.cs | 10 ++--- .../SplashScreenWindow.cs | 38 ++++++++----------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs b/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs index 3f881194..6427a1d5 100644 --- a/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs +++ b/CSharp/Libraries/UniversalEditor.UserInterface/Engine.cs @@ -46,6 +46,11 @@ namespace UniversalEditor.UserInterface System.Threading.Thread.Sleep(500); } splasher.Hide(); + + AfterInitializationInternal(); + AfterInitialization(); + + OpenWindow(SelectedFileNames.ToArray()); } #region implemented abstract members of Engine @@ -1428,11 +1433,6 @@ namespace UniversalEditor.UserInterface Initialize(); - AfterInitializationInternal(); - AfterInitialization(); - - OpenWindow(SelectedFileNames.ToArray()); - MainLoop(); SessionManager.Save(); diff --git a/CSharp/Libraries/UniversalEditor.UserInterface/SplashScreenWindow.cs b/CSharp/Libraries/UniversalEditor.UserInterface/SplashScreenWindow.cs index 59ffa707..168938ef 100644 --- a/CSharp/Libraries/UniversalEditor.UserInterface/SplashScreenWindow.cs +++ b/CSharp/Libraries/UniversalEditor.UserInterface/SplashScreenWindow.cs @@ -47,38 +47,28 @@ namespace UniversalEditor.UserInterface // this.Controls.Add(lbl, new BoxLayout.Constraints(true, true)); } -private static bool created = false; - protected override void OnCreated(EventArgs e) + protected override void OnRealize(EventArgs e) { + base.OnRealize(e); + OnShown(e); + } + + private static bool created = false; + protected override void OnMapped(EventArgs e) + { + base.OnMapped(e); if (created) return; created = true; // less do this Application.ShortName = "mbs-editor"; // Application.Title = "Universal Editor"; + Application.DoEvents(); + // Initialize the XML files before anything else, since this also loads string tables needed // to display the application title Engine.CurrentEngine.InitializeXMLConfiguration(); - System.Threading.Thread threadLoader = new System.Threading.Thread(threadLoader_ThreadStart); - threadLoader.Name = "Initialization Thread"; - threadLoader.Start(); - } - public void SetStatus(string message, int progressValue, int progressMinimum, int progressMaximum) - { - - } - - private void threadLoader_ThreadStart() - { - /* - if (Configuration.SplashScreen.Enabled) - { - while (splasher == null) System.Threading.Thread.Sleep(500); - } - */ - - Engine.CurrentEngine.UpdateSplashScreenStatus("Loading object models..."); UniversalEditor.Common.Reflection.GetAvailableObjectModels(); @@ -96,9 +86,13 @@ created = true; // Initialize Session Manager Engine.CurrentEngine.SessionManager.DataFileName = Engine.DataPath + System.IO.Path.DirectorySeparatorChar.ToString() + "Sessions.xml"; Engine.CurrentEngine.SessionManager.Load(); - + Engine.CurrentEngine.HideSplashScreen(); } + public void SetStatus(string message, int progressValue, int progressMinimum, int progressMaximum) + { + + } }