rewrite part 1

This commit is contained in:
Bitl 2020-07-04 13:19:38 -07:00
parent 9e61f50402
commit aad4582f84
16 changed files with 2129 additions and 2209 deletions

View File

@ -364,11 +364,11 @@ namespace NovetusCMD
{ {
if (!GlobalVars.SelectedClientInfo.Fix2007) if (!GlobalVars.SelectedClientInfo.Fix2007)
{ {
args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptGenerator.ScriptType.Server) + "; " + (!string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? "dofile('" + GlobalVars.AddonScriptPath + "');" : "") + quote + (no3d ? " -no3d" : ""); args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptType.Server) + "; " + (!string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? "dofile('" + GlobalVars.AddonScriptPath + "');" : "") + quote + (no3d ? " -no3d" : "");
} }
else else
{ {
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Server); ScriptGenerator.GenerateScriptForClient(ScriptType.Server);
args = "-script " + quote + luafile + quote + (no3d ? " -no3d" : "") + " " + quote + mapfile + quote; args = "-script " + quote + luafile + quote + (no3d ? " -no3d" : "") + " " + quote + mapfile + quote;
} }
} }
@ -394,7 +394,7 @@ namespace NovetusCMD
client.Exited += new EventHandler(ServerExited); client.Exited += new EventHandler(ServerExited);
client.Start(); client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime; client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Server, GlobalVars.Map); SecurityFuncs.RenameWindow(client, ScriptType.Server, GlobalVars.Map);
LocalVars.ProcessID = client.Id; LocalVars.ProcessID = client.Id;
CreateTXT(); CreateTXT();
} }
@ -456,25 +456,25 @@ namespace NovetusCMD
static void ConsolePrint(string text, int type) static void ConsolePrint(string text, int type)
{ {
ConsoleText("[" + DateTime.Now.ToShortTimeString() + "] - ", ConsoleColor.White); ConsoleText("[" + DateTime.Now.ToShortTimeString() + "] - ", ConsoleColor.White);
if (type == 1)
{ switch (type)
ConsoleText(text, ConsoleColor.White);
}
else if (type == 2)
{ {
case 2:
ConsoleText(text, ConsoleColor.Red); ConsoleText(text, ConsoleColor.Red);
} break;
else if (type == 3) case 3:
{
ConsoleText(text, ConsoleColor.Green); ConsoleText(text, ConsoleColor.Green);
} break;
else if (type == 4) case 4:
{
ConsoleText(text, ConsoleColor.Cyan); ConsoleText(text, ConsoleColor.Cyan);
} break;
else if (type == 5) case 5:
{
ConsoleText(text, ConsoleColor.Yellow); ConsoleText(text, ConsoleColor.Yellow);
break;
case 1:
default:
ConsoleText(text, ConsoleColor.White);
break;
} }
ConsoleText(Environment.NewLine, ConsoleColor.White); ConsoleText(Environment.NewLine, ConsoleColor.White);

View File

@ -19,9 +19,7 @@ public class ClientScript
{ {
int pFrom = code.IndexOf(tag) + tag.Length; int pFrom = code.IndexOf(tag) + tag.Length;
int pTo = code.LastIndexOf(endtag); int pTo = code.LastIndexOf(endtag);
string result = code.Substring(pFrom, pTo - pFrom); string result = code.Substring(pFrom, pTo - pFrom);
return result; return result;
} }
catch (Exception) when (!Env.Debugging) catch (Exception) when (!Env.Debugging)
@ -30,74 +28,80 @@ public class ClientScript
} }
} }
public static ScriptGenerator.ScriptType GetTypeFromTag(string tag, string endtag) public static ScriptType GetTypeFromTag(string tag)
{ {
if (tag.Contains("client") && endtag.Contains("client")) { switch (tag)
return ScriptGenerator.ScriptType.Client; {
} else if (tag.Contains("server") && endtag.Contains("server") || tag.Contains("no3d") && endtag.Contains("no3d")) { case string client when client.Contains("client"):
return ScriptGenerator.ScriptType.Server; return ScriptType.Client;
} else if (tag.Contains("solo") && endtag.Contains("solo")) { case string server when server.Contains("server"):
return ScriptGenerator.ScriptType.Solo; case string no3d when no3d.Contains("no3d"):
} else if (tag.Contains("studio") && endtag.Contains("studio")) { return ScriptType.Server;
return ScriptGenerator.ScriptType.Studio; case string solo when solo.Contains("solo"):
} else { return ScriptType.Solo;
return ScriptGenerator.ScriptType.None; case string studio when studio.Contains("studio"):
return ScriptType.Studio;
default:
return ScriptType.None;
} }
} }
public static string GetRawArgsForType(ScriptGenerator.ScriptType type, string md5s, string luafile) public static string GetRawArgsForType(ScriptType type, string md5s, string luafile)
{ {
if (type == ScriptGenerator.ScriptType.Client) { switch (type)
if (GlobalVars.SelectedClientInfo.UsesPlayerName == true && GlobalVars.SelectedClientInfo.UsesID == true) { {
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.loadtext + "," + md5s + ",'" + GlobalVars.PlayerTripcode + "')"; case ScriptType.Client:
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false && GlobalVars.SelectedClientInfo.UsesID == true) { return LauncherFuncs.ChangeGameSettings() +
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player'," + GlobalVars.loadtext + "," + md5s + ",'" + GlobalVars.PlayerTripcode + "')"; " dofile('" + luafile + "'); _G.CSConnect("
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == true && GlobalVars.SelectedClientInfo.UsesID == false) { + (GlobalVars.SelectedClientInfo.UsesID == true ? GlobalVars.UserID : 0) + ",'"
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.loadtext + "," + md5s + ",'" + GlobalVars.PlayerTripcode + "')"; + GlobalVars.IP + "',"
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false && GlobalVars.SelectedClientInfo.UsesID == false) { + GlobalVars.RobloxPort + ",'"
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player'," + GlobalVars.loadtext + "," + md5s + ",'" + GlobalVars.PlayerTripcode + "')"; + (GlobalVars.SelectedClientInfo.UsesPlayerName == true ? GlobalVars.PlayerName : "Player") + "',"
} else { + GlobalVars.loadtext + ","
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.loadtext + "," + md5s + ",'" + GlobalVars.PlayerTripcode + "')"; + md5s + ",'"
} + GlobalVars.PlayerTripcode + "')";
} else if (type == ScriptGenerator.ScriptType.Server) { case ScriptType.Server:
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSServer(" + GlobalVars.RobloxPort + "," + GlobalVars.PlayerLimit + "," + md5s + "); " + (!string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? LauncherFuncs.ChangeGameSettings() + " dofile('" + GlobalVars.AddonScriptPath + "');" : ""); return LauncherFuncs.ChangeGameSettings() +
} else if (type == ScriptGenerator.ScriptType.Solo) { " dofile('" + luafile + "'); _G.CSServer("
if (GlobalVars.SelectedClientInfo.UsesPlayerName == true && GlobalVars.SelectedClientInfo.UsesID == true) { + GlobalVars.RobloxPort + ","
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")"; + GlobalVars.PlayerLimit + ","
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false && GlobalVars.SelectedClientInfo.UsesID == true) { + md5s + "); "
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'Player'," + GlobalVars.sololoadtext + ")"; + (!string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? LauncherFuncs.ChangeGameSettings() +
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == true && GlobalVars.SelectedClientInfo.UsesID == false) { " dofile('" + GlobalVars.AddonScriptPath + "');" : "");
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSSolo(0,'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")"; case ScriptType.Solo:
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false && GlobalVars.SelectedClientInfo.UsesID == false) { case ScriptType.EasterEgg:
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSSolo(0,'Player'," + GlobalVars.sololoadtext + ")"; return LauncherFuncs.ChangeGameSettings()
} else { + " dofile('" + luafile + "'); _G.CSSolo("
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")"; + (GlobalVars.SelectedClientInfo.UsesID == true ? GlobalVars.UserID : 0) + ",'"
} + (GlobalVars.SelectedClientInfo.UsesPlayerName == true ? GlobalVars.PlayerName : "Player") + "',"
} else if (type == ScriptGenerator.ScriptType.Studio) { + GlobalVars.sololoadtext + ")";
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "');"; case ScriptType.Studio:
} else { return LauncherFuncs.ChangeGameSettings()
+ " dofile('" + luafile + "');";
default:
return ""; return "";
} }
} }
public static string GetRawArgsFromTag(string tag, string endtag, string md5s, string luafile) public static string GetRawArgsFromTag(string tag, string md5s, string luafile)
{ {
return GetRawArgsForType(GetTypeFromTag(tag, endtag), md5s, luafile); return GetRawArgsForType(GetTypeFromTag(tag), md5s, luafile);
} }
public static int ConvertIconStringToInt() public static int ConvertIconStringToInt()
{ {
if (GlobalVars.Custom_Icon_Offline == "BC") { switch (GlobalVars.Custom_Icon_Offline)
{
case "BC:":
return 1; return 1;
} else if (GlobalVars.Custom_Icon_Offline == "TBC") { case "TBC:":
return 2; return 2;
} else if (GlobalVars.Custom_Icon_Offline == "OBC") { case "OBC:":
return 3; return 3;
} else if (GlobalVars.Custom_Icon_Offline == "NBC") { case "NBC:":
default:
return 0; return 0;
} }
return 0;
} }
public static string GetFolderAndMapName(string source, string seperator) public static string GetFolderAndMapName(string source, string seperator)
@ -123,7 +127,7 @@ public class ClientScript
public static string CompileScript(string code, string tag, string endtag, string mapfile, string luafile, string rbxexe) public static string CompileScript(string code, string tag, string endtag, string mapfile, string luafile, string rbxexe)
{ {
if (GlobalVars.SelectedClientInfo.Fix2007) { if (GlobalVars.SelectedClientInfo.Fix2007) {
ScriptGenerator.GenerateScriptForClient(GetTypeFromTag(tag, endtag)); ScriptGenerator.GenerateScriptForClient(GetTypeFromTag(tag));
} }
string extractedCode = GetArgsFromTag(code, tag, endtag); string extractedCode = GetArgsFromTag(code, tag, endtag);
@ -177,7 +181,7 @@ public class ClientScript
.Replace("%extra%", GlobalVars.Custom_Extra) .Replace("%extra%", GlobalVars.Custom_Extra)
.Replace("%extrad%", GlobalVars.extraGameDir + GlobalVars.Custom_Extra) .Replace("%extrad%", GlobalVars.extraGameDir + GlobalVars.Custom_Extra)
.Replace("%hat4d%", GlobalVars.hatGameDir + GlobalVars.Custom_Extra) .Replace("%hat4d%", GlobalVars.hatGameDir + GlobalVars.Custom_Extra)
.Replace("%args%", GetRawArgsFromTag(tag, endtag, md5s, luafile)) .Replace("%args%", GetRawArgsFromTag(tag, md5s, luafile))
.Replace("%facews%", GlobalVars.WebServer_FaceDir + GlobalVars.Custom_Face_Offline) .Replace("%facews%", GlobalVars.WebServer_FaceDir + GlobalVars.Custom_Face_Offline)
.Replace("%headws%", GlobalVars.WebServer_HeadDir + GlobalVars.Custom_Head_Offline) .Replace("%headws%", GlobalVars.WebServer_HeadDir + GlobalVars.Custom_Head_Offline)
.Replace("%tshirtws%", GlobalVars.Custom_T_Shirt_Offline.Contains("http://") ? GlobalVars.Custom_T_Shirt_Offline : GlobalVars.WebServer_TShirtDir + GlobalVars.Custom_T_Shirt_Offline) .Replace("%tshirtws%", GlobalVars.Custom_T_Shirt_Offline.Contains("http://") ? GlobalVars.Custom_T_Shirt_Offline : GlobalVars.WebServer_TShirtDir + GlobalVars.Custom_T_Shirt_Offline)

View File

@ -236,8 +236,8 @@ public static class GlobalVars
public static bool ReShadeFPSDisplay = false; public static bool ReShadeFPSDisplay = false;
public static bool ReShadePerformanceMode = false; public static bool ReShadePerformanceMode = false;
//video //video
public static int GraphicsMode = 1; public static GraphicsMode GraphicsMode = GraphicsMode.OpenGL;
public static int QualityLevel = 5; public static QualityLevel QualityLevel = QualityLevel.Ultra;
public static string MultiLine(params string[] args) public static string MultiLine(params string[] args)
{ {

View File

@ -7,16 +7,12 @@
* To change this template use Tools | Options | Coding | Edit Standard Headers. * To change this template use Tools | Options | Coding | Edit Standard Headers.
*/ */
using System; using System;
using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Threading;
public class LauncherFuncs
{
public enum LauncherState public enum LauncherState
{ {
InLauncher = 0, InLauncher = 0,
@ -28,6 +24,24 @@ public class LauncherFuncs
LoadingURI = 6 LoadingURI = 6
} }
public enum QualityLevel
{
VeryLow = 1,
Low = 2,
Medium = 3,
High = 4,
Ultra = 5
}
public enum GraphicsMode
{
None = 0,
OpenGL = 1,
DirectX = 2
}
public class LauncherFuncs
{
public LauncherFuncs() public LauncherFuncs()
{ {
} }
@ -84,6 +98,68 @@ public class LauncherFuncs
} }
} }
public static QualityLevel GetQualityLevelForInt(int level)
{
switch (level)
{
case 1:
return QualityLevel.VeryLow;
case 2:
return QualityLevel.Low;
case 3:
return QualityLevel.Medium;
case 4:
return QualityLevel.High;
case 5:
default:
return QualityLevel.Ultra;
}
}
public static int GetIntForQualityLevel(QualityLevel level)
{
switch (level)
{
case QualityLevel.VeryLow:
return 1;
case QualityLevel.Low:
return 2;
case QualityLevel.Medium:
return 3;
case QualityLevel.High:
return 4;
case QualityLevel.Ultra:
default:
return 5;
}
}
public static GraphicsMode GetGraphicsModeForInt(int level)
{
switch (level)
{
case 1:
return GraphicsMode.OpenGL;
case 2:
return GraphicsMode.DirectX;
default:
return GraphicsMode.None;
}
}
public static int GetIntForGraphicsMode(GraphicsMode level)
{
switch (level)
{
case GraphicsMode.OpenGL:
return 1;
case GraphicsMode.DirectX:
return 2;
default:
return 0;
}
}
public static void Config(string cfgpath, bool write) public static void Config(string cfgpath, bool write)
{ {
if (write) if (write)
@ -107,9 +183,9 @@ public class LauncherFuncs
ini.IniWriteValue(section, "DiscordRichPresence", GlobalVars.DiscordPresence.ToString()); ini.IniWriteValue(section, "DiscordRichPresence", GlobalVars.DiscordPresence.ToString());
ini.IniWriteValue(section, "MapPath", GlobalVars.MapPath.ToString()); ini.IniWriteValue(section, "MapPath", GlobalVars.MapPath.ToString());
ini.IniWriteValue(section, "MapPathSnip", GlobalVars.MapPathSnip.ToString()); ini.IniWriteValue(section, "MapPathSnip", GlobalVars.MapPathSnip.ToString());
ini.IniWriteValue(section, "GraphicsMode", GlobalVars.GraphicsMode.ToString()); ini.IniWriteValue(section, "GraphicsMode", GetIntForGraphicsMode(GlobalVars.GraphicsMode).ToString());
ini.IniWriteValue(section, "ReShade", GlobalVars.ReShade.ToString()); ini.IniWriteValue(section, "ReShade", GlobalVars.ReShade.ToString());
ini.IniWriteValue(section, "QualityLevel", GlobalVars.QualityLevel.ToString()); ini.IniWriteValue(section, "QualityLevel", GetIntForQualityLevel(GlobalVars.QualityLevel).ToString());
ini.IniWriteValue(section, "OldLayout", GlobalVars.OldLayout.ToString()); ini.IniWriteValue(section, "OldLayout", GlobalVars.OldLayout.ToString());
} }
else else
@ -138,9 +214,9 @@ public class LauncherFuncs
Decryptline13 = ini.IniReadValue(section, "DiscordRichPresence", GlobalVars.DiscordPresence.ToString()); Decryptline13 = ini.IniReadValue(section, "DiscordRichPresence", GlobalVars.DiscordPresence.ToString());
Decryptline14 = ini.IniReadValue(section, "MapPath", GlobalVars.MapPath.ToString()); Decryptline14 = ini.IniReadValue(section, "MapPath", GlobalVars.MapPath.ToString());
Decryptline15 = ini.IniReadValue(section, "MapPathSnip", GlobalVars.MapPathSnip.ToString()); Decryptline15 = ini.IniReadValue(section, "MapPathSnip", GlobalVars.MapPathSnip.ToString());
Decryptline16 = ini.IniReadValue(section, "GraphicsMode", GlobalVars.GraphicsMode.ToString()); Decryptline16 = ini.IniReadValue(section, "GraphicsMode", GetIntForGraphicsMode(GlobalVars.GraphicsMode).ToString());
Decryptline17 = ini.IniReadValue(section, "ReShade", GlobalVars.ReShade.ToString()); Decryptline17 = ini.IniReadValue(section, "ReShade", GlobalVars.ReShade.ToString());
Decryptline20 = ini.IniReadValue(section, "QualityLevel", GlobalVars.QualityLevel.ToString()); Decryptline20 = ini.IniReadValue(section, "QualityLevel", GetIntForQualityLevel(GlobalVars.QualityLevel).ToString());
Decryptline21 = ini.IniReadValue(section, "OldLayout", GlobalVars.OldLayout.ToString()); Decryptline21 = ini.IniReadValue(section, "OldLayout", GlobalVars.OldLayout.ToString());
try try
@ -197,15 +273,13 @@ public class LauncherFuncs
GlobalVars.MapPath = Decryptline14; GlobalVars.MapPath = Decryptline14;
GlobalVars.MapPathSnip = Decryptline15; GlobalVars.MapPathSnip = Decryptline15;
int iline16 = Convert.ToInt32(Decryptline16); int iline16 = Convert.ToInt32(Decryptline16);
GlobalVars.GraphicsMode = iline16; GlobalVars.GraphicsMode = GetGraphicsModeForInt(iline16);
bool bline17 = Convert.ToBoolean(Decryptline17); bool bline17 = Convert.ToBoolean(Decryptline17);
GlobalVars.ReShade = bline17; GlobalVars.ReShade = bline17;
int iline20 = Convert.ToInt32(Decryptline20); int iline20 = Convert.ToInt32(Decryptline20);
GlobalVars.QualityLevel = iline20; GlobalVars.QualityLevel = GetQualityLevelForInt(iline20);
bool bline21 = Convert.ToBoolean(Decryptline21); bool bline21 = Convert.ToBoolean(Decryptline21);
GlobalVars.OldLayout = bline21; GlobalVars.OldLayout = bline21;
//bool bline22 = Convert.ToBoolean(Decryptline22);
//GlobalVars.UDP = bline22;
} }
catch (Exception) catch (Exception)
{ {
@ -394,27 +468,29 @@ public class LauncherFuncs
int PerformanceMode = GlobalVars.ReShadePerformanceMode ? 1 : 0; int PerformanceMode = GlobalVars.ReShadePerformanceMode ? 1 : 0;
Decryptline4 = ini.IniReadValue(section, "PerformanceMode", PerformanceMode.ToString()); Decryptline4 = ini.IniReadValue(section, "PerformanceMode", PerformanceMode.ToString());
if (setglobals) if (setglobals)
{ {
try try
{ {
if (Convert.ToInt32(Decryptline2) == 1 && Convert.ToInt32(Decryptline3) == 1) switch(Convert.ToInt32(Decryptline2))
{ {
case int showFPSLine when showFPSLine == 1 && Convert.ToInt32(Decryptline3) == 1:
GlobalVars.ReShadeFPSDisplay = true; GlobalVars.ReShadeFPSDisplay = true;
} break;
else if (Convert.ToInt32(Decryptline2) == 0 && Convert.ToInt32(Decryptline3) == 0) case int showFPSLine when showFPSLine == 0 && Convert.ToInt32(Decryptline3) == 0:
{ default:
GlobalVars.ReShadeFPSDisplay = false; GlobalVars.ReShadeFPSDisplay = false;
break;
} }
if (Convert.ToInt32(Decryptline4) == 1) switch (Convert.ToInt32(Decryptline4))
{ {
case 1:
GlobalVars.ReShadePerformanceMode = true; GlobalVars.ReShadePerformanceMode = true;
} break;
else if (Convert.ToInt32(Decryptline4) == 0) default:
{
GlobalVars.ReShadePerformanceMode = false; GlobalVars.ReShadePerformanceMode = false;
break;
} }
} }
catch (Exception) catch (Exception)
@ -492,9 +568,9 @@ public class LauncherFuncs
GlobalVars.DiscordPresence = true; GlobalVars.DiscordPresence = true;
GlobalVars.MapPath = GlobalVars.MapsDir + @"\\" + GlobalVars.DefaultMap; GlobalVars.MapPath = GlobalVars.MapsDir + @"\\" + GlobalVars.DefaultMap;
GlobalVars.MapPathSnip = GlobalVars.MapsDirBase + @"\\" + GlobalVars.DefaultMap; GlobalVars.MapPathSnip = GlobalVars.MapsDirBase + @"\\" + GlobalVars.DefaultMap;
GlobalVars.GraphicsMode = 1; GlobalVars.GraphicsMode = GraphicsMode.OpenGL;
GlobalVars.ReShade = false; GlobalVars.ReShade = false;
GlobalVars.QualityLevel = 5; GlobalVars.QualityLevel = QualityLevel.Ultra;
GlobalVars.OldLayout = false; GlobalVars.OldLayout = false;
ResetCustomizationValues(); ResetCustomizationValues();
} }
@ -633,24 +709,49 @@ public class LauncherFuncs
{ {
CryptoRandom random = new CryptoRandom(); CryptoRandom random = new CryptoRandom();
int randomID = 0; int randomID = 0;
int randIDmode = random.Next(0, 7); int randIDmode = random.Next(0, 8);
if (randIDmode == 0) { int idlimit = 0;
randomID = random.Next(0, 99);
} else if (randIDmode == 1) { switch (randIDmode)
randomID = random.Next(0, 999); {
} else if (randIDmode == 2) { case 0:
randomID = random.Next(0, 9999); idlimit = 9;
} else if (randIDmode == 3) { break;
randomID = random.Next(0, 99999); case 1:
} else if (randIDmode == 4) { idlimit = 99;
randomID = random.Next(0, 999999); break;
} else if (randIDmode == 5) { case 2:
randomID = random.Next(0, 9999999); idlimit = 999;
} else if (randIDmode == 6) { break;
randomID = random.Next(0, 99999999); case 3:
} else if (randIDmode == 7) { idlimit = 9999;
break;
case 4:
idlimit = 99999;
break;
case 5:
idlimit = 999999;
break;
case 6:
idlimit = 9999999;
break;
case 7:
idlimit = 99999999;
break;
case 8:
default:
break;
}
if (idlimit > 0)
{
randomID = random.Next(0, idlimit);
}
else
{
randomID = random.Next(); randomID = random.Next();
} }
//2147483647 is max id. //2147483647 is max id.
GlobalVars.UserID = randomID; GlobalVars.UserID = randomID;
} }
@ -762,68 +863,71 @@ public class LauncherFuncs
if (!GlobalVars.SelectedClientInfo.NoGraphicsOptions) if (!GlobalVars.SelectedClientInfo.NoGraphicsOptions)
{ {
if (GlobalVars.GraphicsMode == 1) switch (GlobalVars.GraphicsMode)
{ {
case GraphicsMode.OpenGL:
result += "xpcall( function() settings().Rendering.graphicsMode = 2 end, function( err ) settings().Rendering.graphicsMode = 4 end );"; result += "xpcall( function() settings().Rendering.graphicsMode = 2 end, function( err ) settings().Rendering.graphicsMode = 4 end );";
} break;
else if (GlobalVars.GraphicsMode == 2) case GraphicsMode.DirectX:
{
result += "pcall(function() settings().Rendering.graphicsMode = 3 end);"; result += "pcall(function() settings().Rendering.graphicsMode = 3 end);";
break;
default:
break;
} }
} }
//default values are ultra settings //default values are ultra settings
int MeshDetail = 100; int MeshDetail = 100;
int ShadingQuality = 100; int ShadingQuality = 100;
int QualityLevel = 19; int GFXQualityLevel = 19;
int MaterialQuality = 3; int MaterialQuality = 3;
int AASamples = 8; int AASamples = 8;
int Bevels = 1; int Bevels = 1;
int Shadows_2008 = 1; int Shadows_2008 = 1;
bool Shadows_2007 = true; bool Shadows_2007 = true;
if (GlobalVars.QualityLevel == 1) //very low switch (GlobalVars.QualityLevel)
{ {
case QualityLevel.VeryLow:
MeshDetail = 50; MeshDetail = 50;
ShadingQuality = 50; ShadingQuality = 50;
QualityLevel = 1; GFXQualityLevel = 1;
MaterialQuality = 1; MaterialQuality = 1;
AASamples = 1; AASamples = 1;
Bevels = 2; Bevels = 2;
Shadows_2008 = 2; Shadows_2008 = 2;
Shadows_2007 = false; Shadows_2007 = false;
} break;
else if (GlobalVars.QualityLevel == 2) //low case QualityLevel.Low:
{
MeshDetail = 50; MeshDetail = 50;
ShadingQuality = 50; ShadingQuality = 50;
QualityLevel = 5; GFXQualityLevel = 5;
MaterialQuality = 1; MaterialQuality = 1;
AASamples = 1; AASamples = 1;
Bevels = 2; Bevels = 2;
Shadows_2008 = 2; Shadows_2008 = 2;
Shadows_2007 = false; Shadows_2007 = false;
} break;
else if (GlobalVars.QualityLevel == 3) //medium case QualityLevel.Medium:
{
MeshDetail = 50; MeshDetail = 50;
ShadingQuality = 50; ShadingQuality = 50;
QualityLevel = 10; GFXQualityLevel = 10;
MaterialQuality = 2; MaterialQuality = 2;
AASamples = 4; AASamples = 4;
Bevels = 2; Bevels = 2;
Shadows_2007 = false; Shadows_2007 = false;
} break;
else if (GlobalVars.QualityLevel == 4) //high case QualityLevel.High:
{
MeshDetail = 75; MeshDetail = 75;
ShadingQuality = 75; ShadingQuality = 75;
QualityLevel = 15; GFXQualityLevel = 15;
AASamples = 4; AASamples = 4;
break;
case QualityLevel.Ultra:
default:
break;
} }
//1 = very low, 2 = low, 3 = medium, 4 = high, 5 = ultra.
result += " pcall(function() settings().Rendering.maxMeshDetail = " + MeshDetail.ToString() + " end);" result += " pcall(function() settings().Rendering.maxMeshDetail = " + MeshDetail.ToString() + " end);"
+ " pcall(function() settings().Rendering.maxShadingQuality = " + ShadingQuality.ToString() + " end);" + " pcall(function() settings().Rendering.maxShadingQuality = " + ShadingQuality.ToString() + " end);"
+ " pcall(function() settings().Rendering.minMeshDetail = " + MeshDetail.ToString() + " end);" + " pcall(function() settings().Rendering.minMeshDetail = " + MeshDetail.ToString() + " end);"
@ -843,7 +947,7 @@ public class LauncherFuncs
+ " pcall(function() settings().Rendering.Bevels = " + Bevels.ToString() + " end);" + " pcall(function() settings().Rendering.Bevels = " + Bevels.ToString() + " end);"
+ " pcall(function() settings().Rendering.Shadow = " + Shadows_2008.ToString() + " end);" + " pcall(function() settings().Rendering.Shadow = " + Shadows_2008.ToString() + " end);"
+ " pcall(function() settings().Rendering.Shadows = " + Shadows_2007.ToString().ToLower() + " end);" + " pcall(function() settings().Rendering.Shadows = " + Shadows_2007.ToString().ToLower() + " end);"
+ " pcall(function() settings().Rendering.QualityLevel = " + QualityLevel.ToString() + " end);"; + " pcall(function() settings().Rendering.QualityLevel = " + GFXQualityLevel.ToString() + " end);";
return result; return result;
} }
@ -864,7 +968,7 @@ public class LauncherFuncs
return luafile; return luafile;
} }
public static string GetClientEXEDir(ScriptGenerator.ScriptType type) public static string GetClientEXEDir(ScriptType type)
{ {
string rbxexe = ""; string rbxexe = "";
if (GlobalVars.SelectedClientInfo.LegacyMode) if (GlobalVars.SelectedClientInfo.LegacyMode)
@ -875,20 +979,20 @@ public class LauncherFuncs
{ {
switch (type) switch (type)
{ {
case ScriptGenerator.ScriptType.Client: case ScriptType.Client:
rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp_client.exe"; rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp_client.exe";
break; break;
case ScriptGenerator.ScriptType.Server: case ScriptType.Server:
rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp_server.exe"; rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp_server.exe";
break; break;
case ScriptGenerator.ScriptType.Studio: case ScriptType.Studio:
rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp_studio.exe"; rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp_studio.exe";
break; break;
case ScriptGenerator.ScriptType.Solo: case ScriptType.Solo:
case ScriptGenerator.ScriptType.EasterEgg: case ScriptType.EasterEgg:
rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp_solo.exe"; rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp_solo.exe";
break; break;
case ScriptGenerator.ScriptType.None: case ScriptType.None:
default: default:
rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp.exe"; rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp.exe";
break; break;

View File

@ -13,19 +13,6 @@ using System.IO;
using System.Reflection; using System.Reflection;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
/*
* so, in order for us to generate a good script, we have to:
* - specify the script header that gives us our setting adjustments
* - add player customization into the script
* - call the main script
* - call the function
*
* now, we have to call the funtion associated for the action, such as starting the main client or something
* we also need to make sure that when we add the option, we'll need to adapt map loading to work RBX2007 style for the clients using the script generator.
*/
public class ScriptGenerator
{
public enum ScriptType public enum ScriptType
{ {
Client = 0, Client = 0,
@ -36,12 +23,17 @@ public class ScriptGenerator
None = 5 None = 5
} }
public class ScriptGenerator
{
public static string GetScriptFuncForType(ScriptType type) public static string GetScriptFuncForType(ScriptType type)
{ {
string rbxexe = ""; string rbxexe = "";
if (GlobalVars.SelectedClientInfo.LegacyMode == true) { if (GlobalVars.SelectedClientInfo.LegacyMode == true)
{
rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp.exe"; rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp.exe";
} else { }
else
{
rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp_client.exe"; rbxexe = GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\RobloxApp_client.exe";
} }
@ -49,52 +41,51 @@ public class ScriptGenerator
string md5script = SecurityFuncs.CalculateMD5(GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptName + ".lua"); string md5script = SecurityFuncs.CalculateMD5(GlobalVars.ClientDir + @"\\" + GlobalVars.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptName + ".lua");
string md5exe = SecurityFuncs.CalculateMD5(rbxexe); string md5exe = SecurityFuncs.CalculateMD5(rbxexe);
string md5s = "'" + md5exe + "','" + md5dir + "','" + md5script + "'"; string md5s = "'" + md5exe + "','" + md5dir + "','" + md5script + "'";
if (type == ScriptType.Client) {
if (GlobalVars.SelectedClientInfo.UsesPlayerName == true && GlobalVars.SelectedClientInfo.UsesID == true) { switch (type)
return "_G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.loadtext + "," + md5s + ",'" + GlobalVars.PlayerTripcode + "')"; {
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false && GlobalVars.SelectedClientInfo.UsesID == true) { case ScriptType.Client:
return "_G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player'," + GlobalVars.loadtext + "," + md5s + ",'" + GlobalVars.PlayerTripcode + "')"; return "_G.CSConnect("
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == true && GlobalVars.SelectedClientInfo.UsesID == false) { + (GlobalVars.SelectedClientInfo.UsesID == true ? GlobalVars.UserID : 0) + ",'"
return "_G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.loadtext + "," + md5s + ",'" + GlobalVars.PlayerTripcode + "')"; + GlobalVars.IP + "',"
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false && GlobalVars.SelectedClientInfo.UsesID == false) { + GlobalVars.RobloxPort + ",'"
return "_G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player'," + GlobalVars.loadtext + "," + md5s + ",'" + GlobalVars.PlayerTripcode + "')"; + (GlobalVars.SelectedClientInfo.UsesPlayerName == true ? GlobalVars.PlayerName : "Player") + "',"
} else { + GlobalVars.loadtext + ","
return "_G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.loadtext + "," + md5s + ",'" + GlobalVars.PlayerTripcode + "')"; + md5s + ",'"
} + GlobalVars.PlayerTripcode + "')";
} else if (type == ScriptType.Server) { case ScriptType.Server:
return "_G.CSServer(" + GlobalVars.RobloxPort + "," + GlobalVars.PlayerLimit + "," + md5s + ")"; return "_G.CSServer("
} else if (type == ScriptType.Solo || type == ScriptType.EasterEgg) { + GlobalVars.RobloxPort + ","
if (GlobalVars.SelectedClientInfo.UsesPlayerName == true && GlobalVars.SelectedClientInfo.UsesID == true) { + GlobalVars.PlayerLimit + ","
return "_G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")"; + md5s + ")";
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false && GlobalVars.SelectedClientInfo.UsesID == true) { case ScriptType.Solo:
return "_G.CSSolo(" + GlobalVars.UserID + ",'Player'," + GlobalVars.sololoadtext + ")"; case ScriptType.EasterEgg:
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == true && GlobalVars.SelectedClientInfo.UsesID == false) { return "_G.CSSolo("
return "_G.CSSolo(0,'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")"; + (GlobalVars.SelectedClientInfo.UsesID == true ? GlobalVars.UserID : 0) + ",'"
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false && GlobalVars.SelectedClientInfo.UsesID == false) { + (GlobalVars.SelectedClientInfo.UsesPlayerName == true ? GlobalVars.PlayerName : "Player") + "',"
return "_G.CSSolo(0,'Player'," + GlobalVars.sololoadtext + ")"; + GlobalVars.sololoadtext + ")";
} else { case ScriptType.Studio:
return "_G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")";
}
} else if (type == ScriptType.Studio) {
return "_G.CSStudio()"; return "_G.CSStudio()";
} else { default:
return ""; return "";
} }
} }
public static string GetNameForType(ScriptType type) public static string GetNameForType(ScriptType type)
{ {
if (type == ScriptType.Client) { switch (type)
{
case ScriptType.Client:
return "Client"; return "Client";
} else if (type == ScriptType.Server) { case ScriptType.Server:
return "Server"; return "Server";
} else if (type == ScriptType.Solo) { case ScriptType.Solo:
return "Play Solo"; return "Play Solo";
} else if (type == ScriptType.Studio) { case ScriptType.Studio:
return "Studio"; return "Studio";
} else if (type == ScriptType.EasterEgg) { case ScriptType.EasterEgg:
return "A message from Bitl"; return "A message from Bitl";
} else { default:
return ""; return "";
} }
} }

