From a8dc98f87ca4800e6b91e6c88c1ed35470e4ea8c Mon Sep 17 00:00:00 2001 From: dexy Date: Mon, 5 Aug 2024 20:24:59 +1000 Subject: [PATCH] Save startup position and time of day options, Reset settings button --- CodeWalker/App.config | 11 +- CodeWalker/Properties/Settings.Designer.cs | 42 ++++- CodeWalker/Properties/Settings.settings | 11 +- CodeWalker/WorldForm.Designer.cs | 207 ++++++++++----------- CodeWalker/WorldForm.cs | 55 ++++-- CodeWalker/WorldForm.resx | 6 +- 6 files changed, 202 insertions(+), 130 deletions(-) diff --git a/CodeWalker/App.config b/CodeWalker/App.config index de87735..d49a808 100644 --- a/CodeWalker/App.config +++ b/CodeWalker/App.config @@ -220,7 +220,7 @@ EXTRASUNNY - + True @@ -252,6 +252,15 @@ + + 0, 0, 100 + + + True + + + True + diff --git a/CodeWalker/Properties/Settings.Designer.cs b/CodeWalker/Properties/Settings.Designer.cs index 9602c01..3bc08c6 100644 --- a/CodeWalker/Properties/Settings.Designer.cs +++ b/CodeWalker/Properties/Settings.Designer.cs @@ -866,12 +866,12 @@ namespace CodeWalker.Properties { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool NatrualAmbientLight { + public bool NaturalAmbientLight { get { - return ((bool)(this["NatrualAmbientLight"])); + return ((bool)(this["NaturalAmbientLight"])); } set { - this["NatrualAmbientLight"] = value; + this["NaturalAmbientLight"] = value; } } @@ -938,5 +938,41 @@ namespace CodeWalker.Properties { this["ColourPickerRecentColours"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("0, 0, 100")] + public string StartPosition { + get { + return ((string)(this["StartPosition"])); + } + set { + this["StartPosition"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool SavePosition { + get { + return ((bool)(this["SavePosition"])); + } + set { + this["SavePosition"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("True")] + public bool SaveTimeOfDay { + get { + return ((bool)(this["SaveTimeOfDay"])); + } + set { + this["SaveTimeOfDay"] = value; + } + } } } diff --git a/CodeWalker/Properties/Settings.settings b/CodeWalker/Properties/Settings.settings index 312fa92..c344296 100644 --- a/CodeWalker/Properties/Settings.settings +++ b/CodeWalker/Properties/Settings.settings @@ -212,7 +212,7 @@ EXTRASUNNY - + True @@ -243,5 +243,14 @@ + + 0, 0, 100 + + + True + + + True + \ No newline at end of file diff --git a/CodeWalker/WorldForm.Designer.cs b/CodeWalker/WorldForm.Designer.cs index f5d3502..8ab1d5f 100644 --- a/CodeWalker/WorldForm.Designer.cs +++ b/CodeWalker/WorldForm.Designer.cs @@ -44,6 +44,7 @@ namespace CodeWalker this.ToolsPanelExpandButton = new System.Windows.Forms.Button(); this.ToolsTabControl = new System.Windows.Forms.TabControl(); this.ViewTabPage = new System.Windows.Forms.TabPage(); + this.StatusBarCheckBox = new System.Windows.Forms.CheckBox(); this.ViewTabControl = new System.Windows.Forms.TabControl(); this.ViewWorldTabPage = new System.Windows.Forms.TabPage(); this.EnableModsCheckBox = new System.Windows.Forms.CheckBox(); @@ -72,6 +73,7 @@ namespace CodeWalker this.label3 = new System.Windows.Forms.Label(); this.ViewModeComboBox = new System.Windows.Forms.ComboBox(); this.ShowToolbarCheckBox = new System.Windows.Forms.CheckBox(); + this.ErrorConsoleCheckBox = new System.Windows.Forms.CheckBox(); this.MarkersTabPage = new System.Windows.Forms.TabPage(); this.label27 = new System.Windows.Forms.Label(); this.CameraPositionTextBox = new System.Windows.Forms.TextBox(); @@ -109,9 +111,13 @@ namespace CodeWalker this.OptionsTabPage = new System.Windows.Forms.TabPage(); this.OptionsTabControl = new System.Windows.Forms.TabControl(); this.OptionsGeneralTabPage = new System.Windows.Forms.TabPage(); + this.SaveTimeOfDayCheckBox = new System.Windows.Forms.CheckBox(); + this.SavePositionCheckBox = new System.Windows.Forms.CheckBox(); + this.ResetSettingsButton = new System.Windows.Forms.Button(); this.CarGeneratorsCheckBox = new System.Windows.Forms.CheckBox(); this.RenderEntitiesCheckBox = new System.Windows.Forms.CheckBox(); this.AdvancedSettingsButton = new System.Windows.Forms.Button(); + this.SaveSettingsButton = new System.Windows.Forms.Button(); this.ControlSettingsButton = new System.Windows.Forms.Button(); this.MapViewDetailLabel = new System.Windows.Forms.Label(); this.label28 = new System.Windows.Forms.Label(); @@ -203,12 +209,6 @@ namespace CodeWalker this.ControlLightDirectionCheckBox = new System.Windows.Forms.CheckBox(); this.SkydomeCheckBox = new System.Windows.Forms.CheckBox(); this.ShadowsCheckBox = new System.Windows.Forms.CheckBox(); - this.StatusBarCheckBox = new System.Windows.Forms.CheckBox(); - this.QuitButton = new System.Windows.Forms.Button(); - this.ReloadSettingsButton = new System.Windows.Forms.Button(); - this.SaveSettingsButton = new System.Windows.Forms.Button(); - this.ReloadShadersButton = new System.Windows.Forms.Button(); - this.ErrorConsoleCheckBox = new System.Windows.Forms.CheckBox(); this.ToolsPanelHideButton = new System.Windows.Forms.Button(); this.ToolsPanelShowButton = new System.Windows.Forms.Button(); this.ConsolePanel = new System.Windows.Forms.Panel(); @@ -520,10 +520,12 @@ namespace CodeWalker // // ViewTabPage // + this.ViewTabPage.Controls.Add(this.StatusBarCheckBox); this.ViewTabPage.Controls.Add(this.ViewTabControl); this.ViewTabPage.Controls.Add(this.label3); this.ViewTabPage.Controls.Add(this.ViewModeComboBox); this.ViewTabPage.Controls.Add(this.ShowToolbarCheckBox); + this.ViewTabPage.Controls.Add(this.ErrorConsoleCheckBox); this.ViewTabPage.Location = new System.Drawing.Point(4, 22); this.ViewTabPage.Name = "ViewTabPage"; this.ViewTabPage.Padding = new System.Windows.Forms.Padding(3); @@ -532,6 +534,19 @@ namespace CodeWalker this.ViewTabPage.Text = "View"; this.ViewTabPage.UseVisualStyleBackColor = true; // + // StatusBarCheckBox + // + this.StatusBarCheckBox.AutoSize = true; + this.StatusBarCheckBox.Checked = true; + this.StatusBarCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; + this.StatusBarCheckBox.Location = new System.Drawing.Point(10, 544); + this.StatusBarCheckBox.Name = "StatusBarCheckBox"; + this.StatusBarCheckBox.Size = new System.Drawing.Size(74, 17); + this.StatusBarCheckBox.TabIndex = 45; + this.StatusBarCheckBox.Text = "Status bar"; + this.StatusBarCheckBox.UseVisualStyleBackColor = true; + this.StatusBarCheckBox.CheckedChanged += new System.EventHandler(this.StatusBarCheckBox_CheckedChanged); + // // ViewTabControl // this.ViewTabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -543,7 +558,7 @@ namespace CodeWalker this.ViewTabControl.Location = new System.Drawing.Point(0, 32); this.ViewTabControl.Name = "ViewTabControl"; this.ViewTabControl.SelectedIndex = 0; - this.ViewTabControl.Size = new System.Drawing.Size(202, 548); + this.ViewTabControl.Size = new System.Drawing.Size(202, 506); this.ViewTabControl.TabIndex = 12; // // ViewWorldTabPage @@ -566,7 +581,7 @@ namespace CodeWalker this.ViewWorldTabPage.Location = new System.Drawing.Point(4, 22); this.ViewWorldTabPage.Name = "ViewWorldTabPage"; this.ViewWorldTabPage.Padding = new System.Windows.Forms.Padding(3); - this.ViewWorldTabPage.Size = new System.Drawing.Size(194, 522); + this.ViewWorldTabPage.Size = new System.Drawing.Size(194, 480); this.ViewWorldTabPage.TabIndex = 0; this.ViewWorldTabPage.Text = "World"; this.ViewWorldTabPage.UseVisualStyleBackColor = true; @@ -764,7 +779,7 @@ namespace CodeWalker this.ViewYmapsTabPage.Location = new System.Drawing.Point(4, 22); this.ViewYmapsTabPage.Name = "ViewYmapsTabPage"; this.ViewYmapsTabPage.Padding = new System.Windows.Forms.Padding(3); - this.ViewYmapsTabPage.Size = new System.Drawing.Size(194, 522); + this.ViewYmapsTabPage.Size = new System.Drawing.Size(194, 480); this.ViewYmapsTabPage.TabIndex = 1; this.ViewYmapsTabPage.Text = "Ymaps"; this.ViewYmapsTabPage.UseVisualStyleBackColor = true; @@ -773,7 +788,7 @@ namespace CodeWalker // this.ShowYmapChildrenCheckBox.AutoSize = true; this.ShowYmapChildrenCheckBox.Enabled = false; - this.ShowYmapChildrenCheckBox.Location = new System.Drawing.Point(6, 59); + this.ShowYmapChildrenCheckBox.Location = new System.Drawing.Point(101, 6); this.ShowYmapChildrenCheckBox.Name = "ShowYmapChildrenCheckBox"; this.ShowYmapChildrenCheckBox.Size = new System.Drawing.Size(93, 17); this.ShowYmapChildrenCheckBox.TabIndex = 35; @@ -784,7 +799,7 @@ namespace CodeWalker // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(3, 88); + this.label2.Location = new System.Drawing.Point(3, 56); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(77, 13); this.label2.TabIndex = 8; @@ -808,7 +823,7 @@ namespace CodeWalker this.DynamicLODCheckBox.AutoSize = true; this.DynamicLODCheckBox.Checked = true; this.DynamicLODCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.DynamicLODCheckBox.Location = new System.Drawing.Point(6, 6); + this.DynamicLODCheckBox.Location = new System.Drawing.Point(2, 6); this.DynamicLODCheckBox.Name = "DynamicLODCheckBox"; this.DynamicLODCheckBox.Size = new System.Drawing.Size(92, 17); this.DynamicLODCheckBox.TabIndex = 33; @@ -821,11 +836,11 @@ namespace CodeWalker this.YmapsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.YmapsTextBox.Location = new System.Drawing.Point(0, 104); + this.YmapsTextBox.Location = new System.Drawing.Point(0, 72); this.YmapsTextBox.Multiline = true; this.YmapsTextBox.Name = "YmapsTextBox"; this.YmapsTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.YmapsTextBox.Size = new System.Drawing.Size(194, 418); + this.YmapsTextBox.Size = new System.Drawing.Size(194, 408); this.YmapsTextBox.TabIndex = 36; this.YmapsTextBox.Text = resources.GetString("YmapsTextBox.Text"); this.YmapsTextBox.TextChanged += new System.EventHandler(this.YmapsTextBox_TextChanged); @@ -836,7 +851,7 @@ namespace CodeWalker this.ViewModelTabPage.Controls.Add(this.ModelComboBox); this.ViewModelTabPage.Location = new System.Drawing.Point(4, 22); this.ViewModelTabPage.Name = "ViewModelTabPage"; - this.ViewModelTabPage.Size = new System.Drawing.Size(194, 522); + this.ViewModelTabPage.Size = new System.Drawing.Size(194, 480); this.ViewModelTabPage.TabIndex = 2; this.ViewModelTabPage.Text = "Model"; this.ViewModelTabPage.UseVisualStyleBackColor = true; @@ -886,6 +901,17 @@ namespace CodeWalker this.ShowToolbarCheckBox.UseVisualStyleBackColor = true; this.ShowToolbarCheckBox.CheckedChanged += new System.EventHandler(this.ShowToolbarCheckBox_CheckedChanged); // + // ErrorConsoleCheckBox + // + this.ErrorConsoleCheckBox.AutoSize = true; + this.ErrorConsoleCheckBox.Location = new System.Drawing.Point(10, 565); + this.ErrorConsoleCheckBox.Name = "ErrorConsoleCheckBox"; + this.ErrorConsoleCheckBox.Size = new System.Drawing.Size(88, 17); + this.ErrorConsoleCheckBox.TabIndex = 46; + this.ErrorConsoleCheckBox.Text = "Error console"; + this.ErrorConsoleCheckBox.UseVisualStyleBackColor = true; + this.ErrorConsoleCheckBox.CheckedChanged += new System.EventHandler(this.ErrorConsoleCheckBox_CheckedChanged); + // // MarkersTabPage // this.MarkersTabPage.Controls.Add(this.label27); @@ -931,7 +957,7 @@ namespace CodeWalker // AddSelectionMarkerButton // this.AddSelectionMarkerButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.AddSelectionMarkerButton.Location = new System.Drawing.Point(0, 536); + this.AddSelectionMarkerButton.Location = new System.Drawing.Point(0, 577); this.AddSelectionMarkerButton.Name = "AddSelectionMarkerButton"; this.AddSelectionMarkerButton.Size = new System.Drawing.Size(97, 23); this.AddSelectionMarkerButton.TabIndex = 22; @@ -942,7 +968,7 @@ namespace CodeWalker // AddCurrentPositonMarkerButton // this.AddCurrentPositonMarkerButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.AddCurrentPositonMarkerButton.Location = new System.Drawing.Point(0, 507); + this.AddCurrentPositonMarkerButton.Location = new System.Drawing.Point(0, 548); this.AddCurrentPositonMarkerButton.Name = "AddCurrentPositonMarkerButton"; this.AddCurrentPositonMarkerButton.Size = new System.Drawing.Size(97, 23); this.AddCurrentPositonMarkerButton.TabIndex = 20; @@ -953,7 +979,7 @@ namespace CodeWalker // ResetMarkersButton // this.ResetMarkersButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ResetMarkersButton.Location = new System.Drawing.Point(108, 507); + this.ResetMarkersButton.Location = new System.Drawing.Point(108, 548); this.ResetMarkersButton.Name = "ResetMarkersButton"; this.ResetMarkersButton.Size = new System.Drawing.Size(97, 23); this.ResetMarkersButton.TabIndex = 21; @@ -964,7 +990,7 @@ namespace CodeWalker // ClearMarkersButton // this.ClearMarkersButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.ClearMarkersButton.Location = new System.Drawing.Point(108, 478); + this.ClearMarkersButton.Location = new System.Drawing.Point(108, 519); this.ClearMarkersButton.Name = "ClearMarkersButton"; this.ClearMarkersButton.Size = new System.Drawing.Size(97, 23); this.ClearMarkersButton.TabIndex = 19; @@ -1027,7 +1053,7 @@ namespace CodeWalker // AddMarkersButton // this.AddMarkersButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.AddMarkersButton.Location = new System.Drawing.Point(0, 478); + this.AddMarkersButton.Location = new System.Drawing.Point(0, 519); this.AddMarkersButton.Name = "AddMarkersButton"; this.AddMarkersButton.Size = new System.Drawing.Size(97, 23); this.AddMarkersButton.TabIndex = 18; @@ -1045,7 +1071,7 @@ namespace CodeWalker this.MultiFindTextBox.Multiline = true; this.MultiFindTextBox.Name = "MultiFindTextBox"; this.MultiFindTextBox.ScrollBars = System.Windows.Forms.ScrollBars.Both; - this.MultiFindTextBox.Size = new System.Drawing.Size(205, 355); + this.MultiFindTextBox.Size = new System.Drawing.Size(205, 392); this.MultiFindTextBox.TabIndex = 17; // // SelectionTabPage @@ -1314,12 +1340,6 @@ namespace CodeWalker // OptionsTabPage // this.OptionsTabPage.Controls.Add(this.OptionsTabControl); - this.OptionsTabPage.Controls.Add(this.StatusBarCheckBox); - this.OptionsTabPage.Controls.Add(this.QuitButton); - this.OptionsTabPage.Controls.Add(this.ReloadSettingsButton); - this.OptionsTabPage.Controls.Add(this.SaveSettingsButton); - this.OptionsTabPage.Controls.Add(this.ReloadShadersButton); - this.OptionsTabPage.Controls.Add(this.ErrorConsoleCheckBox); this.OptionsTabPage.Location = new System.Drawing.Point(4, 22); this.OptionsTabPage.Name = "OptionsTabPage"; this.OptionsTabPage.Size = new System.Drawing.Size(205, 606); @@ -1338,14 +1358,18 @@ namespace CodeWalker this.OptionsTabControl.Location = new System.Drawing.Point(0, 3); this.OptionsTabControl.Name = "OptionsTabControl"; this.OptionsTabControl.SelectedIndex = 0; - this.OptionsTabControl.Size = new System.Drawing.Size(208, 508); + this.OptionsTabControl.Size = new System.Drawing.Size(208, 603); this.OptionsTabControl.TabIndex = 50; // // OptionsGeneralTabPage // + this.OptionsGeneralTabPage.Controls.Add(this.SaveTimeOfDayCheckBox); + this.OptionsGeneralTabPage.Controls.Add(this.SavePositionCheckBox); + this.OptionsGeneralTabPage.Controls.Add(this.ResetSettingsButton); this.OptionsGeneralTabPage.Controls.Add(this.CarGeneratorsCheckBox); this.OptionsGeneralTabPage.Controls.Add(this.RenderEntitiesCheckBox); this.OptionsGeneralTabPage.Controls.Add(this.AdvancedSettingsButton); + this.OptionsGeneralTabPage.Controls.Add(this.SaveSettingsButton); this.OptionsGeneralTabPage.Controls.Add(this.ControlSettingsButton); this.OptionsGeneralTabPage.Controls.Add(this.MapViewDetailLabel); this.OptionsGeneralTabPage.Controls.Add(this.label28); @@ -1372,11 +1396,41 @@ namespace CodeWalker this.OptionsGeneralTabPage.Location = new System.Drawing.Point(4, 22); this.OptionsGeneralTabPage.Name = "OptionsGeneralTabPage"; this.OptionsGeneralTabPage.Padding = new System.Windows.Forms.Padding(3); - this.OptionsGeneralTabPage.Size = new System.Drawing.Size(200, 482); + this.OptionsGeneralTabPage.Size = new System.Drawing.Size(200, 577); this.OptionsGeneralTabPage.TabIndex = 0; this.OptionsGeneralTabPage.Text = "General"; this.OptionsGeneralTabPage.UseVisualStyleBackColor = true; // + // SaveTimeOfDayCheckBox + // + this.SaveTimeOfDayCheckBox.AutoSize = true; + this.SaveTimeOfDayCheckBox.Location = new System.Drawing.Point(10, 485); + this.SaveTimeOfDayCheckBox.Name = "SaveTimeOfDayCheckBox"; + this.SaveTimeOfDayCheckBox.Size = new System.Drawing.Size(139, 17); + this.SaveTimeOfDayCheckBox.TabIndex = 149; + this.SaveTimeOfDayCheckBox.Text = "Save time of day on exit"; + this.SaveTimeOfDayCheckBox.UseVisualStyleBackColor = true; + // + // SavePositionCheckBox + // + this.SavePositionCheckBox.AutoSize = true; + this.SavePositionCheckBox.Location = new System.Drawing.Point(10, 464); + this.SavePositionCheckBox.Name = "SavePositionCheckBox"; + this.SavePositionCheckBox.Size = new System.Drawing.Size(124, 17); + this.SavePositionCheckBox.TabIndex = 148; + this.SavePositionCheckBox.Text = "Save position on exit"; + this.SavePositionCheckBox.UseVisualStyleBackColor = true; + // + // ResetSettingsButton + // + this.ResetSettingsButton.Location = new System.Drawing.Point(4, 551); + this.ResetSettingsButton.Name = "ResetSettingsButton"; + this.ResetSettingsButton.Size = new System.Drawing.Size(93, 23); + this.ResetSettingsButton.TabIndex = 146; + this.ResetSettingsButton.Text = "Reset settings"; + this.ResetSettingsButton.UseVisualStyleBackColor = true; + this.ResetSettingsButton.Click += new System.EventHandler(this.ResetSettingsButton_Click); + // // CarGeneratorsCheckBox // this.CarGeneratorsCheckBox.AutoSize = true; @@ -1403,7 +1457,7 @@ namespace CodeWalker // // AdvancedSettingsButton // - this.AdvancedSettingsButton.Location = new System.Drawing.Point(101, 456); + this.AdvancedSettingsButton.Location = new System.Drawing.Point(103, 522); this.AdvancedSettingsButton.Name = "AdvancedSettingsButton"; this.AdvancedSettingsButton.Size = new System.Drawing.Size(93, 23); this.AdvancedSettingsButton.TabIndex = 46; @@ -1411,9 +1465,19 @@ namespace CodeWalker this.AdvancedSettingsButton.UseVisualStyleBackColor = true; this.AdvancedSettingsButton.Click += new System.EventHandler(this.AdvancedSettingsButton_Click); // + // SaveSettingsButton + // + this.SaveSettingsButton.Location = new System.Drawing.Point(103, 551); + this.SaveSettingsButton.Name = "SaveSettingsButton"; + this.SaveSettingsButton.Size = new System.Drawing.Size(93, 23); + this.SaveSettingsButton.TabIndex = 147; + this.SaveSettingsButton.Text = "Save settings"; + this.SaveSettingsButton.UseVisualStyleBackColor = true; + this.SaveSettingsButton.Click += new System.EventHandler(this.SaveSettingsButton_Click); + // // ControlSettingsButton // - this.ControlSettingsButton.Location = new System.Drawing.Point(2, 456); + this.ControlSettingsButton.Location = new System.Drawing.Point(4, 522); this.ControlSettingsButton.Name = "ControlSettingsButton"; this.ControlSettingsButton.Size = new System.Drawing.Size(93, 23); this.ControlSettingsButton.TabIndex = 45; @@ -1703,7 +1767,7 @@ namespace CodeWalker this.OptionsRenderTabPage.Controls.Add(this.label14); this.OptionsRenderTabPage.Location = new System.Drawing.Point(4, 22); this.OptionsRenderTabPage.Name = "OptionsRenderTabPage"; - this.OptionsRenderTabPage.Size = new System.Drawing.Size(200, 482); + this.OptionsRenderTabPage.Size = new System.Drawing.Size(200, 577); this.OptionsRenderTabPage.TabIndex = 3; this.OptionsRenderTabPage.Text = "Render"; this.OptionsRenderTabPage.UseVisualStyleBackColor = true; @@ -1949,7 +2013,7 @@ namespace CodeWalker this.OptionsHelpersTabPage.Location = new System.Drawing.Point(4, 22); this.OptionsHelpersTabPage.Name = "OptionsHelpersTabPage"; this.OptionsHelpersTabPage.Padding = new System.Windows.Forms.Padding(3); - this.OptionsHelpersTabPage.Size = new System.Drawing.Size(200, 482); + this.OptionsHelpersTabPage.Size = new System.Drawing.Size(200, 577); this.OptionsHelpersTabPage.TabIndex = 1; this.OptionsHelpersTabPage.Text = "Helpers"; this.OptionsHelpersTabPage.UseVisualStyleBackColor = true; @@ -2278,7 +2342,7 @@ namespace CodeWalker this.OptionsLightingTabPage.Controls.Add(this.ShadowsCheckBox); this.OptionsLightingTabPage.Location = new System.Drawing.Point(4, 22); this.OptionsLightingTabPage.Name = "OptionsLightingTabPage"; - this.OptionsLightingTabPage.Size = new System.Drawing.Size(200, 482); + this.OptionsLightingTabPage.Size = new System.Drawing.Size(200, 577); this.OptionsLightingTabPage.TabIndex = 2; this.OptionsLightingTabPage.Text = "Lighting"; this.OptionsLightingTabPage.UseVisualStyleBackColor = true; @@ -2589,72 +2653,6 @@ namespace CodeWalker this.ShadowsCheckBox.UseVisualStyleBackColor = true; this.ShadowsCheckBox.CheckedChanged += new System.EventHandler(this.ShadowsCheckBox_CheckedChanged); // - // StatusBarCheckBox - // - this.StatusBarCheckBox.AutoSize = true; - this.StatusBarCheckBox.Checked = true; - this.StatusBarCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; - this.StatusBarCheckBox.Location = new System.Drawing.Point(119, 517); - this.StatusBarCheckBox.Name = "StatusBarCheckBox"; - this.StatusBarCheckBox.Size = new System.Drawing.Size(74, 17); - this.StatusBarCheckBox.TabIndex = 145; - this.StatusBarCheckBox.Text = "Status bar"; - this.StatusBarCheckBox.UseVisualStyleBackColor = true; - this.StatusBarCheckBox.CheckedChanged += new System.EventHandler(this.StatusBarCheckBox_CheckedChanged); - // - // QuitButton - // - this.QuitButton.Location = new System.Drawing.Point(105, 569); - this.QuitButton.Name = "QuitButton"; - this.QuitButton.Size = new System.Drawing.Size(93, 23); - this.QuitButton.TabIndex = 149; - this.QuitButton.Text = "Quit"; - this.QuitButton.UseVisualStyleBackColor = true; - this.QuitButton.Click += new System.EventHandler(this.QuitButton_Click); - // - // ReloadSettingsButton - // - this.ReloadSettingsButton.Enabled = false; - this.ReloadSettingsButton.Location = new System.Drawing.Point(6, 540); - this.ReloadSettingsButton.Name = "ReloadSettingsButton"; - this.ReloadSettingsButton.Size = new System.Drawing.Size(93, 23); - this.ReloadSettingsButton.TabIndex = 146; - this.ReloadSettingsButton.Text = "Reload settings"; - this.ReloadSettingsButton.UseVisualStyleBackColor = true; - this.ReloadSettingsButton.Visible = false; - this.ReloadSettingsButton.Click += new System.EventHandler(this.ReloadSettingsButton_Click); - // - // SaveSettingsButton - // - this.SaveSettingsButton.Location = new System.Drawing.Point(105, 540); - this.SaveSettingsButton.Name = "SaveSettingsButton"; - this.SaveSettingsButton.Size = new System.Drawing.Size(93, 23); - this.SaveSettingsButton.TabIndex = 147; - this.SaveSettingsButton.Text = "Save settings"; - this.SaveSettingsButton.UseVisualStyleBackColor = true; - this.SaveSettingsButton.Click += new System.EventHandler(this.SaveSettingsButton_Click); - // - // ReloadShadersButton - // - this.ReloadShadersButton.Location = new System.Drawing.Point(6, 569); - this.ReloadShadersButton.Name = "ReloadShadersButton"; - this.ReloadShadersButton.Size = new System.Drawing.Size(93, 23); - this.ReloadShadersButton.TabIndex = 148; - this.ReloadShadersButton.Text = "Reload shaders"; - this.ReloadShadersButton.UseVisualStyleBackColor = true; - this.ReloadShadersButton.Click += new System.EventHandler(this.ReloadShadersButton_Click); - // - // ErrorConsoleCheckBox - // - this.ErrorConsoleCheckBox.AutoSize = true; - this.ErrorConsoleCheckBox.Location = new System.Drawing.Point(14, 517); - this.ErrorConsoleCheckBox.Name = "ErrorConsoleCheckBox"; - this.ErrorConsoleCheckBox.Size = new System.Drawing.Size(88, 17); - this.ErrorConsoleCheckBox.TabIndex = 144; - this.ErrorConsoleCheckBox.Text = "Error console"; - this.ErrorConsoleCheckBox.UseVisualStyleBackColor = true; - this.ErrorConsoleCheckBox.CheckedChanged += new System.EventHandler(this.ErrorConsoleCheckBox_CheckedChanged); - // // ToolsPanelHideButton // this.ToolsPanelHideButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -3587,7 +3585,7 @@ namespace CodeWalker this.SubtitleLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.SubtitleLabel.Location = new System.Drawing.Point(455, 555); this.SubtitleLabel.Name = "SubtitleLabel"; - this.SubtitleLabel.Size = new System.Drawing.Size(84, 18); + this.SubtitleLabel.Size = new System.Drawing.Size(83, 18); this.SubtitleLabel.TabIndex = 8; this.SubtitleLabel.Text = "Test Subtitle"; this.SubtitleLabel.TextAlign = System.Drawing.ContentAlignment.TopCenter; @@ -3654,7 +3652,6 @@ namespace CodeWalker this.tabPage13.ResumeLayout(false); this.SelectionExtensionTabPage.ResumeLayout(false); this.OptionsTabPage.ResumeLayout(false); - this.OptionsTabPage.PerformLayout(); this.OptionsTabControl.ResumeLayout(false); this.OptionsGeneralTabPage.ResumeLayout(false); this.OptionsGeneralTabPage.PerformLayout(); @@ -3715,7 +3712,6 @@ namespace CodeWalker private System.Windows.Forms.ToolStripStatusLabel StatsLabel; private System.Windows.Forms.TrackBar DetailTrackBar; private System.Windows.Forms.CheckBox DynamicLODCheckBox; - private System.Windows.Forms.Button ReloadShadersButton; private System.Windows.Forms.ComboBox MarkerStyleComboBox; private System.Windows.Forms.Label label5; private System.Windows.Forms.ComboBox LocatorStyleComboBox; @@ -3753,8 +3749,7 @@ namespace CodeWalker private System.Windows.Forms.Button ToolsPanelExpandButton; private System.Windows.Forms.Button AddSelectionMarkerButton; private System.Windows.Forms.CheckBox FullScreenCheckBox; - private System.Windows.Forms.Button QuitButton; - private System.Windows.Forms.Button ReloadSettingsButton; + private System.Windows.Forms.Button ResetSettingsButton; private System.Windows.Forms.Button SaveSettingsButton; private System.Windows.Forms.Button ToolsButton; private System.Windows.Forms.ContextMenuStrip ToolsMenu; @@ -3969,5 +3964,7 @@ namespace CodeWalker private System.Windows.Forms.ToolStripMenuItem ToolbarSelectCalmingQuadButton; private System.Windows.Forms.ToolStripMenuItem ToolbarSelectWaveQuadButton; private System.Windows.Forms.ToolStripMenuItem ToolsMenuAudioExplorer; + private System.Windows.Forms.CheckBox SaveTimeOfDayCheckBox; + private System.Windows.Forms.CheckBox SavePositionCheckBox; } } \ No newline at end of file diff --git a/CodeWalker/WorldForm.cs b/CodeWalker/WorldForm.cs index 100d0c5..fb76dc7 100644 --- a/CodeWalker/WorldForm.cs +++ b/CodeWalker/WorldForm.cs @@ -60,7 +60,7 @@ namespace CodeWalker string modelname = "dt1_tc_dufo_core";//"dt1_11_fount_decal";//"v_22_overlays";// string[] ymaplist; - Vector3 prevworldpos = new Vector3(0, 0, 100); //also the start pos + Vector3 prevworldpos = FloatUtil.ParseVector3String(Settings.Default.StartPosition); public GameFileCache GameFileCache { get { return gameFileCache; } } @@ -4827,8 +4827,10 @@ namespace CodeWalker WeatherComboBox.SelectedIndex = Math.Max(WeatherComboBox.FindString(s.Weather), 0); WeatherRegionComboBox.SelectedIndex = Math.Max(WeatherRegionComboBox.FindString(s.Region), 0); Renderer.individualcloudfrag = s.Clouds; - NaturalAmbientLightCheckBox.Checked = s.NatrualAmbientLight; + NaturalAmbientLightCheckBox.Checked = s.NaturalAmbientLight; ArtificialAmbientLightCheckBox.Checked = s.ArtificialAmbientLight; + SavePositionCheckBox.Checked = s.SavePosition; + SaveTimeOfDayCheckBox.Checked = s.SaveTimeOfDay; SetTimeOfDay(s.TimeOfDay); Renderer.SetWeatherType(s.Weather); @@ -4870,13 +4872,22 @@ 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.NaturalAmbientLight = NaturalAmbientLightCheckBox.Checked; s.ArtificialAmbientLight = ArtificialAmbientLightCheckBox.Checked; - s.Region = WeatherRegionComboBox.Text; - s.Clouds = CloudsComboBox.Text; + s.SavePosition = SavePositionCheckBox.Checked; + s.SaveTimeOfDay = SaveTimeOfDayCheckBox.Checked; + if (s.SavePosition) + { + s.StartPosition = FloatUtil.GetVector3String(camEntity?.Position ?? camera.Position); + } + if (s.SaveTimeOfDay) + { + s.TimeOfDay = TimeOfDayTrackBar.Value; + s.Weather = WeatherComboBox.Text; + s.Region = WeatherRegionComboBox.Text; + s.Clouds = CloudsComboBox.Text; + } //additional settings from gamefilecache... s.EnableMods = gameFileCache.EnableMods; @@ -4884,6 +4895,23 @@ namespace CodeWalker s.Save(); } + private void ResetSettings() + { + if (MessageBox.Show("Are you sure you want to reset all settings to their default values?", "Reset All Settings", MessageBoxButtons.YesNo) != DialogResult.Yes) return; + + Settings.Default.Reset(); + LoadSettings(); + + if (camEntity != null) + { + camEntity.Position = FloatUtil.ParseVector3String(Settings.Default.StartPosition); + camEntity.Orientation = Quaternion.LookAtLH(Vector3.Zero, Vector3.Up, Vector3.ForwardLH); + camera.CurrentRotation = Vector3.Zero; + camera.TargetRotation = Vector3.Zero; + } + + MessageBox.Show("All settings have been reset to their default values. Please restart CodeWalker."); + } private void ShowSettingsForm(string tab = "") { @@ -6746,6 +6774,7 @@ namespace CodeWalker private void ReloadShadersButton_Click(object sender, EventArgs e) { + //### NO LONGER USED if (Renderer.Device == null) return; //can't do this with no device Cursor = Cursors.WaitCursor; @@ -6970,9 +6999,9 @@ namespace CodeWalker ShowSettingsForm("Advanced"); } - private void ReloadSettingsButton_Click(object sender, EventArgs e) + private void ResetSettingsButton_Click(object sender, EventArgs e) { - LoadSettings(); + ResetSettings(); } private void SaveSettingsButton_Click(object sender, EventArgs e) @@ -6980,14 +7009,6 @@ namespace CodeWalker SaveSettings(); } - private void QuitButton_Click(object sender, EventArgs e) - { - if (MessageBox.Show("Really quit?", "", MessageBoxButtons.YesNo) == DialogResult.Yes) - { - Close(); - } - } - private void AboutButton_Click(object sender, EventArgs e) { AboutForm f = new AboutForm(); diff --git a/CodeWalker/WorldForm.resx b/CodeWalker/WorldForm.resx index 0e069f5..0409128 100644 --- a/CodeWalker/WorldForm.resx +++ b/CodeWalker/WorldForm.resx @@ -242,7 +242,7 @@ ufo iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAAHRJREFUOE/tk0EKgCAQRedIncGrGZ602lowuFW/kM1ElLYLEh668D1dKO2DmYcQ + vwAADr8BOAVTJAAAAHRJREFUOE/tk0EKgCAQRedIncGrGZ602lowuFW/kM1ElLYLEh668D1dKO2DmYcQ gs/EHpTsnIvGmGZKQMrWjnH12y3ztJR9NfBGxiwD6lpPQEYMaxU4n3aF3PcHPh/AY8Ljy67vDkgZ36AG WlEyBgKdHDIRJSPcKxCRg0UPAAAAAElFTkSuQmCC @@ -250,7 +250,7 @@ ufo iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - xAAADsQBlSsOGwAAAThJREFUOE+dk01ugzAQhTlBj+MDIJC4A1yEa7DMnlWaSiAu0ZI7BNi0XaRpF7Bg + wAAADsABataJCQAAAThJREFUOE+dk01ugzAQhTlBj+MDIJC4A1yEa7DMnlWaSiAu0ZI7BNi0XaRpF7Bg 4/pzbMsQ0qod6SX2zHvPP4yDdUzTJBR2CieF2YAxOWFot6GKDwrlMAyyKAqZZZkMw1AjTVOdowYHrpFd w4if67p2os/L1wI2DwfuwkRNSitu2+NdA1szJqUVC7ZGYb9/dOQtA/6bptFjcxyBwY7zkfwL0KDF4ESC 7bHCx/miCf7qYJ1jjjYYx3Fm0nfDXfJWzhjMzuBweJJvr++b5K1dOQN7hP9AH0H96EvM83zh7q+2zsH1 @@ -279,7 +279,7 @@ ufo iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wwAADsMBx2+oZAAAAH5JREFUOE+9kEEKwCAMBH2bL+hPfI/9ooe2B71aVpKS5iBB0i4MyCZZjcFdrbUu + vwAADr8BOAVTJAAAAH5JREFUOE+9kEEKwCAMBH2bL+hPfI/9ooe2B71aVpKS5iBB0i4MyCZZjcFdrbUu IdsuDMUYB/8H1Fo3HQCPynOhsZTSU0pPAM7wpiG4hcFAzns/j2uAMzzZo3ntDHiYkTWNXwCztAJr+ROl 0IhU+UTzMEsHkG2XS4CE7K8Uwg0o2F4o9CrlEwAAAABJRU5ErkJggg==