Ejemplo n.º 1
0
        public FrmMain()
        {
            InitializeComponent();

            InitializeINI();
            currentGameData = new CurrentGameData();

            // Create control array for player screen (name, rebuys, rebuy button, remove button)
            PlayerControlArray = new TableLayoutPanelArray(pnlPlayers, this);

            // Create settings form
            frmSettings = new SettingsForm(this, tlpHeaders, PlayerControlArray, currentGameData);

            fonts = new Fonts(this);

            // Add default player names
            List <string> startingPlayers = settings[Settings.Default.IniSection]["StartingPlayerNames"].Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries).ToList();

            foreach (string s in startingPlayers)
            {
                currentGameData.players.Add(new PlayerData(s));
                PlayerControlArray.AddNewPanel(tlpHeaders, currentGameData);
            }

            // Refresh data with new info
            UpdateCurrentGameData(startingPlayers.Count);
            UpdateDataControls(currentGameData);

            fonts.ResizeAllFonts();

            pnlMainScreen.BringToFront();

            // Disable players panel since we start on main screen
            pnlPlayers.Enabled = false;

            // Disable rebuy buttons untill game has started
            PlayerControlArray.DisableRebuyButtons();
        }