Exemplo n.º 1
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);
        }