View File

@ -168,7 +168,7 @@ public class SecurityFuncs
return new String(' ', random.Next(20)); return new String(' ', random.Next(20));
} }
public static void RenameWindow(Process exe, ScriptGenerator.ScriptType type, string mapname) public static void RenameWindow(Process exe, ScriptType type, string mapname)
{ {
if (GlobalVars.SelectedClientInfo.AlreadyHasSecurity != true) { if (GlobalVars.SelectedClientInfo.AlreadyHasSecurity != true) {
int time = 500; int time = 500;
@ -178,7 +178,7 @@ public class SecurityFuncs
} }
} }
private static void WorkerDoWork(Process exe, ScriptGenerator.ScriptType type, int time, BackgroundWorker worker, string clientname, string mapname) private static void WorkerDoWork(Process exe, ScriptType type, int time, BackgroundWorker worker, string clientname, string mapname)
{ {
if (exe.IsRunning() == true) { if (exe.IsRunning() == true) {
while (exe.IsRunning() == true) { while (exe.IsRunning() == true) {
@ -189,13 +189,40 @@ public class SecurityFuncs
break; break;
} }
if (type == ScriptGenerator.ScriptType.Client) { switch (type)
SetWindowText(exe.MainWindowHandle, "Novetus " + GlobalVars.Version + " - " + clientname + " " + ScriptGenerator.GetNameForType(type) + " [" + GlobalVars.IP + ":" + GlobalVars.RobloxPort + "]" + RandomStringTitle()); {
} else if (type == ScriptGenerator.ScriptType.Server || type == ScriptGenerator.ScriptType.Solo || type == ScriptGenerator.ScriptType.Studio) { case ScriptType.Client:
SetWindowText(exe.MainWindowHandle, "Novetus " + GlobalVars.Version + " - " + clientname + " " + ScriptGenerator.GetNameForType(type) + (string.IsNullOrWhiteSpace(mapname) ? " [Place1]" : " [" + mapname + "]") + RandomStringTitle()); SetWindowText(exe.MainWindowHandle, "Novetus "
}else if (type == ScriptGenerator.ScriptType.EasterEgg) { + GlobalVars.Version + " - "
SetWindowText(exe.MainWindowHandle, ScriptGenerator.GetNameForType(type) + RandomStringTitle()); + clientname + " "
+ ScriptGenerator.GetNameForType(type)
+ " [" + GlobalVars.IP + ":" + GlobalVars.RobloxPort + "]"
+ RandomStringTitle());
break;
case ScriptType.Server:
case ScriptType.Solo:
SetWindowText(exe.MainWindowHandle, "Novetus "
+ GlobalVars.Version + " - "
+ clientname + " "
+ ScriptGenerator.GetNameForType(type)
+ (string.IsNullOrWhiteSpace(mapname) ? " [Place1]" : " [" + mapname + "]")
+ RandomStringTitle());
break;
case ScriptType.Studio:
SetWindowText(exe.MainWindowHandle, "Novetus Studio "
+ GlobalVars.Version + " - "
+ clientname + " "
+ ScriptGenerator.GetNameForType(type)
+ (string.IsNullOrWhiteSpace(mapname) ? " [Place1]" : " [" + mapname + "]")
+ RandomStringTitle());
break;
case ScriptType.EasterEgg:
default:
SetWindowText(exe.MainWindowHandle, ScriptGenerator.GetNameForType(type)
+ RandomStringTitle());
break;
} }
Thread.Sleep(time); Thread.Sleep(time);
} }
} else { } else {

View File

@ -38,36 +38,53 @@ public static class SplashReader
return formattedsplash; return formattedsplash;
} }
private static bool IsTheSameDay(DateTime date1, DateTime date2)
{
return (date1.Month == date2.Month && date1.Day == date2.Day);
}
public static string GetSplash() public static string GetSplash()
{ {
DateTime today = DateTime.Now; DateTime today = DateTime.Now;
string splash = ""; string splash = "";
if (IsTheSameDay(today, new DateTime(today.Year, 12, 24)) || IsTheSameDay(today, new DateTime(today.Year, 12, 25))) { switch (today)
{
case DateTime christmaseve when christmaseve.Month.Equals(12) && christmaseve.Day.Equals(24):
case DateTime christmasday when christmasday.Month.Equals(12) && christmasday.Day.Equals(25):
splash = "Merry Christmas!"; splash = "Merry Christmas!";
} else if (IsTheSameDay(today, new DateTime(today.Year, 12, 31)) || IsTheSameDay(today, new DateTime(today.Year, 1, 1))) { break;
case DateTime newyearseve when newyearseve.Month.Equals(12) && newyearseve.Day.Equals(31):
case DateTime newyearsday when newyearsday.Month.Equals(1) && newyearsday.Day.Equals(1):
splash = "Happy New Year!"; splash = "Happy New Year!";
} else if (IsTheSameDay(today, new DateTime(today.Year, 10, 31))) { break;
case DateTime halloween when halloween.Month.Equals(10) && halloween.Day.Equals(31):
splash = "Happy Halloween!"; splash = "Happy Halloween!";
} else if (IsTheSameDay(today, new DateTime(today.Year, 6, 10))) { break;
case DateTime bitlbirthday when bitlbirthday.Month.Equals(6) && bitlbirthday.Day.Equals(10):
splash = "Happy Birthday, Bitl!"; splash = "Happy Birthday, Bitl!";
} else if (IsTheSameDay(today, new DateTime(today.Year, 8, 27))) { break;
case DateTime robloxbirthday when robloxbirthday.Month.Equals(8) && robloxbirthday.Day.Equals(27):
splash = "Happy Birthday, ROBLOX!"; splash = "Happy Birthday, ROBLOX!";
} else if (IsTheSameDay(today, new DateTime(today.Year, 10, 27))) { break;
case DateTime novetusbirthday when novetusbirthday.Month.Equals(10) && novetusbirthday.Day.Equals(27):
splash = "Happy Birthday, Novetus!"; splash = "Happy Birthday, Novetus!";
} else if (IsTheSameDay(today, new DateTime(today.Year, 10, 9))) { break;
case DateTime leiferikson when leiferikson.Month.Equals(10) && leiferikson.Day.Equals(9):
splash = "Happy Leif Erikson Day! HINGA DINGA DURGEN!"; splash = "Happy Leif Erikson Day! HINGA DINGA DURGEN!";
} else if (IsTheSameDay(today, new DateTime(today.Year, 4, 20))) { break;
case DateTime smokeweedeveryday when smokeweedeveryday.Month.Equals(4) && smokeweedeveryday.Day.Equals(20):
CryptoRandom random = new CryptoRandom();
if (random.Next(0, 1) == 1)
{
splash = "smoke weed every day";
}
else
{
splash = "4/20 lol"; splash = "4/20 lol";
} else if (IsTheSameDay(today, new DateTime(today.Year, 2, 11))) { }
break;
case DateTime erikismyhero when erikismyhero.Month.Equals(2) && erikismyhero.Day.Equals(11):
splash = "RIP Erik Cassel"; splash = "RIP Erik Cassel";
} else { break;
default:
splash = RandomSplash(); splash = RandomSplash();
break;
} }
return splash; return splash;

View File

@ -142,56 +142,63 @@ namespace NovetusLauncher
//clothing //clothing
if (GlobalVars.Custom_T_Shirt_Offline.Contains("http://")) if (GlobalVars.Custom_T_Shirt_Offline.Contains("http://"))
{ {
if (GlobalVars.Custom_T_Shirt_Offline.Contains("http://finobe.com/asset/?id=")) switch (GlobalVars.Custom_T_Shirt_Offline)
{ {
case string finobe when finobe.Contains("http://finobe.com/asset/?id="):
textBox12.Text = GlobalVars.Custom_T_Shirt_Offline.Replace("http://finobe.com/asset/?id=", ""); textBox12.Text = GlobalVars.Custom_T_Shirt_Offline.Replace("http://finobe.com/asset/?id=", "");
comboBox3.SelectedItem = "Finobe"; comboBox3.SelectedItem = "Finobe";
} break;
else if (GlobalVars.Custom_T_Shirt_Offline.Contains("http://www.roblox.com/asset/?id=")) case string roblox when roblox.Contains("http://www.roblox.com/asset/?id="):
{ default:
textBox12.Text = GlobalVars.Custom_T_Shirt_Offline.Replace("http://www.roblox.com/asset/?id=", ""); textBox12.Text = GlobalVars.Custom_T_Shirt_Offline.Replace("http://www.roblox.com/asset/?id=", "");
comboBox3.SelectedItem = "Roblox"; comboBox3.SelectedItem = "Roblox";
break;
} }
} }
if (GlobalVars.Custom_Shirt_Offline.Contains("http://")) if (GlobalVars.Custom_Shirt_Offline.Contains("http://"))
{ {
if (GlobalVars.Custom_Shirt_Offline.Contains("http://finobe.com/asset/?id=")) switch (GlobalVars.Custom_Shirt_Offline)
{ {
case string finobe when finobe.Contains("http://finobe.com/asset/?id="):
textBox11.Text = GlobalVars.Custom_Shirt_Offline.Replace("http://finobe.com/asset/?id=", ""); textBox11.Text = GlobalVars.Custom_Shirt_Offline.Replace("http://finobe.com/asset/?id=", "");
comboBox2.SelectedItem = "Finobe"; comboBox2.SelectedItem = "Finobe";
} break;
else if (GlobalVars.Custom_Shirt_Offline.Contains("http://www.roblox.com/asset/?id=")) case string roblox when roblox.Contains("http://www.roblox.com/asset/?id="):
{ default:
textBox11.Text = GlobalVars.Custom_Shirt_Offline.Replace("http://www.roblox.com/asset/?id=", ""); textBox11.Text = GlobalVars.Custom_Shirt_Offline.Replace("http://www.roblox.com/asset/?id=", "");
comboBox2.SelectedItem = "Roblox"; comboBox2.SelectedItem = "Roblox";
break;
} }
} }
if (GlobalVars.Custom_Pants_Offline.Contains("http://")) if (GlobalVars.Custom_Pants_Offline.Contains("http://"))
{ {
if (GlobalVars.Custom_Pants_Offline.Contains("http://finobe.com/asset/?id=")) switch (GlobalVars.Custom_Pants_Offline)
{ {
case string finobe when finobe.Contains("http://finobe.com/asset/?id="):
textBox13.Text = GlobalVars.Custom_Pants_Offline.Replace("http://finobe.com/asset/?id=", ""); textBox13.Text = GlobalVars.Custom_Pants_Offline.Replace("http://finobe.com/asset/?id=", "");
comboBox1.SelectedItem = "Finobe"; comboBox1.SelectedItem = "Finobe";
} break;
else if (GlobalVars.Custom_Pants_Offline.Contains("http://www.roblox.com/asset/?id=")) case string roblox when roblox.Contains("http://www.roblox.com/asset/?id="):
{ default:
textBox13.Text = GlobalVars.Custom_Pants_Offline.Replace("http://www.roblox.com/asset/?id=", ""); textBox13.Text = GlobalVars.Custom_Pants_Offline.Replace("http://www.roblox.com/asset/?id=", "");
comboBox1.SelectedItem = "Roblox"; comboBox1.SelectedItem = "Roblox";
break;
} }
} }
//discord //discord
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InCustomization, GlobalVars.Map); LauncherFuncs.UpdateRichPresence(LauncherState.InCustomization, GlobalVars.Map);
LauncherFuncs.ReloadLoadtextValue(); LauncherFuncs.ReloadLoadtextValue();
} }
void tabControl1_SelectedIndexChanged(object sender, EventArgs e) void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage1"])//your specific tabname switch (tabControl1.SelectedTab)
{ {
case TabPage pg1 when pg1 == tabControl1.TabPages["tabPage1"]:
panel3.Location = new Point(110, 359); panel3.Location = new Point(110, 359);
listBox1.Items.Clear(); listBox1.Items.Clear();
listBox2.Items.Clear(); listBox2.Items.Clear();
@ -202,9 +209,8 @@ namespace NovetusLauncher
listBox7.Items.Clear(); listBox7.Items.Clear();
listBox8.Items.Clear(); listBox8.Items.Clear();
listBox9.Items.Clear(); listBox9.Items.Clear();
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage7"]) case TabPage pg7 when pg7 == tabControl1.TabPages["tabPage7"]:
{
panel3.Location = new Point(110, 359); panel3.Location = new Point(110, 359);
listBox1.Items.Clear(); listBox1.Items.Clear();
listBox2.Items.Clear(); listBox2.Items.Clear();
@ -226,9 +232,8 @@ namespace NovetusLauncher
Image icon1 = LauncherFuncs.LoadImage(GlobalVars.extradir + "\\NoExtra.png"); Image icon1 = LauncherFuncs.LoadImage(GlobalVars.extradir + "\\NoExtra.png");
pictureBox10.Image = icon1; pictureBox10.Image = icon1;
} }
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage2"])//your specific tabname case TabPage pg2 when pg2 == tabControl1.TabPages["tabPage2"]:
{
//hats //hats
panel3.Location = new Point(110, 239); panel3.Location = new Point(110, 239);
listBox4.Items.Clear(); listBox4.Items.Clear();
@ -292,9 +297,8 @@ namespace NovetusLauncher
textBox4.Text = GlobalVars.Custom_Hat3ID_Offline; textBox4.Text = GlobalVars.Custom_Hat3ID_Offline;
} }
} }
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage3"])//your specific tabname case TabPage pg3 when pg3 == tabControl1.TabPages["tabPage3"]:
{
//faces //faces
panel3.Location = new Point(110, 359); panel3.Location = new Point(110, 359);
listBox1.Items.Clear(); listBox1.Items.Clear();
@ -333,9 +337,8 @@ namespace NovetusLauncher
textBox6.Text = GlobalVars.Custom_Face_Offline; textBox6.Text = GlobalVars.Custom_Face_Offline;
} }
} }
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage4"])//your specific tabname case TabPage pg4 when pg4 == tabControl1.TabPages["tabPage4"]:
{
//faces //faces
listBox1.Items.Clear(); listBox1.Items.Clear();
listBox2.Items.Clear(); listBox2.Items.Clear();
@ -381,9 +384,8 @@ namespace NovetusLauncher
Image icon1 = LauncherFuncs.LoadImage(GlobalVars.tshirtdir + @"\\NoTShirt.png"); Image icon1 = LauncherFuncs.LoadImage(GlobalVars.tshirtdir + @"\\NoTShirt.png");
pictureBox5.Image = icon1; pictureBox5.Image = icon1;
} }
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage5"])//your specific tabname case TabPage pg5 when pg5 == tabControl1.TabPages["tabPage5"]:
{
//faces //faces
listBox1.Items.Clear(); listBox1.Items.Clear();
listBox2.Items.Clear(); listBox2.Items.Clear();
@ -429,9 +431,8 @@ namespace NovetusLauncher
Image icon1 = LauncherFuncs.LoadImage(GlobalVars.shirtdir + @"\\NoShirt.png"); Image icon1 = LauncherFuncs.LoadImage(GlobalVars.shirtdir + @"\\NoShirt.png");
pictureBox6.Image = icon1; pictureBox6.Image = icon1;
} }
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage6"])//your specific tabname case TabPage pg6 when pg6 == tabControl1.TabPages["tabPage6"]:
{
//faces //faces
listBox1.Items.Clear(); listBox1.Items.Clear();
listBox2.Items.Clear(); listBox2.Items.Clear();
@ -477,9 +478,8 @@ namespace NovetusLauncher
Image icon1 = LauncherFuncs.LoadImage(GlobalVars.pantsdir + @"\\NoPants.png"); Image icon1 = LauncherFuncs.LoadImage(GlobalVars.pantsdir + @"\\NoPants.png");
pictureBox7.Image = icon1; pictureBox7.Image = icon1;
} }
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage8"])//your specific tabname case TabPage pg8 when pg8 == tabControl1.TabPages["tabPage8"]:
{
//faces //faces
panel3.Location = new Point(110, 359); panel3.Location = new Point(110, 359);
listBox1.Items.Clear(); listBox1.Items.Clear();
@ -518,9 +518,8 @@ namespace NovetusLauncher
textBox5.Text = GlobalVars.Custom_Head_Offline; textBox5.Text = GlobalVars.Custom_Head_Offline;
} }
} }
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage9"])//your specific tabname case TabPage pg9 when pg9 == tabControl1.TabPages["tabPage9"]:
{
//faces //faces
panel3.Location = new Point(110, 359); panel3.Location = new Point(110, 359);
listBox1.Items.Clear(); listBox1.Items.Clear();
@ -601,12 +600,24 @@ namespace NovetusLauncher
} }
} }
} }
break;
default:
listBox1.Items.Clear();
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
listBox5.Items.Clear();
listBox6.Items.Clear();
listBox7.Items.Clear();
listBox8.Items.Clear();
listBox9.Items.Clear();
break;
} }
} }
void CharacterCustomizationClose(object sender, CancelEventArgs e) void CharacterCustomizationClose(object sender, CancelEventArgs e)
{ {
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, ""); LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
LauncherFuncs.ReloadLoadtextValue(); LauncherFuncs.ReloadLoadtextValue();
} }
@ -1152,91 +1163,55 @@ namespace NovetusLauncher
return Color.FromArgb(A,R,G,B); return Color.FromArgb(A,R,G,B);
} }
void ChangeColorOfPart(int ColorID)
{
ChangeColorOfPart(ColorID, PartColorList.Find(x => x.ColorID == ColorID).ButtonColor);
}
void ChangeColorOfPart(int ColorID, Color ButtonColor) void ChangeColorOfPart(int ColorID, Color ButtonColor)
{ {
if (SelectedPart == "Head") ChangeColorOfPart(SelectedPart, ColorID, ButtonColor);
{
GlobalVars.HeadColorID = ColorID;
GlobalVars.ColorMenu_HeadColor = ButtonColor.ToString();
button1.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_HeadColor);
}
else if (SelectedPart == "Torso")
{
GlobalVars.TorsoColorID = ColorID;
GlobalVars.ColorMenu_TorsoColor = ButtonColor.ToString();
button2.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_TorsoColor);
}
else if (SelectedPart == "Right Arm")
{
GlobalVars.RightArmColorID = ColorID;
GlobalVars.ColorMenu_RightArmColor = ButtonColor.ToString();
button3.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightArmColor);
}
else if (SelectedPart == "Left Arm")
{
GlobalVars.LeftArmColorID = ColorID;
GlobalVars.ColorMenu_LeftArmColor = ButtonColor.ToString();
button4.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftArmColor);
}
else if (SelectedPart == "Right Leg")
{
GlobalVars.RightLegColorID = ColorID;
GlobalVars.ColorMenu_RightLegColor = ButtonColor.ToString();
button5.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightLegColor);
}
else if (SelectedPart == "Left Leg")
{
GlobalVars.LeftLegColorID = ColorID;
GlobalVars.ColorMenu_LeftLegColor = ButtonColor.ToString();
button6.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftLegColor);
}
} }
void ChangeColorOfPart(string part, int ColorID, Color ButtonColor) void ChangeColorOfPart(string part, int ColorID, Color ButtonColor)
{ {
if (part == "Head") switch (part)
{ {
case "Head":
GlobalVars.HeadColorID = ColorID; GlobalVars.HeadColorID = ColorID;
GlobalVars.ColorMenu_HeadColor = ButtonColor.ToString(); GlobalVars.ColorMenu_HeadColor = ButtonColor.ToString();
button1.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_HeadColor); button1.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_HeadColor);
} break;
else if (part == "Torso") case "Torso":
{
GlobalVars.TorsoColorID = ColorID; GlobalVars.TorsoColorID = ColorID;
GlobalVars.ColorMenu_TorsoColor = ButtonColor.ToString(); GlobalVars.ColorMenu_TorsoColor = ButtonColor.ToString();
button2.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_TorsoColor); button2.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_TorsoColor);
} break;
else if (part == "Right Arm") case "Right Arm":
{
GlobalVars.RightArmColorID = ColorID; GlobalVars.RightArmColorID = ColorID;
GlobalVars.ColorMenu_RightArmColor = ButtonColor.ToString(); GlobalVars.ColorMenu_RightArmColor = ButtonColor.ToString();
button3.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightArmColor); button3.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightArmColor);
} break;
else if (part == "Left Arm") case "Left Arm":
{
GlobalVars.LeftArmColorID = ColorID; GlobalVars.LeftArmColorID = ColorID;
GlobalVars.ColorMenu_LeftArmColor = ButtonColor.ToString(); GlobalVars.ColorMenu_LeftArmColor = ButtonColor.ToString();
button4.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftArmColor); button4.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftArmColor);
} break;
else if (part == "Right Leg") case "Right Leg":
{
GlobalVars.RightLegColorID = ColorID; GlobalVars.RightLegColorID = ColorID;
GlobalVars.ColorMenu_RightLegColor = ButtonColor.ToString(); GlobalVars.ColorMenu_RightLegColor = ButtonColor.ToString();
button5.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightLegColor); button5.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightLegColor);
} break;
else if (part == "Left Leg") case "Left Leg":
{
GlobalVars.LeftLegColorID = ColorID; GlobalVars.LeftLegColorID = ColorID;
GlobalVars.ColorMenu_LeftLegColor = ButtonColor.ToString(); GlobalVars.ColorMenu_LeftLegColor = ButtonColor.ToString();
button6.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftLegColor); button6.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftLegColor);
break;
default:
break;
} }
} }
void ChangeColorOfPart(int ColorID)
{
ChangeColorOfPart(ColorID, PartColorList.Find(x => x.ColorID == ColorID).ButtonColor);
}
void Button7Click(object sender, EventArgs e) void Button7Click(object sender, EventArgs e)
{ {
ChangeColorOfPart(1); ChangeColorOfPart(1);
@ -1415,29 +1390,28 @@ namespace NovetusLauncher
{ {
int RandomColor = rand.Next(PartColorList.Count); int RandomColor = rand.Next(PartColorList.Count);
if (i == 1) switch (i)
{ {
case 1:
ChangeColorOfPart("Head", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); ChangeColorOfPart("Head", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor);
} break;
else if (i == 2) case 2:
{
ChangeColorOfPart("Torso", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); ChangeColorOfPart("Torso", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor);
} break;
else if (i == 3) case 3:
{
ChangeColorOfPart("Left Arm", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); ChangeColorOfPart("Left Arm", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor);
} break;
else if (i == 4) case 4:
{
ChangeColorOfPart("Right Arm", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); ChangeColorOfPart("Right Arm", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor);
} break;
else if (i == 5) case 5:
{
ChangeColorOfPart("Left Leg", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); ChangeColorOfPart("Left Leg", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor);
} break;
else if (i == 6) case 6:
{
ChangeColorOfPart("Right Leg", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); ChangeColorOfPart("Right Leg", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor);
break;
default:
break;
} }
} }
} }
@ -1647,8 +1621,9 @@ namespace NovetusLauncher
void CheckBox1CheckedChanged(object sender, EventArgs e) void CheckBox1CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox1.Checked == true) switch (checkBox1.Checked)
{ {
case true:
GlobalVars.Custom_Extra_ShowHats = true; GlobalVars.Custom_Extra_ShowHats = true;
if (Directory.Exists(GlobalVars.hatdir)) if (Directory.Exists(GlobalVars.hatdir))
@ -1670,9 +1645,8 @@ namespace NovetusLauncher
listBox9.Items.Add(file.Name); listBox9.Items.Add(file.Name);
} }
} }
} break;
else if (checkBox1.Checked == false) case false:
{
GlobalVars.Custom_Extra_ShowHats = false; GlobalVars.Custom_Extra_ShowHats = false;
listBox9.Items.Clear(); listBox9.Items.Clear();
@ -1725,6 +1699,9 @@ namespace NovetusLauncher
} }
} }
} }
break;
default:
break;
} }
} }

