customization and 2007.

This commit is contained in:
Bitl 2018-11-11 15:33:58 -07:00
parent d4447065fe
commit b262c1d0e3
3 changed files with 201 additions and 65 deletions

View File

@ -149,6 +149,7 @@ namespace NovetusLauncher
this.tabControl1.SelectedIndex = 0;
this.tabControl1.Size = new System.Drawing.Size(475, 267);
this.tabControl1.TabIndex = 0;
this.tabControl1.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
//
// tabPage1
//

View File

@ -93,46 +93,6 @@ namespace NovetusLauncher
button4.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftArmColor);
button5.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightLegColor);
button6.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftLegColor);
//hats
listBox1.Items.Clear();
listBox2.Items.Clear();
listBox3.Items.Clear();
if (Directory.Exists(hatdir))
{
DirectoryInfo dinfo = new DirectoryInfo(hatdir);
FileInfo[] Files = dinfo.GetFiles("*.rbxm");
foreach( FileInfo file in Files )
{
if (file.Name.Equals(String.Empty))
{
continue;
}
if (file.Name.Equals("TeapotTurret.rbxm") && GlobalVars.AdminMode != true)
{
continue;
}
listBox1.Items.Add(file.Name);
listBox2.Items.Add(file.Name);
listBox3.Items.Add(file.Name);
}
listBox1.SelectedItem = GlobalVars.Custom_Hat1ID_Offline;
listBox2.SelectedItem = GlobalVars.Custom_Hat2ID_Offline;
listBox3.SelectedItem = GlobalVars.Custom_Hat3ID_Offline;
listBox1.Enabled = true;
listBox2.Enabled = true;
listBox3.Enabled = true;
Image icon1 = Image.FromFile(hatdir + @"\\" + GlobalVars.Custom_Hat1ID_Offline.Replace(".rbxm", "") + ".png");
pictureBox1.Image = icon1;
Image icon2 = Image.FromFile(hatdir + @"\\" + GlobalVars.Custom_Hat2ID_Offline.Replace(".rbxm", "") + ".png");
pictureBox2.Image = icon2;
Image icon3 = Image.FromFile(hatdir + @"\\" + GlobalVars.Custom_Hat3ID_Offline.Replace(".rbxm", "") + ".png");
pictureBox3.Image = icon3;
}
//discord
if (StartedVIAURI == false)
@ -148,6 +108,184 @@ namespace NovetusLauncher
LauncherFuncs.ReloadLoadtextValue();
}
void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage1"] && tabControl1.SelectedTab == tabControl1.TabPages["tabPage7"])//your specific tabname
{
listBox1.Items.Clear();
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
listBox5.Items.Clear();
listBox6.Items.Clear();
listBox7.Items.Clear();
//listBox8.Items.Clear();
}
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage2"])//your specific tabname
{
//hats
listBox4.Items.Clear();
listBox5.Items.Clear();
listBox6.Items.Clear();
listBox7.Items.Clear();
//listBox8.Items.Clear();
if (Directory.Exists(hatdir))
{
DirectoryInfo dinfo = new DirectoryInfo(hatdir);
FileInfo[] Files = dinfo.GetFiles("*.rbxm");
foreach( FileInfo file in Files )
{
if (file.Name.Equals(String.Empty))
{
continue;
}
if (file.Name.Equals("TeapotTurret.rbxm") && GlobalVars.AdminMode != true)
{
continue;
}
listBox1.Items.Add(file.Name);
listBox2.Items.Add(file.Name);
listBox3.Items.Add(file.Name);
}
listBox1.SelectedItem = GlobalVars.Custom_Hat1ID_Offline;
listBox2.SelectedItem = GlobalVars.Custom_Hat2ID_Offline;
listBox3.SelectedItem = GlobalVars.Custom_Hat3ID_Offline;
listBox1.Enabled = true;
listBox2.Enabled = true;
listBox3.Enabled = true;
Image icon1 = Image.FromFile(hatdir + @"\\" + GlobalVars.Custom_Hat1ID_Offline.Replace(".rbxm", "") + ".png");
pictureBox1.Image = icon1;
Image icon2 = Image.FromFile(hatdir + @"\\" + GlobalVars.Custom_Hat2ID_Offline.Replace(".rbxm", "") + ".png");
pictureBox2.Image = icon2;
Image icon3 = Image.FromFile(hatdir + @"\\" + GlobalVars.Custom_Hat3ID_Offline.Replace(".rbxm", "") + ".png");
pictureBox3.Image = icon3;
}
}
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage3"])//your specific tabname
{
//faces
listBox1.Items.Clear();
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox5.Items.Clear();
listBox6.Items.Clear();
listBox7.Items.Clear();
//listBox8.Items.Clear();
if (Directory.Exists(facedir))
{
DirectoryInfo dinfo = new DirectoryInfo(facedir);
FileInfo[] Files = dinfo.GetFiles("*.rbxm");
foreach( FileInfo file in Files )
{
if (file.Name.Equals(String.Empty))
{
continue;
}
listBox4.Items.Add(file.Name);
}
listBox4.SelectedItem = GlobalVars.Custom_Face_Offline;
listBox4.Enabled = true;
Image icon1 = Image.FromFile(facedir + @"\\" + GlobalVars.Custom_Face_Offline.Replace(".rbxm", "") + ".png");
pictureBox4.Image = icon1;
}
}
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage4"])//your specific tabname
{
//faces
listBox1.Items.Clear();
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
listBox6.Items.Clear();
listBox7.Items.Clear();
//listBox8.Items.Clear();
if (Directory.Exists(tshirtdir))
{
DirectoryInfo dinfo = new DirectoryInfo(tshirtdir);
FileInfo[] Files = dinfo.GetFiles("*.rbxm");
foreach( FileInfo file in Files )
{
if (file.Name.Equals(String.Empty))
{
continue;
}
listBox5.Items.Add(file.Name);
}
listBox5.SelectedItem = GlobalVars.Custom_T_Shirt_Offline;
listBox5.Enabled = true;
Image icon1 = Image.FromFile(tshirtdir + @"\\" + GlobalVars.Custom_T_Shirt_Offline.Replace(".rbxm", "") + ".png");
pictureBox5.Image = icon1;
}
}
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage5"])//your specific tabname
{
//faces
listBox1.Items.Clear();
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
listBox5.Items.Clear();
listBox7.Items.Clear();
//listBox8.Items.Clear();
if (Directory.Exists(shirtdir))
{
DirectoryInfo dinfo = new DirectoryInfo(shirtdir);
FileInfo[] Files = dinfo.GetFiles("*.rbxm");
foreach( FileInfo file in Files )
{
if (file.Name.Equals(String.Empty))
{
continue;
}
listBox6.Items.Add(file.Name);
}
listBox6.SelectedItem = GlobalVars.Custom_Shirt_Offline;
listBox6.Enabled = true;
Image icon1 = Image.FromFile(shirtdir + @"\\" + GlobalVars.Custom_Shirt_Offline.Replace(".rbxm", "") + ".png");
pictureBox6.Image = icon1;
}
}
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage6"])//your specific tabname
{
//faces
listBox1.Items.Clear();
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
listBox5.Items.Clear();
listBox6.Items.Clear();
//listBox8.Items.Clear();
if (Directory.Exists(pantsdir))
{
DirectoryInfo dinfo = new DirectoryInfo(pantsdir);
FileInfo[] Files = dinfo.GetFiles("*.rbxm");
foreach( FileInfo file in Files )
{
if (file.Name.Equals(String.Empty))
{
continue;
}
listBox7.Items.Add(file.Name);
}
listBox7.SelectedItem = GlobalVars.Custom_Pants_Offline;
listBox7.Enabled = true;
Image icon1 = Image.FromFile(pantsdir + @"\\" + GlobalVars.Custom_Pants_Offline.Replace(".rbxm", "") + ".png");
pictureBox7.Image = icon1;
}
}
}
void CharacterCustomizationClose(object sender, CancelEventArgs e)
{
if (StartedVIAURI == false)

View File

@ -733,18 +733,6 @@ namespace NovetusLauncher
Studio = 3
}
public static bool TypeSupportsCustom(ScriptType type)
{
if (type == ScriptType.Server || type == ScriptType.Studio)
{
return false;
}
else
{
return true;
}
}
public static string GetScriptFuncForType(ScriptType type)
{
string md5dir = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location);
@ -752,42 +740,50 @@ namespace NovetusLauncher
{
if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true)
{
return "CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "')";
return "_G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "')";
}
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true)
{
return "CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "')";
return "_G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "')";
}
else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false)
{
return "CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "')";
return "_G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "')";
}
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false)
{
return "CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "')";
return "_G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "')";
}
else
{
return "_G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "')";
}
}
else if (type == ScriptType.Server)
{
return "CSServer(" + GlobalVars.RobloxPort + "," + GlobalVars.PlayerLimit + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "'," + GlobalVars.DisableTeapotTurret.ToString().ToLower() + ")";
return "_G.CSServer(" + GlobalVars.RobloxPort + "," + GlobalVars.PlayerLimit + ",'" + GlobalVars.SelectedClientMD5 + "','" + md5dir + "','" + GlobalVars.SelectedClientScriptMD5 + "'," + GlobalVars.DisableTeapotTurret.ToString().ToLower() + ")";
}
else if (type == ScriptType.Solo)
{
if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == true)
{
return "CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ")";
return "_G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ")";
}
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == true)
{
return "CSSolo(" + GlobalVars.UserID + ",'Player','" + GlobalVars.loadtext + ")";
return "_G.CSSolo(" + GlobalVars.UserID + ",'Player','" + GlobalVars.loadtext + ")";
}
else if (GlobalVars.UsesPlayerName == true && GlobalVars.UsesID == false)
{
return "CSSolo(0,'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ")";
return "_G.CSSolo(0,'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ")";
}
else if (GlobalVars.UsesPlayerName == false && GlobalVars.UsesID == false )
{
return "CSSolo(0,'Player','" + GlobalVars.loadtext + ")";
return "_G.CSSolo(0,'Player','" + GlobalVars.loadtext + ")";
}
else
{
return "_G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "','" + GlobalVars.loadtext + ")";
}
}
else if (type == ScriptType.Studio)
@ -798,10 +794,9 @@ namespace NovetusLauncher
{
return "";
}
return "";
}
/*
public static string[] GetScriptContents(string scriptPath)
{
List<string> array = new List<string>();
@ -816,6 +811,7 @@ namespace NovetusLauncher
return array.ToArray();
}
*/
private static void ReadConfigValues()
{
@ -828,11 +824,12 @@ namespace NovetusLauncher
ReadConfigValues();
string scriptcontents = MultiLine(GetScriptContents(GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptName + ".lua"));
//string scriptcontents = MultiLine(GetScriptContents(GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptName + ".lua"));
string code = MultiLine(
"--Load Script",
scriptcontents,
//scriptcontents,
"dofile('rbxasset://scripts/" + GlobalVars.ScriptName + ".lua')",
GetScriptFuncForType(type)
);