コード例 #1
0
 private void IsNightTime_CheckedChanged(object sender, EventArgs e)
 {
     if (IsNightTime.Checked)
     {
         maxTimeAll = CalculDayTime.CalculMinOrMaxDay(dayHours, dayMinutes, daySeconds, 0.1f);
         minTimeAll = CalculDayTime.CalculMinOrMaxDay(dayHours, dayMinutes, daySeconds, 64f);
         if (minTime == null)
         {
             minTime = CalculDayTime.GetArrayTime(minTimeAll);
         }
         if (maxTime == null)
         {
             maxTime = CalculDayTime.GetArrayTime(maxTimeAll);
         }
         ChangeLabelMinMaxNight();
         MinMaxNightTime();
     }
     else
     {
         minTimeAll = -1;
         maxTimeAll = -1;
         if (minTime != null)
         {
             minTime = null;
         }
         if (maxTime != null)
         {
             maxTime = null;
         }
     }
 }
コード例 #2
0
 private void MinMaxDayTime()
 {
     if (CalculDayTime.GetTimeInSeconds(dayHours, dayMinutes, daySeconds) < MINALLDAYTIME)
     {
         dayHours.Value   = MINHOURSDAYTIME;
         dayMinutes.Value = MINMINUTESDAYTIME;
         daySeconds.Value = MINSECONDSDAYTIME;
     }
     if (CalculDayTime.GetTimeInSeconds(dayHours, dayMinutes, daySeconds) > MAXALLDAYTIME)
     {
         dayHours.Value   = MAXHOURSDAYTIME;
         dayMinutes.Value = MAXMINUTESDAYTIME;
         daySeconds.Value = MAXSECONDSDAYTIME;
     }
 }
コード例 #3
0
        private void Button1_Click(object sender, EventArgs e)
        {
            string dayMultiplier = CalculDayTime.GetPercent(86400, CalculDayTime.GetTimeInSeconds(dayHours, dayMinutes, daySeconds)).ToString();
            string nightMultiplier;

            dayMultiplier     = dayMultiplier.Replace(',', '.');
            richTextBox1.Text = "serverTimeAcceleration=" + dayMultiplier + "; // Must be in range of 64-0.1";
            if (IsNightTime.Checked)
            {
                nightMultiplier = CalculDayTime.GetPercent(CalculDayTime.GetTimeInSeconds(dayHours, dayMinutes, daySeconds), CalculDayTime.GetTimeInSeconds(nightHours, nightMinutes, nightSeconds)).ToString();
                nightMultiplier = nightMultiplier.Replace(',', '.');
                richTextBox1.AppendText("\nserverNightTimeAcceleration=" + nightMultiplier + "; // Must be in range of 64-0.1");
                richTextBox1.AppendText("\n\n// Careful, if you change Day duration, you need to uncheck and recheck 'Consider night duration', min-max range is not updated by default for night.");
            }
        }