View File

@ -140,56 +140,63 @@ namespace NovetusLauncher
//clothing //clothing
if (GlobalVars.Custom_T_Shirt_Offline.Contains("http://")) if (GlobalVars.Custom_T_Shirt_Offline.Contains("http://"))
{ {
if (GlobalVars.Custom_T_Shirt_Offline.Contains("http://finobe.com/asset/?id=")) switch (GlobalVars.Custom_T_Shirt_Offline)
{ {
case string finobe when finobe.Contains("http://finobe.com/asset/?id="):
textBox11.Text = GlobalVars.Custom_T_Shirt_Offline.Replace("http://finobe.com/asset/?id=", ""); textBox11.Text = GlobalVars.Custom_T_Shirt_Offline.Replace("http://finobe.com/asset/?id=", "");
comboBox2.SelectedItem = "Finobe"; comboBox2.SelectedItem = "Finobe";
} break;
else if (GlobalVars.Custom_T_Shirt_Offline.Contains("http://www.roblox.com/asset/?id=")) case string roblox when roblox.Contains("http://www.roblox.com/asset/?id="):
{ default:
textBox12.Text = GlobalVars.Custom_T_Shirt_Offline.Replace("http://www.roblox.com/asset/?id=", ""); textBox11.Text = GlobalVars.Custom_T_Shirt_Offline.Replace("http://www.roblox.com/asset/?id=", "");
comboBox2.SelectedItem = "Roblox"; comboBox2.SelectedItem = "Roblox";
break;
} }
} }
if (GlobalVars.Custom_Shirt_Offline.Contains("http://")) if (GlobalVars.Custom_Shirt_Offline.Contains("http://"))
{ {
if (GlobalVars.Custom_Shirt_Offline.Contains("http://finobe.com/asset/?id=")) switch (GlobalVars.Custom_Shirt_Offline)
{ {
case string finobe when finobe.Contains("http://finobe.com/asset/?id="):
textBox12.Text = GlobalVars.Custom_Shirt_Offline.Replace("http://finobe.com/asset/?id=", ""); textBox12.Text = GlobalVars.Custom_Shirt_Offline.Replace("http://finobe.com/asset/?id=", "");
comboBox1.SelectedItem = "Finobe"; comboBox1.SelectedItem = "Finobe";
} break;
else if (GlobalVars.Custom_Shirt_Offline.Contains("http://www.roblox.com/asset/?id=")) case string roblox when roblox.Contains("http://www.roblox.com/asset/?id="):
{ default:
textBox12.Text = GlobalVars.Custom_Shirt_Offline.Replace("http://www.roblox.com/asset/?id=", ""); textBox12.Text = GlobalVars.Custom_Shirt_Offline.Replace("http://www.roblox.com/asset/?id=", "");
comboBox1.SelectedItem = "Roblox"; comboBox1.SelectedItem = "Roblox";
break;
} }
} }
if (GlobalVars.Custom_Pants_Offline.Contains("http://")) if (GlobalVars.Custom_Pants_Offline.Contains("http://"))
{ {
if (GlobalVars.Custom_Pants_Offline.Contains("http://finobe.com/asset/?id=")) switch (GlobalVars.Custom_Pants_Offline)
{ {
case string finobe when finobe.Contains("http://finobe.com/asset/?id="):
textBox13.Text = GlobalVars.Custom_Pants_Offline.Replace("http://finobe.com/asset/?id=", ""); textBox13.Text = GlobalVars.Custom_Pants_Offline.Replace("http://finobe.com/asset/?id=", "");
comboBox3.SelectedItem = "Finobe"; comboBox3.SelectedItem = "Finobe";
} break;
else if (GlobalVars.Custom_Pants_Offline.Contains("http://www.roblox.com/asset/?id=")) case string roblox when roblox.Contains("http://www.roblox.com/asset/?id="):
{ default:
textBox13.Text = GlobalVars.Custom_Pants_Offline.Replace("http://www.roblox.com/asset/?id=", ""); textBox13.Text = GlobalVars.Custom_Pants_Offline.Replace("http://www.roblox.com/asset/?id=", "");
comboBox3.SelectedItem = "Roblox"; comboBox3.SelectedItem = "Roblox";
break;
} }
} }
//discord //discord
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InCustomization, GlobalVars.Map); LauncherFuncs.UpdateRichPresence(LauncherState.InCustomization, GlobalVars.Map);
LauncherFuncs.ReloadLoadtextValue(); LauncherFuncs.ReloadLoadtextValue();
} }
void tabControl1_SelectedIndexChanged(object sender, EventArgs e) void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage1"])//your specific tabname switch (tabControl1.SelectedTab)
{ {
case TabPage pg1 when pg1 == tabControl1.TabPages["tabPage1"]:
listBox1.Items.Clear(); listBox1.Items.Clear();
listBox2.Items.Clear(); listBox2.Items.Clear();
listBox3.Items.Clear(); listBox3.Items.Clear();
@ -199,9 +206,8 @@ namespace NovetusLauncher
listBox7.Items.Clear(); listBox7.Items.Clear();
listBox8.Items.Clear(); listBox8.Items.Clear();
listBox9.Items.Clear(); listBox9.Items.Clear();
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage7"]) case TabPage pg7 when pg7 == tabControl1.TabPages["tabPage7"]:
{
listBox1.Items.Clear(); listBox1.Items.Clear();
listBox2.Items.Clear(); listBox2.Items.Clear();
listBox3.Items.Clear(); listBox3.Items.Clear();
@ -222,9 +228,8 @@ namespace NovetusLauncher
Image icon1 = LauncherFuncs.LoadImage(GlobalVars.extradir + "\\NoExtra.png"); Image icon1 = LauncherFuncs.LoadImage(GlobalVars.extradir + "\\NoExtra.png");
pictureBox10.Image = icon1; pictureBox10.Image = icon1;
} }
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage2"])//your specific tabname case TabPage pg2 when pg2 == tabControl1.TabPages["tabPage2"]:
{
//hats //hats
listBox4.Items.Clear(); listBox4.Items.Clear();
listBox5.Items.Clear(); listBox5.Items.Clear();
@ -287,9 +292,8 @@ namespace NovetusLauncher
textBox4.Text = GlobalVars.Custom_Hat3ID_Offline; textBox4.Text = GlobalVars.Custom_Hat3ID_Offline;
} }
} }
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage3"])//your specific tabname case TabPage pg3 when pg3 == tabControl1.TabPages["tabPage3"]:
{
//faces //faces
listBox1.Items.Clear(); listBox1.Items.Clear();
listBox2.Items.Clear(); listBox2.Items.Clear();
@ -327,9 +331,8 @@ namespace NovetusLauncher
textBox6.Text = GlobalVars.Custom_Face_Offline; textBox6.Text = GlobalVars.Custom_Face_Offline;
} }
} }
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage4"])//your specific tabname case TabPage pg4 when pg4 == tabControl1.TabPages["tabPage4"]:
{
//faces //faces
listBox1.Items.Clear(); listBox1.Items.Clear();
listBox2.Items.Clear(); listBox2.Items.Clear();
@ -375,9 +378,8 @@ namespace NovetusLauncher
Image icon1 = LauncherFuncs.LoadImage(GlobalVars.tshirtdir + @"\\NoTShirt.png"); Image icon1 = LauncherFuncs.LoadImage(GlobalVars.tshirtdir + @"\\NoTShirt.png");
pictureBox5.Image = icon1; pictureBox5.Image = icon1;
} }
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage5"])//your specific tabname case TabPage pg5 when pg5 == tabControl1.TabPages["tabPage5"]:
{
//faces //faces
listBox1.Items.Clear(); listBox1.Items.Clear();
listBox2.Items.Clear(); listBox2.Items.Clear();
@ -423,9 +425,8 @@ namespace NovetusLauncher
Image icon1 = LauncherFuncs.LoadImage(GlobalVars.shirtdir + @"\\NoShirt.png"); Image icon1 = LauncherFuncs.LoadImage(GlobalVars.shirtdir + @"\\NoShirt.png");
pictureBox6.Image = icon1; pictureBox6.Image = icon1;
} }
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage6"])//your specific tabname case TabPage pg6 when pg6 == tabControl1.TabPages["tabPage6"]:
{
//faces //faces
listBox1.Items.Clear(); listBox1.Items.Clear();
listBox2.Items.Clear(); listBox2.Items.Clear();
@ -471,9 +472,8 @@ namespace NovetusLauncher
Image icon1 = LauncherFuncs.LoadImage(GlobalVars.pantsdir + @"\\NoPants.png"); Image icon1 = LauncherFuncs.LoadImage(GlobalVars.pantsdir + @"\\NoPants.png");
pictureBox7.Image = icon1; pictureBox7.Image = icon1;
} }
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage8"])//your specific tabname case TabPage pg8 when pg8 == tabControl1.TabPages["tabPage8"]:
{
//faces //faces
listBox1.Items.Clear(); listBox1.Items.Clear();
listBox2.Items.Clear(); listBox2.Items.Clear();
@ -511,9 +511,8 @@ namespace NovetusLauncher
textBox5.Text = GlobalVars.Custom_Head_Offline; textBox5.Text = GlobalVars.Custom_Head_Offline;
} }
} }
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage9"])//your specific tabname case TabPage pg9 when pg9 == tabControl1.TabPages["tabPage9"]:
{
//faces //faces
listBox1.Items.Clear(); listBox1.Items.Clear();
listBox2.Items.Clear(); listBox2.Items.Clear();
@ -593,12 +592,24 @@ namespace NovetusLauncher
} }
} }
} }
break;
default:
listBox1.Items.Clear();
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
listBox5.Items.Clear();
listBox6.Items.Clear();
listBox7.Items.Clear();
listBox8.Items.Clear();
listBox9.Items.Clear();
break;
} }
} }
void CharacterCustomizationClose(object sender, CancelEventArgs e) void CharacterCustomizationClose(object sender, CancelEventArgs e)
{ {
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, ""); LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
LauncherFuncs.ReloadLoadtextValue(); LauncherFuncs.ReloadLoadtextValue();
} }
@ -1144,91 +1155,55 @@ namespace NovetusLauncher
return Color.FromArgb(A,R,G,B); return Color.FromArgb(A,R,G,B);
} }
void ChangeColorOfPart(int ColorID)
{
ChangeColorOfPart(ColorID, PartColorList.Find(x => x.ColorID == ColorID).ButtonColor);
}
void ChangeColorOfPart(int ColorID, Color ButtonColor) void ChangeColorOfPart(int ColorID, Color ButtonColor)
{ {
if (SelectedPart == "Head") ChangeColorOfPart(SelectedPart, ColorID, ButtonColor);
{
GlobalVars.HeadColorID = ColorID;
GlobalVars.ColorMenu_HeadColor = ButtonColor.ToString();
button1.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_HeadColor);
}
else if (SelectedPart == "Torso")
{
GlobalVars.TorsoColorID = ColorID;
GlobalVars.ColorMenu_TorsoColor = ButtonColor.ToString();
button2.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_TorsoColor);
}
else if (SelectedPart == "Right Arm")
{
GlobalVars.RightArmColorID = ColorID;
GlobalVars.ColorMenu_RightArmColor = ButtonColor.ToString();
button3.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightArmColor);
}
else if (SelectedPart == "Left Arm")
{
GlobalVars.LeftArmColorID = ColorID;
GlobalVars.ColorMenu_LeftArmColor = ButtonColor.ToString();
button4.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftArmColor);
}
else if (SelectedPart == "Right Leg")
{
GlobalVars.RightLegColorID = ColorID;
GlobalVars.ColorMenu_RightLegColor = ButtonColor.ToString();
button5.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightLegColor);
}
else if (SelectedPart == "Left Leg")
{
GlobalVars.LeftLegColorID = ColorID;
GlobalVars.ColorMenu_LeftLegColor = ButtonColor.ToString();
button6.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftLegColor);
}
} }
void ChangeColorOfPart(string part, int ColorID, Color ButtonColor) void ChangeColorOfPart(string part, int ColorID, Color ButtonColor)
{ {
if (part == "Head") switch (part)
{ {
case "Head":
GlobalVars.HeadColorID = ColorID; GlobalVars.HeadColorID = ColorID;
GlobalVars.ColorMenu_HeadColor = ButtonColor.ToString(); GlobalVars.ColorMenu_HeadColor = ButtonColor.ToString();
button1.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_HeadColor); button1.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_HeadColor);
} break;
else if (part == "Torso") case "Torso":
{
GlobalVars.TorsoColorID = ColorID; GlobalVars.TorsoColorID = ColorID;
GlobalVars.ColorMenu_TorsoColor = ButtonColor.ToString(); GlobalVars.ColorMenu_TorsoColor = ButtonColor.ToString();
button2.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_TorsoColor); button2.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_TorsoColor);
} break;
else if (part == "Right Arm") case "Right Arm":
{
GlobalVars.RightArmColorID = ColorID; GlobalVars.RightArmColorID = ColorID;
GlobalVars.ColorMenu_RightArmColor = ButtonColor.ToString(); GlobalVars.ColorMenu_RightArmColor = ButtonColor.ToString();
button3.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightArmColor); button3.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightArmColor);
} break;
else if (part == "Left Arm") case "Left Arm":
{
GlobalVars.LeftArmColorID = ColorID; GlobalVars.LeftArmColorID = ColorID;
GlobalVars.ColorMenu_LeftArmColor = ButtonColor.ToString(); GlobalVars.ColorMenu_LeftArmColor = ButtonColor.ToString();
button4.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftArmColor); button4.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftArmColor);
} break;
else if (part == "Right Leg") case "Right Leg":
{
GlobalVars.RightLegColorID = ColorID; GlobalVars.RightLegColorID = ColorID;
GlobalVars.ColorMenu_RightLegColor = ButtonColor.ToString(); GlobalVars.ColorMenu_RightLegColor = ButtonColor.ToString();
button5.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightLegColor); button5.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_RightLegColor);
} break;
else if (part == "Left Leg") case "Left Leg":
{
GlobalVars.LeftLegColorID = ColorID; GlobalVars.LeftLegColorID = ColorID;
GlobalVars.ColorMenu_LeftLegColor = ButtonColor.ToString(); GlobalVars.ColorMenu_LeftLegColor = ButtonColor.ToString();
button6.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftLegColor); button6.BackColor = ConvertStringtoColor(GlobalVars.ColorMenu_LeftLegColor);
break;
default:
break;
} }
} }
void ChangeColorOfPart(int ColorID)
{
ChangeColorOfPart(ColorID, PartColorList.Find(x => x.ColorID == ColorID).ButtonColor);
}
void Button7Click(object sender, EventArgs e) void Button7Click(object sender, EventArgs e)
{ {
ChangeColorOfPart(1); ChangeColorOfPart(1);
@ -1407,29 +1382,28 @@ namespace NovetusLauncher
{ {
int RandomColor = rand.Next(PartColorList.Count); int RandomColor = rand.Next(PartColorList.Count);
if (i == 1) switch (i)
{ {
case 1:
ChangeColorOfPart("Head", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); ChangeColorOfPart("Head", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor);
} break;
else if (i == 2) case 2:
{
ChangeColorOfPart("Torso", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); ChangeColorOfPart("Torso", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor);
} break;
else if (i == 3) case 3:
{
ChangeColorOfPart("Left Arm", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); ChangeColorOfPart("Left Arm", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor);
} break;
else if (i == 4) case 4:
{
ChangeColorOfPart("Right Arm", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); ChangeColorOfPart("Right Arm", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor);
} break;
else if (i == 5) case 5:
{
ChangeColorOfPart("Left Leg", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); ChangeColorOfPart("Left Leg", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor);
} break;
else if (i == 6) case 6:
{
ChangeColorOfPart("Right Leg", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor); ChangeColorOfPart("Right Leg", PartColorList[RandomColor].ColorID, PartColorList[RandomColor].ButtonColor);
break;
default:
break;
} }
} }
} }
@ -1639,8 +1613,9 @@ namespace NovetusLauncher
void CheckBox1CheckedChanged(object sender, EventArgs e) void CheckBox1CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox1.Checked == true) switch (checkBox1.Checked)
{ {
case true:
GlobalVars.Custom_Extra_ShowHats = true; GlobalVars.Custom_Extra_ShowHats = true;
if (Directory.Exists(GlobalVars.hatdir)) if (Directory.Exists(GlobalVars.hatdir))
@ -1662,9 +1637,8 @@ namespace NovetusLauncher
listBox9.Items.Add(file.Name); listBox9.Items.Add(file.Name);
} }
} }
} break;
else if (checkBox1.Checked == false) case false:
{
GlobalVars.Custom_Extra_ShowHats = false; GlobalVars.Custom_Extra_ShowHats = false;
listBox9.Items.Clear(); listBox9.Items.Clear();
@ -1717,6 +1691,9 @@ namespace NovetusLauncher
} }
} }
} }
break;
default:
break;
} }
} }

