more reorganization

This commit is contained in:
Bitl 2020-07-07 08:48:53 -07:00
parent f5e472045b
commit 7abeac5415
22 changed files with 153 additions and 58 deletions

View File

@ -135,6 +135,7 @@ public class LauncherFuncs
ini.IniWriteValue(section, "ReShade", GlobalVars.UserConfiguration.ReShade.ToString());
ini.IniWriteValue(section, "QualityLevel", EnumParser.GetIntForQualityLevel(GlobalVars.UserConfiguration.QualityLevel).ToString());
ini.IniWriteValue(section, "Layout", EnumParser.GetIntForLauncherLayout(GlobalVars.UserConfiguration.LauncherLayout).ToString());
ini.IniWriteValue(section, "AssetLocalizerSaveBackups", GlobalVars.UserConfiguration.AssetLocalizerSaveBackups.ToString());
}
else
{
@ -142,7 +143,7 @@ public class LauncherFuncs
string closeonlaunch, userid, name, selectedclient,
map, port, limit, upnp,
disablehelpmessage, tripcode, discord, mappath, mapsnip,
graphics, reshade, qualitylevel, layout;
graphics, reshade, qualitylevel, layout, savebackups;
IniFile ini = new IniFile(cfgpath);
@ -165,6 +166,7 @@ public class LauncherFuncs
reshade = ini.IniReadValue(section, "ReShade", GlobalVars.UserConfiguration.ReShade.ToString());
qualitylevel = ini.IniReadValue(section, "QualityLevel", EnumParser.GetIntForQualityLevel(GlobalVars.UserConfiguration.QualityLevel).ToString());
layout = ini.IniReadValue(section, "Layout", EnumParser.GetIntForLauncherLayout(GlobalVars.UserConfiguration.LauncherLayout).ToString());
savebackups = ini.IniReadValue(section, "AssetLocalizerSaveBackups", GlobalVars.UserConfiguration.AssetLocalizerSaveBackups.ToString());
try
{
@ -213,6 +215,7 @@ public class LauncherFuncs
GlobalVars.UserConfiguration.ReShade = Convert.ToBoolean(reshade);
GlobalVars.UserConfiguration.QualityLevel = EnumParser.GetQualityLevelForInt(Convert.ToInt32(qualitylevel));
GlobalVars.UserConfiguration.LauncherLayout = EnumParser.GetLauncherLayoutForInt(Convert.ToInt32(layout));
GlobalVars.UserConfiguration.AssetLocalizerSaveBackups = Convert.ToBoolean(savebackups);
}
catch (Exception)
{

View File

@ -310,6 +310,7 @@ public class Config
LauncherLayout = LauncherLayout.Extended;
ReShadeFPSDisplay = false;
ReShadePerformanceMode = false;
AssetLocalizerSaveBackups = true;
}
public string SelectedClient { get; set; }
@ -331,6 +332,7 @@ public class Config
public LauncherLayout LauncherLayout { get; set; }
public bool ReShadeFPSDisplay { get; set; }
public bool ReShadePerformanceMode { get; set; }
public bool AssetLocalizerSaveBackups { get; set; }
}
#endregion

View File

@ -135,16 +135,16 @@
<DependentUpon>CharacterCustomization.cs</DependentUpon>
</Compile>
<Compile Include="Classes\LocalVars.cs" />
<Compile Include="MainForm\MainForm_legacy.cs">
<Compile Include="MainForm\Compact\MainForm_legacy.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm\MainForm_legacy.Designer.cs">
<Compile Include="MainForm\Compact\MainForm_legacy.Designer.cs">
<DependentUpon>MainForm_legacy.cs</DependentUpon>
</Compile>
<Compile Include="NovetusSettings.cs">
<Compile Include="MainForm\Compact\NovetusSettings.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="NovetusSettings.Designer.cs">
<Compile Include="MainForm\Compact\NovetusSettings.Designer.cs">
<DependentUpon>NovetusSettings.cs</DependentUpon>
</Compile>
<Compile Include="SDK\ClientinfoCreator.cs">
@ -200,10 +200,10 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="MainForm\MainForm.cs">
<Compile Include="MainForm\Extended\MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm\MainForm.Designer.cs">
<Compile Include="MainForm\Extended\MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
@ -216,10 +216,10 @@
<EmbeddedResource Include="CharacterCustomization\CharacterCustomization.resx">
<DependentUpon>CharacterCustomization.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm\MainForm_legacy.resx">
<EmbeddedResource Include="MainForm\Compact\MainForm_legacy.resx">
<DependentUpon>MainForm_legacy.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="NovetusSettings.resx">
<EmbeddedResource Include="MainForm\Compact\NovetusSettings.resx">
<DependentUpon>NovetusSettings.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SDK\ClientinfoCreator.resx">
@ -240,7 +240,7 @@
<EmbeddedResource Include="SDK\SplashTester.resx">
<DependentUpon>SplashTester.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm\MainForm.resx">
<EmbeddedResource Include="MainForm\Extended\MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="SDK\NovetusSDK.resx">

