Esempio n. 1
0
 public void UpdateSelectedTeam()
 {
     if (GameMode.IsActive && GameMode.ActiveMode is TDMMode)
     {
         int index = (int)PlayerInfo.HeroInfo.TeamID;
         if (index >= 0)
         {
             if (Cast.Try(items[index], out MainMenuButton button))
             {
                 arrow.SetPosY(button.VPos.Y + GUCView.PixelToVirtualY(5), true);
                 arrow.SetPosX(button.VPos.X - GUCView.PixelToVirtualX(25), true);
                 arrow.Show();
                 return;
             }
         }
     }
     arrow.Hide();
 }
Esempio n. 2
0
 public void UpdateSelectedTeam()
 {
     if (TeamMode.ActiveTODef != null)
     {
         var team  = TeamMode.TeamDef;
         int index = TeamMode.ActiveTODef.Teams.IndexOf(team);
         if (team != null && index >= 0)
         {
             if (Cast.Try(items[index], out MainMenuButton button))
             {
                 arrow.SetPosY(button.VPos.Y + GUCView.PixelToVirtualY(5), true);
                 arrow.SetPosX(button.VPos.X - GUCView.PixelToVirtualX(25), true);
                 arrow.Show();
                 return;
             }
         }
     }
     arrow.Hide();
 }
Esempio n. 3
0
        static bool ShowConnectionAttempts()
        {
            if (GameClient.IsDisconnected)
            {
                return(true);
            }

            if (!GameClient.IsConnected)
            {
                if (!GameClient.IsConnecting)
                {
                    GameClient.Connect();
                }

                if (connectionVis == null)
                {
                    connectionVis = new GUCVisual();
                    connectionVis.SetBackTexture("MENU_CHOICE_BACK.TGA");
                    var text = connectionVis.CreateText("");
                }
                var screenSize = GUCView.GetScreenSize();
                connectionVis.SetPosX(screenSize.X / 2 - 200);
                connectionVis.SetPosY(200);
                connectionVis.SetHeight(40);
                connectionVis.SetWidth(400);
                connectionVis.Texts[0].Text = string.Format("Connecting to '{0}:{1}' ... ({2})", Program.ServerIP, Program.ServerPort, GameClient.ConnectionAttempts);
                connectionVis.Show();
                return(true);
            }

            if (connectionVis != null)
            {
                connectionVis.Hide();
            }
            return(!GameClient.IsConnected);
        }