private void StartGame() { int lastRebuyRound = Int32.Parse(settings[Settings.Default.IniSection]["LastRebuyRound"]); tmrPokerTimer.Enabled = true; btnStart.Text = "Pause"; currentGameData.State = State.TimeRunning; btnAddPlayer.Enabled = false; settingsToolStripMenuItem.Enabled = false; 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); } if (lastRebuyRound == 0) { PlayerControlArray.DisableRebuyButtons(); } else { PlayerControlArray.EnableRebuyButtons(); } }
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 SetRoundToolStripMenuItem_Click(object sender, EventArgs e) { DialogResult result; int lastRebuyRound = Int32.Parse(settings[Settings.Default.IniSection]["LastRebuyRound"]); do { result = InputBox.ShowDialog("Enter Round\n(min: 1, max: " + settings[Settings.Default.IniSection]["MaximumRounds"] + ", no decimals)", "Enter Round", InputBox.Buttons.OkCancel, InputBox.Type.TextBox, null, false, new Font("Arial", 10F, FontStyle.Bold)); } while ((!int.TryParse(InputBox.ResultValue, out int val) || Convert.ToInt32(InputBox.ResultValue) == 0 || Convert.ToInt32(InputBox.ResultValue) > Int32.Parse(settings[Settings.Default.IniSection]["MaximumRounds"])) && result != DialogResult.Cancel); if (result == DialogResult.OK && InputBox.ResultValue.Length != 0) { currentGameData.Round = Convert.ToInt32(InputBox.ResultValue); if (currentGameData.Round < lastRebuyRound) { lblNoRebuys.Text = "No rebuys after this round!"; lblNoRebuys.Visible = false; } else if (currentGameData.Round == lastRebuyRound) { lblNoRebuys.Visible = true; lblNoRebuys.Text = "No rebuys after this round!"; Fonts.ResizeFont(lblNoRebuys); } else if (currentGameData.Round > lastRebuyRound) { lblNoRebuys.Text = "No rebuys!!!!"; lblNoRebuys.Visible = true; Fonts.ResizeFont(lblNoRebuys); } UpdateDataControls(currentGameData); } fonts.ResizeAllFonts(); }