View File

@ -30,11 +30,9 @@ namespace NovetusLauncher
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
LauncherFuncs.ReadInfoFile(Directories.ConfigDir + "\\" + GlobalVars.InfoName);
LauncherFuncs.Config(Directories.ConfigDir + "\\" + GlobalVars.ConfigName, false);
if (args.Length == 0)
{
//read from our config to determine which clients to load.
LauncherFuncs.Config(Directories.ConfigDir + "\\" + GlobalVars.ConfigName, false);
switch (GlobalVars.UserConfiguration.LauncherLayout)
{
case LauncherLayout.Compact:

View File

@ -38,11 +38,13 @@
this.comboBox2 = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(12, 101);
this.button1.Location = new System.Drawing.Point(12, 120);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(254, 21);
this.button1.TabIndex = 0;
@ -71,7 +73,7 @@
//
// label2
//
this.label2.Location = new System.Drawing.Point(12, 132);
this.label2.Location = new System.Drawing.Point(12, 144);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(254, 13);
this.label2.TabIndex = 3;
@ -133,12 +135,32 @@
this.label4.TabIndex = 8;
this.label4.Text = "Asset Type:";
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(12, 160);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(254, 16);
this.progressBar1.TabIndex = 9;
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(93, 97);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(96, 17);
this.checkBox1.TabIndex = 10;
this.checkBox1.Text = "Save Backups";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// AssetLocalizer
//
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(278, 154);
this.ClientSize = new System.Drawing.Size(278, 188);
this.Controls.Add(this.checkBox1);
this.Controls.Add(this.progressBar1);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.comboBox2);
@ -170,5 +192,7 @@
private System.Windows.Forms.ComboBox comboBox2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.CheckBox checkBox1;
}
}

View File

@ -66,6 +66,7 @@ namespace NovetusLauncher
private void AssetLocalizer_Load(object sender, EventArgs e)
{
checkBox1.Checked = true;
comboBox1.SelectedItem = "RBXL";
comboBox2.SelectedItem = "None";
@ -288,14 +289,17 @@ namespace NovetusLauncher
{
case RobloxFileType.RBXL:
//backup the original copy
try
if (GlobalVars.UserConfiguration.AssetLocalizerSaveBackups)
{
worker.ReportProgress(0);
File.Copy(path, path.Replace(".rbxl", " BAK.rbxl"));
}
catch (Exception)
{
worker.ReportProgress(100);
try
{
worker.ReportProgress(0);
File.Copy(path, path.Replace(".rbxl", " BAK.rbxl"));
}
catch (Exception)
{
worker.ReportProgress(100);
}
}
//meshes
worker.ReportProgress(5);
@ -340,6 +344,18 @@ namespace NovetusLauncher
worker.ReportProgress(100);
break;
case RobloxFileType.RBXM:
if (GlobalVars.UserConfiguration.AssetLocalizerSaveBackups)
{
try
{
worker.ReportProgress(0);
File.Copy(path, path.Replace(".rbxm", " BAK.rbxm"));
}
catch (Exception)
{
worker.ReportProgress(100);
}
}
//meshes
worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.Fonts);
@ -383,6 +399,18 @@ namespace NovetusLauncher
worker.ReportProgress(100);
break;
case RobloxFileType.Hat:
if (GlobalVars.UserConfiguration.AssetLocalizerSaveBackups)
{
try
{
worker.ReportProgress(0);
File.Copy(path, path.Replace(".rbxm", " BAK.rbxm"));
}
catch (Exception)
{
worker.ReportProgress(100);
}
}
//meshes
worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemHatFonts, name, meshname);
@ -397,6 +425,18 @@ namespace NovetusLauncher
worker.ReportProgress(100);
break;
case RobloxFileType.Head:
if (GlobalVars.UserConfiguration.AssetLocalizerSaveBackups)
{
try
{
worker.ReportProgress(0);
File.Copy(path, path.Replace(".rbxm", " BAK.rbxm"));
}
catch (Exception)
{
worker.ReportProgress(100);
}
}
//meshes
worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemHeadFonts, name);
@ -404,24 +444,72 @@ namespace NovetusLauncher
worker.ReportProgress(100);
break;
case RobloxFileType.Face:
if (GlobalVars.UserConfiguration.AssetLocalizerSaveBackups)
{
try
{
worker.ReportProgress(0);
File.Copy(path, path.Replace(".rbxm", " BAK.rbxm"));
}
catch (Exception)
{
worker.ReportProgress(100);
}
}
//decal
worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemFaceTexture, name);
worker.ReportProgress(100);
break;
case RobloxFileType.TShirt:
if (GlobalVars.UserConfiguration.AssetLocalizerSaveBackups)
{
try
{
worker.ReportProgress(0);
File.Copy(path, path.Replace(".rbxm", " BAK.rbxm"));
}
catch (Exception)
{
worker.ReportProgress(100);
}
}
//texture
worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemTShirtTexture, name);
worker.ReportProgress(100);
break;
case RobloxFileType.Shirt:
if (GlobalVars.UserConfiguration.AssetLocalizerSaveBackups)
{
try
{
worker.ReportProgress(0);
File.Copy(path, path.Replace(".rbxm", " BAK.rbxm"));
}
catch (Exception)
{
worker.ReportProgress(100);
}
}
//texture
worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemShirtTexture, name);
worker.ReportProgress(100);
break;
case RobloxFileType.Pants:
if (GlobalVars.UserConfiguration.AssetLocalizerSaveBackups)
{
try
{
worker.ReportProgress(0);
File.Copy(path, path.Replace(".rbxm", " BAK.rbxm"));
}
catch (Exception)
{
worker.ReportProgress(100);
}
}
//texture
worker.ReportProgress(0);
RobloxXMLLocalizer.DownloadFromNodes(path, RobloxDefs.ItemPantsTexture, name);
@ -442,6 +530,7 @@ namespace NovetusLauncher
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
label2.Text = GetProgressString(e.ProgressPercentage);
progressBar1.Value = e.ProgressPercentage;
}
// This event handler deals with the results of the background operation.
@ -482,5 +571,10 @@ namespace NovetusLauncher
meshname = comboBox2.SelectedItem.ToString();
}
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
checkBox1.Checked = GlobalVars.UserConfiguration.AssetLocalizerSaveBackups;
}
}
}

