// Simple 10 Minute clock method private void CashoutTimer_Tick(object sender, EventArgs e) { if (SecondsLeft == 0) { MinutesLeft--; SecondsLeft = 59; } else { SecondsLeft--; } if (SecondsLeft < 10) { CashoutTimerLabel.Text = MinutesLeft + ":0" + SecondsLeft; } else { CashoutTimerLabel.Text = MinutesLeft + ":" + SecondsLeft; } if (MinutesLeft != 0 || SecondsLeft != 0) { return; } CashoutTimer.Stop(); InvestmentTimer.Stop(); VerifyTextBox.Enabled = false; CashoutButton.Visible = true; }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void IncomeDoubleButton_Click(object sender, EventArgs e) { if (_wallet.Balance < 5) { return; } _upgradeCount++; _wallet.Balance -= 5; ResourceLabel.Text = _wallet.Balance.ToString(CultureInfo.InvariantCulture); _incomeDoubled = true; IncomeDoubleButton.Enabled = false; AutoGenerateButton.Text = "Doubles Manual Income\r\n\r\nPurchased!"; InvestmentTimer.Start(); MessageBox.Show("Investment Successful."); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AutoGenerateButton_Click(object sender, EventArgs e) { if (_wallet.Balance < 2) { return; } _upgradeCount++; _wallet.Balance -= 2; ResourceLabel.Text = _wallet.Balance.ToString(CultureInfo.InvariantCulture); AutoGenerateButton.Enabled = false; AutoGenerateButton.Text = "Generate 1 Code Every 5 Seconds\r\n\r\nPurchased!"; InvestmentTimer.Start(); _investmentBought = true; MessageBox.Show("Investment Successful."); }