Exemple #1
0
        private void AddPlayerButtonClick(object sender, EventArgs e)
        {
            //ListBox characterList = new ListBox();
            //AvailableCharacters.Sort(); // todo override character comparator to be able to sort.
            //characterList.Items.AddRange(AvailableCharacters.ToArray());
            PlayerRosterForm newPlayerForm = new PlayerRosterForm(Program.GManager.CharacterList);

            if (newPlayerForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                IList<Player> newPlayers = newPlayerForm.Players;
                if (characterListBox.Enabled == false)
                {
                    characterListBox.Enabled = true;
                    characterListBox.Items.Clear();
                }
                foreach (Player p in newPlayers)
                {
                    characterListBox.Items.Add(p);
                    AvailableCharacters.Remove(p.Character);
                }
                if (!_gameStarted)
                {
                    if (characterListBox.Items.Count > 0)
                        RemovePlayerButton.Enabled = true;
                    else if (characterListBox.Items.Count == 0)
                        RemovePlayerButton.Enabled = false;
                    if (characterListBox.Items.Count >= 3)
                        beginGameButton.Enabled = true;
                }
            }
        }
Exemple #2
0
        private void ItmNewGameClick(object sender, EventArgs e)
        {
            var characters = Program.GManager.CharacterList;
            var rosterForm = new PlayerRosterForm(characters);

            rosterForm.ShowDialog();
            if (rosterForm.DialogResult == DialogResult.OK)
            {
            }

            /*_gameStarted = true;
             *
             *
             *
             * addPlayerButton.Enabled = false;
             * RemovePlayerButton.Enabled = false;
             * beginGameButton.Enabled = false;
             * beginGameButton.Visible = false;
             * this.TitlesPanel.Location = new System.Drawing.Point(263, 92);
             * this.PlayerLoyaltyHandPanel.Visible = true;
             * var players = characterListBox.Items.Cast<Player>().ToList();
             *
             * GameState gs = Program.GManager.NewGame(players, 0, false);
             * enableControls();*/
        }
Exemple #3
0
        private void NewGameStripMenuItemClick(object sender, EventArgs e)
        {
            var characters = Program.GManager.CharacterList;
            var rosterForm = new PlayerRosterForm(characters);
            rosterForm.ShowDialog();
            if (rosterForm.DialogResult != DialogResult.OK)
                return;
            
            var optionalRulesForm = new OptionalRulesForm();
            optionalRulesForm.ShowDialog();
            if (optionalRulesForm.DialogResult != DialogResult.OK)
                return;

            var firstPlayerDrawIndex = 0;

            var currentPlayer = rosterForm.Players.First();
            if (currentPlayer.Character.DefaultDrawColors.Count > 0)
            {
                var drawForm = new SelectDrawForm(currentPlayer.Character.DefaultDrawColors);
                drawForm.ShowDialog();

                if (drawForm.DialogResult == DialogResult.OK && drawForm.SelectedSkillCardDrawIndex.HasValue)
                    firstPlayerDrawIndex = drawForm.SelectedSkillCardDrawIndex.Value;
            }
            Program.GManager.NewGame(rosterForm.Players, optionalRulesForm.ExtraLoyaltyCards, optionalRulesForm.UsingSympathizer, firstPlayerDrawIndex);

            PlayerReadonlyListBox.BeginUpdate();
            PlayerReadonlyListBox.DataSource = Program.GManager.CurrentGameState.Players;
            PlayerReadonlyListBox.SelectedIndex = 0;
            PlayerReadonlyListBox.EndUpdate();
            
            FoodUpDown.Value = Program.GManager.CurrentGameState.Food;
            FuelUpDown.Value = Program.GManager.CurrentGameState.Fuel;
            MoraleUpDown.Value = Program.GManager.CurrentGameState.Morale;
            PopUpDown.Value = Program.GManager.CurrentGameState.Population;

            managePlayerToolStripMenuItem.DropDownItems.Clear();
            ShowHandMenuItem.DropDownItems.Clear();
            foreach (var player in Program.GManager.CurrentGameState.Players)
            {
                var newMenuItem = new ToolStripMenuItem(player.PlayerName, null, ManagePlayerMenuItemClick);
                var showHandItem = new ToolStripMenuItem(player.PlayerName, null, ShowHandMenuItemClick);
                managePlayerToolStripMenuItem.DropDownItems.Add(newMenuItem);
                ShowHandMenuItem.DropDownItems.Add(showHandItem);
            }

            RefreshGameDataBoxes();

            JumpPrepChanged(sender, e);
        }
