From 3467ace8b08b346fd31e504d1b685c64cb134bef Mon Sep 17 00:00:00 2001 From: dexy Date: Mon, 8 Nov 2021 01:13:52 +1100 Subject: [PATCH] Cleaned up changes to WorldForm from PR79 --- CodeWalker/WorldForm.cs | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/CodeWalker/WorldForm.cs b/CodeWalker/WorldForm.cs index 6e91b15..dc9d1f6 100644 --- a/CodeWalker/WorldForm.cs +++ b/CodeWalker/WorldForm.cs @@ -4618,15 +4618,16 @@ namespace CodeWalker SnapGridSizeUpDown.Value = (decimal)s.SnapGridSize; SetRotationSnapping(s.SnapRotationDegrees); TimeOfDayTrackBar.Value = s.TimeOfDay; - setTime(s.TimeOfDay); LODLightsCheckBox.Checked = s.LODLights; WeatherComboBox.SelectedIndex = Math.Max(WeatherComboBox.FindString(s.Weather), 0); - Renderer.SetWeatherType(s.Weather); WeatherRegionComboBox.SelectedIndex = Math.Max(WeatherRegionComboBox.FindString(s.Region), 0); Renderer.individualcloudfrag = s.Clouds; NaturalAmbientLightCheckBox.Checked = s.NatrualAmbientLight; ArtificialAmbientLightCheckBox.Checked = s.ArtificialAmbientLight; + SetTimeOfDay(s.TimeOfDay); + Renderer.SetWeatherType(s.Weather); + EnableModsCheckBox.Checked = s.EnableMods; DlcLevelComboBox.Text = s.DLC; @@ -5782,6 +5783,17 @@ namespace CodeWalker + private void SetTimeOfDay(int minute) + { + float hour = minute / 60.0f; + UpdateTimeOfDayLabel(); + lock (Renderer.RenderSyncRoot) + { + Renderer.SetTimeOfDay(hour); + } + } + + @@ -7009,17 +7021,7 @@ namespace CodeWalker private void TimeOfDayTrackBar_Scroll(object sender, EventArgs e) { - setTime(TimeOfDayTrackBar.Value); - } - - private void setTime(int time) - { - float hour = time / 60.0f; - UpdateTimeOfDayLabel(); - lock (Renderer.RenderSyncRoot) - { - Renderer.SetTimeOfDay(hour); - } + SetTimeOfDay(TimeOfDayTrackBar.Value); } private void WeatherComboBox_SelectedIndexChanged(object sender, EventArgs e)