Add more ability to save more options

This commit is contained in:
Yoda 2020-05-24 18:03:15 +02:00
parent 6f1d148875
commit 682f0cfa1e
3 changed files with 132 additions and 8 deletions

View File

@ -43,6 +43,27 @@
<setting name="Skydome" serializeAs="String">
<value>True</value>
</setting>
<setting name="TimeOfDay" serializeAs="String">
<value>720</value>
</setting>
<setting name="LODLights" serializeAs="String">
<value>True</value>
</setting>
<setting name="Region" serializeAs="String">
<value>Global</value>
</setting>
<setting name="Clouds" serializeAs="String">
<value>contrails</value>
</setting>
<setting name="Weather" serializeAs="String">
<value>True</value>
</setting>
<setting name="NatrualAmbientLight" serializeAs="String">
<value>True</value>
</setting>
<setting name="ArtificialAmbientLight" serializeAs="String">
<value>True</value>
</setting>
<setting name="ShowTimedEntities" serializeAs="String">
<value>True</value>
</setting>

View File

@ -142,7 +142,7 @@ namespace CodeWalker.Properties {
this["Wireframe"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
@ -154,7 +154,43 @@ namespace CodeWalker.Properties {
this["Skydome"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool LODLights {
get {
return ((bool)(this["LODLights"]));
}
set {
this["LODLights"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool NatrualAmbientLight {
get {
return ((bool)(this["NatrualAmbientLight"]));
}
set {
this["NatrualAmbientLight"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool ArtificialAmbientLight {
get {
return ((bool)(this["ArtificialAmbientLight"]));
}
set {
this["ArtificialAmbientLight"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
@ -490,7 +526,55 @@ namespace CodeWalker.Properties {
this["RenderMode"] = value;
}
}
[global::System.Configuration.UserScopedSetting()]
[global::System.Diagnostics.DebuggerNonUserCode()]
[global::System.Configuration.DefaultSettingValue("EXTRASUNNY")]
public string Weather {
get {
return ((string)(this["Weather"]));
}
set {
this["Weather"] = value;
}
}
[global::System.Configuration.UserScopedSetting()]
[global::System.Diagnostics.DebuggerNonUserCode()]
[global::System.Configuration.DefaultSettingValue("GLOBAL")]
public string Region {
get {
return ((string)(this["Region"]));
}
set {
this["Region"] = value;
}
}
[global::System.Configuration.UserScopedSetting()]
[global::System.Diagnostics.DebuggerNonUserCode()]
[global::System.Configuration.DefaultSettingValue("contrails")]
public string Clouds {
get {
return ((string)(this["Clouds"]));
}
set {
this["Clouds"] = value;
}
}
[global::System.Configuration.UserScopedSetting()]
[global::System.Diagnostics.DebuggerNonUserCode()]
[global::System.Configuration.DefaultSettingValue("720")]
public int TimeOfDay {
get {
return ((int)(this["TimeOfDay"]));
}
set {
this["TimeOfDay"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("DiffuseSampler")]

View File

@ -4184,8 +4184,8 @@ namespace CodeWalker
{
WeatherComboBox.Items.Add(wt);
}
WeatherComboBox.SelectedIndex = 0;
WeatherRegionComboBox.SelectedIndex = 0;
WeatherComboBox.SelectedIndex = Math.Max(WeatherComboBox.FindString(Settings.Default.Weather), 0);
WeatherRegionComboBox.SelectedIndex = Math.Max(WeatherRegionComboBox.FindString(Settings.Default.Region), 0);
}
}
catch { }
@ -4497,6 +4497,15 @@ namespace CodeWalker
StatusBarCheckBox.Checked = s.ShowStatusBar;
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;
EnableModsCheckBox.Checked = s.EnableMods;
@ -4535,7 +4544,13 @@ namespace CodeWalker
s.ShowStatusBar = StatusBarCheckBox.Checked;
s.SnapRotationDegrees = (float)SnapAngleUpDown.Value;
s.SnapGridSize = (float)SnapGridSizeUpDown.Value;
s.TimeOfDay = TimeOfDayTrackBar.Value;
s.LODLights = LODLightsCheckBox.Checked;
s.Weather = WeatherComboBox.Text;
s.NatrualAmbientLight = NaturalAmbientLightCheckBox.Checked;
s.ArtificialAmbientLight = ArtificialAmbientLightCheckBox.Checked;
s.Region = WeatherRegionComboBox.Text;
s.Clouds = CloudsComboBox.Text;
//additional settings from gamefilecache...
s.EnableMods = gameFileCache.EnableMods;
@ -6825,8 +6840,12 @@ namespace CodeWalker
private void TimeOfDayTrackBar_Scroll(object sender, EventArgs e)
{
int v = TimeOfDayTrackBar.Value;
float hour = v / 60.0f;
setTime(TimeOfDayTrackBar.Value);
}
private void setTime(int time)
{
float hour = time / 60.0f;
UpdateTimeOfDayLabel();
lock (Renderer.RenderSyncRoot)
{