Cleaned up changes to WorldForm from PR79

This commit is contained in:
dexy 2021-11-08 01:13:52 +11:00
parent 76fd33d254
commit 3467ace8b0

View File

@ -4618,15 +4618,16 @@ namespace CodeWalker
SnapGridSizeUpDown.Value = (decimal)s.SnapGridSize; SnapGridSizeUpDown.Value = (decimal)s.SnapGridSize;
SetRotationSnapping(s.SnapRotationDegrees); SetRotationSnapping(s.SnapRotationDegrees);
TimeOfDayTrackBar.Value = s.TimeOfDay; TimeOfDayTrackBar.Value = s.TimeOfDay;
setTime(s.TimeOfDay);
LODLightsCheckBox.Checked = s.LODLights; LODLightsCheckBox.Checked = s.LODLights;
WeatherComboBox.SelectedIndex = Math.Max(WeatherComboBox.FindString(s.Weather), 0); WeatherComboBox.SelectedIndex = Math.Max(WeatherComboBox.FindString(s.Weather), 0);
Renderer.SetWeatherType(s.Weather);
WeatherRegionComboBox.SelectedIndex = Math.Max(WeatherRegionComboBox.FindString(s.Region), 0); WeatherRegionComboBox.SelectedIndex = Math.Max(WeatherRegionComboBox.FindString(s.Region), 0);
Renderer.individualcloudfrag = s.Clouds; Renderer.individualcloudfrag = s.Clouds;
NaturalAmbientLightCheckBox.Checked = s.NatrualAmbientLight; NaturalAmbientLightCheckBox.Checked = s.NatrualAmbientLight;
ArtificialAmbientLightCheckBox.Checked = s.ArtificialAmbientLight; ArtificialAmbientLightCheckBox.Checked = s.ArtificialAmbientLight;
SetTimeOfDay(s.TimeOfDay);
Renderer.SetWeatherType(s.Weather);
EnableModsCheckBox.Checked = s.EnableMods; EnableModsCheckBox.Checked = s.EnableMods;
DlcLevelComboBox.Text = s.DLC; 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) private void TimeOfDayTrackBar_Scroll(object sender, EventArgs e)
{ {
setTime(TimeOfDayTrackBar.Value); SetTimeOfDay(TimeOfDayTrackBar.Value);
}
private void setTime(int time)
{
float hour = time / 60.0f;
UpdateTimeOfDayLabel();
lock (Renderer.RenderSyncRoot)
{
Renderer.SetTimeOfDay(hour);
}
} }
private void WeatherComboBox_SelectedIndexChanged(object sender, EventArgs e) private void WeatherComboBox_SelectedIndexChanged(object sender, EventArgs e)