Exemplo n.º 1
0
        public EndGameMenu(Game1 game, AssetManager assetManager)
            : base(game, assetManager)
        {
            _lblHeader.Text = "Match Over!";
            _lblList        = new List <label>();


            for (int i = 0; i < 8; i++)
            {
                _lblList.Add(new label(assetManager.FontLib["SegoeUI"]));
            }

            foreach (label lbl in _lblList)
            {
                lbl.isClickable = false;
                lbl.Text        = "";
            }

            // May wish to make this IEnumerable....
            _lblList[0].TextColor   = Color.Sienna;
            _lblList[0].Position    = new Point(250, 100);
            _lblList[0].isClickable = false;
            _lblList[1].Text        = "has won the match!";
            _lblList[1].Position    = new Point(_lblList[0].Position.X + 100, _lblList[0].Position.Y);
            _lblList[1].isClickable = false;

            _listBox = new Listbox(assetManager, 650, 500);
            _listBox.Add("EXIT");
        }
Exemplo n.º 2
0
        private void getMapList()
        {
            DirectoryInfo dirInfo = new DirectoryInfo("Content\\Levels\\");

            if (Directory.Exists(dirInfo.FullName))
            {
                foreach (FileInfo file in dirInfo.GetFiles())
                {
                    string[] splitName = file.Name.Split('.');
                    listBoxMap.Add(splitName[0]);
                }
            }

            listBoxMatch.Add("DeathMatch");
            listBoxMatch.Add("Team Deathmatch");
            listBoxMatch.Add("Capture The Flag");
        }
Exemplo n.º 3
0
        private void doEventsJoinScreen(Game1 Game, SessionManager sessionManager)
        {
            if (canClick())
            {
                setJoinScreen();
            }

            m_sleepCounter = m_delay;

            if (!m_searchDone)
            {
                sessionManager.doSessionSearch();

                if (sessionManager.SessionList.Count > 0)
                {
                    foreach (AvailableNetworkSession session in sessionManager.SessionList)
                    {
                        listBoxSession.Add(session.HostGamertag);
                    }
                }

                else
                {
                    Console.WriteLine("No Sessions Could be Found");
                    _state = MenuState.TitleScreen;
                }
                m_searchDone = true;
            }

            if (btnJoin.Clicked && (listBoxSession.SelectedItem != null))
            {
                foreach (AvailableNetworkSession session in sessionManager.SessionList)
                {
                    if (session.HostGamertag == listBoxSession.SelectedItem.Text)
                    {
                        sessionManager.JoinSession(session);
                    }

                    m_launch = true;
                }
            }
        }