added skin support

This commit is contained in:
Bitl 2021-03-14 11:16:24 -07:00
parent 55c9128ecc
commit 2246419caf
3 changed files with 15 additions and 39 deletions

View File

@ -1139,7 +1139,7 @@ public class GlobalFuncs
RobloxXML.EditRenderSettings(doc, "Bevels", Bevels.ToString(), XMLTypes.Token);
RobloxXML.EditRenderSettings(doc, "Shadow", Shadows_2008.ToString(), XMLTypes.Token);
RobloxXML.EditRenderSettings(doc, "Shadows", Shadows_2007.ToString().ToLower(), XMLTypes.Bool);
RobloxXML.EditRenderSettings(doc, "_skinFile", Style_2007, XMLTypes.String);
RobloxXML.EditRenderSettings(doc, "_skinFile", !string.IsNullOrWhiteSpace(Style_2007) ? @"Styles\" + Style_2007 : "", XMLTypes.String);
RobloxXML.EditRenderSettings(doc, "QualityLevel", GFXQualityLevel.ToString(), XMLTypes.Token);
}
catch (Exception)

View File

@ -49,7 +49,7 @@
this.GraphicsShadows2007 = new System.Windows.Forms.ComboBox();
this.label10 = new System.Windows.Forms.Label();
this.label11 = new System.Windows.Forms.Label();
this.style2007 = new System.Windows.Forms.ComboBox();
this.Style2007 = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.GraphicsLevel)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.GraphicsMeshQuality)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.GraphicsShadingQuality)).BeginInit();
@ -281,15 +281,13 @@
this.label11.TabIndex = 21;
this.label11.Text = "Style (Early 2007)";
//
// style2007
// Style2007
//
this.style2007.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.style2007.FormattingEnabled = true;
this.style2007.Location = new System.Drawing.Point(172, 252);
this.style2007.Name = "style2007";
this.style2007.Size = new System.Drawing.Size(155, 21);
this.style2007.TabIndex = 20;
this.style2007.SelectedIndexChanged += new System.EventHandler(this.style2007_SelectedIndexChanged);
this.Style2007.Location = new System.Drawing.Point(172, 252);
this.Style2007.Name = "Style2007";
this.Style2007.Size = new System.Drawing.Size(155, 20);
this.Style2007.TabIndex = 22;
this.Style2007.TextChanged += new System.EventHandler(this.Style2007_TextChanged);
//
// CustomGraphicsOptions
//
@ -297,8 +295,8 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.ClientSize = new System.Drawing.Size(339, 303);
this.Controls.Add(this.Style2007);
this.Controls.Add(this.label11);
this.Controls.Add(this.style2007);
this.Controls.Add(this.label10);
this.Controls.Add(this.GraphicsShadows2007);
this.Controls.Add(this.label9);
@ -354,6 +352,6 @@
private System.Windows.Forms.ComboBox GraphicsShadows2007;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label11;
private System.Windows.Forms.ComboBox style2007;
private System.Windows.Forms.TextBox Style2007;
}
}

View File

@ -182,31 +182,14 @@ namespace NovetusLauncher
}
}
//TODO: fix this
try
{
style2007.Items.Clear();
string clientpath = GlobalPaths.ClientDir + @"\\" + ClientName + @"\\Styles";
DirectoryInfo dinfo = new DirectoryInfo(clientpath);
FileInfo[] Files = dinfo.GetFiles("*.cjstyles");
foreach (FileInfo file in Files)
{
style2007.Items.Add(file.Replace(clientpath, "Styles"));
}
FileInfo[] Files2 = dinfo.GetFiles("*.msstyles");
foreach (FileInfo file in Files2)
{
style2007.Items.Add(file.Replace(clientpath, "Styles"));
}
Style_2007 = RobloxXML.GetRenderSettings(doc, "_skinFile", XMLTypes.String);
style2007.SelectedText = Style_2007;
Style_2007 = RobloxXML.GetRenderSettings(doc, "_skinFile", XMLTypes.String).Replace(@"Styles\", "");
Style2007.Text = Style_2007;
}
catch (Exception)
{
style2007.Enabled = false;
Style2007.Enabled = false;
}
try
@ -312,14 +295,9 @@ namespace NovetusLauncher
Shadows_2008 = GraphicsShadows2008.SelectedIndex;
}
private void style2007_SelectedIndexChanged(object sender, EventArgs e)
private void Style2007_TextChanged(object sender, EventArgs e)
{
if (!style2007.Enabled)
{
style2007.SelectedIndex = 0;
}
Style_2007 = style2007.SelectedText;
Style_2007 = Style2007.Text;
}
private void GraphicsShadows2007_SelectedIndexChanged(object sender, EventArgs e)