Example #1
0
 public override void Update(TimeSpan delta)
 {
     //Don't want the big lag at the start
     if (frames == 0)
     {
         frames = 1;
         return;
     }
     scene.Update(delta);
     manager.Update(delta);
     lastTag = null;
 }
Example #2
0
 public override void Update(TimeSpan delta)
 {
     //Don't want the big lag at the start
     if (frames == 0)
     {
         frames = 1;
         return;
     }
     scene.Update(delta);
     manager.Update(delta);
     if (lastTag == "gameplay")
     {
         manager.PlaySound("ui_motion_swish");
         manager.FlyOutAll(FLYIN_LENGTH, 0.05);
         manager.AnimationComplete += () =>
         {
             manager.Dispose();
             Game.ChangeState(new SpaceGameplay(Game, new GameSession(Game)));
         };
     }
     if (lastTag == "multiplayer")
     {
         ConstructLanInternetDialog();                 //Don't bother with ESRB notice just skip to LAN/INTERNET
     }
     if (lastTag == "dlg_cancel")
     {
         manager.Dialog = null;
     }
     if (lastTag == "system")
     {
         manager.PlaySound("ui_motion_swish");
         manager.FlyOutAll(FLYIN_LENGTH, 0.05);
         manager.AnimationComplete += () =>
         {
             manager.Dispose();
             Game.ChangeState(new DemoSystemView(Game));
         };
     }
     if (lastTag == "options")
     {
         manager.PlaySound("ui_motion_swish");
         manager.FlyOutAll(FLYIN_LENGTH, 0.05);
         manager.AnimationComplete += ConstructOptions;
     }
     if (lastTag == "opt_mainmenu")
     {
         manager.PlaySound("ui_motion_swish");
         manager.FlyOutAll(FLYIN_LENGTH, 0.05);
         manager.AnimationComplete += ConstructMainMenu;
     }
     if (lastTag == "srvlst_refresh")
     {
         connectButton.Tag = null;
         serverList.Servers.Clear();
         netClient.DiscoverLocalPeers();
         if (internetServers)
         {
             netClient.DiscoverGlobalPeers();
         }
     }
     if (lastTag == "srvlst_connect")
     {
         netClient.Connect(selectedInfo.EndPoint);
     }
     if (lastTag == "srvlst_mainmenu")
     {
         netClient.Disconnected -= ServerList_Disconnected;
         netClient.Dispose();
         netClient = null;
         manager.PlaySound("ui_motion_swish");
         manager.FlyOutAll(FLYIN_LENGTH, 0.05);
         manager.AnimationComplete += ConstructMainMenu;
     }
     if (lastTag == "csel_mainmenu")
     {
         netClient.Disconnected -= CharSelect_Disconnected;
         netClient.Dispose();
         netClient = null;
         manager.PlaySound("ui_motion_swish");
         manager.FlyOutAll(FLYIN_LENGTH, 0.05);
         manager.AnimationComplete += ConstructMainMenu;
     }
     if (lastTag == "csel_servlist")
     {
         netClient.Disconnected -= CharSelect_Disconnected;
         netClient.Stop();
         netClient.Start();
         manager.PlaySound("ui_motion_swish");
         manager.FlyOutAll(FLYIN_LENGTH, 0.05);
         manager.AnimationComplete += ConstructServerList;
     }
     if (lastTag == "exit")
     {
         manager.PlaySound("ui_motion_swish");
         manager.FlyOutAll(FLYIN_LENGTH, 0.05);
         manager.AnimationComplete += () =>
         {
             manager.Dispose();
             if (netClient != null)
             {
                 netClient.Dispose();
             }
             Game.Exit();
         };
     }
     lastTag = null;
 }