diff --git a/Novetus/NovetusCore/CharCustom/Forms/Compact/CharacterCustomizationCompact.cs b/Novetus/NovetusCore/CharCustom/Forms/Compact/CharacterCustomizationCompact.cs index 7a14bc5..dd4183c 100644 --- a/Novetus/NovetusCore/CharCustom/Forms/Compact/CharacterCustomizationCompact.cs +++ b/Novetus/NovetusCore/CharCustom/Forms/Compact/CharacterCustomizationCompact.cs @@ -129,7 +129,7 @@ public partial class CharacterCustomizationCompact : Form { string FaceWebSource = "Roblox"; - switch (GlobalVars.UserCustomization.Pants) + switch (GlobalVars.UserCustomization.Face) { case string finobe when finobe.Contains("http://finobe.com/asset/?id="): FaceIDBox.Text = GlobalVars.UserCustomization.Face.Replace("http://finobe.com/asset/?id=", ""); diff --git a/Novetus/NovetusCore/CharCustom/Forms/Extended/CharacterCustomizationExtended.cs b/Novetus/NovetusCore/CharCustom/Forms/Extended/CharacterCustomizationExtended.cs index 709c564..7150b87 100644 --- a/Novetus/NovetusCore/CharCustom/Forms/Extended/CharacterCustomizationExtended.cs +++ b/Novetus/NovetusCore/CharCustom/Forms/Extended/CharacterCustomizationExtended.cs @@ -133,7 +133,7 @@ using System.Windows.Forms; { string FaceWebSource = "Roblox"; - switch (GlobalVars.UserCustomization.Pants) + switch (GlobalVars.UserCustomization.Face) { case string finobe when finobe.Contains("http://finobe.com/asset/?id="): FaceIDBox.Text = GlobalVars.UserCustomization.Face.Replace("http://finobe.com/asset/?id=", ""); diff --git a/Novetus/NovetusCore/SDK/Forms/ClientinfoCreator.Designer.cs b/Novetus/NovetusCore/SDK/Forms/ClientinfoCreator.Designer.cs index bd0546f..08526ed 100644 --- a/Novetus/NovetusCore/SDK/Forms/ClientinfoCreator.Designer.cs +++ b/Novetus/NovetusCore/SDK/Forms/ClientinfoCreator.Designer.cs @@ -149,6 +149,8 @@ partial class ClientinfoEditor this.label9 = new System.Windows.Forms.Label(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.label10 = new System.Windows.Forms.Label(); + this.textToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.iNIToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); this.SuspendLayout(); // @@ -315,30 +317,32 @@ partial class ClientinfoEditor // newToolStripMenuItem // this.newToolStripMenuItem.Name = "newToolStripMenuItem"; - this.newToolStripMenuItem.Size = new System.Drawing.Size(157, 22); + this.newToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.newToolStripMenuItem.Text = "New"; this.newToolStripMenuItem.Click += new System.EventHandler(this.NewToolStripMenuItemClick); // // loadToolStripMenuItem // this.loadToolStripMenuItem.Name = "loadToolStripMenuItem"; - this.loadToolStripMenuItem.Size = new System.Drawing.Size(157, 22); + this.loadToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.loadToolStripMenuItem.Text = "Load"; this.loadToolStripMenuItem.Click += new System.EventHandler(this.LoadToolStripMenuItemClick); // // saveToolStripMenuItem // this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; - this.saveToolStripMenuItem.Size = new System.Drawing.Size(157, 22); + this.saveToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.saveToolStripMenuItem.Text = "Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.SaveToolStripMenuItemClick); // // saveAsTextFileToolStripMenuItem // + this.saveAsTextFileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.textToolStripMenuItem, + this.iNIToolStripMenuItem}); this.saveAsTextFileToolStripMenuItem.Name = "saveAsTextFileToolStripMenuItem"; - this.saveAsTextFileToolStripMenuItem.Size = new System.Drawing.Size(157, 22); - this.saveAsTextFileToolStripMenuItem.Text = "Save as Text File"; - this.saveAsTextFileToolStripMenuItem.Click += new System.EventHandler(this.saveAsTextFileToolStripMenuItem_Click); + this.saveAsTextFileToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.saveAsTextFileToolStripMenuItem.Text = "Save As"; // // addToolStripMenuItem // @@ -1106,6 +1110,20 @@ partial class ClientinfoEditor this.label10.TabIndex = 33; this.label10.Text = "When applying the settings:"; // + // textToolStripMenuItem + // + this.textToolStripMenuItem.Name = "textToolStripMenuItem"; + this.textToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.textToolStripMenuItem.Text = "Text"; + this.textToolStripMenuItem.Click += new System.EventHandler(this.saveAsTextFileToolStripMenuItem_Click); + // + // iNIToolStripMenuItem + // + this.iNIToolStripMenuItem.Name = "iNIToolStripMenuItem"; + this.iNIToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.iNIToolStripMenuItem.Text = "INI"; + this.iNIToolStripMenuItem.Click += new System.EventHandler(this.saveAsINIFileToolStripMenuItem_Click); + // // ClientinfoEditor // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1261,4 +1279,6 @@ partial class ClientinfoEditor private System.Windows.Forms.ToolStripMenuItem versionToolStripMenuItem; private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.Label label10; + private System.Windows.Forms.ToolStripMenuItem textToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem iNIToolStripMenuItem; } diff --git a/Novetus/NovetusCore/SDK/Forms/ClientinfoCreator.cs b/Novetus/NovetusCore/SDK/Forms/ClientinfoCreator.cs index ccc4006..8084e73 100644 --- a/Novetus/NovetusCore/SDK/Forms/ClientinfoCreator.cs +++ b/Novetus/NovetusCore/SDK/Forms/ClientinfoCreator.cs @@ -3,6 +3,7 @@ using System; using System.Windows.Forms; using System.IO; using System.Globalization; +using Nini.Config; #endregion #region Client SDK @@ -107,8 +108,11 @@ public partial class ClientinfoEditor : Form { MessageBox.Show("Cannot load '" + GlobalPaths.ScriptName + ".lua'. Please make sure you selected the directory","Novetus Launcher - Error while generating MD5 for script", MessageBoxButtons.OK, MessageBoxIcon.Error); } - - MessageBox.Show("MD5s generated.","Novetus Launcher - Novetus Client SDK", MessageBoxButtons.OK, MessageBoxIcon.Information); + + if (!string.IsNullOrWhiteSpace(ClientMD5) && !string.IsNullOrWhiteSpace(ClientScriptMD5)) + { + MessageBox.Show("MD5s generated.", "Novetus Launcher - Novetus Client SDK", MessageBoxButtons.OK, MessageBoxIcon.Information); + } } void CheckBox4CheckedChanged(object sender, EventArgs e) @@ -370,7 +374,43 @@ public partial class ClientinfoEditor : Form SelectedClientInfo.CommandLineArgs.ToString() }; File.WriteAllLines(sfd.FileName, lines); - SelectedClientInfoPath = Path.GetDirectoryName(sfd.FileName); + } + } + } + + private void saveAsINIFileToolStripMenuItem_Click(object sender, EventArgs e) + { + using (var sfd = new SaveFileDialog()) + { + sfd.Filter = "Configuration File (*.ini)|*.ini"; + sfd.FilterIndex = 1; + string filename = "clientinfo.ini"; + sfd.FileName = filename; + sfd.Title = "Save " + filename; + + if (sfd.ShowDialog() == DialogResult.OK) + { + //WRITE + IniConfigSource ini = new IniConfigSource(); + + string section = "ClientInfo"; + + ini.AddConfig(section); + + ini.Configs[section].Set("UsesPlayerName", SelectedClientInfo.UsesPlayerName.ToString()); + ini.Configs[section].Set("UsesID", SelectedClientInfo.UsesID.ToString()); + ini.Configs[section].Set("Warning", SelectedClientInfo.Warning.ToString()); + ini.Configs[section].Set("LegacyMode", SelectedClientInfo.LegacyMode.ToString()); + ini.Configs[section].Set("ClientMD5", SelectedClientInfo.ClientMD5.ToString()); + ini.Configs[section].Set("ScriptMD5", SelectedClientInfo.ScriptMD5.ToString()); + ini.Configs[section].Set("Description", SelectedClientInfo.Description.ToString()); + ini.Configs[section].Set("Locked", Locked.ToString()); + ini.Configs[section].Set("Fix2007", SelectedClientInfo.Fix2007.ToString()); + ini.Configs[section].Set("AlreadyHasSecurity", SelectedClientInfo.AlreadyHasSecurity.ToString()); + ini.Configs[section].Set("ClientLoadOptions", Settings.GraphicsOptions.GetIntForClientLoadOptions(SelectedClientInfo.ClientLoadOptions).ToString()); + ini.Configs[section].Set("CommandLineArgs", SelectedClientInfo.CommandLineArgs.ToString()); + + ini.Save(sfd.FileName); } } } diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs index b8011b3..328aec8 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs @@ -3,6 +3,7 @@ * * change control names for all forms * Make launcher form line count smaller + * organize launcher codebase * replace == and != with .equals */ diff --git a/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.Designer.cs b/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.Designer.cs index 97f0472..7b54cf2 100644 --- a/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.Designer.cs @@ -44,9 +44,10 @@ this.GraphicsBevels = new System.Windows.Forms.ComboBox(); this.GraphicsShadows2008 = new System.Windows.Forms.ComboBox(); this.label7 = new System.Windows.Forms.Label(); - this.GraphicsShadows2007 = new System.Windows.Forms.CheckBox(); this.label8 = new System.Windows.Forms.Label(); - this.ApplyButton = new System.Windows.Forms.Button(); + this.label9 = new System.Windows.Forms.Label(); + this.GraphicsShadows2007 = new System.Windows.Forms.ComboBox(); + this.label10 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.GraphicsLevel)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.GraphicsMeshQuality)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.GraphicsShadingQuality)).BeginInit(); @@ -137,12 +138,11 @@ // // label4 // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(12, 93); + this.label4.Location = new System.Drawing.Point(12, 87); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(118, 13); + this.label4.Size = new System.Drawing.Size(141, 28); this.label4.TabIndex = 7; - this.label4.Text = "Material Quality (2009+)"; + this.label4.Text = "Material Quality/Truss Detail (2009+)"; // // label5 // @@ -184,7 +184,7 @@ "None", "4x", "8x"}); - this.GraphicsAASamples.Location = new System.Drawing.Point(172, 145); + this.GraphicsAASamples.Location = new System.Drawing.Point(172, 144); this.GraphicsAASamples.Name = "GraphicsAASamples"; this.GraphicsAASamples.Size = new System.Drawing.Size(155, 21); this.GraphicsAASamples.TabIndex = 11; @@ -198,7 +198,7 @@ "Automatic", "On", "Off"}); - this.GraphicsBevels.Location = new System.Drawing.Point(172, 172); + this.GraphicsBevels.Location = new System.Drawing.Point(172, 171); this.GraphicsBevels.Name = "GraphicsBevels"; this.GraphicsBevels.Size = new System.Drawing.Size(155, 21); this.GraphicsBevels.TabIndex = 12; @@ -213,7 +213,7 @@ "On", "Off", "Character-Only"}); - this.GraphicsShadows2008.Location = new System.Drawing.Point(172, 199); + this.GraphicsShadows2008.Location = new System.Drawing.Point(172, 198); this.GraphicsShadows2008.Name = "GraphicsShadows2008"; this.GraphicsShadows2008.Size = new System.Drawing.Size(155, 21); this.GraphicsShadows2008.TabIndex = 13; @@ -228,17 +228,6 @@ this.label7.TabIndex = 14; this.label7.Text = "Bevels (2008+)"; // - // GraphicsShadows2007 - // - this.GraphicsShadows2007.AutoSize = true; - this.GraphicsShadows2007.Location = new System.Drawing.Point(113, 226); - this.GraphicsShadows2007.Name = "GraphicsShadows2007"; - this.GraphicsShadows2007.Size = new System.Drawing.Size(103, 17); - this.GraphicsShadows2007.TabIndex = 15; - this.GraphicsShadows2007.Text = "Shadows (2007)"; - this.GraphicsShadows2007.UseVisualStyleBackColor = true; - this.GraphicsShadows2007.CheckedChanged += new System.EventHandler(this.GraphicsShadows2007_CheckedChanged); - // // label8 // this.label8.AutoSize = true; @@ -248,25 +237,49 @@ this.label8.TabIndex = 16; this.label8.Text = "Shadows (2008+)"; // - // ApplyButton + // label9 // - this.ApplyButton.Location = new System.Drawing.Point(113, 249); - this.ApplyButton.Name = "ApplyButton"; - this.ApplyButton.Size = new System.Drawing.Size(103, 23); - this.ApplyButton.TabIndex = 17; - this.ApplyButton.Text = "Apply"; - this.ApplyButton.UseVisualStyleBackColor = true; - this.ApplyButton.Click += new System.EventHandler(this.ApplyButton_Click); + this.label9.AutoSize = true; + this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label9.ForeColor = System.Drawing.Color.Red; + this.label9.Location = new System.Drawing.Point(49, 253); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(234, 13); + this.label9.TabIndex = 17; + this.label9.Text = "Close this window to save your settings."; + // + // GraphicsShadows2007 + // + this.GraphicsShadows2007.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.GraphicsShadows2007.FormattingEnabled = true; + this.GraphicsShadows2007.Items.AddRange(new object[] { + "On", + "Off"}); + this.GraphicsShadows2007.Location = new System.Drawing.Point(172, 225); + this.GraphicsShadows2007.Name = "GraphicsShadows2007"; + this.GraphicsShadows2007.Size = new System.Drawing.Size(155, 21); + this.GraphicsShadows2007.TabIndex = 18; + this.GraphicsShadows2007.SelectedIndexChanged += new System.EventHandler(this.GraphicsShadows2007_SelectedIndexChanged); + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(12, 228); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(84, 13); + this.label10.TabIndex = 19; + this.label10.Text = "Shadows (2007)"; // // CustomGraphicsOptions // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.ClientSize = new System.Drawing.Size(339, 278); - this.Controls.Add(this.ApplyButton); - this.Controls.Add(this.label8); + this.ClientSize = new System.Drawing.Size(339, 275); + this.Controls.Add(this.label10); this.Controls.Add(this.GraphicsShadows2007); + this.Controls.Add(this.label9); + this.Controls.Add(this.label8); this.Controls.Add(this.label7); this.Controls.Add(this.GraphicsShadows2008); this.Controls.Add(this.GraphicsBevels); @@ -286,6 +299,7 @@ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "CustomGraphicsOptions"; this.Text = "Novetus Settings"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.CustomGraphicsOptions_Close); this.Load += new System.EventHandler(this.CustomGraphicsOptions_Load); ((System.ComponentModel.ISupportInitialize)(this.GraphicsLevel)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.GraphicsMeshQuality)).EndInit(); @@ -312,8 +326,9 @@ private System.Windows.Forms.ComboBox GraphicsBevels; private System.Windows.Forms.ComboBox GraphicsShadows2008; private System.Windows.Forms.Label label7; - private System.Windows.Forms.CheckBox GraphicsShadows2007; private System.Windows.Forms.Label label8; - private System.Windows.Forms.Button ApplyButton; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.ComboBox GraphicsShadows2007; + private System.Windows.Forms.Label label10; } } \ No newline at end of file diff --git a/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.cs b/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.cs index 9ab50ff..7750f12 100644 --- a/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.cs +++ b/Novetus/NovetusLauncher/Forms/CustomGraphicsOptions.cs @@ -1,12 +1,16 @@ -using System; +#region Usings +using System; using System.IO; using System.Windows.Forms; using System.Xml.Linq; +#endregion namespace NovetusLauncher { + #region CustomGraphicsOptions public partial class CustomGraphicsOptions : Form { + #region Private Variables private int QualityLevel = 0; private int MeshDetail = 100; private int ShadingQuality = 100; @@ -18,12 +22,16 @@ namespace NovetusLauncher private bool Shadows_2007 = false; private static string ClientName = ""; private FileFormat.ClientInfo info; + #endregion + #region Constructor public CustomGraphicsOptions() { InitializeComponent(); } + #endregion + #region Form Events private void CustomGraphicsOptions_Load(object sender, EventArgs e) { ClientName = GlobalVars.UserConfiguration.SelectedClient; @@ -146,7 +154,16 @@ namespace NovetusLauncher try { Shadows_2007 = Convert.ToBoolean(RobloxXML.GetRenderSettings(doc, "Shadows", XMLTypes.Bool)); - GraphicsShadows2007.Checked = Shadows_2007; + + switch (Shadows_2007) + { + case false: + GraphicsShadows2007.SelectedIndex = 1; + break; + default: + GraphicsShadows2007.SelectedIndex = 0; + break; + } } catch (Exception) { @@ -256,23 +273,26 @@ namespace NovetusLauncher Shadows_2008 = GraphicsShadows2008.SelectedIndex; } - private void GraphicsShadows2007_CheckedChanged(object sender, EventArgs e) + private void GraphicsShadows2007_SelectedIndexChanged(object sender, EventArgs e) { - if (!GraphicsShadows2007.Enabled) + switch (GraphicsShadows2007.SelectedIndex) { - GraphicsShadows2007.Checked = false; + case 1: + Shadows_2007 = false; + break; + default: + Shadows_2007 = true; + break; } - - Shadows_2007 = GraphicsShadows2007.Checked; } - private void ApplyButton_Click(object sender, EventArgs e) + private void CustomGraphicsOptions_Close(object sender, FormClosingEventArgs e) { GlobalFuncs.ReadClientValues(ClientName, null); GlobalFuncs.ApplyClientSettings_custom(info, ClientName, MeshDetail, ShadingQuality, MaterialQuality, AA, AASamples, Bevels, Shadows_2008, Shadows_2007, QualityLevel); - MessageBox.Show("Custom settings applied!"); - Close(); } + #endregion } + #endregion } diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs index 6cd4648..e970ce7 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs @@ -341,20 +341,6 @@ namespace NovetusLauncher } } - void Button3Click(object sender, EventArgs e) - { - DialogResult result = MessageBox.Show("If you want to test out your place, you will have to save your place in Novetus's map folder, then launch your place in Play Solo.", "Novetus - Launch ROBLOX Studio", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); - if (result == DialogResult.Cancel) - return; - - WriteConfigValues(); - StartStudio(false); - if (GlobalVars.UserConfiguration.CloseOnLaunch) - { - Visible = false; - } - } - void Button18Click(object sender, EventArgs e) { WriteConfigValues(); @@ -377,20 +363,6 @@ namespace NovetusLauncher } } - private void button35_Click(object sender, EventArgs e) - { - DialogResult result = MessageBox.Show("If you want to test out your place, you will have to save your place in Novetus's map folder, then launch your place in Play Solo.", "Novetus - Launch ROBLOX Studio", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); - if (result == DialogResult.Cancel) - return; - - WriteConfigValues(); - StartStudio(true); - if (GlobalVars.UserConfiguration.CloseOnLaunch) - { - Visible = false; - } - } - void MainFormLoad(object sender, EventArgs e) { Text = "Novetus " + GlobalVars.ProgramInformation.Version; @@ -1209,6 +1181,8 @@ namespace NovetusLauncher switch (result) { + case DialogResult.Cancel: + return; case DialogResult.No: nomap = true; break; diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.Designer.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.Designer.cs index 084fd1e..99e2aed 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.Designer.cs @@ -37,6 +37,7 @@ this.label22 = new System.Windows.Forms.Label(); this.checkBox5 = new System.Windows.Forms.CheckBox(); this.button1 = new System.Windows.Forms.Button(); + this.label9 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // comboBox2 @@ -51,16 +52,16 @@ "High", "Ultra", "Custom"}); - this.comboBox2.Location = new System.Drawing.Point(129, 38); + this.comboBox2.Location = new System.Drawing.Point(123, 38); this.comboBox2.Name = "comboBox2"; - this.comboBox2.Size = new System.Drawing.Size(84, 21); + this.comboBox2.Size = new System.Drawing.Size(109, 21); this.comboBox2.TabIndex = 81; this.comboBox2.SelectedIndexChanged += new System.EventHandler(this.comboBox2_SelectedIndexChanged); // // label31 // this.label31.AutoSize = true; - this.label31.Location = new System.Drawing.Point(42, 15); + this.label31.Location = new System.Drawing.Point(38, 14); this.label31.Name = "label31"; this.label31.Size = new System.Drawing.Size(79, 13); this.label31.TabIndex = 80; @@ -74,9 +75,9 @@ "Automatic", "OpenGL", "DirectX"}); - this.comboBox1.Location = new System.Drawing.Point(129, 12); + this.comboBox1.Location = new System.Drawing.Point(123, 11); this.comboBox1.Name = "comboBox1"; - this.comboBox1.Size = new System.Drawing.Size(84, 21); + this.comboBox1.Size = new System.Drawing.Size(109, 21); this.comboBox1.TabIndex = 79; this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); // @@ -84,7 +85,7 @@ // this.checkBox6.Location = new System.Drawing.Point(68, 128); this.checkBox6.Name = "checkBox6"; - this.checkBox6.Size = new System.Drawing.Size(131, 16); + this.checkBox6.Size = new System.Drawing.Size(131, 17); this.checkBox6.TabIndex = 76; this.checkBox6.Text = "ReShade FPS Display"; this.checkBox6.UseVisualStyleBackColor = true; @@ -104,7 +105,7 @@ // label22 // this.label22.AutoSize = true; - this.label22.Location = new System.Drawing.Point(42, 41); + this.label22.Location = new System.Drawing.Point(38, 40); this.label22.Name = "label22"; this.label22.Size = new System.Drawing.Size(84, 13); this.label22.TabIndex = 78; @@ -133,12 +134,24 @@ this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // + // label9 + // + this.label9.AutoSize = true; + this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label9.ForeColor = System.Drawing.Color.Red; + this.label9.Location = new System.Drawing.Point(20, 147); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(234, 13); + this.label9.TabIndex = 84; + this.label9.Text = "Close this window to save your settings."; + // // LauncherFormCompactSettings // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.ClientSize = new System.Drawing.Size(270, 151); + this.ClientSize = new System.Drawing.Size(270, 169); + this.Controls.Add(this.label9); this.Controls.Add(this.button1); this.Controls.Add(this.comboBox2); this.Controls.Add(this.label31); @@ -151,6 +164,7 @@ this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "LauncherFormCompactSettings"; this.Text = "Novetus Settings"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.NovetusSettings_Close); this.Load += new System.EventHandler(this.NovetusSettings_Load); this.ResumeLayout(false); this.PerformLayout(); @@ -171,5 +185,6 @@ private System.Windows.Forms.Label label22; private System.Windows.Forms.CheckBox checkBox5; private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label9; } } \ No newline at end of file diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.cs index 5f3f2c5..c832876 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.cs @@ -1,61 +1,21 @@ -using System; +#region Usings +using System; using System.Windows.Forms; +#endregion namespace NovetusLauncher { + #region LauncherFormCompactSettings public partial class LauncherFormCompactSettings : Form { + #region Constructor public LauncherFormCompactSettings() { InitializeComponent(); } + #endregion - void ReadConfigValues() - { - GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); - checkBox5.Checked = GlobalVars.UserConfiguration.ReShade; - checkBox6.Checked = GlobalVars.UserConfiguration.ReShadeFPSDisplay; - checkBox7.Checked = GlobalVars.UserConfiguration.ReShadePerformanceMode; - - switch (GlobalVars.UserConfiguration.GraphicsMode) - { - case Settings.GraphicsOptions.Mode.OpenGL: - comboBox1.SelectedIndex = 1; - break; - case Settings.GraphicsOptions.Mode.DirectX: - comboBox1.SelectedIndex = 2; - break; - default: - comboBox1.SelectedIndex = 0; - break; - } - - switch (GlobalVars.UserConfiguration.QualityLevel) - { - case Settings.GraphicsOptions.Level.VeryLow: - comboBox2.SelectedIndex = 1; - break; - case Settings.GraphicsOptions.Level.Low: - comboBox2.SelectedIndex = 2; - break; - case Settings.GraphicsOptions.Level.Medium: - comboBox2.SelectedIndex = 3; - break; - case Settings.GraphicsOptions.Level.High: - comboBox2.SelectedIndex = 4; - break; - case Settings.GraphicsOptions.Level.Ultra: - comboBox2.SelectedIndex = 5; - break; - case Settings.GraphicsOptions.Level.Custom: - comboBox2.SelectedIndex = 6; - break; - default: - comboBox2.SelectedIndex = 0; - break; - } - } - + #region Form Events private void checkBox5_CheckedChanged(object sender, EventArgs e) { GlobalVars.UserConfiguration.ReShade = checkBox5.Checked; @@ -144,6 +104,23 @@ namespace NovetusLauncher } } + private void NovetusSettings_Close(object sender, FormClosingEventArgs e) + { + GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); + + FormCollection fc = Application.OpenForms; + + foreach (Form frm in fc) + { + //iterate through + if (frm.Name == "CustomGraphicsOptions") + { + frm.Close(); + break; + } + } + } + private void button1_Click(object sender, EventArgs e) { if (comboBox2.SelectedIndex == 6) @@ -156,5 +133,55 @@ namespace NovetusLauncher MessageBox.Show("You do not have the 'Custom' option selected. Please select it before continuing."); } } + #endregion + + #region Functions + void ReadConfigValues() + { + GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); + checkBox5.Checked = GlobalVars.UserConfiguration.ReShade; + checkBox6.Checked = GlobalVars.UserConfiguration.ReShadeFPSDisplay; + checkBox7.Checked = GlobalVars.UserConfiguration.ReShadePerformanceMode; + + switch (GlobalVars.UserConfiguration.GraphicsMode) + { + case Settings.GraphicsOptions.Mode.OpenGL: + comboBox1.SelectedIndex = 1; + break; + case Settings.GraphicsOptions.Mode.DirectX: + comboBox1.SelectedIndex = 2; + break; + default: + comboBox1.SelectedIndex = 0; + break; + } + + switch (GlobalVars.UserConfiguration.QualityLevel) + { + case Settings.GraphicsOptions.Level.VeryLow: + comboBox2.SelectedIndex = 1; + break; + case Settings.GraphicsOptions.Level.Low: + comboBox2.SelectedIndex = 2; + break; + case Settings.GraphicsOptions.Level.Medium: + comboBox2.SelectedIndex = 3; + break; + case Settings.GraphicsOptions.Level.High: + comboBox2.SelectedIndex = 4; + break; + case Settings.GraphicsOptions.Level.Ultra: + comboBox2.SelectedIndex = 5; + break; + case Settings.GraphicsOptions.Level.Custom: + comboBox2.SelectedIndex = 6; + break; + default: + comboBox2.SelectedIndex = 0; + break; + } + } + #endregion } + #endregion }