From a4d10036bc1fd70685400784e9deda439aed6812 Mon Sep 17 00:00:00 2001 From: Bitl Date: Wed, 13 Nov 2019 10:53:38 -0700 Subject: [PATCH] added a button to clear cache. --- .../NovetusLauncher/AssetLocalizer.cs | 21 ++++---- .../NovetusLauncher/MainForm.Designer.cs | 48 +++++++++---------- NovetusLauncher/NovetusLauncher/MainForm.cs | 14 ++++++ NovetusLauncher/NovetusLauncher/MainForm.resx | 8 ++-- 4 files changed, 53 insertions(+), 38 deletions(-) diff --git a/NovetusLauncher/NovetusLauncher/AssetLocalizer.cs b/NovetusLauncher/NovetusLauncher/AssetLocalizer.cs index aefee82..3a5a4a9 100644 --- a/NovetusLauncher/NovetusLauncher/AssetLocalizer.cs +++ b/NovetusLauncher/NovetusLauncher/AssetLocalizer.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -71,29 +72,29 @@ namespace NovetusLauncher { comboBox1.SelectedItem = "RBXL"; - if (!System.IO.Directory.Exists(GlobalVars.AssetCacheDirFonts)) + if (!Directory.Exists(GlobalVars.AssetCacheDirFonts)) { - System.IO.Directory.CreateDirectory(GlobalVars.AssetCacheDirFonts); + Directory.CreateDirectory(GlobalVars.AssetCacheDirFonts); } - if (!System.IO.Directory.Exists(GlobalVars.AssetCacheDirSky)) + if (!Directory.Exists(GlobalVars.AssetCacheDirSky)) { - System.IO.Directory.CreateDirectory(GlobalVars.AssetCacheDirSky); + Directory.CreateDirectory(GlobalVars.AssetCacheDirSky); } - if (!System.IO.Directory.Exists(GlobalVars.AssetCacheDirSounds)) + if (!Directory.Exists(GlobalVars.AssetCacheDirSounds)) { - System.IO.Directory.CreateDirectory(GlobalVars.AssetCacheDirSounds); + Directory.CreateDirectory(GlobalVars.AssetCacheDirSounds); } - if (!System.IO.Directory.Exists(GlobalVars.AssetCacheDirTexturesGUI)) + if (!Directory.Exists(GlobalVars.AssetCacheDirTexturesGUI)) { - System.IO.Directory.CreateDirectory(GlobalVars.AssetCacheDirTexturesGUI); + Directory.CreateDirectory(GlobalVars.AssetCacheDirTexturesGUI); } - if (!System.IO.Directory.Exists(GlobalVars.AssetCacheDirScripts)) + if (!Directory.Exists(GlobalVars.AssetCacheDirScripts)) { - System.IO.Directory.CreateDirectory(GlobalVars.AssetCacheDirScripts); + Directory.CreateDirectory(GlobalVars.AssetCacheDirScripts); } } } diff --git a/NovetusLauncher/NovetusLauncher/MainForm.Designer.cs b/NovetusLauncher/NovetusLauncher/MainForm.Designer.cs index 858196f..e459db8 100644 --- a/NovetusLauncher/NovetusLauncher/MainForm.Designer.cs +++ b/NovetusLauncher/NovetusLauncher/MainForm.Designer.cs @@ -92,7 +92,6 @@ namespace NovetusLauncher this.richTextBox2 = new System.Windows.Forms.RichTextBox(); this.tabPage5 = new System.Windows.Forms.TabPage(); this.button25 = new System.Windows.Forms.Button(); - this.label18 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); @@ -119,6 +118,7 @@ namespace NovetusLauncher this.label11 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label(); + this.button26 = new System.Windows.Forms.Button(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); @@ -757,8 +757,8 @@ namespace NovetusLauncher // // tabPage5 // + this.tabPage5.Controls.Add(this.button26); this.tabPage5.Controls.Add(this.button25); - this.tabPage5.Controls.Add(this.label18); this.tabPage5.Controls.Add(this.label7); this.tabPage5.Controls.Add(this.label10); this.tabPage5.Controls.Add(this.label9); @@ -787,15 +787,6 @@ namespace NovetusLauncher this.button25.UseVisualStyleBackColor = true; this.button25.Click += new System.EventHandler(this.button25_Click); // - // label18 - // - this.label18.AutoSize = true; - this.label18.Location = new System.Drawing.Point(334, 3); - this.label18.Name = "label18"; - this.label18.Size = new System.Drawing.Size(37, 13); - this.label18.TabIndex = 55; - this.label18.Text = "Config"; - // // label7 // this.label7.Location = new System.Drawing.Point(274, 237); @@ -861,19 +852,19 @@ namespace NovetusLauncher // button9 // this.button9.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button9.Location = new System.Drawing.Point(355, 19); + this.button9.Location = new System.Drawing.Point(174, 24); this.button9.Name = "button9"; - this.button9.Size = new System.Drawing.Size(43, 29); + this.button9.Size = new System.Drawing.Size(82, 19); this.button9.TabIndex = 37; - this.button9.Text = "Reset"; + this.button9.Text = "Reset Config"; this.button9.UseVisualStyleBackColor = true; this.button9.Click += new System.EventHandler(this.Button9Click); // // checkBox3 // - this.checkBox3.Location = new System.Drawing.Point(119, 25); + this.checkBox3.Location = new System.Drawing.Point(286, 4); this.checkBox3.Name = "checkBox3"; - this.checkBox3.Size = new System.Drawing.Size(114, 19); + this.checkBox3.Size = new System.Drawing.Size(109, 19); this.checkBox3.TabIndex = 22; this.checkBox3.Text = "Local Play Mode"; this.checkBox3.UseVisualStyleBackColor = true; @@ -883,11 +874,11 @@ namespace NovetusLauncher // this.checkBox1.Checked = true; this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBox1.Location = new System.Drawing.Point(119, 3); + this.checkBox1.Location = new System.Drawing.Point(95, 5); this.checkBox1.Name = "checkBox1"; - this.checkBox1.Size = new System.Drawing.Size(182, 17); + this.checkBox1.Size = new System.Drawing.Size(185, 17); this.checkBox1.TabIndex = 5; - this.checkBox1.Text = "Minimize Launcher on Launch"; + this.checkBox1.Text = "Minimize Launcher on Launch"; this.checkBox1.UseCompatibleTextRendering = true; this.checkBox1.UseVisualStyleBackColor = true; this.checkBox1.CheckedChanged += new System.EventHandler(this.CheckBox1CheckedChanged); @@ -895,11 +886,11 @@ namespace NovetusLauncher // button5 // this.button5.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.button5.Location = new System.Drawing.Point(307, 19); + this.button5.Location = new System.Drawing.Point(95, 24); this.button5.Name = "button5"; - this.button5.Size = new System.Drawing.Size(42, 29); + this.button5.Size = new System.Drawing.Size(73, 19); this.button5.TabIndex = 10; - this.button5.Text = "Save"; + this.button5.Text = "Save Config"; this.button5.UseVisualStyleBackColor = true; this.button5.Click += new System.EventHandler(this.Button5Click); // @@ -1042,6 +1033,16 @@ namespace NovetusLauncher this.label16.Size = new System.Drawing.Size(2, 65); this.label16.TabIndex = 51; // + // button26 + // + this.button26.Location = new System.Drawing.Point(262, 24); + this.button26.Name = "button26"; + this.button26.Size = new System.Drawing.Size(133, 19); + this.button26.TabIndex = 57; + this.button26.Text = "Clear Local Asset Cache"; + this.button26.UseVisualStyleBackColor = true; + this.button26.Click += new System.EventHandler(this.button26_Click); + // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -1087,7 +1088,6 @@ namespace NovetusLauncher this.tabPage7.ResumeLayout(false); this.tabPage8.ResumeLayout(false); this.tabPage5.ResumeLayout(false); - this.tabPage5.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -1175,6 +1175,6 @@ namespace NovetusLauncher private System.Windows.Forms.TreeView _fieldsTreeCache; private System.Windows.Forms.Button button24; private System.Windows.Forms.Button button25; - private System.Windows.Forms.Label label18; + private System.Windows.Forms.Button button26; } } diff --git a/NovetusLauncher/NovetusLauncher/MainForm.cs b/NovetusLauncher/NovetusLauncher/MainForm.cs index 240cbb8..ab72c76 100644 --- a/NovetusLauncher/NovetusLauncher/MainForm.cs +++ b/NovetusLauncher/NovetusLauncher/MainForm.cs @@ -1524,5 +1524,19 @@ namespace NovetusLauncher MessageBox.Show(addon.getInstallOutcome()); } } + + private void button26_Click(object sender, EventArgs e) + { + if (Directory.Exists(GlobalVars.AssetCacheDir)) + { + Directory.Delete(GlobalVars.AssetCacheDir, true); + ConsolePrint("Asset cache cleared!", 3); + MessageBox.Show("Asset cache cleared!"); + } + else + { + MessageBox.Show("There is no asset cache to clear."); + } + } } } diff --git a/NovetusLauncher/NovetusLauncher/MainForm.resx b/NovetusLauncher/NovetusLauncher/MainForm.resx index 56b0629..510551f 100644 --- a/NovetusLauncher/NovetusLauncher/MainForm.resx +++ b/NovetusLauncher/NovetusLauncher/MainForm.resx @@ -117,16 +117,16 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ROBLOX and the ROBLOX Clients were made by the ROBLOX Corporation. The ROBLOX Corporation does not support or endorse the creation of Novetus. Bitl is not affiliated with the ROBLOX Corporation or its subsidiaries. Bitl does not own any of the content included with Novetus. LUA scripts were used to build a client that can connect to LAN and the Internet. The LUA scripts used were borrowed from the RBXPri client and modified for this project. All credit for the LUA code included with the RBXPri client goes to the RBXPri team. All credit for the LUA code used with "non-modern" clients goes to Scripter John and EnergyCell. All credit for the LUA code used for character customization goes to RBXBanLand. - - NOTE: - If you have a problem where you can't see your character, REGENERATE YOUR PLAYER ID THEN REJOIN THE SERVER. - If you tried to connect to the server and you get an error, REJOIN THE SERVER. - To reset your character, type !!!reset into chat. + + + + ROBLOX and the ROBLOX Clients were made by the ROBLOX Corporation. The ROBLOX Corporation does not support or endorse the creation of Novetus. Bitl is not affiliated with the ROBLOX Corporation or its subsidiaries. Bitl does not own any of the content included with Novetus. LUA scripts were used to build a client that can connect to LAN and the Internet. The LUA scripts used were borrowed from the RBXPri client and modified for this project. All credit for the LUA code included with the RBXPri client goes to the RBXPri team. All credit for the LUA code used with "non-modern" clients goes to Scripter John and EnergyCell. All credit for the LUA code used for character customization goes to RBXBanLand.