Exemple #4
0
        private void AddPlayerButtonClick(object sender, EventArgs e)
        {
            //ListBox characterList = new ListBox();
            //AvailableCharacters.Sort(); // todo override character comparator to be able to sort.
            //characterList.Items.AddRange(AvailableCharacters.ToArray());
            PlayerRosterForm newPlayerForm = new PlayerRosterForm(Program.GManager.CharacterList);

            if (newPlayerForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                IList <Player> newPlayers = newPlayerForm.Players;
                if (characterListBox.Enabled == false)
                {
                    characterListBox.Enabled = true;
                    characterListBox.Items.Clear();
                }
                foreach (Player p in newPlayers)
                {
                    characterListBox.Items.Add(p);
                    AvailableCharacters.Remove(p.Character);
                }
                if (!_gameStarted)
                {
                    if (characterListBox.Items.Count > 0)
                    {
                        RemovePlayerButton.Enabled = true;
                    }
                    else if (characterListBox.Items.Count == 0)
                    {
                        RemovePlayerButton.Enabled = false;
                    }
                    if (characterListBox.Items.Count >= 3)
                    {
                        beginGameButton.Enabled = true;
                    }
                }
            }
        }
Exemple #5
0
        private void NewGameStripMenuItemClick(object sender, EventArgs e)
        {
            var characters = Program.GManager.CharacterList;
            var rosterForm = new PlayerRosterForm(characters);

            rosterForm.ShowDialog();
            if (rosterForm.DialogResult != DialogResult.OK)
            {
                return;
            }

            var optionalRulesForm = new OptionalRulesForm();

            optionalRulesForm.ShowDialog();
            if (optionalRulesForm.DialogResult != DialogResult.OK)
            {
                return;
            }

            var firstPlayerDrawIndex = 0;

            var currentPlayer = rosterForm.Players.First();

            if (currentPlayer.Character.DefaultDrawColors.Count > 0)
            {
                var drawForm = new SelectDrawForm(currentPlayer.Character.DefaultDrawColors);
                drawForm.ShowDialog();

                if (drawForm.DialogResult == DialogResult.OK && drawForm.SelectedSkillCardDrawIndex.HasValue)
                {
                    firstPlayerDrawIndex = drawForm.SelectedSkillCardDrawIndex.Value;
                }
            }
            Program.GManager.NewGame(rosterForm.Players, optionalRulesForm.ExtraLoyaltyCards, optionalRulesForm.UsingSympathizer, firstPlayerDrawIndex);

            PlayerReadonlyListBox.BeginUpdate();
            PlayerReadonlyListBox.DataSource    = Program.GManager.CurrentGameState.Players;
            PlayerReadonlyListBox.SelectedIndex = 0;
            PlayerReadonlyListBox.EndUpdate();

            FoodUpDown.Value   = Program.GManager.CurrentGameState.Food;
            FuelUpDown.Value   = Program.GManager.CurrentGameState.Fuel;
            MoraleUpDown.Value = Program.GManager.CurrentGameState.Morale;
            PopUpDown.Value    = Program.GManager.CurrentGameState.Population;

            managePlayerToolStripMenuItem.DropDownItems.Clear();
            ShowHandMenuItem.DropDownItems.Clear();
            foreach (var player in Program.GManager.CurrentGameState.Players)
            {
                var newMenuItem  = new ToolStripMenuItem(player.PlayerName, null, ManagePlayerMenuItemClick);
                var showHandItem = new ToolStripMenuItem(player.PlayerName, null, ShowHandMenuItemClick);
                managePlayerToolStripMenuItem.DropDownItems.Add(newMenuItem);
                ShowHandMenuItem.DropDownItems.Add(showHandItem);
            }

            foreach (var boardSkillCheck in Program.GManager.CurrentGameState.BoardSkillChecks.Deck)
            {
                playBoardSkillCheckToolStripMenuItem.DropDownItems.Add(boardSkillCheck.Heading, null, PlayBoardSkillCheck);
            }

            RefreshGameDataBoxes();

            JumpPrepChanged(sender, e);
        }
Exemple #6
0
        private void ItmNewGameClick(object sender, EventArgs e)
        {
            var characters = Program.GManager.CharacterList;
            var rosterForm = new PlayerRosterForm(characters);
            rosterForm.ShowDialog();
            if (rosterForm.DialogResult == DialogResult.OK)
            {

            }

            /*_gameStarted = true;



            addPlayerButton.Enabled = false;
            RemovePlayerButton.Enabled = false;
            beginGameButton.Enabled = false;
            beginGameButton.Visible = false;
            this.TitlesPanel.Location = new System.Drawing.Point(263, 92);
            this.PlayerLoyaltyHandPanel.Visible = true;
            var players = characterListBox.Items.Cast<Player>().ToList();

            GameState gs = Program.GManager.NewGame(players, 0, false);
            enableControls();*/
        }