public override void Update(double delta)
 {
     if (loading)
     {
         if (loader.Update(delta))
         {
             loading = false;
             loader  = null;
             FinishLoad();
         }
         return;
     }
     session.GameplayUpdate(this);
     if (session.Update())
     {
         return;
     }
     if (ShowHud && (Thn == null || !Thn.Running))
     {
         ui.Update(Game);
     }
     if (ui.KeyboardGrabbed)
     {
         Game.EnableTextInput();
     }
     else
     {
         Game.DisableTextInput();
     }
     world.Update(paused ? 0 : delta);
     if (Thn != null && Thn.Running)
     {
         sysrender.Camera = Thn.CameraHandle;
     }
     else
     {
         sysrender.Camera = camera;
     }
     if (frameCount < 2)
     {
         frameCount++;
         if (frameCount == 2)
         {
             session.BeginUpdateProcess();
         }
     }
     else
     {
         if (session.Popups.Count > 0 && session.Popups.TryDequeue(out var popup))
         {
             FLLog.Debug("Space", "Displaying popup");
             if (!session.Multiplayer)
             {
                 paused = true;
             }
             session.Pause();
             ui.Event("Popup", popup.Title, popup.Contents, popup.ID);
         }
     }
 }
Exemple #2
0
 public override void Update(TimeSpan delta)
 {
     if (loading)
     {
         if (loader.Update(delta))
         {
             loading = false;
             loader  = null;
             FinishLoad();
         }
         return;
     }
     session.GameplayUpdate(this);
     if (session.Update())
     {
         return;
     }
     if (ShowHud && (Thn == null || !Thn.Running))
     {
         ui.Update(Game);
     }
     if (ui.KeyboardGrabbed)
     {
         Game.EnableTextInput();
     }
     else
     {
         Game.DisableTextInput();
     }
     if (Thn != null && Thn.Running)
     {
         Thn.Update(delta);
         sysrender.Camera = Thn.CameraHandle;
     }
     else
     {
         sysrender.Camera = camera;
     }
     world.Update(delta);
 }