public void StartNextRound() { int seconds; bool timeIsPerPlayer = Convert.ToBoolean(settings[Settings.Default.IniSection]["TimeIsPerPlayer"]); int secondsPerRound = Int32.Parse(settings[Settings.Default.IniSection]["SecondsPerRound"]); //int secondsPerPlayer = Int32.Parse(settings[Settings.Default.IniSection]["SecondsPerPlayer"]); //int maxSecondsPerRound = Int32.Parse(settings[Settings.Default.IniSection]["MaxSecondsPerRound"]); int lastRebuyRound = Int32.Parse(settings[Settings.Default.IniSection]["LastRebuyRound"]); //if (timeIsPerPlayer) //{ // seconds = secondsPerPlayer; //} //else //{ // seconds = secondsPerRound; //} currentGameData.NextRound(); currentGameData.ResetTime(); if (currentGameData.Round == lastRebuyRound) { lblNoRebuys.Visible = true; lblNoRebuys.Text = "No rebuys after this round!"; Fonts.ResizeFont(lblNoRebuys); } else if (currentGameData.Round > lastRebuyRound) { lblNoRebuys.Visible = true; lblNoRebuys.Text = "No rebuys!!!!"; Fonts.ResizeFont(lblNoRebuys); } lblRound.Text = "Round " + currentGameData.Round; lblBlinds.Text = currentGameData.GetBlinds(); lblNextBlinds.Text = currentGameData.GetNextBlinds(); lblTime.ForeColor = Color.White; lblTime.Text = currentGameData.GetMinutes().ToString("D2") + ":" + currentGameData.GetSeconds().ToString("D2"); tmrPokerTimer.Enabled = true; //Reset sound counter timerAtZeroCount = 0; currentGameData.State = State.TimeRunning; btnStart.Text = "Pause"; fonts.ResizeAllFonts(); }
private void BtnSettingsApply_Click(object sender, EventArgs e, TableLayoutPanelArray playerControlArray, CurrentGameData currentGameData) { int roundLengthInMinutes = Int32.Parse(nudRoundLength.Text); int maxRoundLengthInMinutes = Int32.Parse(nudMaxRoundLength.Text); // Set round time and round type settings if (rbPerPlayer.Checked) { settings[Settings.Default.IniSection]["SecondsPerPlayer"] = (roundLengthInMinutes * 60).ToString(); settings[Settings.Default.IniSection]["MaxSecondsPerRound"] = (maxRoundLengthInMinutes * 60).ToString(); settings[Settings.Default.IniSection]["TimeIsPerPlayer"] = true.ToString(); } else if (rbPerRound.Checked) { settings[Settings.Default.IniSection]["SecondsPerRound"] = (roundLengthInMinutes * 60).ToString(); settings[Settings.Default.IniSection]["TimeIsPerPlayer"] = false.ToString(); } if (Equals(settings[Settings.Default.IniSection]["Bounties"], "0")) { HideBountyColumn(_header, playerControlArray); } else { ShowBountyColumn(_header, playerControlArray); } // Save starting chips settings[Settings.Default.IniSection]["StartingChips"] = nudStartingChips.Value.ToString(); // Save rebuy info settings[Settings.Default.IniSection]["BuyinCost"] = nudBuyinCost.Value.ToString(); settings[Settings.Default.IniSection]["LastRebuyRound"] = nudLastRebuyRound.Value.ToString(); currentGameData.ChangeBlindsSchedule(Int32.Parse(settings[Settings.Default.IniSection]["Blinds"])); // Save Results Folder settings[Settings.Default.IniSection]["ResultsFolder"] = tbSaveFolder.Text; fonts.ResizeAllFonts(); //Properties.Settings.Default.Save(); // Saves settings in application configuration file fileIniData.WriteFile(Settings.Default.IniFile, settings); // Activate main form in order to update displayed data // main form updates dispalyed data on activate Application.OpenForms["frmMain"].Activate(); }
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(); }