View File

@ -167,7 +167,7 @@ namespace NovetusLauncher
handlers.requestCallback += RequestCallback; handlers.requestCallback += RequestCallback;
DiscordRpc.Initialize(GlobalVars.appid, ref handlers, true, ""); DiscordRpc.Initialize(GlobalVars.appid, ref handlers, true, "");
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, "", true); LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "", true);
} }
} }
#endregion #endregion
@ -219,8 +219,9 @@ namespace NovetusLauncher
async void tabControl1_SelectedIndexChanged(object sender, EventArgs e) async void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage2"])//your specific tabname switch (tabControl1.SelectedTab)
{ {
case TabPage pg2 when pg2 == tabControl1.TabPages["tabPage2"]:
treeView1.Nodes.Clear(); treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear(); _fieldsTreeCache.Nodes.Clear();
textBox4.Text = ""; textBox4.Text = "";
@ -270,9 +271,8 @@ namespace NovetusLauncher
} }
textBox3.SelectionStart = 0; textBox3.SelectionStart = 0;
textBox3.ScrollToCaret(); textBox3.ScrollToCaret();
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage4"])//your specific tabname case TabPage pg4 when pg4 == tabControl1.TabPages["tabPage4"]:
{
string mapdir = GlobalVars.MapsDir; string mapdir = GlobalVars.MapsDir;
TreeNodeHelper.ListDirectory(treeView1, mapdir, ".rbxl"); TreeNodeHelper.ListDirectory(treeView1, mapdir, ".rbxl");
TreeNodeHelper.CopyNodes(treeView1.Nodes, _fieldsTreeCache.Nodes); TreeNodeHelper.CopyNodes(treeView1.Nodes, _fieldsTreeCache.Nodes);
@ -282,9 +282,8 @@ namespace NovetusLauncher
listBox2.Items.Clear(); listBox2.Items.Clear();
listBox3.Items.Clear(); listBox3.Items.Clear();
listBox4.Items.Clear(); listBox4.Items.Clear();
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage3"])//your specific tabname case TabPage pg3 when pg3 == tabControl1.TabPages["tabPage3"]:
{
string clientdir = GlobalVars.ClientDir; string clientdir = GlobalVars.ClientDir;
DirectoryInfo dinfo = new DirectoryInfo(clientdir); DirectoryInfo dinfo = new DirectoryInfo(clientdir);
DirectoryInfo[] Dirs = dinfo.GetDirectories(); DirectoryInfo[] Dirs = dinfo.GetDirectories();
@ -299,9 +298,8 @@ namespace NovetusLauncher
textBox3.Text = ""; textBox3.Text = "";
listBox3.Items.Clear(); listBox3.Items.Clear();
listBox4.Items.Clear(); listBox4.Items.Clear();
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage6"])//your specific tabname case TabPage pg6 when pg6 == tabControl1.TabPages["tabPage6"]:
{
string[] lines_server = File.ReadAllLines(GlobalVars.ConfigDir + "\\servers.txt"); string[] lines_server = File.ReadAllLines(GlobalVars.ConfigDir + "\\servers.txt");
string[] lines_ports = File.ReadAllLines(GlobalVars.ConfigDir + "\\ports.txt"); string[] lines_ports = File.ReadAllLines(GlobalVars.ConfigDir + "\\ports.txt");
listBox3.Items.AddRange(lines_server); listBox3.Items.AddRange(lines_server);
@ -311,9 +309,8 @@ namespace NovetusLauncher
textBox4.Text = ""; textBox4.Text = "";
textBox3.Text = ""; textBox3.Text = "";
listBox2.Items.Clear(); listBox2.Items.Clear();
} break;
else default:
{
treeView1.Nodes.Clear(); treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear(); _fieldsTreeCache.Nodes.Clear();
textBox4.Text = ""; textBox4.Text = "";
@ -321,6 +318,7 @@ namespace NovetusLauncher
listBox2.Items.Clear(); listBox2.Items.Clear();
listBox3.Items.Clear(); listBox3.Items.Clear();
listBox4.Items.Clear(); listBox4.Items.Clear();
break;
} }
} }
@ -516,53 +514,44 @@ namespace NovetusLauncher
label28.Text = GlobalVars.Map; label28.Text = GlobalVars.Map;
treeView1.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.Map, treeView1.Nodes); treeView1.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.Map, treeView1.Nodes);
treeView1.Focus(); treeView1.Focus();
//GlobalVars.Map = treeView1.SelectedNode.Text.ToString();
// GlobalVars.MapPath = treeView1.SelectedNode.FullPath.ToString().Replace(@"\", @"\\");
numericUpDown1.Value = Convert.ToDecimal(GlobalVars.RobloxPort); numericUpDown1.Value = Convert.ToDecimal(GlobalVars.RobloxPort);
numericUpDown2.Value = Convert.ToDecimal(GlobalVars.RobloxPort); numericUpDown2.Value = Convert.ToDecimal(GlobalVars.RobloxPort);
label37.Text = GlobalVars.IP; label37.Text = GlobalVars.IP;
label38.Text = GlobalVars.RobloxPort.ToString(); label38.Text = GlobalVars.RobloxPort.ToString();
/*
if (GlobalVars.UDP == false && GlobalVars.UPnP == true)
{
checkBox4.Checked = GlobalVars.UPnP;
}
else if (GlobalVars.UDP == true && GlobalVars.UPnP == false)
{
checkBox8.Checked = GlobalVars.UDP;
}*/
checkBox2.Checked = GlobalVars.DiscordPresence; checkBox2.Checked = GlobalVars.DiscordPresence;
checkBox5.Checked = GlobalVars.ReShade; checkBox5.Checked = GlobalVars.ReShade;
checkBox6.Checked = GlobalVars.ReShadeFPSDisplay; checkBox6.Checked = GlobalVars.ReShadeFPSDisplay;
checkBox7.Checked = GlobalVars.ReShadePerformanceMode; checkBox7.Checked = GlobalVars.ReShadePerformanceMode;
if (GlobalVars.GraphicsMode == 1)
{ switch (GlobalVars.GraphicsMode)
comboBox1.SelectedIndex = 0;
}
else if (GlobalVars.GraphicsMode == 2)
{ {
case GraphicsMode.DirectX:
comboBox1.SelectedIndex = 1; comboBox1.SelectedIndex = 1;
break;
case GraphicsMode.OpenGL:
default:
comboBox1.SelectedIndex = 0;
break;
} }
if (GlobalVars.QualityLevel == 1) switch (GlobalVars.QualityLevel)
{ {
case QualityLevel.VeryLow:
comboBox2.SelectedIndex = 0; comboBox2.SelectedIndex = 0;
} break;
else if (GlobalVars.QualityLevel == 2) case QualityLevel.Low:
{
comboBox2.SelectedIndex = 1; comboBox2.SelectedIndex = 1;
} break;
else if (GlobalVars.QualityLevel == 3) case QualityLevel.Medium:
{
comboBox2.SelectedIndex = 2; comboBox2.SelectedIndex = 2;
} break;
else if (GlobalVars.QualityLevel == 4) case QualityLevel.High:
{
comboBox2.SelectedIndex = 3; comboBox2.SelectedIndex = 3;
} break;
else if (GlobalVars.QualityLevel == 5) case QualityLevel.Ultra:
{ default:
comboBox2.SelectedIndex = 4; comboBox2.SelectedIndex = 4;
break;
} }
ConsolePrint("Config loaded.", 3); ConsolePrint("Config loaded.", 3);
@ -596,30 +585,32 @@ namespace NovetusLauncher
{ {
LauncherFuncs.ReadClientValues(clientpath); LauncherFuncs.ReadClientValues(clientpath);
if (GlobalVars.SelectedClientInfo.UsesPlayerName == true) switch (GlobalVars.SelectedClientInfo.UsesPlayerName)
{ {
case true:
textBox2.Enabled = true; textBox2.Enabled = true;
} break;
else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false) case false:
{
textBox2.Enabled = false; textBox2.Enabled = false;
break;
} }
if (GlobalVars.SelectedClientInfo.UsesID == true) switch (GlobalVars.SelectedClientInfo.UsesID)
{ {
case true:
textBox5.Enabled = true; textBox5.Enabled = true;
button4.Enabled = true; button4.Enabled = true;
if (GlobalVars.IP.Equals("localhost")) if (GlobalVars.IP.Equals("localhost"))
{ {
checkBox3.Enabled = true; checkBox3.Enabled = true;
} }
} break;
else if (GlobalVars.SelectedClientInfo.UsesID == false) case false:
{
textBox5.Enabled = false; textBox5.Enabled = false;
button4.Enabled = false; button4.Enabled = false;
checkBox3.Enabled = false; checkBox3.Enabled = false;
GlobalVars.LocalPlayMode = false; GlobalVars.LocalPlayMode = false;
break;
} }
if (!string.IsNullOrWhiteSpace(GlobalVars.SelectedClientInfo.Warning)) if (!string.IsNullOrWhiteSpace(GlobalVars.SelectedClientInfo.Warning))
@ -660,14 +651,7 @@ namespace NovetusLauncher
void CheckBox1CheckedChanged(object sender, EventArgs e) void CheckBox1CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox1.Checked == true) GlobalVars.CloseOnLaunch = checkBox1.Checked;
{
GlobalVars.CloseOnLaunch = true;
}
else if (checkBox1.Checked == false)
{
GlobalVars.CloseOnLaunch = false;
}
} }
void Button4Click(object sender, EventArgs e) void Button4Click(object sender, EventArgs e)
@ -690,19 +674,12 @@ namespace NovetusLauncher
{ {
GlobalVars.SelectedClient = listBox2.SelectedItem.ToString(); GlobalVars.SelectedClient = listBox2.SelectedItem.ToString();
ReadClientValues(GlobalVars.SelectedClient); ReadClientValues(GlobalVars.SelectedClient);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, ""); LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
} }
void CheckBox3CheckedChanged(object sender, EventArgs e) void CheckBox3CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox3.Checked == true) GlobalVars.LocalPlayMode = checkBox3.Checked;
{
GlobalVars.LocalPlayMode = true;
}
else if (checkBox3.Checked == false)
{
GlobalVars.LocalPlayMode = false;
}
} }
void TextBox5TextChanged(object sender, EventArgs e) void TextBox5TextChanged(object sender, EventArgs e)
@ -860,29 +837,28 @@ namespace NovetusLauncher
void ConsolePrint(string text, int type) void ConsolePrint(string text, int type)
{ {
richTextBox1.AppendText("[" + DateTime.Now.ToShortTimeString() + "] - ", Color.White); richTextBox1.AppendText("[" + DateTime.Now.ToShortTimeString() + "] - ", Color.White);
if (type == 1)
{ switch (type)
richTextBox1.AppendText(text, Color.White);
}
else if (type == 2)
{ {
case 2:
richTextBox1.AppendText(text, Color.Red); richTextBox1.AppendText(text, Color.Red);
} break;
else if (type == 3) case 3:
{
richTextBox1.AppendText(text, Color.Lime); richTextBox1.AppendText(text, Color.Lime);
} break;
else if (type == 4) case 4:
{
richTextBox1.AppendText(text, Color.Aqua); richTextBox1.AppendText(text, Color.Aqua);
} break;
else if (type == 5) case 5:
{
richTextBox1.AppendText(text, Color.Yellow); richTextBox1.AppendText(text, Color.Yellow);
} break;
else if (type == 6) case 6:
{
richTextBox1.AppendText(text, Color.LightSalmon); richTextBox1.AppendText(text, Color.LightSalmon);
break;
case 1:
default:
richTextBox1.AppendText(text, Color.White);
break;
} }
richTextBox1.AppendText(Environment.NewLine); richTextBox1.AppendText(Environment.NewLine);
@ -892,7 +868,7 @@ namespace NovetusLauncher
void StartClient() void StartClient()
{ {
string luafile = LauncherFuncs.GetLuaFileName(); string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Client); string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Client);
string quote = "\""; string quote = "\"";
string args = ""; string args = "";
@ -900,11 +876,11 @@ namespace NovetusLauncher
{ {
if (!GlobalVars.SelectedClientInfo.Fix2007) if (!GlobalVars.SelectedClientInfo.Fix2007)
{ {
args = "-script " + quote + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptGenerator.ScriptType.Client) + quote; args = "-script " + quote + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptType.Client) + quote;
} }
else else
{ {
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Client); ScriptGenerator.GenerateScriptForClient(ScriptType.Client);
args = "-script " + quote + luafile + quote; args = "-script " + quote + luafile + quote;
} }
} }
@ -964,13 +940,13 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ClientExited); client.Exited += new EventHandler(ClientExited);
client.Start(); client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime; client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Client, GlobalVars.Map); SecurityFuncs.RenameWindow(client, ScriptType.Client, GlobalVars.Map);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InMPGame, GlobalVars.Map); LauncherFuncs.UpdateRichPresence(LauncherState.InMPGame, GlobalVars.Map);
} }
void ClientExited(object sender, EventArgs e) void ClientExited(object sender, EventArgs e)
{ {
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, ""); LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
if (GlobalVars.CloseOnLaunch == true) if (GlobalVars.CloseOnLaunch == true)
{ {
Visible = true; Visible = true;
@ -987,7 +963,7 @@ namespace NovetusLauncher
void EasterEggExited(object sender, EventArgs e) void EasterEggExited(object sender, EventArgs e)
{ {
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, ""); LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
label12.Text = LocalVars.prevsplash; label12.Text = LocalVars.prevsplash;
if (GlobalVars.CloseOnLaunch == true) if (GlobalVars.CloseOnLaunch == true)
{ {
@ -998,7 +974,7 @@ namespace NovetusLauncher
void StartSolo() void StartSolo()
{ {
string luafile = LauncherFuncs.GetLuaFileName(); string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Solo); string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Solo);
string mapfile = GlobalVars.MapPath; string mapfile = GlobalVars.MapPath;
string quote = "\""; string quote = "\"";
string args = ""; string args = "";
@ -1006,11 +982,11 @@ namespace NovetusLauncher
{ {
if (!GlobalVars.SelectedClientInfo.Fix2007) if (!GlobalVars.SelectedClientInfo.Fix2007)
{ {
args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptGenerator.ScriptType.Solo) + quote; args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptType.Solo) + quote;
} }
else else
{ {
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Solo); ScriptGenerator.GenerateScriptForClient(ScriptType.Solo);
args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote; args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote;
} }
} }
@ -1029,8 +1005,8 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ClientExited); client.Exited += new EventHandler(ClientExited);
client.Start(); client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime; client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Solo, GlobalVars.Map); SecurityFuncs.RenameWindow(client, ScriptType.Solo, GlobalVars.Map);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InSoloGame, GlobalVars.Map); LauncherFuncs.UpdateRichPresence(LauncherState.InSoloGame, GlobalVars.Map);
} }
catch (Exception ex) when (!Env.Debugging) catch (Exception ex) when (!Env.Debugging)
{ {
@ -1042,7 +1018,7 @@ namespace NovetusLauncher
void StartServer(bool no3d) void StartServer(bool no3d)
{ {
string luafile = LauncherFuncs.GetLuaFileName(); string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Server); string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Server);
string mapfile = GlobalVars.MapPath; string mapfile = GlobalVars.MapPath;
string quote = "\""; string quote = "\"";
string args = ""; string args = "";
@ -1050,11 +1026,11 @@ namespace NovetusLauncher
{ {
if (!GlobalVars.SelectedClientInfo.Fix2007) if (!GlobalVars.SelectedClientInfo.Fix2007)
{ {
args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptGenerator.ScriptType.Server) + "; " + (!string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? LauncherFuncs.ChangeGameSettings() + " dofile('" + GlobalVars.AddonScriptPath + "');" : "") + quote + (no3d ? " -no3d" : ""); args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptType.Server) + "; " + (!string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? LauncherFuncs.ChangeGameSettings() + " dofile('" + GlobalVars.AddonScriptPath + "');" : "") + quote + (no3d ? " -no3d" : "");
} }
else else
{ {
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Server); ScriptGenerator.GenerateScriptForClient(ScriptType.Server);
args = "-script " + quote + luafile + quote + (no3d ? " -no3d" : "") + " " + quote + mapfile + quote; args = "-script " + quote + luafile + quote + (no3d ? " -no3d" : "") + " " + quote + mapfile + quote;
} }
} }
@ -1081,7 +1057,7 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ServerExited); client.Exited += new EventHandler(ServerExited);
client.Start(); client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime; client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Server, GlobalVars.Map); SecurityFuncs.RenameWindow(client, ScriptType.Server, GlobalVars.Map);
} }
catch (Exception ex) when (!Env.Debugging) catch (Exception ex) when (!Env.Debugging)
{ {
@ -1093,7 +1069,7 @@ namespace NovetusLauncher
void StartStudio(bool nomap) void StartStudio(bool nomap)
{ {
string luafile = LauncherFuncs.GetLuaFileName(); string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Studio); string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Studio);
string mapfile = (nomap ? "" : GlobalVars.MapPath); string mapfile = (nomap ? "" : GlobalVars.MapPath);
string mapname = (nomap ? "" : GlobalVars.Map); string mapname = (nomap ? "" : GlobalVars.Map);
string quote = "\""; string quote = "\"";
@ -1102,11 +1078,11 @@ namespace NovetusLauncher
{ {
if (!GlobalVars.SelectedClientInfo.Fix2007) if (!GlobalVars.SelectedClientInfo.Fix2007)
{ {
args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptGenerator.ScriptType.Studio) + quote; args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptType.Studio) + quote;
} }
else else
{ {
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Studio); ScriptGenerator.GenerateScriptForClient(ScriptType.Studio);
args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote; args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote;
} }
} }
@ -1125,8 +1101,8 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ClientExited); client.Exited += new EventHandler(ClientExited);
client.Start(); client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime; client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Studio, mapname); SecurityFuncs.RenameWindow(client, ScriptType.Studio, mapname);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InStudio, mapname); LauncherFuncs.UpdateRichPresence(LauncherState.InStudio, mapname);
} }
catch (Exception ex) when (!Env.Debugging) catch (Exception ex) when (!Env.Debugging)
{ {
@ -1139,7 +1115,7 @@ namespace NovetusLauncher
{ {
label12.Text = "<3"; label12.Text = "<3";
string luafile = LauncherFuncs.GetLuaFileName(); string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.EasterEgg); string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.EasterEgg);
string mapfile = GlobalVars.ConfigDirData + "\\Appreciation.rbxl"; string mapfile = GlobalVars.ConfigDirData + "\\Appreciation.rbxl";
string quote = "\""; string quote = "\"";
string args = ""; string args = "";
@ -1147,11 +1123,11 @@ namespace NovetusLauncher
{ {
if (!GlobalVars.SelectedClientInfo.Fix2007) if (!GlobalVars.SelectedClientInfo.Fix2007)
{ {
args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptGenerator.ScriptType.EasterEgg) + quote; args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptType.EasterEgg) + quote;
} }
else else
{ {
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.EasterEgg); ScriptGenerator.GenerateScriptForClient(ScriptType.EasterEgg);
args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote; args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote;
} }
} }
@ -1170,8 +1146,8 @@ namespace NovetusLauncher
client.Start(); client.Start();
client.Exited += new EventHandler(EasterEggExited); client.Exited += new EventHandler(EasterEggExited);
client.PriorityClass = ProcessPriorityClass.RealTime; client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.EasterEgg, ""); SecurityFuncs.RenameWindow(client, ScriptType.EasterEgg, "");
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InEasterEggGame, ""); LauncherFuncs.UpdateRichPresence(LauncherState.InEasterEggGame, "");
} }
catch (Exception ex) when (!Env.Debugging) catch (Exception ex) when (!Env.Debugging)
{ {
@ -1601,16 +1577,7 @@ namespace NovetusLauncher
void CheckBox4CheckedChanged(object sender, EventArgs e) void CheckBox4CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox4.Checked == true) GlobalVars.UPnP = checkBox4.Checked;
{
GlobalVars.UPnP = true;
//checkBox8.Checked = false;
}
else if (checkBox4.Checked == false)
{
GlobalVars.UPnP = false;
//checkBox8.Checked = GlobalVars.UDP;
}
} }
void CheckBox4Click(object sender, EventArgs e) void CheckBox4Click(object sender, EventArgs e)
@ -1679,17 +1646,9 @@ namespace NovetusLauncher
private void checkBox2_CheckedChanged(object sender, EventArgs e) private void checkBox2_CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox2.Checked == true && GlobalVars.DiscordPresence == false) checkBox2.Checked = GlobalVars.DiscordPresence;
{
GlobalVars.DiscordPresence = true;
MessageBox.Show("Restart the launcher to apply changes."); MessageBox.Show("Restart the launcher to apply changes.");
} }
else if (checkBox2.Checked == false && GlobalVars.DiscordPresence == true)
{
GlobalVars.DiscordPresence = false;
MessageBox.Show("Restart the launcher to apply changes.");
}
}
private void button27_Click(object sender, EventArgs e) private void button27_Click(object sender, EventArgs e)
{ {
@ -1742,24 +1701,21 @@ namespace NovetusLauncher
{ {
LocalVars.Clicks += 1; LocalVars.Clicks += 1;
if (LocalVars.Clicks == 1) switch(LocalVars.Clicks)
{ {
case 1:
label12.Text = "Hi " + GlobalVars.PlayerName + "!"; label12.Text = "Hi " + GlobalVars.PlayerName + "!";
} break;
else if (LocalVars.Clicks == 3) case 3:
{
label12.Text = "How are you doing today?"; label12.Text = "How are you doing today?";
} break;
else if (LocalVars.Clicks == 6) case 6:
{
label12.Text = "I just wanted to say something."; label12.Text = "I just wanted to say something.";
} break;
else if (LocalVars.Clicks == 9) case 9:
{
label12.Text = "Just wait a little on the last click, OK?"; label12.Text = "Just wait a little on the last click, OK?";
} break;
else if (LocalVars.Clicks == 10) case 10:
{
WriteConfigValues(); WriteConfigValues();
StartEasterEgg(); StartEasterEgg();
@ -1767,79 +1723,61 @@ namespace NovetusLauncher
{ {
Visible = false; Visible = false;
} }
break;
default:
break;
} }
} }
} }
private void checkBox5_CheckedChanged(object sender, EventArgs e) private void checkBox5_CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox5.Checked == true) GlobalVars.ReShade = checkBox5.Checked;
{
GlobalVars.ReShade = true;
}
else if (checkBox5.Checked == false)
{
GlobalVars.ReShade = false;
}
} }
private void checkBox6_CheckedChanged(object sender, EventArgs e) private void checkBox6_CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox6.Checked == true) GlobalVars.ReShadeFPSDisplay = checkBox6.Checked;
{
GlobalVars.ReShadeFPSDisplay = true;
}
else if (checkBox6.Checked == false)
{
GlobalVars.ReShadeFPSDisplay = false;
}
} }
private void checkBox7_CheckedChanged(object sender, EventArgs e) private void checkBox7_CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox7.Checked == true) GlobalVars.ReShadePerformanceMode = checkBox7.Checked;
{
GlobalVars.ReShadePerformanceMode = true;
}
else if (checkBox7.Checked == false)
{
GlobalVars.ReShadePerformanceMode = false;
}
} }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (comboBox1.SelectedIndex == 0) switch (comboBox1.SelectedIndex)
{ {
GlobalVars.GraphicsMode = 1; case 1:
} GlobalVars.GraphicsMode = GraphicsMode.DirectX;
else if (comboBox1.SelectedIndex == 1) break;
{ default:
GlobalVars.GraphicsMode = 2; GlobalVars.GraphicsMode = GraphicsMode.OpenGL;
break;
} }
} }
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (comboBox2.SelectedIndex == 0) switch (comboBox2.SelectedIndex)
{ {
GlobalVars.QualityLevel = 1; case 0:
} GlobalVars.QualityLevel = QualityLevel.VeryLow;
else if (comboBox2.SelectedIndex == 1) break;
{ case 1:
GlobalVars.QualityLevel = 2; GlobalVars.QualityLevel = QualityLevel.Low;
} break;
else if (comboBox2.SelectedIndex == 2) case 2:
{ GlobalVars.QualityLevel = QualityLevel.Medium;
GlobalVars.QualityLevel = 3; break;
} case 3:
else if (comboBox2.SelectedIndex == 3) GlobalVars.QualityLevel = QualityLevel.High;
{ break;
GlobalVars.QualityLevel = 4; case 4:
} default:
else if (comboBox2.SelectedIndex == 4) GlobalVars.QualityLevel = QualityLevel.Ultra;
{ break;
GlobalVars.QualityLevel = 5;
} }
} }
@ -1849,20 +1787,5 @@ namespace NovetusLauncher
WriteConfigValues(); WriteConfigValues();
Application.Restart(); Application.Restart();
} }
/*
private void checkBox8_CheckedChanged(object sender, EventArgs e)
{
if (checkBox8.Checked == true)
{
GlobalVars.UDP = true;
checkBox4.Checked = false;
}
else if (checkBox8.Checked == false)
{
GlobalVars.UDP = false;
checkBox4.Checked = GlobalVars.UPnP;
}
}*/
} }
} }

