Пример #1
0
        void PerformLoading()
        {
            try
            {
                SetLoadingString("Loading Languages...");

                var language = LoadLanguages();

                SetLoadingString("Initializing base forms...");

                Program.Context.SplashForm.Invoke((Action)(() =>
                {
                    Editor.MainForm.FinishedLoadingLanguages();
                    Editor.MainForm.Initialize(language);
                }));

                if (GlobalSettings.AutoUpdate)
                {
                    SetLoadingString("Checking for updates...");

                    if (Program.Context.Updater.CheckForUpdates())
                    {
                        Program.Context.SplashForm.Invoke((Action)(() =>
                        {
                            Editor.ShowUpdateDialog(Program.Context.SplashForm);
                        }));
                    }
                }

                SetLoadingString("Loading swatches...");

                SwatchLoader.LoadSwatches();
                Program.Context.SplashForm.Invoke((Action)SwatchLoader.FinishedLoadingSwatches);

                SetLoadingString("Loading models...");

                ModelLoader.LoadModels();
                Program.Context.SplashForm.Invoke((Action)Editor.MainForm.FinishedLoadingModels);

                SetLoadingString("Loading skins...");

                SkinLoader.LoadSkins();

                Program.Context.SplashForm.Invoke((Action)Program.Context.DoneLoadingSplash);
                Program.Context.Form.Invoke((Action)(() =>
                {
                    Program.Context.SplashForm.Close();
                    GC.Collect();
                }
                                                     ));
            }
            catch (Exception ex)
            {
                Program.RaiseException(new Exception("Failed to initialize program during \"" + label1.Text + "\"", ex));
                Application.Exit();
            }
        }
Пример #2
0
        void PerformLoading()
        {
            ErrorHandlerWrap(() =>
            {
                SetLoadingString("Loading Languages...");

                var language = LoadLanguages();

                SetLoadingString("Initializing base forms...");

                Program.Context.SplashForm.Invoke(ErrorHandlerWrap(() =>
                {
                    Editor.MainForm.FinishedLoadingLanguages();
                    Editor.MainForm.Initialize(language);
                }));

                if (GlobalSettings.AutoUpdate)
                {
                    SetLoadingString("Checking for updates...");

                    if (Program.Context.Updater.CheckForUpdates())
                    {
                        Program.Context.SplashForm.Invoke(ErrorHandlerWrap(() =>
                        {
                            Editor.ShowUpdateDialog(Program.Context.SplashForm);
                        }));
                    }
                }

                SetLoadingString("Loading swatches...");

                SwatchLoader.LoadSwatches();
                Program.Context.SplashForm.Invoke(ErrorHandlerWrap(SwatchLoader.FinishedLoadingSwatches));

                SetLoadingString("Loading models...");

                ModelLoader.LoadModels();
                Program.Context.SplashForm.Invoke(ErrorHandlerWrap(Editor.MainForm.FinishedLoadingModels));

                SetLoadingString("Loading skins...");

                SkinLoader.LoadSkins();

                Program.Context.SplashForm.Invoke(ErrorHandlerWrap(Program.Context.DoneLoadingSplash));

                Program.Context.Form.Invoke(ErrorHandlerWrap(() =>
                {
                    Program.Context.SplashForm.Close();
                    GC.Collect();
                }));
            })();
        }
Пример #3
0
    // Called when the node enters the scene tree for the first time.
    public override void _Ready()
    {
        Godot.Engine.TargetFps = 0;

        LoadReference();

        CreateBlockOutline();
        ModelLoader.LoadModels();
        NoiseMaker.Initialize();

        if (MultiThreaded)
        {
            var threadStart1 = new ThreadStart(ChunkManager.UpdateThread);
            Threads[0] = new Thread(threadStart1);
            Threads[0].Start();
        }
    }