Exemplo n.º 1
0
        protected override void Update(GameTime gameTime)
        {
            if (Profiler.InContext("OutOfContext"))
            {
                Profiler.ExitContext("OutOfContext");
            }
            Profiler.EnterContext("Update");

            IsFixedTimeStep = Settings.Game.IsFixedTimeStep;

            if (!IsRunning)
            {
                Settings.Save();
                Exit();
            }
            else
            {
                base.Update(gameTime);
                double totalMS = gameTime.TotalGameTime.TotalMilliseconds;
                double frameMS = gameTime.ElapsedGameTime.TotalMilliseconds;

                TotalMS = totalMS;
                Input.Update(totalMS, frameMS);
                UserInterface.Update(totalMS, frameMS);
                if (Network.IsConnected)
                {
                    Network.Slice();
                }
                ActiveModel.Update(totalMS, frameMS);
            }

            Profiler.ExitContext("Update");
            Profiler.EnterContext("OutOfContext");
        }
Exemplo n.º 2
0
        protected override void Draw(GameTime gameTime)
        {
            Profiler.EndFrame();
            Profiler.BeginFrame();
            if (Profiler.InContext("OutOfContext"))
            {
                Profiler.ExitContext("OutOfContext");
            }
            Profiler.EnterContext("RenderFrame");

            if (!IsMinimized)
            {
                SpriteBatch3D.Reset();
                GraphicsDevice.Clear(Color.Black);

                ActiveModel.GetView()
                .Draw(gameTime.ElapsedGameTime.TotalMilliseconds);
                UserInterface.Draw(gameTime.ElapsedGameTime.TotalMilliseconds);
            }

            Profiler.ExitContext("RenderFrame");
            Profiler.EnterContext("OutOfContext");

            UpdateWindowCaption(gameTime);
        }
Exemplo n.º 3
0
        protected override void Draw(GameTime gameTime)
        {
            Profiler.EndFrame();
            Profiler.BeginFrame();
            if (Profiler.InContext("OutOfContext"))
            {
                Profiler.ExitContext("OutOfContext");
            }
            Profiler.EnterContext("RenderFrame");

            if (!IsMinimized)
            {
                if (ActiveModel is WorldModel)
                {
                    CheckWindowSize(Settings.UserInterface.PlayWindowGumpResolution.Width, Settings.UserInterface.PlayWindowGumpResolution.Height);
                }
                else
                {
                    CheckWindowSize(800, 600);
                }

                ActiveModel.GetView()
                .Draw(gameTime.ElapsedGameTime.TotalMilliseconds);
                UserInterface.Draw(gameTime.ElapsedGameTime.TotalMilliseconds);
            }

            Profiler.ExitContext("RenderFrame");
            Profiler.EnterContext("OutOfContext");

            UpdateWindowCaption(gameTime);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Disposing
        /// </summary>
        public override void Dispose()
        {
            // Clean active model
            ActiveModel?.Dispose();

            // Dispose command manager
            CommandManager?.Dispose();

            // NOTE: Don't dispose the application, SolidWorks does that itself
            //base.Dispose();
        }
Exemplo n.º 5
0
        protected override void Draw(GameTime gameTime)
        {
            if (IsMinimized)
            {
                return;
            }
            SpriteBatch3D.ResetZ();
            GraphicsDevice.Clear(Color.Black);
            ActiveModel.GetView()
            .Draw(gameTime.ElapsedGameTime.TotalMilliseconds);
            UserInterface.Draw(gameTime.ElapsedGameTime.TotalMilliseconds);

            EngineVars.UpdateFPS(gameTime.ElapsedGameTime.TotalMilliseconds);
            Window.Title =
                Settings.Debug.ShowFps ?
                string.Format("UltimaXNA FPS:{0}", EngineVars.UpdateFPS(gameTime.ElapsedGameTime.TotalMilliseconds)) :
                "UltimaXNA";
        }
Exemplo n.º 6
0
        public IActionResult ActiveAccount([FromBody] ActiveModel model)
        {
            var account = _db.Set <Account>().FirstOrDefault(x => x.Email == model.email);

            if (account == null)
            {
                return(BadRequest("Sistemde tanımlı hesap bulunamadı!"));
            }
            var password = _db.Set <UserPassword>().FirstOrDefault(x => x.UserId == account.Id && x.Password == model.password);

            if (password == null)
            {
                return(BadRequest("Şifre Hatalı veya Aktif Değil!"));
            }
            else
            {
                account.isActive = model.active;
                _db.SaveChanges();
                return(Ok("Hesap Aktif Edildi."));
            }
        }
Exemplo n.º 7
0
        protected override void Update(GameTime gameTime)
        {
            IsFixedTimeStep = Settings.Game.IsFixedTimeStep;

            if (!EngineVars.EngineRunning)
            {
                Settings.Save();
                Exit();
            }
            else
            {
                var totalMs = gameTime.TotalGameTime.TotalMilliseconds;
                var frameMs = gameTime.ElapsedGameTime.TotalMilliseconds;

                TotalMs = totalMs;
                Input.Update(totalMs, frameMs);
                UserInterface.Update(totalMs, frameMs);
                Network.Slice();
                ActiveModel.Update(totalMs, frameMs);
            }
        }
Exemplo n.º 8
0
 internal void DeleteRow(DataRow Row)
 {
     Row.Delete();
     ActiveModel.AcceptChanges();
 }
Exemplo n.º 9
0
 public void OnSaveModel()
 {
     ActiveModel.Save(ActiveModelPath);
     ActiveModelChanged = false;
 }
Exemplo n.º 10
0
 public void OnLoadModel()
 {
     ActiveModel        = ActiveModel.Open(ActiveModelPath);
     ActiveModelChanged = false;
 }
Exemplo n.º 11
0
 private void MouseLeftButtonDownHandler(object sender, MouseButtonEventArgs e)
 {
     if (ActiveModel != null)
     {
         PluginChangedEventArgs args = new PluginChangedEventArgs(ActiveModel.Plugin, ActiveModel.GetName(), DisplayPluginMode.Normal);
         MyEditor.onSelectedPluginChanged(args);
         e.Handled = true;
     }
     return;
 }