View File

@ -166,7 +166,7 @@ namespace NovetusLauncher
handlers.requestCallback += RequestCallback; handlers.requestCallback += RequestCallback;
DiscordRpc.Initialize(GlobalVars.appid, ref handlers, true, ""); DiscordRpc.Initialize(GlobalVars.appid, ref handlers, true, "");
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, "", true); LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "", true);
} }
} }
#endregion #endregion
@ -218,8 +218,9 @@ namespace NovetusLauncher
async void tabControl1_SelectedIndexChanged(object sender, EventArgs e) async void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage2"])//your specific tabname switch (tabControl1.SelectedTab)
{ {
case TabPage pg2 when pg2 == tabControl1.TabPages["tabPage2"]:
treeView1.Nodes.Clear(); treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear(); _fieldsTreeCache.Nodes.Clear();
textBox4.Text = ""; textBox4.Text = "";
@ -269,9 +270,8 @@ namespace NovetusLauncher
} }
textBox3.SelectionStart = 0; textBox3.SelectionStart = 0;
textBox3.ScrollToCaret(); textBox3.ScrollToCaret();
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage4"])//your specific tabname case TabPage pg4 when pg4 == tabControl1.TabPages["tabPage4"]:
{
string mapdir = GlobalVars.MapsDir; string mapdir = GlobalVars.MapsDir;
TreeNodeHelper.ListDirectory(treeView1, mapdir, ".rbxl"); TreeNodeHelper.ListDirectory(treeView1, mapdir, ".rbxl");
TreeNodeHelper.CopyNodes(treeView1.Nodes, _fieldsTreeCache.Nodes); TreeNodeHelper.CopyNodes(treeView1.Nodes, _fieldsTreeCache.Nodes);
@ -281,9 +281,8 @@ namespace NovetusLauncher
listBox2.Items.Clear(); listBox2.Items.Clear();
listBox3.Items.Clear(); listBox3.Items.Clear();
listBox4.Items.Clear(); listBox4.Items.Clear();
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage3"])//your specific tabname case TabPage pg3 when pg3 == tabControl1.TabPages["tabPage3"]:
{
string clientdir = GlobalVars.ClientDir; string clientdir = GlobalVars.ClientDir;
DirectoryInfo dinfo = new DirectoryInfo(clientdir); DirectoryInfo dinfo = new DirectoryInfo(clientdir);
DirectoryInfo[] Dirs = dinfo.GetDirectories(); DirectoryInfo[] Dirs = dinfo.GetDirectories();
@ -298,9 +297,8 @@ namespace NovetusLauncher
textBox3.Text = ""; textBox3.Text = "";
listBox3.Items.Clear(); listBox3.Items.Clear();
listBox4.Items.Clear(); listBox4.Items.Clear();
} break;
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage6"])//your specific tabname case TabPage pg6 when pg6 == tabControl1.TabPages["tabPage6"]:
{
string[] lines_server = File.ReadAllLines(GlobalVars.ConfigDir + "\\servers.txt"); string[] lines_server = File.ReadAllLines(GlobalVars.ConfigDir + "\\servers.txt");
string[] lines_ports = File.ReadAllLines(GlobalVars.ConfigDir + "\\ports.txt"); string[] lines_ports = File.ReadAllLines(GlobalVars.ConfigDir + "\\ports.txt");
listBox3.Items.AddRange(lines_server); listBox3.Items.AddRange(lines_server);
@ -310,9 +308,8 @@ namespace NovetusLauncher
textBox4.Text = ""; textBox4.Text = "";
textBox3.Text = ""; textBox3.Text = "";
listBox2.Items.Clear(); listBox2.Items.Clear();
} break;
else default:
{
treeView1.Nodes.Clear(); treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear(); _fieldsTreeCache.Nodes.Clear();
textBox4.Text = ""; textBox4.Text = "";
@ -320,6 +317,7 @@ namespace NovetusLauncher
listBox2.Items.Clear(); listBox2.Items.Clear();
listBox3.Items.Clear(); listBox3.Items.Clear();
listBox4.Items.Clear(); listBox4.Items.Clear();
break;
} }
} }
@ -515,21 +513,10 @@ namespace NovetusLauncher
label28.Text = GlobalVars.Map; label28.Text = GlobalVars.Map;
treeView1.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.Map, treeView1.Nodes); treeView1.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.Map, treeView1.Nodes);
treeView1.Focus(); treeView1.Focus();
//GlobalVars.Map = treeView1.SelectedNode.Text.ToString();
// GlobalVars.MapPath = treeView1.SelectedNode.FullPath.ToString().Replace(@"\", @"\\");
numericUpDown1.Value = Convert.ToDecimal(GlobalVars.RobloxPort); numericUpDown1.Value = Convert.ToDecimal(GlobalVars.RobloxPort);
numericUpDown2.Value = Convert.ToDecimal(GlobalVars.RobloxPort); numericUpDown2.Value = Convert.ToDecimal(GlobalVars.RobloxPort);
label37.Text = GlobalVars.IP; label37.Text = GlobalVars.IP;
label38.Text = GlobalVars.RobloxPort.ToString(); label38.Text = GlobalVars.RobloxPort.ToString();
/*
if (GlobalVars.UDP == false && GlobalVars.UPnP == true)
{
checkBox4.Checked = GlobalVars.UPnP;
}
else if (GlobalVars.UDP == true && GlobalVars.UPnP == false)
{
checkBox8.Checked = GlobalVars.UDP;
}*/
checkBox2.Checked = GlobalVars.DiscordPresence; checkBox2.Checked = GlobalVars.DiscordPresence;
ConsolePrint("Config loaded.", 3); ConsolePrint("Config loaded.", 3);
@ -563,30 +550,32 @@ namespace NovetusLauncher
{ {
LauncherFuncs.ReadClientValues(clientpath); LauncherFuncs.ReadClientValues(clientpath);
if (GlobalVars.SelectedClientInfo.UsesPlayerName == true) switch (GlobalVars.SelectedClientInfo.UsesPlayerName)
{ {
case true:
textBox2.Enabled = true; textBox2.Enabled = true;
} break;
else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false) case false:
{
textBox2.Enabled = false; textBox2.Enabled = false;
break;
} }
if (GlobalVars.SelectedClientInfo.UsesID == true) switch (GlobalVars.SelectedClientInfo.UsesID)
{ {
case true:
textBox5.Enabled = true; textBox5.Enabled = true;
button4.Enabled = true; button4.Enabled = true;
if (GlobalVars.IP.Equals("localhost")) if (GlobalVars.IP.Equals("localhost"))
{ {
checkBox3.Enabled = true; checkBox3.Enabled = true;
} }
} break;
else if (GlobalVars.SelectedClientInfo.UsesID == false) case false:
{
textBox5.Enabled = false; textBox5.Enabled = false;
button4.Enabled = false; button4.Enabled = false;
checkBox3.Enabled = false; checkBox3.Enabled = false;
GlobalVars.LocalPlayMode = false; GlobalVars.LocalPlayMode = false;
break;
} }
if (!string.IsNullOrWhiteSpace(GlobalVars.SelectedClientInfo.Warning)) if (!string.IsNullOrWhiteSpace(GlobalVars.SelectedClientInfo.Warning))
@ -627,14 +616,7 @@ namespace NovetusLauncher
void CheckBox1CheckedChanged(object sender, EventArgs e) void CheckBox1CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox1.Checked == true) GlobalVars.CloseOnLaunch = checkBox1.Checked;
{
GlobalVars.CloseOnLaunch = true;
}
else if (checkBox1.Checked == false)
{
GlobalVars.CloseOnLaunch = false;
}
} }
void Button4Click(object sender, EventArgs e) void Button4Click(object sender, EventArgs e)
@ -657,19 +639,12 @@ namespace NovetusLauncher
{ {
GlobalVars.SelectedClient = listBox2.SelectedItem.ToString(); GlobalVars.SelectedClient = listBox2.SelectedItem.ToString();
ReadClientValues(GlobalVars.SelectedClient); ReadClientValues(GlobalVars.SelectedClient);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, ""); LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
} }
void CheckBox3CheckedChanged(object sender, EventArgs e) void CheckBox3CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox3.Checked == true) GlobalVars.LocalPlayMode = checkBox3.Checked;
{
GlobalVars.LocalPlayMode = true;
}
else if (checkBox3.Checked == false)
{
GlobalVars.LocalPlayMode = false;
}
} }
void TextBox5TextChanged(object sender, EventArgs e) void TextBox5TextChanged(object sender, EventArgs e)
@ -827,29 +802,28 @@ namespace NovetusLauncher
void ConsolePrint(string text, int type) void ConsolePrint(string text, int type)
{ {
richTextBox1.AppendText("[" + DateTime.Now.ToShortTimeString() + "] - ", Color.White); richTextBox1.AppendText("[" + DateTime.Now.ToShortTimeString() + "] - ", Color.White);
if (type == 1)
{ switch (type)
richTextBox1.AppendText(text, Color.White);
}
else if (type == 2)
{ {
case 2:
richTextBox1.AppendText(text, Color.Red); richTextBox1.AppendText(text, Color.Red);
} break;
else if (type == 3) case 3:
{
richTextBox1.AppendText(text, Color.Lime); richTextBox1.AppendText(text, Color.Lime);
} break;
else if (type == 4) case 4:
{
richTextBox1.AppendText(text, Color.Aqua); richTextBox1.AppendText(text, Color.Aqua);
} break;
else if (type == 5) case 5:
{
richTextBox1.AppendText(text, Color.Yellow); richTextBox1.AppendText(text, Color.Yellow);
} break;
else if (type == 6) case 6:
{
richTextBox1.AppendText(text, Color.LightSalmon); richTextBox1.AppendText(text, Color.LightSalmon);
break;
case 1:
default:
richTextBox1.AppendText(text, Color.White);
break;
} }
richTextBox1.AppendText(Environment.NewLine); richTextBox1.AppendText(Environment.NewLine);
@ -859,7 +833,7 @@ namespace NovetusLauncher
void StartClient() void StartClient()
{ {
string luafile = LauncherFuncs.GetLuaFileName(); string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Client); string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Client);
string quote = "\""; string quote = "\"";
string args = ""; string args = "";
@ -867,11 +841,11 @@ namespace NovetusLauncher
{ {
if (!GlobalVars.SelectedClientInfo.Fix2007) if (!GlobalVars.SelectedClientInfo.Fix2007)
{ {
args = "-script " + quote + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptGenerator.ScriptType.Client) + quote; args = "-script " + quote + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptType.Client) + quote;
} }
else else
{ {
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Client); ScriptGenerator.GenerateScriptForClient(ScriptType.Client);
args = "-script " + quote + luafile + quote; args = "-script " + quote + luafile + quote;
} }
} }
@ -931,13 +905,13 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ClientExited); client.Exited += new EventHandler(ClientExited);
client.Start(); client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime; client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Client, GlobalVars.Map); SecurityFuncs.RenameWindow(client, ScriptType.Client, GlobalVars.Map);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InMPGame, GlobalVars.Map); LauncherFuncs.UpdateRichPresence(LauncherState.InMPGame, GlobalVars.Map);
} }
void ClientExited(object sender, EventArgs e) void ClientExited(object sender, EventArgs e)
{ {
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, ""); LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
if (GlobalVars.CloseOnLaunch == true) if (GlobalVars.CloseOnLaunch == true)
{ {
Visible = true; Visible = true;
@ -954,7 +928,7 @@ namespace NovetusLauncher
void EasterEggExited(object sender, EventArgs e) void EasterEggExited(object sender, EventArgs e)
{ {
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, ""); LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
label12.Text = LocalVars.prevsplash; label12.Text = LocalVars.prevsplash;
if (GlobalVars.CloseOnLaunch == true) if (GlobalVars.CloseOnLaunch == true)
{ {
@ -965,7 +939,7 @@ namespace NovetusLauncher
void StartSolo() void StartSolo()
{ {
string luafile = LauncherFuncs.GetLuaFileName(); string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Solo); string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Solo);
string mapfile = GlobalVars.MapPath; string mapfile = GlobalVars.MapPath;
string quote = "\""; string quote = "\"";
string args = ""; string args = "";
@ -973,11 +947,11 @@ namespace NovetusLauncher
{ {
if (!GlobalVars.SelectedClientInfo.Fix2007) if (!GlobalVars.SelectedClientInfo.Fix2007)
{ {
args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptGenerator.ScriptType.Solo) + quote; args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptType.Solo) + quote;
} }
else else
{ {
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Solo); ScriptGenerator.GenerateScriptForClient(ScriptType.Solo);
args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote; args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote;
} }
} }
@ -996,8 +970,8 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ClientExited); client.Exited += new EventHandler(ClientExited);
client.Start(); client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime; client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Solo, GlobalVars.Map); SecurityFuncs.RenameWindow(client, ScriptType.Solo, GlobalVars.Map);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InSoloGame, GlobalVars.Map); LauncherFuncs.UpdateRichPresence(LauncherState.InSoloGame, GlobalVars.Map);
} }
catch (Exception ex) when (!Env.Debugging) catch (Exception ex) when (!Env.Debugging)
{ {
@ -1009,7 +983,7 @@ namespace NovetusLauncher
void StartServer(bool no3d) void StartServer(bool no3d)
{ {
string luafile = LauncherFuncs.GetLuaFileName(); string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Server); string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Server);
string mapfile = GlobalVars.MapPath; string mapfile = GlobalVars.MapPath;
string quote = "\""; string quote = "\"";
string args = ""; string args = "";
@ -1017,11 +991,11 @@ namespace NovetusLauncher
{ {
if (!GlobalVars.SelectedClientInfo.Fix2007) if (!GlobalVars.SelectedClientInfo.Fix2007)
{ {
args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptGenerator.ScriptType.Server) + "; " + (!string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? LauncherFuncs.ChangeGameSettings() + " dofile('" + GlobalVars.AddonScriptPath + "');" : "") + quote + (no3d ? " -no3d" : ""); args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptType.Server) + "; " + (!string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? LauncherFuncs.ChangeGameSettings() + " dofile('" + GlobalVars.AddonScriptPath + "');" : "") + quote + (no3d ? " -no3d" : "");
} }
else else
{ {
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Server); ScriptGenerator.GenerateScriptForClient(ScriptType.Server);
args = "-script " + quote + luafile + quote + (no3d ? " -no3d" : "") + " " + quote + mapfile + quote; args = "-script " + quote + luafile + quote + (no3d ? " -no3d" : "") + " " + quote + mapfile + quote;
} }
} }
@ -1048,7 +1022,7 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ServerExited); client.Exited += new EventHandler(ServerExited);
client.Start(); client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime; client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Server, GlobalVars.Map); SecurityFuncs.RenameWindow(client, ScriptType.Server, GlobalVars.Map);
} }
catch (Exception ex) when (!Env.Debugging) catch (Exception ex) when (!Env.Debugging)
{ {
@ -1060,7 +1034,7 @@ namespace NovetusLauncher
void StartStudio(bool nomap) void StartStudio(bool nomap)
{ {
string luafile = LauncherFuncs.GetLuaFileName(); string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Studio); string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Studio);
string mapfile = (nomap ? "" : GlobalVars.MapPath); string mapfile = (nomap ? "" : GlobalVars.MapPath);
string mapname = (nomap ? "" : GlobalVars.Map); string mapname = (nomap ? "" : GlobalVars.Map);
string quote = "\""; string quote = "\"";
@ -1069,11 +1043,11 @@ namespace NovetusLauncher
{ {
if (!GlobalVars.SelectedClientInfo.Fix2007) if (!GlobalVars.SelectedClientInfo.Fix2007)
{ {
args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptGenerator.ScriptType.Studio) + quote; args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptType.Studio) + quote;
} }
else else
{ {
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Studio); ScriptGenerator.GenerateScriptForClient(ScriptType.Studio);
args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote; args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote;
} }
} }
@ -1092,8 +1066,8 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ClientExited); client.Exited += new EventHandler(ClientExited);
client.Start(); client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime; client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Studio, mapname); SecurityFuncs.RenameWindow(client, ScriptType.Studio, mapname);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InStudio, mapname); LauncherFuncs.UpdateRichPresence(LauncherState.InStudio, mapname);
} }
catch (Exception ex) when (!Env.Debugging) catch (Exception ex) when (!Env.Debugging)
{ {
@ -1106,7 +1080,7 @@ namespace NovetusLauncher
{ {
label12.Text = "<3"; label12.Text = "<3";
string luafile = LauncherFuncs.GetLuaFileName(); string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.EasterEgg); string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.EasterEgg);
string mapfile = GlobalVars.ConfigDirData + "\\Appreciation.rbxl"; string mapfile = GlobalVars.ConfigDirData + "\\Appreciation.rbxl";
string quote = "\""; string quote = "\"";
string args = ""; string args = "";
@ -1114,11 +1088,11 @@ namespace NovetusLauncher
{ {
if (!GlobalVars.SelectedClientInfo.Fix2007) if (!GlobalVars.SelectedClientInfo.Fix2007)
{ {
args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptGenerator.ScriptType.EasterEgg) + quote; args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptType.EasterEgg) + quote;
} }
else else
{ {
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.EasterEgg); ScriptGenerator.GenerateScriptForClient(ScriptType.EasterEgg);
args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote; args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote;
} }
} }
@ -1137,8 +1111,8 @@ namespace NovetusLauncher
client.Start(); client.Start();
client.Exited += new EventHandler(EasterEggExited); client.Exited += new EventHandler(EasterEggExited);
client.PriorityClass = ProcessPriorityClass.RealTime; client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.EasterEgg, ""); SecurityFuncs.RenameWindow(client, ScriptType.EasterEgg, "");
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InEasterEggGame, ""); LauncherFuncs.UpdateRichPresence(LauncherState.InEasterEggGame, "");
} }
catch (Exception ex) when (!Env.Debugging) catch (Exception ex) when (!Env.Debugging)
{ {
@ -1568,16 +1542,7 @@ namespace NovetusLauncher
void CheckBox4CheckedChanged(object sender, EventArgs e) void CheckBox4CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox4.Checked == true) GlobalVars.UPnP = checkBox4.Checked;
{
GlobalVars.UPnP = true;
//checkBox8.Checked = false;
}
else if (checkBox4.Checked == false)
{
GlobalVars.UPnP = false;
//checkBox8.Checked = GlobalVars.UDP;
}
} }
void CheckBox4Click(object sender, EventArgs e) void CheckBox4Click(object sender, EventArgs e)
@ -1646,17 +1611,9 @@ namespace NovetusLauncher
private void checkBox2_CheckedChanged(object sender, EventArgs e) private void checkBox2_CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox2.Checked == true && GlobalVars.DiscordPresence == false) checkBox2.Checked = GlobalVars.DiscordPresence;
{
GlobalVars.DiscordPresence = true;
MessageBox.Show("Restart the launcher to apply changes."); MessageBox.Show("Restart the launcher to apply changes.");
} }
else if (checkBox2.Checked == false && GlobalVars.DiscordPresence == true)
{
GlobalVars.DiscordPresence = false;
MessageBox.Show("Restart the launcher to apply changes.");
}
}
private void button27_Click(object sender, EventArgs e) private void button27_Click(object sender, EventArgs e)
{ {
@ -1709,24 +1666,21 @@ namespace NovetusLauncher
{ {
LocalVars.Clicks += 1; LocalVars.Clicks += 1;
if (LocalVars.Clicks == 1) switch (LocalVars.Clicks)
{ {
case 1:
label12.Text = "Hi " + GlobalVars.PlayerName + "!"; label12.Text = "Hi " + GlobalVars.PlayerName + "!";
} break;
else if (LocalVars.Clicks == 3) case 3:
{
label12.Text = "How are you doing today?"; label12.Text = "How are you doing today?";
} break;
else if (LocalVars.Clicks == 6) case 6:
{
label12.Text = "I just wanted to say something."; label12.Text = "I just wanted to say something.";
} break;
else if (LocalVars.Clicks == 9) case 9:
{
label12.Text = "Just wait a little on the last click, OK?"; label12.Text = "Just wait a little on the last click, OK?";
} break;
else if (LocalVars.Clicks == 10) case 10:
{
WriteConfigValues(); WriteConfigValues();
StartEasterEgg(); StartEasterEgg();
@ -1734,12 +1688,13 @@ namespace NovetusLauncher
{ {
Visible = false; Visible = false;
} }
break;
default:
break;
} }
} }
} }
void SettingsButtonClick(object sender, EventArgs e) void SettingsButtonClick(object sender, EventArgs e)
{ {
NovetusSettings im = new NovetusSettings(); NovetusSettings im = new NovetusSettings();
@ -1773,20 +1728,5 @@ namespace NovetusLauncher
WriteConfigValues(); WriteConfigValues();
Application.Restart(); Application.Restart();
} }
/*
private void checkBox8_CheckedChanged(object sender, EventArgs e)
{
if (checkBox8.Checked == true)
{
GlobalVars.UDP = true;
checkBox4.Checked = false;
}
else if (checkBox8.Checked == false)
{
GlobalVars.UDP = false;
checkBox4.Checked = GlobalVars.UPnP;
}
}*/
} }
} }

