From 6d4143fa7e330a3cd64abe0656375adb1b41d820 Mon Sep 17 00:00:00 2001 From: Bitl Date: Mon, 25 Nov 2019 17:38:28 -0700 Subject: [PATCH] Customizations now are saved by user name, allowing multiple customizations to be saved under 1 Novetus install. You can now manually save customizations. --- NovetusLauncher/NovetusCMD/Program.cs | 8 +-- NovetusLauncher/NovetusFuncs/GlobalVars.cs | 7 ++- NovetusLauncher/NovetusFuncs/LauncherFuncs.cs | 8 +-- .../NovetusFuncs/ScriptGenerator.cs | 2 +- .../CharacterCustomization.Designer.cs | 61 +++++++++++-------- .../NovetusLauncher/CharacterCustomization.cs | 6 ++ .../NovetusLauncher/ClientinfoCreator.cs | 2 +- NovetusLauncher/NovetusLauncher/ItemMaker.cs | 4 +- NovetusLauncher/NovetusLauncher/LoaderForm.cs | 2 +- NovetusLauncher/NovetusLauncher/MainForm.cs | 14 ++--- .../NovetusLauncher/QuickConfigure.cs | 4 +- 11 files changed, 70 insertions(+), 48 deletions(-) diff --git a/NovetusLauncher/NovetusCMD/Program.cs b/NovetusLauncher/NovetusCMD/Program.cs index d496f9a..f18fb2d 100644 --- a/NovetusLauncher/NovetusCMD/Program.cs +++ b/NovetusLauncher/NovetusCMD/Program.cs @@ -140,7 +140,7 @@ namespace NovetusCMD static void WriteConfigValues() { - LauncherFuncs.WriteConfigValues(GlobalVars.ConfigDir + "\\config.ini"); + LauncherFuncs.WriteConfigValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName); ConsolePrint("Config Saved.", 3); } @@ -155,7 +155,7 @@ namespace NovetusCMD static void ReadConfigValues() { - LauncherFuncs.ReadConfigValues(GlobalVars.ConfigDir + "\\config.ini"); + LauncherFuncs.ReadConfigValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName); ConsolePrint("Config loaded.", 3); ReadClientValues(GlobalVars.SelectedClient); } @@ -255,9 +255,9 @@ namespace NovetusCMD { ConsolePrint("NovetusCMD is now loading all server configurations from the INI file.", 5); - if (!File.Exists(GlobalVars.ConfigDir + "\\config.ini")) + if (!File.Exists(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName)) { - ConsolePrint("WARNING 2 - config.ini not found. Creating one with default values.", 5); + ConsolePrint("WARNING 2 - " + GlobalVars.ConfigName + " not found. Creating one with default values.", 5); WriteConfigValues(); } diff --git a/NovetusLauncher/NovetusFuncs/GlobalVars.cs b/NovetusLauncher/NovetusFuncs/GlobalVars.cs index 5a07b9d..29ac8f4 100644 --- a/NovetusLauncher/NovetusFuncs/GlobalVars.cs +++ b/NovetusLauncher/NovetusFuncs/GlobalVars.cs @@ -131,8 +131,11 @@ public static class GlobalVars public static readonly string ScriptGenName = "CSMPBoot"; public static SimpleHTTPServer WebServer = null; public static bool IsWebServerOn = false; - //vars for loader - public static bool ReadyToLaunch = false; + //config name + public static readonly string ConfigName = "config.ini"; + public static readonly string ConfigNameCustomization = "character_" + PlayerName + ".ini"; + //vars for loader + public static bool ReadyToLaunch = false; //server settings. public static bool UPnP = false; public static string Map = ""; diff --git a/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs b/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs index 5e470ec..c8903f0 100644 --- a/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs +++ b/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs @@ -97,7 +97,7 @@ public class LauncherFuncs if (Decryptline2.Equals("0")) { GeneratePlayerID(); - WriteConfigValues(GlobalVars.ConfigDir + "\\config.ini"); + WriteConfigValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName); } else { @@ -129,7 +129,7 @@ public class LauncherFuncs if (string.IsNullOrWhiteSpace(Decryptline12)) { GenerateTripcode(); - WriteConfigValues(GlobalVars.ConfigDir + "\\config.ini"); + WriteConfigValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName); } else { @@ -137,7 +137,7 @@ public class LauncherFuncs GlobalVars.PlayerTripcode = sdecrypt12; } - ReadCustomizationValues(cfgpath.Replace(".ini", "_customization.ini")); + ReadCustomizationValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization); } public static void WriteConfigValues(string cfgpath) @@ -157,7 +157,7 @@ public class LauncherFuncs ini.IniWriteValue(section, "UPnP", GlobalVars.UPnP.ToString()); ini.IniWriteValue(section, "ItemMakerDisableHelpMessage", GlobalVars.DisabledHelp.ToString()); ini.IniWriteValue(section, "PlayerTripcode", SecurityFuncs.Base64Encode(GlobalVars.PlayerTripcode.ToString())); - WriteCustomizationValues(cfgpath.Replace(".ini", "_customization.ini")); + WriteCustomizationValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization); } public static void ResetConfigValues() diff --git a/NovetusLauncher/NovetusFuncs/ScriptGenerator.cs b/NovetusLauncher/NovetusFuncs/ScriptGenerator.cs index 3ec268f..58b5d63 100644 --- a/NovetusLauncher/NovetusFuncs/ScriptGenerator.cs +++ b/NovetusLauncher/NovetusFuncs/ScriptGenerator.cs @@ -119,7 +119,7 @@ public class ScriptGenerator private static void ReadConfigValues() { - LauncherFuncs.ReadConfigValues(GlobalVars.ConfigDir + "\\config.ini"); + LauncherFuncs.ReadConfigValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName); } public static void GenerateScriptForClient(ScriptType type, string client) diff --git a/NovetusLauncher/NovetusLauncher/CharacterCustomization.Designer.cs b/NovetusLauncher/NovetusLauncher/CharacterCustomization.Designer.cs index 54b30be..9b11794 100644 --- a/NovetusLauncher/NovetusLauncher/CharacterCustomization.Designer.cs +++ b/NovetusLauncher/NovetusLauncher/CharacterCustomization.Designer.cs @@ -49,8 +49,6 @@ namespace NovetusLauncher this.button64 = new System.Windows.Forms.Button(); this.button68 = new System.Windows.Forms.Button(); this.groupBox2 = new System.Windows.Forms.GroupBox(); - this.button70 = new System.Windows.Forms.Button(); - this.button69 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); @@ -58,7 +56,9 @@ namespace NovetusLauncher this.button5 = new System.Windows.Forms.Button(); this.button6 = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.button70 = new System.Windows.Forms.Button(); this.button7 = new System.Windows.Forms.Button(); + this.button69 = new System.Windows.Forms.Button(); this.button8 = new System.Windows.Forms.Button(); this.button9 = new System.Windows.Forms.Button(); this.button10 = new System.Windows.Forms.Button(); @@ -153,6 +153,7 @@ namespace NovetusLauncher this.button54 = new System.Windows.Forms.Button(); this.button53 = new System.Windows.Forms.Button(); this.button52 = new System.Windows.Forms.Button(); + this.button71 = new System.Windows.Forms.Button(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -330,28 +331,6 @@ namespace NovetusLauncher this.groupBox2.TabStop = false; this.groupBox2.Text = "Body Parts"; // - // button70 - // - this.button70.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(174)))), ((int)(((byte)(122)))), ((int)(((byte)(89))))); - this.button70.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.button70.Location = new System.Drawing.Point(244, 97); - this.button70.Name = "button70"; - this.button70.Size = new System.Drawing.Size(20, 20); - this.button70.TabIndex = 33; - this.button70.UseVisualStyleBackColor = false; - this.button70.Click += new System.EventHandler(this.button70_Click); - // - // button69 - // - this.button69.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(112)))), ((int)(((byte)(160))))); - this.button69.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.button69.Location = new System.Drawing.Point(58, 97); - this.button69.Name = "button69"; - this.button69.Size = new System.Drawing.Size(20, 20); - this.button69.TabIndex = 32; - this.button69.UseVisualStyleBackColor = false; - this.button69.Click += new System.EventHandler(this.button69_Click); - // // button2 // this.button2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(13)))), ((int)(((byte)(105)))), ((int)(((byte)(172))))); @@ -461,6 +440,17 @@ namespace NovetusLauncher this.groupBox1.TabStop = false; this.groupBox1.Text = "Part Colors"; // + // button70 + // + this.button70.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(174)))), ((int)(((byte)(122)))), ((int)(((byte)(89))))); + this.button70.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button70.Location = new System.Drawing.Point(244, 97); + this.button70.Name = "button70"; + this.button70.Size = new System.Drawing.Size(20, 20); + this.button70.TabIndex = 33; + this.button70.UseVisualStyleBackColor = false; + this.button70.Click += new System.EventHandler(this.button70_Click); + // // button7 // this.button7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(243)))), ((int)(((byte)(243)))), ((int)(((byte)(243))))); @@ -472,6 +462,17 @@ namespace NovetusLauncher this.button7.UseVisualStyleBackColor = false; this.button7.Click += new System.EventHandler(this.Button7Click); // + // button69 + // + this.button69.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(196)))), ((int)(((byte)(112)))), ((int)(((byte)(160))))); + this.button69.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.button69.Location = new System.Drawing.Point(58, 97); + this.button69.Name = "button69"; + this.button69.Size = new System.Drawing.Size(20, 20); + this.button69.TabIndex = 32; + this.button69.UseVisualStyleBackColor = false; + this.button69.Click += new System.EventHandler(this.button69_Click); + // // button8 // this.button8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(228)))), ((int)(((byte)(229)))), ((int)(((byte)(224))))); @@ -1302,6 +1303,7 @@ namespace NovetusLauncher // // tabPage7 // + this.tabPage7.Controls.Add(this.button71); this.tabPage7.Controls.Add(this.label8); this.tabPage7.Controls.Add(this.pictureBox10); this.tabPage7.Controls.Add(this.button60); @@ -1466,6 +1468,16 @@ namespace NovetusLauncher this.button52.UseVisualStyleBackColor = true; this.button52.Click += new System.EventHandler(this.Button52Click); // + // button71 + // + this.button71.Location = new System.Drawing.Point(365, 37); + this.button71.Name = "button71"; + this.button71.Size = new System.Drawing.Size(99, 31); + this.button71.TabIndex = 13; + this.button71.Text = "Save Outfit"; + this.button71.UseVisualStyleBackColor = true; + this.button71.Click += new System.EventHandler(this.button71_Click); + // // CharacterCustomization // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1627,5 +1639,6 @@ namespace NovetusLauncher private System.Windows.Forms.Button button68; private System.Windows.Forms.Button button70; private System.Windows.Forms.Button button69; + private System.Windows.Forms.Button button71; } } diff --git a/NovetusLauncher/NovetusLauncher/CharacterCustomization.cs b/NovetusLauncher/NovetusLauncher/CharacterCustomization.cs index 67a8db4..9b7c949 100644 --- a/NovetusLauncher/NovetusLauncher/CharacterCustomization.cs +++ b/NovetusLauncher/NovetusLauncher/CharacterCustomization.cs @@ -1345,6 +1345,12 @@ namespace NovetusLauncher ApplyPreset(9, 194, 9, 9, 119, 119); } + private void button71_Click(object sender, EventArgs e) + { + LauncherFuncs.WriteCustomizationValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization); + MessageBox.Show("Outfit Saved!"); + } + /* private void button61_Click(object sender, EventArgs e) { diff --git a/NovetusLauncher/NovetusLauncher/ClientinfoCreator.cs b/NovetusLauncher/NovetusLauncher/ClientinfoCreator.cs index 451d037..06b7c5e 100644 --- a/NovetusLauncher/NovetusLauncher/ClientinfoCreator.cs +++ b/NovetusLauncher/NovetusLauncher/ClientinfoCreator.cs @@ -75,7 +75,7 @@ namespace NovetusLauncher void ClientinfoCreatorLoad(object sender, EventArgs e) { - string cfgpath = GlobalVars.ConfigDir + "\\config.ini"; + string cfgpath = GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName; if (!File.Exists(cfgpath)) { LauncherFuncs.WriteConfigValues(cfgpath); diff --git a/NovetusLauncher/NovetusLauncher/ItemMaker.cs b/NovetusLauncher/NovetusLauncher/ItemMaker.cs index df241dc..f77649a 100644 --- a/NovetusLauncher/NovetusLauncher/ItemMaker.cs +++ b/NovetusLauncher/NovetusLauncher/ItemMaker.cs @@ -108,7 +108,7 @@ namespace NovetusLauncher void ItemMakerLoad(object sender, EventArgs e) { - string cfgpath = GlobalVars.ConfigDir + "\\config.ini"; + string cfgpath = GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName; if (!File.Exists(cfgpath)) { LauncherFuncs.WriteConfigValues(cfgpath); @@ -133,7 +133,7 @@ namespace NovetusLauncher void ItemMakerClose(object sender, CancelEventArgs e) { - LauncherFuncs.WriteConfigValues(GlobalVars.ConfigDir + "\\config.ini"); + LauncherFuncs.WriteConfigValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName); } void CheckBox1CheckedChanged(object sender, EventArgs e) diff --git a/NovetusLauncher/NovetusLauncher/LoaderForm.cs b/NovetusLauncher/NovetusLauncher/LoaderForm.cs index 0835b5c..c93c185 100644 --- a/NovetusLauncher/NovetusLauncher/LoaderForm.cs +++ b/NovetusLauncher/NovetusLauncher/LoaderForm.cs @@ -170,7 +170,7 @@ namespace NovetusLauncher void ReadConfigValues() { - LauncherFuncs.ReadConfigValues(GlobalVars.ConfigDir + "\\config.ini"); + LauncherFuncs.ReadConfigValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName); } void ReadClientValues(string ClientName) diff --git a/NovetusLauncher/NovetusLauncher/MainForm.cs b/NovetusLauncher/NovetusLauncher/MainForm.cs index 9051d60..b18224e 100644 --- a/NovetusLauncher/NovetusLauncher/MainForm.cs +++ b/NovetusLauncher/NovetusLauncher/MainForm.cs @@ -322,14 +322,14 @@ namespace NovetusLauncher { ConsolePrint("ERROR 4 - changelog.txt not found.", 2); } - if (!File.Exists(GlobalVars.ConfigDir + "\\config.ini")) + if (!File.Exists(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName)) { - ConsolePrint("WARNING 1 - config.ini not found. Creating one with default values.", 5); + ConsolePrint("WARNING 1 - " + GlobalVars.ConfigName + " not found. Creating one with default values.", 5); WriteConfigValues(); } - if (!File.Exists(GlobalVars.ConfigDir + "\\config_customization.ini")) + if (!File.Exists(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization)) { - ConsolePrint("WARNING 2 - config_customization.ini not found. Creating one with default values.", 5); + ConsolePrint("WARNING 2 - " + GlobalVars.ConfigNameCustomization + " not found. Creating one with default values.", 5); WriteCustomizationValues(); } if (!File.Exists(GlobalVars.ConfigDir + "\\servers.txt")) @@ -381,7 +381,7 @@ namespace NovetusLauncher void ReadConfigValues() { - LauncherFuncs.ReadConfigValues(GlobalVars.ConfigDir + "\\config.ini"); + LauncherFuncs.ReadConfigValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName); if (GlobalVars.CloseOnLaunch == true) { @@ -411,13 +411,13 @@ namespace NovetusLauncher void WriteConfigValues() { - LauncherFuncs.WriteConfigValues(GlobalVars.ConfigDir + "\\config.ini"); + LauncherFuncs.WriteConfigValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName); ConsolePrint("Config Saved.", 3); } void WriteCustomizationValues() { - LauncherFuncs.WriteCustomizationValues(GlobalVars.ConfigDir + "\\config_customization.ini"); + LauncherFuncs.WriteCustomizationValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization); ConsolePrint("Config Saved.", 3); } diff --git a/NovetusLauncher/NovetusLauncher/QuickConfigure.cs b/NovetusLauncher/NovetusLauncher/QuickConfigure.cs index 5c19e9a..56c05c5 100644 --- a/NovetusLauncher/NovetusLauncher/QuickConfigure.cs +++ b/NovetusLauncher/NovetusLauncher/QuickConfigure.cs @@ -33,7 +33,7 @@ namespace NovetusLauncher void QuickConfigureLoad(object sender, EventArgs e) { - string cfgpath = GlobalVars.ConfigDir + "\\config.ini"; + string cfgpath = GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName; if (!File.Exists(cfgpath)) { LauncherFuncs.WriteConfigValues(cfgpath); @@ -107,7 +107,7 @@ namespace NovetusLauncher void QuickConfigureClose(object sender, CancelEventArgs e) { - LauncherFuncs.WriteConfigValues(GlobalVars.ConfigDir + "\\config.ini"); + LauncherFuncs.WriteConfigValues(GlobalVars.ConfigDir + "\\" + GlobalVars.ConfigName); GlobalVars.ReadyToLaunch = true; } }