Пример #1
0
        private void numericUpDownCurrentTorpor_ValueChanged(object sender, EventArgs e)
        {
            var duration = new TimeSpan(0, 0, Taming.secondsUntilWakingUp(speciesIndex, (int)nudLevel.Value, (double)numericUpDownCurrentTorpor.Value));

            labelTimeUntilWakingUp.Text = "Time until wake-up: " + Utils.duration(duration);
            if (duration.TotalSeconds < 30)
            {
                labelTimeUntilWakingUp.ForeColor = Color.DarkRed;
            }
            else if (duration.TotalSeconds < 120)
            {
                labelTimeUntilWakingUp.ForeColor = Color.DarkGoldenrod;
            }
            else
            {
                labelTimeUntilWakingUp.ForeColor = Color.Black;
            }
            wakeUpTime = DateTime.Now.Add(duration);
        }
Пример #2
0
        private void numericUpDownCurrentTorpor_ValueChanged(object sender, EventArgs e)
        {
            var duration = new TimeSpan(0, 0, Taming.secondsUntilWakingUp(selectedSpecies, (int)nudLevel.Value, (double)numericUpDownCurrentTorpor.Value));

            lbTimeUntilWakingUp.Text = string.Format(Loc.s("lbTimeUntilWakingUp"), Utils.duration(duration));
            if (duration.TotalSeconds < 30)
            {
                lbTimeUntilWakingUp.ForeColor = Color.DarkRed;
            }
            else if (duration.TotalSeconds < 120)
            {
                lbTimeUntilWakingUp.ForeColor = Color.DarkGoldenrod;
            }
            else
            {
                lbTimeUntilWakingUp.ForeColor = Color.Black;
            }
            wakeUpTime = DateTime.Now.Add(duration);
        }