View File

@ -22,106 +22,87 @@ namespace NovetusLauncher
checkBox5.Checked = GlobalVars.ReShade; checkBox5.Checked = GlobalVars.ReShade;
checkBox6.Checked = GlobalVars.ReShadeFPSDisplay; checkBox6.Checked = GlobalVars.ReShadeFPSDisplay;
checkBox7.Checked = GlobalVars.ReShadePerformanceMode; checkBox7.Checked = GlobalVars.ReShadePerformanceMode;
if (GlobalVars.GraphicsMode == 1)
{ switch (GlobalVars.GraphicsMode)
comboBox1.SelectedIndex = 0;
}
else if (GlobalVars.GraphicsMode == 2)
{ {
case GraphicsMode.DirectX:
comboBox1.SelectedIndex = 1; comboBox1.SelectedIndex = 1;
break;
case GraphicsMode.OpenGL:
default:
comboBox1.SelectedIndex = 0;
break;
} }
if (GlobalVars.QualityLevel == 1) switch (GlobalVars.QualityLevel)
{ {
case QualityLevel.VeryLow:
comboBox2.SelectedIndex = 0; comboBox2.SelectedIndex = 0;
} break;
else if (GlobalVars.QualityLevel == 2) case QualityLevel.Low:
{
comboBox2.SelectedIndex = 1; comboBox2.SelectedIndex = 1;
} break;
else if (GlobalVars.QualityLevel == 3) case QualityLevel.Medium:
{
comboBox2.SelectedIndex = 2; comboBox2.SelectedIndex = 2;
} break;
else if (GlobalVars.QualityLevel == 4) case QualityLevel.High:
{
comboBox2.SelectedIndex = 3; comboBox2.SelectedIndex = 3;
} break;
else if (GlobalVars.QualityLevel == 5) case QualityLevel.Ultra:
{ default:
comboBox2.SelectedIndex = 4; comboBox2.SelectedIndex = 4;
break;
} }
} }
private void checkBox5_CheckedChanged(object sender, EventArgs e) private void checkBox5_CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox5.Checked == true) GlobalVars.ReShade = checkBox5.Checked;
{
GlobalVars.ReShade = true;
}
else if (checkBox5.Checked == false)
{
GlobalVars.ReShade = false;
}
} }
private void checkBox6_CheckedChanged(object sender, EventArgs e) private void checkBox6_CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox6.Checked == true) GlobalVars.ReShadeFPSDisplay = checkBox6.Checked;
{
GlobalVars.ReShadeFPSDisplay = true;
}
else if (checkBox6.Checked == false)
{
GlobalVars.ReShadeFPSDisplay = false;
}
} }
private void checkBox7_CheckedChanged(object sender, EventArgs e) private void checkBox7_CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox7.Checked == true) GlobalVars.ReShadePerformanceMode = checkBox7.Checked;
{
GlobalVars.ReShadePerformanceMode = true;
}
else if (checkBox7.Checked == false)
{
GlobalVars.ReShadePerformanceMode = false;
}
} }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (comboBox1.SelectedIndex == 0) switch (comboBox1.SelectedIndex)
{ {
GlobalVars.GraphicsMode = 1; case 1:
} GlobalVars.GraphicsMode = GraphicsMode.DirectX;
else if (comboBox1.SelectedIndex == 1) break;
{ default:
GlobalVars.GraphicsMode = 2; GlobalVars.GraphicsMode = GraphicsMode.OpenGL;
break;
} }
} }
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e) private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (comboBox2.SelectedIndex == 0) switch (comboBox2.SelectedIndex)
{ {
GlobalVars.QualityLevel = 1; case 0:
} GlobalVars.QualityLevel = QualityLevel.VeryLow;
else if (comboBox2.SelectedIndex == 1) break;
{ case 1:
GlobalVars.QualityLevel = 2; GlobalVars.QualityLevel = QualityLevel.Low;
} break;
else if (comboBox2.SelectedIndex == 2) case 2:
{ GlobalVars.QualityLevel = QualityLevel.Medium;
GlobalVars.QualityLevel = 3; break;
} case 3:
else if (comboBox2.SelectedIndex == 3) GlobalVars.QualityLevel = QualityLevel.High;
{ break;
GlobalVars.QualityLevel = 4; case 4:
} default:
else if (comboBox2.SelectedIndex == 4) GlobalVars.QualityLevel = QualityLevel.Ultra;
{ break;
GlobalVars.QualityLevel = 5;
} }
} }