View File

@ -52,16 +52,6 @@ namespace NovetusLauncher
void ClientinfoCreatorLoad(object sender, EventArgs e)
{
string cfgpath = Directories.ConfigDir + "\\" + GlobalVars.ConfigName;
if (!File.Exists(cfgpath))
{
LauncherFuncs.Config(cfgpath, true);
}
else
{
LauncherFuncs.Config(cfgpath, false);
}
checkBox4.Visible = GlobalVars.AdminMode;
}

View File

@ -155,7 +155,6 @@ namespace NovetusLauncher
this.MaximizeBox = false;
this.Name = "ItemMaker";
this.Text = "Novetus Item SDK";
this.Closing += new System.ComponentModel.CancelEventHandler(this.ItemMakerClose);
this.Load += new System.EventHandler(this.ItemMakerLoad);
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
this.ResumeLayout(false);

View File

@ -107,27 +107,12 @@ namespace NovetusLauncher
void ItemMakerLoad(object sender, EventArgs e)
{
string cfgpath = Directories.ConfigDir + "\\" + GlobalVars.ConfigName;
if (!File.Exists(cfgpath))
{
LauncherFuncs.Config(cfgpath, true);
}
else
{
LauncherFuncs.Config(cfgpath, false);
}
comboBox1.SelectedItem = "http://www.roblox.com/";
isWebSite = false;
checkBox1.Checked = GlobalVars.UserConfiguration.DisabledItemMakerHelp;
}
void ItemMakerClose(object sender, CancelEventArgs e)
{
LauncherFuncs.Config(Directories.ConfigDir + "\\" + GlobalVars.ConfigName, true);
}
void CheckBox1CheckedChanged(object sender, EventArgs e)
{
GlobalVars.UserConfiguration.DisabledItemMakerHelp = checkBox1.Checked;

View File

@ -88,6 +88,7 @@
this.Name = "NovetusSDK";
this.Text = "Novetus SDK";
this.Load += new System.EventHandler(this.NovetusSDK_Load);
this.Closing += new System.ComponentModel.CancelEventHandler(this.NovetusSDK_Close);
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
this.ResumeLayout(false);

View File

@ -1,5 +1,6 @@
using NovetusLauncher.SDK;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
@ -38,6 +39,11 @@ namespace NovetusLauncher
label1.Text = GlobalVars.ProgramInformation.Version;
}
private void NovetusSDK_Close(object sender, CancelEventArgs e)
{
LauncherFuncs.Config(Directories.ConfigDir + "\\" + GlobalVars.ConfigName, true);
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
switch (listBox1.SelectedIndex)

View File

@ -21,6 +21,7 @@ namespace NovetusURI
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
LauncherFuncs.Config(Directories.ConfigDir + "\\" + GlobalVars.ConfigName, false);
if (args.Length == 0)
{
Application.Run(new Form1());

View File

@ -33,15 +33,7 @@ namespace NovetusURI
void QuickConfigureLoad(object sender, EventArgs e)
{
string cfgpath = Directories.ConfigDir + "\\" + GlobalVars.ConfigName;
if (!File.Exists(cfgpath))
{
LauncherFuncs.Config(cfgpath, true);
}
else
{
ReadConfigValues(cfgpath);
}
ReadConfigValues(Directories.ConfigDir + "\\" + GlobalVars.ConfigName);
}
void Button3Click(object sender, EventArgs e)