From b1d9f2fee237ea710b19c1ed264062f0ca4676e2 Mon Sep 17 00:00:00 2001 From: Bitl Date: Sat, 19 Oct 2019 09:25:45 -0700 Subject: [PATCH] finalized 1.0 features --- NovetusLauncher/.vs/NovetusLauncher/v14/.suo | Bin 134656 -> 147456 bytes NovetusLauncher/NovetusCMD/NovetusCMD.csproj | 4 + NovetusLauncher/NovetusFuncs/IconLoader.cs | 34 +++---- NovetusLauncher/NovetusFuncs/LauncherFuncs.cs | 21 ++++ .../CharacterCustomization.Designer.cs | 23 +++-- .../NovetusLauncher/CharacterCustomization.cs | 94 +++++++++--------- 6 files changed, 98 insertions(+), 78 deletions(-) diff --git a/NovetusLauncher/.vs/NovetusLauncher/v14/.suo b/NovetusLauncher/.vs/NovetusLauncher/v14/.suo index 2bc59c51a981da0701ed14e8671cfc72d83c72a5..86a049bdbeba265d48b8d0dd7140b943014e1d3f 100644 GIT binary patch delta 4455 zcmdUy3s6+o8OQH;cNf-WS9g_{yaEXE1q!m@iUHSv79RmreAFn4B5k6zh-+#zx;&!M zk*TsrIi|H~M5PmxVB|Vpr)`=wT5F~TF^L*uYOsyz#2RBAObVLN|GCR1TXiPMw9{$N z%x}+kzI*O>&;1_f+^ybatgh~}EiGB{H>)I#fUE;w_Vn}!HGwD)&34Zibg*(0dE{k% zD)+s1{Mn6XX)aqOyGhS($%X8goF23q6DP@Rjc$^KERbPCYwS#9k|hkLPW6WtErgLi z+T9n@Okf5EFb6~cBggElq0hT_!BVi_3xS*kOjy)?tY3r4Dqn`)ngHo^nECgj> z5n!8UJDe*ZRDqSi1y+G4z)!#$Af6)HTF6gVvJ_hiPb7$wQnK?WI_tz$ORfQDs8CCU7N%#LNG?{W1ddX%l|S7a6*5;-k; zQ3@teV8XqUqcrT2#R)b$L7Ca4k1K0?Z$WR9vg!UXO3yUzmFXjQ}3frU? zYEQ0(ZF3qSzdXtEmAqSZBp)3k5?XGS+`z$TSQ@K+srE^aRb3 zBE9_+m@B4Oi<-#guauoJMHUhxu~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?__sIefQaM_cA6 zcke%VAg7199nJhXgB-v0TC7d8hG`a?4I-3cMTSnuNA5$hn< zh@DC7DeJ1lUgs-GSWVJntn;oN{J23LHPE3UJNcsE;In*RLMiP3>n4uDuuc>e|n1SjT<)4h2!Uk*7ve5w9?j&SmR;j+F9o zbkvuRyoPd}0Thl?Mz81>QnnAb&8A#_xR^HblW8!W~FI1?Ui}_ zGUo<#bcna;aLX zmlmKvt+WQRU2;eg|Ei3#eD~5aDMwnM9BC&DInych5DsH<-b%E`{4_>@lioQd;lxwD z?z5-2ZGPargY^fB#j;Rir@!A>O#b2^-&#$%mOLq4vVsEqUMJ;AiMWbbAZ0;H$9o1Y z`H9e2aE4_=N|REcw;<;_ovhj_ ztWAeL1NJ3CZ-Ko9kTUQqbQX*!3%^;|K|Nnt5z;Zfp^>&vS-*bW^o)$;l>GGUL`!x? za$8Pn%UR@u@Pi~?(@;vyqk+PXQb2DSO4F_M{aQ(z}*>@p$D zoH{wehKu_Q=?>iJt(?$hDQo2l|5;^qILySOb= u{zNh5$ZyH~+-O + + + + \ No newline at end of file diff --git a/NovetusLauncher/NovetusFuncs/IconLoader.cs b/NovetusLauncher/NovetusFuncs/IconLoader.cs index e7f9b01..2f88b89 100644 --- a/NovetusLauncher/NovetusFuncs/IconLoader.cs +++ b/NovetusLauncher/NovetusFuncs/IconLoader.cs @@ -3,6 +3,8 @@ using System.IO; using System.Windows.Forms; using System.IO.Compression; using System.Linq; +using System.Drawing; +using System.Drawing.Imaging; public class IconLoader { @@ -28,7 +30,18 @@ public class IconLoader { using (Stream str = openFileDialog1.OpenFile()) { - CopyStream(openFileDialog1.FileName, extradir + "\\icons\\" + GlobalVars.PlayerName + ".png"); + using (Stream output = new FileStream(extradir + "\\icons\\" + GlobalVars.PlayerName + ".png", FileMode.Create)) + { + byte[] buffer = new byte[32 * 1024]; + int read; + + while ((read = str.Read(buffer, 0, buffer.Length)) > 0) + { + output.Write(buffer, 0, read); + } + } + + str.Close(); } installOutcome = "Icon " + openFileDialog1.SafeFileName + " installed!"; @@ -39,23 +52,4 @@ public class IconLoader } } } - - public static void CopyStream(string inputFilePath, string outputFilePath) - { - int bufferSize = 1024 * 1024; - - using (FileStream fileStream = new FileStream(outputFilePath, FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite)) - //using (FileStream fs = File.Open(, FileMode.Open, FileAccess.Read, FileShare.Read)) - { - FileStream fs = new FileStream(inputFilePath, FileMode.Open, FileAccess.ReadWrite); - fileStream.SetLength(fs.Length); - int bytesRead = -1; - byte[] bytes = new byte[bufferSize]; - - while ((bytesRead = fs.Read(bytes, 0, bufferSize)) > 0) - { - fileStream.Write(bytes, 0, bytesRead); - } - } - } } diff --git a/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs b/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs index a0eebbe..1410d53 100644 --- a/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs +++ b/NovetusLauncher/NovetusFuncs/LauncherFuncs.cs @@ -7,6 +7,8 @@ * To change this template use Tools | Options | Coding | Edit Standard Headers. */ using System; +using System.Drawing; +using System.Drawing.Imaging; using System.IO; public class LauncherFuncs @@ -580,4 +582,23 @@ public class LauncherFuncs //2147483647 is max id. GlobalVars.UserID = randomID; } + + public static Image LoadImage(string fileFullName) + { + Stream fileStream = File.OpenRead(fileFullName); + Image image = Image.FromStream(fileStream); + + // PropertyItems seem to get lost when fileStream is closed to quickly (?); perhaps + // this is the reason Microsoft didn't want to close it in the first place. + PropertyItem[] items = image.PropertyItems; + + fileStream.Close(); + + foreach (PropertyItem item in items) + { + image.SetPropertyItem(item); + } + + return image; + } } diff --git a/NovetusLauncher/NovetusLauncher/CharacterCustomization.Designer.cs b/NovetusLauncher/NovetusLauncher/CharacterCustomization.Designer.cs index de84c20..2e7ebf7 100644 --- a/NovetusLauncher/NovetusLauncher/CharacterCustomization.Designer.cs +++ b/NovetusLauncher/NovetusLauncher/CharacterCustomization.Designer.cs @@ -128,6 +128,7 @@ namespace NovetusLauncher this.pictureBox9 = new System.Windows.Forms.PictureBox(); this.listBox9 = new System.Windows.Forms.ListBox(); this.tabPage7 = new System.Windows.Forms.TabPage(); + this.button61 = new System.Windows.Forms.Button(); this.label8 = new System.Windows.Forms.Label(); this.pictureBox10 = new System.Windows.Forms.PictureBox(); this.button60 = new System.Windows.Forms.Button(); @@ -142,7 +143,6 @@ namespace NovetusLauncher this.button54 = new System.Windows.Forms.Button(); this.button53 = new System.Windows.Forms.Button(); this.button52 = new System.Windows.Forms.Button(); - this.button61 = new System.Windows.Forms.Button(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); this.groupBox2.SuspendLayout(); @@ -1191,6 +1191,16 @@ namespace NovetusLauncher this.tabPage7.Text = "OTHER"; this.tabPage7.UseVisualStyleBackColor = true; // + // button61 + // + this.button61.Location = new System.Drawing.Point(368, 191); + this.button61.Name = "button61"; + this.button61.Size = new System.Drawing.Size(92, 42); + this.button61.TabIndex = 13; + this.button61.Text = "Generate Charapp"; + this.button61.UseVisualStyleBackColor = true; + this.button61.Click += new System.EventHandler(this.button61_Click); + // // label8 // this.label8.Location = new System.Drawing.Point(293, 6); @@ -1205,6 +1215,7 @@ namespace NovetusLauncher this.pictureBox10.Location = new System.Drawing.Point(294, 37); this.pictureBox10.Name = "pictureBox10"; this.pictureBox10.Size = new System.Drawing.Size(65, 64); + this.pictureBox10.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox10.TabIndex = 11; this.pictureBox10.TabStop = false; // @@ -1333,16 +1344,6 @@ namespace NovetusLauncher this.button52.UseVisualStyleBackColor = true; this.button52.Click += new System.EventHandler(this.Button52Click); // - // button61 - // - this.button61.Location = new System.Drawing.Point(368, 191); - this.button61.Name = "button61"; - this.button61.Size = new System.Drawing.Size(92, 42); - this.button61.TabIndex = 13; - this.button61.Text = "Generate Charapp"; - this.button61.UseVisualStyleBackColor = true; - this.button61.Click += new System.EventHandler(this.button61_Click); - // // CharacterCustomization // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/NovetusLauncher/NovetusLauncher/CharacterCustomization.cs b/NovetusLauncher/NovetusLauncher/CharacterCustomization.cs index 0092609..6a45aaa 100644 --- a/NovetusLauncher/NovetusLauncher/CharacterCustomization.cs +++ b/NovetusLauncher/NovetusLauncher/CharacterCustomization.cs @@ -134,12 +134,12 @@ namespace NovetusLauncher try { - Image icon1 = Image.FromFile(extradir + "\\icons\\" + GlobalVars.PlayerName + ".png"); + Image icon1 = LauncherFuncs.LoadImage(extradir + "\\icons\\" + GlobalVars.PlayerName + ".png"); pictureBox10.Image = icon1; } catch (Exception) { - Image icon1 = Image.FromFile(extradir + "\\NoExtra.png"); + Image icon1 = LauncherFuncs.LoadImage(extradir + "\\NoExtra.png"); pictureBox10.Image = icon1; } } @@ -174,11 +174,11 @@ namespace NovetusLauncher listBox1.Enabled = true; listBox2.Enabled = true; listBox3.Enabled = true; - Image icon1 = Image.FromFile(hatdir + @"\\" + GlobalVars.Custom_Hat1ID_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(hatdir + @"\\" + GlobalVars.Custom_Hat1ID_Offline.Replace(".rbxm", "") + ".png"); pictureBox1.Image = icon1; - Image icon2 = Image.FromFile(hatdir + @"\\" + GlobalVars.Custom_Hat2ID_Offline.Replace(".rbxm", "") + ".png"); + Image icon2 = LauncherFuncs.LoadImage(hatdir + @"\\" + GlobalVars.Custom_Hat2ID_Offline.Replace(".rbxm", "") + ".png"); pictureBox2.Image = icon2; - Image icon3 = Image.FromFile(hatdir + @"\\" + GlobalVars.Custom_Hat3ID_Offline.Replace(".rbxm", "") + ".png"); + Image icon3 = LauncherFuncs.LoadImage(hatdir + @"\\" + GlobalVars.Custom_Hat3ID_Offline.Replace(".rbxm", "") + ".png"); pictureBox3.Image = icon3; } } @@ -209,7 +209,7 @@ namespace NovetusLauncher } listBox4.SelectedItem = GlobalVars.Custom_Face_Offline; listBox4.Enabled = true; - Image icon1 = Image.FromFile(facedir + @"\\" + GlobalVars.Custom_Face_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(facedir + @"\\" + GlobalVars.Custom_Face_Offline.Replace(".rbxm", "") + ".png"); pictureBox4.Image = icon1; } } @@ -240,7 +240,7 @@ namespace NovetusLauncher } listBox5.SelectedItem = GlobalVars.Custom_T_Shirt_Offline; listBox5.Enabled = true; - Image icon1 = Image.FromFile(tshirtdir + @"\\" + GlobalVars.Custom_T_Shirt_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(tshirtdir + @"\\" + GlobalVars.Custom_T_Shirt_Offline.Replace(".rbxm", "") + ".png"); pictureBox5.Image = icon1; } } @@ -271,7 +271,7 @@ namespace NovetusLauncher } listBox6.SelectedItem = GlobalVars.Custom_Shirt_Offline; listBox6.Enabled = true; - Image icon1 = Image.FromFile(shirtdir + @"\\" + GlobalVars.Custom_Shirt_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(shirtdir + @"\\" + GlobalVars.Custom_Shirt_Offline.Replace(".rbxm", "") + ".png"); pictureBox6.Image = icon1; } } @@ -302,7 +302,7 @@ namespace NovetusLauncher } listBox7.SelectedItem = GlobalVars.Custom_Pants_Offline; listBox7.Enabled = true; - Image icon1 = Image.FromFile(pantsdir + @"\\" + GlobalVars.Custom_Pants_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(pantsdir + @"\\" + GlobalVars.Custom_Pants_Offline.Replace(".rbxm", "") + ".png"); pictureBox7.Image = icon1; } } @@ -333,7 +333,7 @@ namespace NovetusLauncher } listBox8.SelectedItem = GlobalVars.Custom_Head_Offline; listBox8.Enabled = true; - Image icon1 = Image.FromFile(headdir + @"\\" + GlobalVars.Custom_Head_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(headdir + @"\\" + GlobalVars.Custom_Head_Offline.Replace(".rbxm", "") + ".png"); pictureBox8.Image = icon1; } } @@ -391,14 +391,14 @@ namespace NovetusLauncher listBox9.Enabled = true; try { - Image icon1 = Image.FromFile(extradir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(extradir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; } catch(Exception) { if (Directory.Exists(hatdir)) { - Image icon1 = Image.FromFile(hatdir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(hatdir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; } } @@ -422,7 +422,7 @@ namespace NovetusLauncher if (Directory.Exists(hatdir)) { GlobalVars.Custom_Hat1ID_Offline = listBox1.SelectedItem.ToString(); - Image icon1 = Image.FromFile(hatdir + "\\" + GlobalVars.Custom_Hat1ID_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(hatdir + "\\" + GlobalVars.Custom_Hat1ID_Offline.Replace(".rbxm", "") + ".png"); pictureBox1.Image = icon1; } } @@ -432,7 +432,7 @@ namespace NovetusLauncher if (Directory.Exists(hatdir)) { GlobalVars.Custom_Hat2ID_Offline = listBox2.SelectedItem.ToString(); - Image icon2 = Image.FromFile(hatdir + "\\" + GlobalVars.Custom_Hat2ID_Offline.Replace(".rbxm", "") + ".png"); + Image icon2 = LauncherFuncs.LoadImage(hatdir + "\\" + GlobalVars.Custom_Hat2ID_Offline.Replace(".rbxm", "") + ".png"); pictureBox2.Image = icon2; } } @@ -442,7 +442,7 @@ namespace NovetusLauncher if (Directory.Exists(hatdir)) { GlobalVars.Custom_Hat3ID_Offline = listBox3.SelectedItem.ToString(); - Image icon3 = Image.FromFile(hatdir + "\\" + GlobalVars.Custom_Hat3ID_Offline.Replace(".rbxm", "") + ".png"); + Image icon3 = LauncherFuncs.LoadImage(hatdir + "\\" + GlobalVars.Custom_Hat3ID_Offline.Replace(".rbxm", "") + ".png"); pictureBox3.Image = icon3; } } @@ -455,17 +455,17 @@ namespace NovetusLauncher int randomHat1 = random.Next(listBox1.Items.Count); listBox1.SelectedItem = listBox1.Items[randomHat1]; GlobalVars.Custom_Hat1ID_Offline = listBox1.SelectedItem.ToString(); - Image icon1 = Image.FromFile(hatdir + "\\" + GlobalVars.Custom_Hat1ID_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(hatdir + "\\" + GlobalVars.Custom_Hat1ID_Offline.Replace(".rbxm", "") + ".png"); pictureBox1.Image = icon1; int randomHat2 = random.Next(listBox2.Items.Count); listBox2.SelectedItem = listBox1.Items[randomHat2]; GlobalVars.Custom_Hat2ID_Offline = listBox2.SelectedItem.ToString(); - Image icon2 = Image.FromFile(hatdir + "\\" + GlobalVars.Custom_Hat2ID_Offline.Replace(".rbxm", "") + ".png"); + Image icon2 = LauncherFuncs.LoadImage(hatdir + "\\" + GlobalVars.Custom_Hat2ID_Offline.Replace(".rbxm", "") + ".png"); pictureBox2.Image = icon2; int randomHat3 = random.Next(listBox3.Items.Count); listBox3.SelectedItem = listBox1.Items[randomHat3]; GlobalVars.Custom_Hat3ID_Offline = listBox3.SelectedItem.ToString(); - Image icon3 = Image.FromFile(hatdir + "\\" + GlobalVars.Custom_Hat3ID_Offline.Replace(".rbxm", "") + ".png"); + Image icon3 = LauncherFuncs.LoadImage(hatdir + "\\" + GlobalVars.Custom_Hat3ID_Offline.Replace(".rbxm", "") + ".png"); pictureBox3.Image = icon3; } } @@ -476,15 +476,15 @@ namespace NovetusLauncher { listBox1.SelectedItem = "NoHat.rbxm"; GlobalVars.Custom_Hat1ID_Offline = listBox1.SelectedItem.ToString(); - Image icon1 = Image.FromFile(hatdir + "\\" + GlobalVars.Custom_Hat1ID_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(hatdir + "\\" + GlobalVars.Custom_Hat1ID_Offline.Replace(".rbxm", "") + ".png"); pictureBox1.Image = icon1; listBox2.SelectedItem = "NoHat.rbxm"; GlobalVars.Custom_Hat2ID_Offline = listBox2.SelectedItem.ToString(); - Image icon2 = Image.FromFile(hatdir + "\\" + GlobalVars.Custom_Hat2ID_Offline.Replace(".rbxm", "") + ".png"); + Image icon2 = LauncherFuncs.LoadImage(hatdir + "\\" + GlobalVars.Custom_Hat2ID_Offline.Replace(".rbxm", "") + ".png"); pictureBox2.Image = icon2; listBox3.SelectedItem = "NoHat.rbxm"; GlobalVars.Custom_Hat3ID_Offline = listBox3.SelectedItem.ToString(); - Image icon3 = Image.FromFile(hatdir + "\\" + GlobalVars.Custom_Hat3ID_Offline.Replace(".rbxm", "") + ".png"); + Image icon3 = LauncherFuncs.LoadImage(hatdir + "\\" + GlobalVars.Custom_Hat3ID_Offline.Replace(".rbxm", "") + ".png"); pictureBox3.Image = icon3; } } @@ -496,7 +496,7 @@ namespace NovetusLauncher if (Directory.Exists(facedir)) { GlobalVars.Custom_Face_Offline = listBox4.SelectedItem.ToString(); - Image icon1 = Image.FromFile(facedir + "\\" + GlobalVars.Custom_Face_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(facedir + "\\" + GlobalVars.Custom_Face_Offline.Replace(".rbxm", "") + ".png"); pictureBox4.Image = icon1; } } @@ -509,7 +509,7 @@ namespace NovetusLauncher int randomFace1 = random.Next(listBox4.Items.Count); listBox4.SelectedItem = listBox4.Items[randomFace1]; GlobalVars.Custom_Face_Offline = listBox4.SelectedItem.ToString(); - Image icon1 = Image.FromFile(facedir + "\\" + GlobalVars.Custom_Face_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(facedir + "\\" + GlobalVars.Custom_Face_Offline.Replace(".rbxm", "") + ".png"); pictureBox4.Image = icon1; } } @@ -520,7 +520,7 @@ namespace NovetusLauncher { listBox4.SelectedItem = "DefaultFace.rbxm"; GlobalVars.Custom_Face_Offline = listBox4.SelectedItem.ToString(); - Image icon1 = Image.FromFile(facedir + "\\" + GlobalVars.Custom_Face_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(facedir + "\\" + GlobalVars.Custom_Face_Offline.Replace(".rbxm", "") + ".png"); pictureBox4.Image = icon1; } } @@ -532,7 +532,7 @@ namespace NovetusLauncher if (Directory.Exists(tshirtdir)) { GlobalVars.Custom_T_Shirt_Offline = listBox5.SelectedItem.ToString(); - Image icon1 = Image.FromFile(tshirtdir + "\\" + GlobalVars.Custom_T_Shirt_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(tshirtdir + "\\" + GlobalVars.Custom_T_Shirt_Offline.Replace(".rbxm", "") + ".png"); pictureBox5.Image = icon1; } } @@ -545,7 +545,7 @@ namespace NovetusLauncher int randomTShirt1 = random.Next(listBox5.Items.Count); listBox5.SelectedItem = listBox5.Items[randomTShirt1]; GlobalVars.Custom_T_Shirt_Offline = listBox5.SelectedItem.ToString(); - Image icon1 = Image.FromFile(tshirtdir + "\\" + GlobalVars.Custom_T_Shirt_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(tshirtdir + "\\" + GlobalVars.Custom_T_Shirt_Offline.Replace(".rbxm", "") + ".png"); pictureBox5.Image = icon1; } } @@ -556,7 +556,7 @@ namespace NovetusLauncher { listBox5.SelectedItem = "NoTShirt.rbxm"; GlobalVars.Custom_T_Shirt_Offline = listBox5.SelectedItem.ToString(); - Image icon1 = Image.FromFile(tshirtdir + "\\" + GlobalVars.Custom_T_Shirt_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(tshirtdir + "\\" + GlobalVars.Custom_T_Shirt_Offline.Replace(".rbxm", "") + ".png"); pictureBox5.Image = icon1; } } @@ -568,7 +568,7 @@ namespace NovetusLauncher if (Directory.Exists(shirtdir)) { GlobalVars.Custom_Shirt_Offline = listBox6.SelectedItem.ToString(); - Image icon1 = Image.FromFile(shirtdir + "\\" + GlobalVars.Custom_Shirt_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(shirtdir + "\\" + GlobalVars.Custom_Shirt_Offline.Replace(".rbxm", "") + ".png"); pictureBox6.Image = icon1; } } @@ -581,7 +581,7 @@ namespace NovetusLauncher int randomShirt1 = random.Next(listBox6.Items.Count); listBox6.SelectedItem = listBox6.Items[randomShirt1]; GlobalVars.Custom_Shirt_Offline = listBox6.SelectedItem.ToString(); - Image icon1 = Image.FromFile(shirtdir + "\\" + GlobalVars.Custom_Shirt_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(shirtdir + "\\" + GlobalVars.Custom_Shirt_Offline.Replace(".rbxm", "") + ".png"); pictureBox6.Image = icon1; } } @@ -592,7 +592,7 @@ namespace NovetusLauncher { listBox6.SelectedItem = "NoShirt.rbxm"; GlobalVars.Custom_Shirt_Offline = listBox6.SelectedItem.ToString(); - Image icon1 = Image.FromFile(shirtdir + "\\" + GlobalVars.Custom_Shirt_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(shirtdir + "\\" + GlobalVars.Custom_Shirt_Offline.Replace(".rbxm", "") + ".png"); pictureBox6.Image = icon1; } } @@ -604,7 +604,7 @@ namespace NovetusLauncher if (Directory.Exists(pantsdir)) { GlobalVars.Custom_Pants_Offline = listBox7.SelectedItem.ToString(); - Image icon1 = Image.FromFile(pantsdir + "\\" + GlobalVars.Custom_Pants_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(pantsdir + "\\" + GlobalVars.Custom_Pants_Offline.Replace(".rbxm", "") + ".png"); pictureBox7.Image = icon1; } } @@ -617,7 +617,7 @@ namespace NovetusLauncher int randomPants1 = random.Next(listBox7.Items.Count); listBox7.SelectedItem = listBox7.Items[randomPants1]; GlobalVars.Custom_Pants_Offline = listBox7.SelectedItem.ToString(); - Image icon1 = Image.FromFile(pantsdir + "\\" + GlobalVars.Custom_Pants_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(pantsdir + "\\" + GlobalVars.Custom_Pants_Offline.Replace(".rbxm", "") + ".png"); pictureBox7.Image = icon1; } } @@ -628,7 +628,7 @@ namespace NovetusLauncher { listBox7.SelectedItem = "NoPants.rbxm"; GlobalVars.Custom_Pants_Offline = listBox7.SelectedItem.ToString(); - Image icon1 = Image.FromFile(pantsdir + "\\" + GlobalVars.Custom_Pants_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(pantsdir + "\\" + GlobalVars.Custom_Pants_Offline.Replace(".rbxm", "") + ".png"); pictureBox7.Image = icon1; } } @@ -640,7 +640,7 @@ namespace NovetusLauncher if (Directory.Exists(headdir)) { GlobalVars.Custom_Head_Offline = listBox8.SelectedItem.ToString(); - Image icon1 = Image.FromFile(headdir + "\\" + GlobalVars.Custom_Head_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(headdir + "\\" + GlobalVars.Custom_Head_Offline.Replace(".rbxm", "") + ".png"); pictureBox8.Image = icon1; } } @@ -653,7 +653,7 @@ namespace NovetusLauncher int randomHead1 = random.Next(listBox8.Items.Count); listBox8.SelectedItem = listBox8.Items[randomHead1]; GlobalVars.Custom_Head_Offline = listBox8.SelectedItem.ToString(); - Image icon1 = Image.FromFile(headdir + "\\" + GlobalVars.Custom_Head_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(headdir + "\\" + GlobalVars.Custom_Head_Offline.Replace(".rbxm", "") + ".png"); pictureBox8.Image = icon1; } } @@ -664,7 +664,7 @@ namespace NovetusLauncher { listBox8.SelectedItem = "DefaultHead.rbxm"; GlobalVars.Custom_Head_Offline = listBox8.SelectedItem.ToString(); - Image icon1 = Image.FromFile(headdir + "\\" + GlobalVars.Custom_Head_Offline.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(headdir + "\\" + GlobalVars.Custom_Head_Offline.Replace(".rbxm", "") + ".png"); pictureBox8.Image = icon1; } } @@ -1115,7 +1115,7 @@ namespace NovetusLauncher try { GlobalVars.Custom_Extra = listBox9.SelectedItem.ToString(); - Image icon1 = Image.FromFile(extradir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(extradir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.Custom_Extra_SelectionIsHat = false; } @@ -1124,7 +1124,7 @@ namespace NovetusLauncher if (Directory.Exists(hatdir)) { GlobalVars.Custom_Extra = listBox9.SelectedItem.ToString(); - Image icon1 = Image.FromFile(hatdir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(hatdir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.Custom_Extra_SelectionIsHat = true; } @@ -1142,7 +1142,7 @@ namespace NovetusLauncher try { GlobalVars.Custom_Extra = listBox9.SelectedItem.ToString(); - Image icon1 = Image.FromFile(extradir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(extradir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.Custom_Extra_SelectionIsHat = false; } @@ -1151,7 +1151,7 @@ namespace NovetusLauncher if (Directory.Exists(hatdir)) { GlobalVars.Custom_Extra = listBox9.SelectedItem.ToString(); - Image icon1 = Image.FromFile(hatdir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(hatdir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.Custom_Extra_SelectionIsHat = true; } @@ -1167,7 +1167,7 @@ namespace NovetusLauncher try { GlobalVars.Custom_Extra = listBox9.SelectedItem.ToString(); - Image icon1 = Image.FromFile(extradir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(extradir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.Custom_Extra_SelectionIsHat = false; } @@ -1176,7 +1176,7 @@ namespace NovetusLauncher if (Directory.Exists(hatdir)) { GlobalVars.Custom_Extra = listBox9.SelectedItem.ToString(); - Image icon1 = Image.FromFile(hatdir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(hatdir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.Custom_Extra_SelectionIsHat = true; } @@ -1234,7 +1234,7 @@ namespace NovetusLauncher try { GlobalVars.Custom_Extra = listBox9.SelectedItem.ToString(); - Image icon1 = Image.FromFile(extradir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(extradir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.Custom_Extra_SelectionIsHat = false; } @@ -1243,7 +1243,7 @@ namespace NovetusLauncher if (Directory.Exists(hatdir)) { GlobalVars.Custom_Extra = listBox9.SelectedItem.ToString(); - Image icon1 = Image.FromFile(hatdir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = LauncherFuncs.LoadImage(hatdir + "\\" + GlobalVars.Custom_Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.Custom_Extra_SelectionIsHat = true; } @@ -1269,12 +1269,12 @@ namespace NovetusLauncher try { - Image icon1 = Image.FromFile(extradir + "\\icons\\" + GlobalVars.PlayerName + ".png"); + Image icon1 = LauncherFuncs.LoadImage(extradir + "\\icons\\" + GlobalVars.PlayerName + ".png"); pictureBox10.Image = icon1; } catch (Exception) { - Image icon1 = Image.FromFile(extradir + "\\NoExtra.png"); + Image icon1 = LauncherFuncs.LoadImage(extradir + "\\NoExtra.png"); pictureBox10.Image = icon1; } } @@ -1302,7 +1302,7 @@ namespace NovetusLauncher } else { - MessageBox.Show("Could not generate charapp. Is are you running Novetus as as administrator and is the webserver running?"); + MessageBox.Show("Could not generate charapp. Are you running Novetus as as administrator and is the webserver running?"); textBox1.Text = ""; GlobalVars.CharacterID = ""; }