View File

@ -84,25 +84,24 @@ namespace NovetusLauncher
void ComboBox1SelectedIndexChanged(object sender, EventArgs e) void ComboBox1SelectedIndexChanged(object sender, EventArgs e)
{ {
if (comboBox1.SelectedIndex == 0) switch (comboBox1.SelectedIndex)
{
url = "http://www.roblox.com/asset?id=";
isWebSite = false;
}
else if (comboBox1.SelectedIndex == 1)
{ {
case 1:
url = "http://assetgame.roblox.com/asset/?id="; url = "http://assetgame.roblox.com/asset/?id=";
isWebSite = false; isWebSite = false;
} break;
else if (comboBox1.SelectedIndex == 2) case 2:
{
url = "https://www.roblox.com/catalog/"; url = "https://www.roblox.com/catalog/";
isWebSite = true; isWebSite = true;
} break;
else if (comboBox1.SelectedIndex == 3) case 3:
{
url = "https://www.roblox.com/library/"; url = "https://www.roblox.com/library/";
isWebSite = true; isWebSite = true;
break;
default:
url = "http://www.roblox.com/asset?id=";
isWebSite = false;
break;
} }
} }
@ -121,14 +120,7 @@ namespace NovetusLauncher
comboBox1.SelectedItem = "http://www.roblox.com/"; comboBox1.SelectedItem = "http://www.roblox.com/";
isWebSite = false; isWebSite = false;
if (GlobalVars.DisabledHelp == true) checkBox1.Checked = GlobalVars.DisabledHelp;
{
checkBox1.Checked = true;
}
else if (GlobalVars.DisabledHelp == false)
{
checkBox1.Checked = false;
}
} }
void ItemMakerClose(object sender, CancelEventArgs e) void ItemMakerClose(object sender, CancelEventArgs e)
@ -138,14 +130,7 @@ namespace NovetusLauncher
void CheckBox1CheckedChanged(object sender, EventArgs e) void CheckBox1CheckedChanged(object sender, EventArgs e)
{ {
if (checkBox1.Checked == true) GlobalVars.DisabledHelp = checkBox1.Checked;
{
GlobalVars.DisabledHelp = true;
}
else if (checkBox1.Checked == false)
{
GlobalVars.DisabledHelp = false;
}
} }
} }
} }

