Example #1
0
        protected override void Update(GameTime gameTime)
        {
            KeyboardState KCurrent = Keyboard.GetState();

            if (LoadOperation != null && !LoadOperation.IsCompleted)
            {
                try
                {
                    Monitor.Enter(LoadGraphicsQueue);
                    while (LoadGraphicsQueue.Count > 0)
                    {
                        Task GraphTask = (Task)LoadGraphicsQueue.Dequeue();
                        GraphTask.RunSynchronously();
                    }
                }
                finally { Monitor.Exit(LoadGraphicsQueue); }
                try
                {
                    Monitor.Enter(LPLockObj);
                    LoadCover.Scale(new Vector2((1 - LoadPercentage) - LoadCover.ScaleSize.X, 0));
                }
                finally { Monitor.Exit(LPLockObj); }
                LoadText.Text = "[F:SYSFONT]" + LastLogLine;
                if (KCurrent.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.F11) && !LastKeyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.F11))
                {
                    ToggleFullscreen();
                }
                LastKeyState = KCurrent;
            }
            else
            {
                if (LoadOperation != null)
                {
                    if (LoadOperation.IsFaulted)
                    {
                        MessageBox.Show("VNFramework could not launch as the application was unable to read the specified application manifest file.", "eVent horizoN Client Loader");
                        Exit();
                        return;
                    }
                    object[] LoadResult       = LoadOperation.GetAwaiter().GetResult();
                    String   FirstScript      = (String)LoadResult[0];
                    Boolean  RunFirstAsUnique = (Boolean)LoadResult[1];
                    if (FirstScript.Length > 0)
                    {
                        WriteLine("Priming first script.");
                        if (RunFirstAsUnique)
                        {
                            Shell.UpdateQueue.Add(new ScriptProcessor.ScriptSniffer("INTRO_SNIFFER_UNIQUE", ScriptProcessor.RetrieveScriptByName(FirstScript), FirstScript));
                        }
                        else
                        {
                            Shell.UpdateQueue.Add(new ScriptProcessor.ScriptSniffer(FirstScript + "_SNIFFER", ScriptProcessor.RetrieveScriptByName(FirstScript), FirstScript));
                        }
                    }
                    LoadBar.AnimationQueue.Add(Animation.Retrieve("FADEOUT"));
                    LoadBar.TransientAnimation = true;
                    UpdateQueue.Add(LoadBar);
                    DeleteQueue.Add(LoadCover);
                    DeleteQueue.Add(LoadText);
                    LoadOperation.Dispose();
                    LoadOperation = null;
                }
                MainUpdate(gameTime, KCurrent);
            }
            base.Update(gameTime);
        }
        static void LoadScriptStemSave(Hashtable AttrIndex)
        {
            String ScriptName = (String)AttrIndex["#SCRIPTNAME"];
            int    SIndex     = Convert.ToInt32((String)AttrIndex["#SCRIPTSHIFTINDEX"]);

            String[] Conditionals = ((String)AttrIndex["#CONDITIONALS"]).Split(',');
            Shell.UpdateQueue = new ArrayList();
            Shell.RenderQueue = new ArrayList();
            foreach (String C in Conditionals)
            {
                switch (C)
                {
                case "DEFAULTUI":
                    ButtonScripts.InitDefaultUI();
                    break;
                }
            }
            ScriptProcessor.ScriptSniffer LoadSniffer = new ScriptProcessor.ScriptSniffer(ScriptName.ToUpper() + "_SNIFFER", ScriptProcessor.RetrieveScriptByName(ScriptName), ScriptName, true);
            LoadSniffer.SetLoadBreaker(SIndex);
            Shell.UpdateQueue.Add(LoadSniffer);
        }