View File

@ -71,7 +71,7 @@
this.listBox1.Name = "listBox1"; this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(260, 95); this.listBox1.Size = new System.Drawing.Size(260, 95);
this.listBox1.TabIndex = 14; this.listBox1.TabIndex = 14;
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged); this.listBox1.DoubleClick += new System.EventHandler(this.listBox1_SelectedIndexChanged);
// //
// NovetusSDK // NovetusSDK
// //

View File

@ -40,56 +40,50 @@ namespace NovetusLauncher
private void listBox1_SelectedIndexChanged(object sender, EventArgs e) private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{ {
if (listBox1.SelectedIndex == 0) switch (listBox1.SelectedIndex)
{
ItemMaker im = new ItemMaker();
im.Show();
}
else if (listBox1.SelectedIndex == 1)
{ {
case 1:
ClientinfoEditor cie = new ClientinfoEditor(); ClientinfoEditor cie = new ClientinfoEditor();
cie.Show(); cie.Show();
} break;
else if (listBox1.SelectedIndex == 2) case 2:
{
ClientScriptDocumentation csd = new ClientScriptDocumentation(); ClientScriptDocumentation csd = new ClientScriptDocumentation();
csd.Show(); csd.Show();
} break;
else if (listBox1.SelectedIndex == 3) case 3:
{
AssetLocalizer al = new AssetLocalizer(); AssetLocalizer al = new AssetLocalizer();
al.Show(); al.Show();
} break;
else if (listBox1.SelectedIndex == 4) case 4:
{
SplashTester st = new SplashTester(); SplashTester st = new SplashTester();
st.Show(); st.Show();
} break;
else if (listBox1.SelectedIndex == 5) case 5:
{
Obj2MeshV1GUI obj = new Obj2MeshV1GUI(); Obj2MeshV1GUI obj = new Obj2MeshV1GUI();
obj.Show(); obj.Show();
} break;
else if (listBox1.SelectedIndex == 6) case 6:
{
Process proc = new Process(); Process proc = new Process();
proc.StartInfo.FileName = GlobalVars.ConfigDirData + "\\RSG.exe"; proc.StartInfo.FileName = GlobalVars.ConfigDirData + "\\RSG.exe";
proc.StartInfo.CreateNoWindow = false; proc.StartInfo.CreateNoWindow = false;
proc.StartInfo.UseShellExecute = false; proc.StartInfo.UseShellExecute = false;
proc.Start(); proc.Start();
} break;
else if (listBox1.SelectedIndex == 7) case 7:
{ Process proc2 = new Process();
Process proc = new Process(); proc2.StartInfo.FileName = GlobalVars.ConfigDirData + "\\Roblox_Legacy_Place_Converter.exe";
proc.StartInfo.FileName = GlobalVars.ConfigDirData + "\\Roblox_Legacy_Place_Converter.exe"; proc2.StartInfo.CreateNoWindow = false;
proc.StartInfo.CreateNoWindow = false; proc2.StartInfo.UseShellExecute = false;
proc.StartInfo.UseShellExecute = false; proc2.Start();
proc.Start(); break;
} case 8:
else if (listBox1.SelectedIndex == 8)
{
DiogenesEditor dio = new DiogenesEditor(); DiogenesEditor dio = new DiogenesEditor();
dio.Show(); dio.Show();
break;
default:
ItemMaker im = new ItemMaker();
im.Show();
break;
} }
} }
} }

View File

@ -78,7 +78,7 @@ namespace NovetusURI
handlers.requestCallback += RequestCallback; handlers.requestCallback += RequestCallback;
DiscordRpc.Initialize(GlobalVars.appid, ref handlers, true, ""); DiscordRpc.Initialize(GlobalVars.appid, ref handlers, true, "");
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.LoadingURI, "", true); LauncherFuncs.UpdateRichPresence(LauncherState.LoadingURI, "", true);
} }
} }
@ -118,11 +118,11 @@ namespace NovetusURI
{ {
if (!GlobalVars.SelectedClientInfo.Fix2007) if (!GlobalVars.SelectedClientInfo.Fix2007)
{ {
args = "-script " + quote + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptGenerator.ScriptType.Client) + quote; args = "-script " + quote + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptGenerator.GetScriptFuncForType(ScriptType.Client) + quote;
} }
else else
{ {
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Client); ScriptGenerator.GenerateScriptForClient(ScriptType.Client);
args = "-script " + quote + luafile + quote; args = "-script " + quote + luafile + quote;
} }
} }
@ -177,14 +177,14 @@ namespace NovetusURI
clientproc.Exited += new EventHandler(ClientExited); clientproc.Exited += new EventHandler(ClientExited);
clientproc.Start(); clientproc.Start();
clientproc.PriorityClass = ProcessPriorityClass.RealTime; clientproc.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(clientproc, ScriptGenerator.ScriptType.Client, ""); SecurityFuncs.RenameWindow(clientproc, ScriptType.Client, "");
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InMPGame, ""); LauncherFuncs.UpdateRichPresence(LauncherState.InMPGame, "");
this.Visible = false; this.Visible = false;
} }
void ClientExited(object sender, EventArgs e) void ClientExited(object sender, EventArgs e)
{ {
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, ""); LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
this.Close(); this.Close();
} }