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();
} }
@ -453,34 +453,34 @@ 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)
{
ConsoleText(text, ConsoleColor.White);
}
else if (type == 2)
{
ConsoleText(text, ConsoleColor.Red);
}
else if (type == 3)
{
ConsoleText(text, ConsoleColor.Green);
}
else if (type == 4)
{
ConsoleText(text, ConsoleColor.Cyan);
}
else if (type == 5)
{
ConsoleText(text, ConsoleColor.Yellow);
}
ConsoleText(Environment.NewLine, ConsoleColor.White); switch (type)
} {
case 2:
ConsoleText(text, ConsoleColor.Red);
break;
case 3:
ConsoleText(text, ConsoleColor.Green);
break;
case 4:
ConsoleText(text, ConsoleColor.Cyan);
break;
case 5:
ConsoleText(text, ConsoleColor.Yellow);
break;
case 1:
default:
ConsoleText(text, ConsoleColor.White);
break;
}
static void ConsoleText(string text, ConsoleColor color) ConsoleText(Environment.NewLine, ConsoleColor.White);
}
static void ConsoleText(string text, ConsoleColor color)
{ {
Console.ForegroundColor = color; Console.ForegroundColor = color;
Console.Write(text); Console.Write(text);

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()
return ""; + " dofile('" + luafile + "');";
default:
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)
return 1; {
} else if (GlobalVars.Custom_Icon_Offline == "TBC") { case "BC:":
return 2; return 1;
} else if (GlobalVars.Custom_Icon_Offline == "OBC") { case "TBC:":
return 3; return 2;
} else if (GlobalVars.Custom_Icon_Offline == "NBC") { case "OBC:":
return 0; return 3;
case "NBC:":
default:
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,27 +7,41 @@
* 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 enum LauncherState
{
InLauncher = 0,
InMPGame = 1,
InSoloGame = 2,
InStudio = 3,
InCustomization = 4,
InEasterEggGame = 5,
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 class LauncherFuncs
{ {
public enum LauncherState
{
InLauncher = 0,
InMPGame = 1,
InSoloGame = 2,
InStudio = 3,
InCustomization = 4,
InEasterEggGame = 5,
LoadingURI = 6
}
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))
{ {
GlobalVars.ReShadeFPSDisplay = true; case int showFPSLine when showFPSLine == 1 && Convert.ToInt32(Decryptline3) == 1:
} GlobalVars.ReShadeFPSDisplay = true;
else if (Convert.ToInt32(Decryptline2) == 0 && Convert.ToInt32(Decryptline3) == 0) break;
{ case int showFPSLine when showFPSLine == 0 && Convert.ToInt32(Decryptline3) == 0:
GlobalVars.ReShadeFPSDisplay = false; default:
GlobalVars.ReShadeFPSDisplay = false;
break;
} }
if (Convert.ToInt32(Decryptline4) == 1) switch (Convert.ToInt32(Decryptline4))
{ {
GlobalVars.ReShadePerformanceMode = true; case 1:
} GlobalVars.ReShadePerformanceMode = true;
else if (Convert.ToInt32(Decryptline4) == 0) break;
{ 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;
randomID = random.Next(); 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();
}
//2147483647 is max id. //2147483647 is max id.
GlobalVars.UserID = randomID; GlobalVars.UserID = randomID;
} }
@ -762,67 +863,70 @@ public class LauncherFuncs
if (!GlobalVars.SelectedClientInfo.NoGraphicsOptions) if (!GlobalVars.SelectedClientInfo.NoGraphicsOptions)
{ {
if (GlobalVars.GraphicsMode == 1) switch (GlobalVars.GraphicsMode)
{ {
result += "xpcall( function() settings().Rendering.graphicsMode = 2 end, function( err ) settings().Rendering.graphicsMode = 4 end );"; case GraphicsMode.OpenGL:
} result += "xpcall( function() settings().Rendering.graphicsMode = 2 end, function( err ) settings().Rendering.graphicsMode = 4 end );";
else if (GlobalVars.GraphicsMode == 2) break;
{ 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)
{ {
MeshDetail = 50; case QualityLevel.VeryLow:
ShadingQuality = 50; MeshDetail = 50;
QualityLevel = 1; ShadingQuality = 50;
MaterialQuality = 1; GFXQualityLevel = 1;
AASamples = 1; MaterialQuality = 1;
Bevels = 2; AASamples = 1;
Shadows_2008 = 2; Bevels = 2;
Shadows_2007 = false; Shadows_2008 = 2;
Shadows_2007 = false;
break;
case QualityLevel.Low:
MeshDetail = 50;
ShadingQuality = 50;
GFXQualityLevel = 5;
MaterialQuality = 1;
AASamples = 1;
Bevels = 2;
Shadows_2008 = 2;
Shadows_2007 = false;
break;
case QualityLevel.Medium:
MeshDetail = 50;
ShadingQuality = 50;
GFXQualityLevel = 10;
MaterialQuality = 2;
AASamples = 4;
Bevels = 2;
Shadows_2007 = false;
break;
case QualityLevel.High:
MeshDetail = 75;
ShadingQuality = 75;
GFXQualityLevel = 15;
AASamples = 4;
break;
case QualityLevel.Ultra:
default:
break;
} }
else if (GlobalVars.QualityLevel == 2) //low
{
MeshDetail = 50;
ShadingQuality = 50;
QualityLevel = 5;
MaterialQuality = 1;
AASamples = 1;
Bevels = 2;
Shadows_2008 = 2;
Shadows_2007 = false;
}
else if (GlobalVars.QualityLevel == 3) //medium
{
MeshDetail = 50;
ShadingQuality = 50;
QualityLevel = 10;
MaterialQuality = 2;
AASamples = 4;
Bevels = 2;
Shadows_2007 = false;
}
else if (GlobalVars.QualityLevel == 4) //high
{
MeshDetail = 75;
ShadingQuality = 75;
QualityLevel = 15;
AASamples = 4;
}
//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);"
@ -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,35 +13,27 @@ using System.IO;
using System.Reflection; using System.Reflection;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
/* public enum ScriptType
* so, in order for us to generate a good script, we have to: {
* - specify the script header that gives us our setting adjustments Client = 0,
* - add player customization into the script Server = 1,
* - call the main script Solo = 2,
* - call the function Studio = 3,
* EasterEgg = 4,
* now, we have to call the funtion associated for the action, such as starting the main client or something None = 5
* 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 class ScriptGenerator
{ {
public enum ScriptType
{
Client = 0,
Server = 1,
Solo = 2,
Studio = 3,
EasterEgg = 4,
None = 5
}
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,60 +41,59 @@ 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 + ")"; return "_G.CSStudio()";
} default:
} else if (type == ScriptType.Studio) { return "";
return "_G.CSStudio()";
} else {
return "";
} }
} }
public static string GetNameForType(ScriptType type) public static string GetNameForType(ScriptType type)
{ {
if (type == ScriptType.Client) { switch (type)
return "Client"; {
} else if (type == ScriptType.Server) { case ScriptType.Client:
return "Server"; return "Client";
} else if (type == ScriptType.Solo) { case ScriptType.Server:
return "Play Solo"; return "Server";
} else if (type == ScriptType.Studio) { case ScriptType.Solo:
return "Studio"; return "Play Solo";
} else if (type == ScriptType.EasterEgg) { case ScriptType.Studio:
return "A message from Bitl"; return "Studio";
} else { case ScriptType.EasterEgg:
return ""; return "A message from Bitl";
default:
return "";
} }
} }
public static void GenerateScriptForClient(ScriptType type) public static void GenerateScriptForClient(ScriptType type)
{ {
string code = GlobalVars.MultiLine( string code = GlobalVars.MultiLine(
"--Load Script", "--Load Script",
//scriptcontents, //scriptcontents,
LauncherFuncs.ChangeGameSettings(), LauncherFuncs.ChangeGameSettings(),
"dofile('rbxasset://scripts/" + GlobalVars.ScriptName + ".lua')", "dofile('rbxasset://scripts/" + GlobalVars.ScriptName + ".lua')",
GetScriptFuncForType(type), GetScriptFuncForType(type),

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,37 +38,54 @@ 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)
splash = "Merry Christmas!"; {
} else if (IsTheSameDay(today, new DateTime(today.Year, 12, 31)) || IsTheSameDay(today, new DateTime(today.Year, 1, 1))) { case DateTime christmaseve when christmaseve.Month.Equals(12) && christmaseve.Day.Equals(24):
splash = "Happy New Year!"; case DateTime christmasday when christmasday.Month.Equals(12) && christmasday.Day.Equals(25):
} else if (IsTheSameDay(today, new DateTime(today.Year, 10, 31))) { splash = "Merry Christmas!";
splash = "Happy Halloween!"; break;
} else if (IsTheSameDay(today, new DateTime(today.Year, 6, 10))) { case DateTime newyearseve when newyearseve.Month.Equals(12) && newyearseve.Day.Equals(31):
splash = "Happy Birthday, Bitl!"; case DateTime newyearsday when newyearsday.Month.Equals(1) && newyearsday.Day.Equals(1):
} else if (IsTheSameDay(today, new DateTime(today.Year, 8, 27))) { splash = "Happy New Year!";
splash = "Happy Birthday, ROBLOX!"; break;
} else if (IsTheSameDay(today, new DateTime(today.Year, 10, 27))) { case DateTime halloween when halloween.Month.Equals(10) && halloween.Day.Equals(31):
splash = "Happy Birthday, Novetus!"; splash = "Happy Halloween!";
} else if (IsTheSameDay(today, new DateTime(today.Year, 10, 9))) { break;
splash = "Happy Leif Erikson Day! HINGA DINGA DURGEN!"; case DateTime bitlbirthday when bitlbirthday.Month.Equals(6) && bitlbirthday.Day.Equals(10):
} else if (IsTheSameDay(today, new DateTime(today.Year, 4, 20))) { splash = "Happy Birthday, Bitl!";
splash = "4/20 lol"; break;
} else if (IsTheSameDay(today, new DateTime(today.Year, 2, 11))) { case DateTime robloxbirthday when robloxbirthday.Month.Equals(8) && robloxbirthday.Day.Equals(27):
splash = "RIP Erik Cassel"; splash = "Happy Birthday, ROBLOX!";
} else { break;
splash = RandomSplash(); case DateTime novetusbirthday when novetusbirthday.Month.Equals(10) && novetusbirthday.Day.Equals(27):
} splash = "Happy Birthday, Novetus!";
break;
case DateTime leiferikson when leiferikson.Month.Equals(10) && leiferikson.Day.Equals(9):
splash = "Happy Leif Erikson Day! HINGA DINGA DURGEN!";
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";
}
break;
case DateTime erikismyhero when erikismyhero.Month.Equals(2) && erikismyhero.Day.Equals(11):
splash = "RIP Erik Cassel";
break;
default:
splash = RandomSplash();
break;
}
return splash; return splash;
} }

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,109 +219,107 @@ 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)
{ {
treeView1.Nodes.Clear(); case TabPage pg2 when pg2 == tabControl1.TabPages["tabPage2"]:
_fieldsTreeCache.Nodes.Clear(); treeView1.Nodes.Clear();
textBox4.Text = ""; _fieldsTreeCache.Nodes.Clear();
listBox2.Items.Clear(); textBox4.Text = "";
listBox3.Items.Clear(); listBox2.Items.Clear();
listBox4.Items.Clear(); listBox3.Items.Clear();
//since we are async, DO THESE first or we'll clear out random stuff. listBox4.Items.Clear();
textBox3.Text = "Loading..."; //since we are async, DO THESE first or we'll clear out random stuff.
string IP = await SecurityFuncs.GetExternalIPAddressAsync(); textBox3.Text = "Loading...";
textBox3.Text = ""; string IP = await SecurityFuncs.GetExternalIPAddressAsync();
string[] lines1 = { textBox3.Text = "";
SecurityFuncs.Base64Encode(IP), string[] lines1 = {
SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()), SecurityFuncs.Base64Encode(IP),
SecurityFuncs.Base64Encode(GlobalVars.SelectedClient) SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()),
}; SecurityFuncs.Base64Encode(GlobalVars.SelectedClient)
string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1), true); };
string[] lines2 = { string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1), true);
SecurityFuncs.Base64Encode("localhost"), string[] lines2 = {
SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()), SecurityFuncs.Base64Encode("localhost"),
SecurityFuncs.Base64Encode(GlobalVars.SelectedClient) SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()),
}; SecurityFuncs.Base64Encode(GlobalVars.SelectedClient)
string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2), true); };
string[] text = { string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2), true);
"Client: " + GlobalVars.SelectedClient, string[] text = {
"IP: " + IP, "Client: " + GlobalVars.SelectedClient,
"Port: " + GlobalVars.RobloxPort.ToString(), "IP: " + IP,
"Map: " + GlobalVars.Map, "Port: " + GlobalVars.RobloxPort.ToString(),
"Players: " + GlobalVars.PlayerLimit, "Map: " + GlobalVars.Map,
"Version: Novetus " + GlobalVars.Version, "Players: " + GlobalVars.PlayerLimit,
"Online URI Link:", "Version: Novetus " + GlobalVars.Version,
URI, "Online URI Link:",
"Local URI Link:", URI,
URI2, "Local URI Link:",
GlobalVars.IsWebServerOn == true ? "Web Server URL:" : "", URI2,
GlobalVars.IsWebServerOn == true ? "http://" + IP + ":" + GlobalVars.WebServer.Port.ToString() : "", GlobalVars.IsWebServerOn == true ? "Web Server URL:" : "",
GlobalVars.IsWebServerOn == true ? "Local Web Server URL:" : "", GlobalVars.IsWebServerOn == true ? "http://" + IP + ":" + GlobalVars.WebServer.Port.ToString() : "",
GlobalVars.IsWebServerOn == true ? GlobalVars.LocalWebServerURI : "" GlobalVars.IsWebServerOn == true ? "Local Web Server URL:" : "",
}; GlobalVars.IsWebServerOn == true ? GlobalVars.LocalWebServerURI : ""
};
foreach (string str in text) foreach (string str in text)
{ {
if (!string.IsNullOrWhiteSpace(str)) if (!string.IsNullOrWhiteSpace(str))
{ {
textBox3.AppendText(str); textBox3.AppendText(str);
textBox3.AppendText(Environment.NewLine); textBox3.AppendText(Environment.NewLine);
} }
} }
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); treeView1.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.Map, treeView1.Nodes);
treeView1.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.Map, treeView1.Nodes); treeView1.Focus();
treeView1.Focus(); textBox3.Text = "";
textBox3.Text = ""; listBox2.Items.Clear();
listBox2.Items.Clear(); listBox3.Items.Clear();
listBox3.Items.Clear(); listBox4.Items.Clear();
listBox4.Items.Clear(); break;
} case TabPage pg3 when pg3 == tabControl1.TabPages["tabPage3"]:
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage3"])//your specific tabname string clientdir = GlobalVars.ClientDir;
{ DirectoryInfo dinfo = new DirectoryInfo(clientdir);
string clientdir = GlobalVars.ClientDir; DirectoryInfo[] Dirs = dinfo.GetDirectories();
DirectoryInfo dinfo = new DirectoryInfo(clientdir); foreach (DirectoryInfo dir in Dirs)
DirectoryInfo[] Dirs = dinfo.GetDirectories(); {
foreach( DirectoryInfo dir in Dirs ) listBox2.Items.Add(dir.Name);
{ }
listBox2.Items.Add(dir.Name); listBox2.SelectedItem = GlobalVars.SelectedClient;
} treeView1.Nodes.Clear();
listBox2.SelectedItem = GlobalVars.SelectedClient; _fieldsTreeCache.Nodes.Clear();
treeView1.Nodes.Clear(); textBox4.Text = "";
_fieldsTreeCache.Nodes.Clear(); textBox3.Text = "";
textBox4.Text = ""; listBox3.Items.Clear();
textBox3.Text = ""; listBox4.Items.Clear();
listBox3.Items.Clear(); break;
listBox4.Items.Clear(); case TabPage pg6 when pg6 == tabControl1.TabPages["tabPage6"]:
} string[] lines_server = File.ReadAllLines(GlobalVars.ConfigDir + "\\servers.txt");
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage6"])//your specific tabname string[] lines_ports = File.ReadAllLines(GlobalVars.ConfigDir + "\\ports.txt");
{ listBox3.Items.AddRange(lines_server);
string[] lines_server = File.ReadAllLines(GlobalVars.ConfigDir + "\\servers.txt"); listBox4.Items.AddRange(lines_ports);
string[] lines_ports = File.ReadAllLines(GlobalVars.ConfigDir + "\\ports.txt"); treeView1.Nodes.Clear();
listBox3.Items.AddRange(lines_server); _fieldsTreeCache.Nodes.Clear();
listBox4.Items.AddRange(lines_ports); textBox4.Text = "";
treeView1.Nodes.Clear(); textBox3.Text = "";
_fieldsTreeCache.Nodes.Clear(); listBox2.Items.Clear();
textBox4.Text = ""; break;
textBox3.Text = ""; default:
listBox2.Items.Clear(); treeView1.Nodes.Clear();
} _fieldsTreeCache.Nodes.Clear();
else textBox4.Text = "";
{ textBox3.Text = "";
treeView1.Nodes.Clear(); listBox2.Items.Clear();
_fieldsTreeCache.Nodes.Clear(); listBox3.Items.Clear();
textBox4.Text = ""; listBox4.Items.Clear();
textBox3.Text = ""; break;
listBox2.Items.Clear(); }
listBox3.Items.Clear();
listBox4.Items.Clear();
}
} }
void Button1Click(object sender, EventArgs e) void Button1Click(object sender, EventArgs e)
@ -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; case GraphicsMode.DirectX:
} comboBox1.SelectedIndex = 1;
else if (GlobalVars.GraphicsMode == 2) break;
{ case GraphicsMode.OpenGL:
comboBox1.SelectedIndex = 1; default:
comboBox1.SelectedIndex = 0;
break;
} }
if (GlobalVars.QualityLevel == 1) switch (GlobalVars.QualityLevel)
{ {
comboBox2.SelectedIndex = 0; case QualityLevel.VeryLow:
} comboBox2.SelectedIndex = 0;
else if (GlobalVars.QualityLevel == 2) break;
{ 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;
} case QualityLevel.High:
else if (GlobalVars.QualityLevel == 4) comboBox2.SelectedIndex = 3;
{ break;
comboBox2.SelectedIndex = 3; case QualityLevel.Ultra:
} default:
else if (GlobalVars.QualityLevel == 5) comboBox2.SelectedIndex = 4;
{ break;
comboBox2.SelectedIndex = 4;
} }
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)
{ {
textBox2.Enabled = true; case true:
} textBox2.Enabled = true;
else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false) break;
{ case false:
textBox2.Enabled = false; textBox2.Enabled = false;
break;
} }
if (GlobalVars.SelectedClientInfo.UsesID == true) switch (GlobalVars.SelectedClientInfo.UsesID)
{ {
textBox5.Enabled = true; case true:
button4.Enabled = true; textBox5.Enabled = true;
if (GlobalVars.IP.Equals("localhost")) button4.Enabled = true;
{ if (GlobalVars.IP.Equals("localhost"))
checkBox3.Enabled = true; {
} checkBox3.Enabled = true;
} }
else if (GlobalVars.SelectedClientInfo.UsesID == false) break;
{ 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,39 +837,38 @@ 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)
{
richTextBox1.AppendText(text, Color.White);
}
else if (type == 2)
{
richTextBox1.AppendText(text, Color.Red);
}
else if (type == 3)
{
richTextBox1.AppendText(text, Color.Lime);
}
else if (type == 4)
{
richTextBox1.AppendText(text, Color.Aqua);
}
else if (type == 5)
{
richTextBox1.AppendText(text, Color.Yellow);
}
else if (type == 6)
{
richTextBox1.AppendText(text, Color.LightSalmon);
}
richTextBox1.AppendText(Environment.NewLine); switch (type)
{
case 2:
richTextBox1.AppendText(text, Color.Red);
break;
case 3:
richTextBox1.AppendText(text, Color.Lime);
break;
case 4:
richTextBox1.AppendText(text, Color.Aqua);
break;
case 5:
richTextBox1.AppendText(text, Color.Yellow);
break;
case 6:
richTextBox1.AppendText(text, Color.LightSalmon);
break;
case 1:
default:
richTextBox1.AppendText(text, Color.White);
break;
}
richTextBox1.AppendText(Environment.NewLine);
} }
//Rewrite these into one function. Preferably global. //Rewrite these into one function. Preferably global.
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;
{ MessageBox.Show("Restart the launcher to apply changes.");
GlobalVars.DiscordPresence = true; }
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,104 +1701,83 @@ namespace NovetusLauncher
{ {
LocalVars.Clicks += 1; LocalVars.Clicks += 1;
if (LocalVars.Clicks == 1) switch(LocalVars.Clicks)
{ {
label12.Text = "Hi " + GlobalVars.PlayerName + "!"; case 1:
} label12.Text = "Hi " + GlobalVars.PlayerName + "!";
else if (LocalVars.Clicks == 3) break;
{ 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;
} case 9:
else if (LocalVars.Clicks == 9) label12.Text = "Just wait a little on the last click, OK?";
{ break;
label12.Text = "Just wait a little on the last click, OK?"; case 10:
} WriteConfigValues();
else if (LocalVars.Clicks == 10) StartEasterEgg();
{
WriteConfigValues();
StartEasterEgg();
if (GlobalVars.CloseOnLaunch == true) if (GlobalVars.CloseOnLaunch == true)
{ {
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,109 +218,107 @@ 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)
{ {
treeView1.Nodes.Clear(); case TabPage pg2 when pg2 == tabControl1.TabPages["tabPage2"]:
_fieldsTreeCache.Nodes.Clear(); treeView1.Nodes.Clear();
textBox4.Text = ""; _fieldsTreeCache.Nodes.Clear();
listBox2.Items.Clear(); textBox4.Text = "";
listBox3.Items.Clear(); listBox2.Items.Clear();
listBox4.Items.Clear(); listBox3.Items.Clear();
//since we are async, DO THESE first or we'll clear out random stuff. listBox4.Items.Clear();
textBox3.Text = "Loading..."; //since we are async, DO THESE first or we'll clear out random stuff.
string IP = await SecurityFuncs.GetExternalIPAddressAsync(); textBox3.Text = "Loading...";
textBox3.Text = ""; string IP = await SecurityFuncs.GetExternalIPAddressAsync();
string[] lines1 = { textBox3.Text = "";
SecurityFuncs.Base64Encode(IP), string[] lines1 = {
SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()), SecurityFuncs.Base64Encode(IP),
SecurityFuncs.Base64Encode(GlobalVars.SelectedClient) SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()),
}; SecurityFuncs.Base64Encode(GlobalVars.SelectedClient)
string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1), true); };
string[] lines2 = { string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1), true);
SecurityFuncs.Base64Encode("localhost"), string[] lines2 = {
SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()), SecurityFuncs.Base64Encode("localhost"),
SecurityFuncs.Base64Encode(GlobalVars.SelectedClient) SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()),
}; SecurityFuncs.Base64Encode(GlobalVars.SelectedClient)
string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2), true); };
string[] text = { string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2), true);
"Client: " + GlobalVars.SelectedClient, string[] text = {
"IP: " + IP, "Client: " + GlobalVars.SelectedClient,
"Port: " + GlobalVars.RobloxPort.ToString(), "IP: " + IP,
"Map: " + GlobalVars.Map, "Port: " + GlobalVars.RobloxPort.ToString(),
"Players: " + GlobalVars.PlayerLimit, "Map: " + GlobalVars.Map,
"Version: Novetus " + GlobalVars.Version, "Players: " + GlobalVars.PlayerLimit,
"Online URI Link:", "Version: Novetus " + GlobalVars.Version,
URI, "Online URI Link:",
"Local URI Link:", URI,
URI2, "Local URI Link:",
GlobalVars.IsWebServerOn == true ? "Web Server URL:" : "", URI2,
GlobalVars.IsWebServerOn == true ? "http://" + IP + ":" + GlobalVars.WebServer.Port.ToString() : "", GlobalVars.IsWebServerOn == true ? "Web Server URL:" : "",
GlobalVars.IsWebServerOn == true ? "Local Web Server URL:" : "", GlobalVars.IsWebServerOn == true ? "http://" + IP + ":" + GlobalVars.WebServer.Port.ToString() : "",
GlobalVars.IsWebServerOn == true ? GlobalVars.LocalWebServerURI : "" GlobalVars.IsWebServerOn == true ? "Local Web Server URL:" : "",
}; GlobalVars.IsWebServerOn == true ? GlobalVars.LocalWebServerURI : ""
};
foreach (string str in text) foreach (string str in text)
{ {
if (!string.IsNullOrWhiteSpace(str)) if (!string.IsNullOrWhiteSpace(str))
{ {
textBox3.AppendText(str); textBox3.AppendText(str);
textBox3.AppendText(Environment.NewLine); textBox3.AppendText(Environment.NewLine);
} }
} }
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); treeView1.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.Map, treeView1.Nodes);
treeView1.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.Map, treeView1.Nodes); treeView1.Focus();
treeView1.Focus(); textBox3.Text = "";
textBox3.Text = ""; listBox2.Items.Clear();
listBox2.Items.Clear(); listBox3.Items.Clear();
listBox3.Items.Clear(); listBox4.Items.Clear();
listBox4.Items.Clear(); break;
} case TabPage pg3 when pg3 == tabControl1.TabPages["tabPage3"]:
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage3"])//your specific tabname string clientdir = GlobalVars.ClientDir;
{ DirectoryInfo dinfo = new DirectoryInfo(clientdir);
string clientdir = GlobalVars.ClientDir; DirectoryInfo[] Dirs = dinfo.GetDirectories();
DirectoryInfo dinfo = new DirectoryInfo(clientdir); foreach (DirectoryInfo dir in Dirs)
DirectoryInfo[] Dirs = dinfo.GetDirectories(); {
foreach( DirectoryInfo dir in Dirs ) listBox2.Items.Add(dir.Name);
{ }
listBox2.Items.Add(dir.Name); listBox2.SelectedItem = GlobalVars.SelectedClient;
} treeView1.Nodes.Clear();
listBox2.SelectedItem = GlobalVars.SelectedClient; _fieldsTreeCache.Nodes.Clear();
treeView1.Nodes.Clear(); textBox4.Text = "";
_fieldsTreeCache.Nodes.Clear(); textBox3.Text = "";
textBox4.Text = ""; listBox3.Items.Clear();
textBox3.Text = ""; listBox4.Items.Clear();
listBox3.Items.Clear(); break;
listBox4.Items.Clear(); case TabPage pg6 when pg6 == tabControl1.TabPages["tabPage6"]:
} string[] lines_server = File.ReadAllLines(GlobalVars.ConfigDir + "\\servers.txt");
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage6"])//your specific tabname string[] lines_ports = File.ReadAllLines(GlobalVars.ConfigDir + "\\ports.txt");
{ listBox3.Items.AddRange(lines_server);
string[] lines_server = File.ReadAllLines(GlobalVars.ConfigDir + "\\servers.txt"); listBox4.Items.AddRange(lines_ports);
string[] lines_ports = File.ReadAllLines(GlobalVars.ConfigDir + "\\ports.txt"); treeView1.Nodes.Clear();
listBox3.Items.AddRange(lines_server); _fieldsTreeCache.Nodes.Clear();
listBox4.Items.AddRange(lines_ports); textBox4.Text = "";
treeView1.Nodes.Clear(); textBox3.Text = "";
_fieldsTreeCache.Nodes.Clear(); listBox2.Items.Clear();
textBox4.Text = ""; break;
textBox3.Text = ""; default:
listBox2.Items.Clear(); treeView1.Nodes.Clear();
} _fieldsTreeCache.Nodes.Clear();
else textBox4.Text = "";
{ textBox3.Text = "";
treeView1.Nodes.Clear(); listBox2.Items.Clear();
_fieldsTreeCache.Nodes.Clear(); listBox3.Items.Clear();
textBox4.Text = ""; listBox4.Items.Clear();
textBox3.Text = ""; break;
listBox2.Items.Clear(); }
listBox3.Items.Clear();
listBox4.Items.Clear();
}
} }
void Button1Click(object sender, EventArgs e) void Button1Click(object sender, EventArgs e)
@ -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)
{ {
textBox2.Enabled = true; case true:
} textBox2.Enabled = true;
else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false) break;
{ case false:
textBox2.Enabled = false; textBox2.Enabled = false;
break;
} }
if (GlobalVars.SelectedClientInfo.UsesID == true) switch (GlobalVars.SelectedClientInfo.UsesID)
{ {
textBox5.Enabled = true; case true:
button4.Enabled = true; textBox5.Enabled = true;
if (GlobalVars.IP.Equals("localhost")) button4.Enabled = true;
{ if (GlobalVars.IP.Equals("localhost"))
checkBox3.Enabled = true; {
} checkBox3.Enabled = true;
} }
else if (GlobalVars.SelectedClientInfo.UsesID == false) break;
{ 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,39 +802,38 @@ 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)
{
richTextBox1.AppendText(text, Color.White);
}
else if (type == 2)
{
richTextBox1.AppendText(text, Color.Red);
}
else if (type == 3)
{
richTextBox1.AppendText(text, Color.Lime);
}
else if (type == 4)
{
richTextBox1.AppendText(text, Color.Aqua);
}
else if (type == 5)
{
richTextBox1.AppendText(text, Color.Yellow);
}
else if (type == 6)
{
richTextBox1.AppendText(text, Color.LightSalmon);
}
richTextBox1.AppendText(Environment.NewLine); switch (type)
{
case 2:
richTextBox1.AppendText(text, Color.Red);
break;
case 3:
richTextBox1.AppendText(text, Color.Lime);
break;
case 4:
richTextBox1.AppendText(text, Color.Aqua);
break;
case 5:
richTextBox1.AppendText(text, Color.Yellow);
break;
case 6:
richTextBox1.AppendText(text, Color.LightSalmon);
break;
case 1:
default:
richTextBox1.AppendText(text, Color.White);
break;
}
richTextBox1.AppendText(Environment.NewLine);
} }
//Rewrite these into one function. Preferably global. //Rewrite these into one function. Preferably global.
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)
@ -1644,21 +1609,13 @@ 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;
{ MessageBox.Show("Restart the launcher to apply changes.");
GlobalVars.DiscordPresence = true; }
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)
{ {
tabControl1.SelectedTab = tabPage1; tabControl1.SelectedTab = tabPage1;
} }
@ -1703,42 +1660,40 @@ namespace NovetusLauncher
LoadLauncher(); LoadLauncher();
} }
private void label8_Click(object sender, EventArgs e) private void label8_Click(object sender, EventArgs e)
{ {
if (LocalVars.Clicks < 10) if (LocalVars.Clicks < 10)
{ {
LocalVars.Clicks += 1; LocalVars.Clicks += 1;
if (LocalVars.Clicks == 1)
{
label12.Text = "Hi " + GlobalVars.PlayerName + "!";
}
else if (LocalVars.Clicks == 3)
{
label12.Text = "How are you doing today?";
}
else if (LocalVars.Clicks == 6)
{
label12.Text = "I just wanted to say something.";
}
else if (LocalVars.Clicks == 9)
{
label12.Text = "Just wait a little on the last click, OK?";
}
else if (LocalVars.Clicks == 10)
{
WriteConfigValues();
StartEasterEgg();
if (GlobalVars.CloseOnLaunch == true)
{
Visible = false;
}
}
}
}
switch (LocalVars.Clicks)
{
case 1:
label12.Text = "Hi " + GlobalVars.PlayerName + "!";
break;
case 3:
label12.Text = "How are you doing today?";
break;
case 6:
label12.Text = "I just wanted to say something.";
break;
case 9:
label12.Text = "Just wait a little on the last click, OK?";
break;
case 10:
WriteConfigValues();
StartEasterEgg();
if (GlobalVars.CloseOnLaunch == true)
{
Visible = false;
}
break;
default:
break;
}
}
}
void SettingsButtonClick(object sender, EventArgs e) void SettingsButtonClick(object sender, EventArgs e)
{ {
@ -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; case GraphicsMode.DirectX:
} comboBox1.SelectedIndex = 1;
else if (GlobalVars.GraphicsMode == 2) break;
{ case GraphicsMode.OpenGL:
comboBox1.SelectedIndex = 1; default:
comboBox1.SelectedIndex = 0;
break;
} }
if (GlobalVars.QualityLevel == 1) switch (GlobalVars.QualityLevel)
{ {
comboBox2.SelectedIndex = 0; case QualityLevel.VeryLow:
} comboBox2.SelectedIndex = 0;
else if (GlobalVars.QualityLevel == 2) break;
{ 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;
} case QualityLevel.High:
else if (GlobalVars.QualityLevel == 4) comboBox2.SelectedIndex = 3;
{ break;
comboBox2.SelectedIndex = 3; case QualityLevel.Ultra:
} default:
else if (GlobalVars.QualityLevel == 5) comboBox2.SelectedIndex = 4;
{ break;
comboBox2.SelectedIndex = 4;
} }
} }
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="; case 1:
isWebSite = false; url = "http://assetgame.roblox.com/asset/?id=";
} isWebSite = false;
else if (comboBox1.SelectedIndex == 1) break;
{ case 2:
url = "http://assetgame.roblox.com/asset/?id="; url = "https://www.roblox.com/catalog/";
isWebSite = false; isWebSite = true;
} break;
else if (comboBox1.SelectedIndex == 2) case 3:
{ url = "https://www.roblox.com/library/";
url = "https://www.roblox.com/catalog/"; isWebSite = true;
isWebSite = true; break;
} default:
else if (comboBox1.SelectedIndex == 3) url = "http://www.roblox.com/asset?id=";
{ isWebSite = false;
url = "https://www.roblox.com/library/"; break;
isWebSite = true;
} }
} }
@ -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(); case 1:
im.Show(); ClientinfoEditor cie = new ClientinfoEditor();
} cie.Show();
else if (listBox1.SelectedIndex == 1) break;
{ case 2:
ClientinfoEditor cie = new ClientinfoEditor(); ClientScriptDocumentation csd = new ClientScriptDocumentation();
cie.Show(); csd.Show();
} break;
else if (listBox1.SelectedIndex == 2) case 3:
{ AssetLocalizer al = new AssetLocalizer();
ClientScriptDocumentation csd = new ClientScriptDocumentation(); al.Show();
csd.Show(); break;
} case 4:
else if (listBox1.SelectedIndex == 3) SplashTester st = new SplashTester();
{ st.Show();
AssetLocalizer al = new AssetLocalizer(); break;
al.Show(); case 5:
} Obj2MeshV1GUI obj = new Obj2MeshV1GUI();
else if (listBox1.SelectedIndex == 4) obj.Show();
{ break;
SplashTester st = new SplashTester(); case 6:
st.Show(); Process proc = new Process();
} proc.StartInfo.FileName = GlobalVars.ConfigDirData + "\\RSG.exe";
else if (listBox1.SelectedIndex == 5) proc.StartInfo.CreateNoWindow = false;
{ proc.StartInfo.UseShellExecute = false;
Obj2MeshV1GUI obj = new Obj2MeshV1GUI(); proc.Start();
obj.Show(); break;
} case 7:
else if (listBox1.SelectedIndex == 6) Process proc2 = new Process();
{ proc2.StartInfo.FileName = GlobalVars.ConfigDirData + "\\Roblox_Legacy_Place_Converter.exe";
Process proc = new Process(); proc2.StartInfo.CreateNoWindow = false;
proc.StartInfo.FileName = GlobalVars.ConfigDirData + "\\RSG.exe"; proc2.StartInfo.UseShellExecute = false;
proc.StartInfo.CreateNoWindow = false; proc2.Start();
proc.StartInfo.UseShellExecute = false; break;
proc.Start(); case 8:
} DiogenesEditor dio = new DiogenesEditor();
else if (listBox1.SelectedIndex == 7) dio.Show();
{ break;
Process proc = new Process(); default:
proc.StartInfo.FileName = GlobalVars.ConfigDirData + "\\Roblox_Legacy_Place_Converter.exe"; ItemMaker im = new ItemMaker();
proc.StartInfo.CreateNoWindow = false; im.Show();
proc.StartInfo.UseShellExecute = false; break;
proc.Start();
}
else if (listBox1.SelectedIndex == 8)
{
DiogenesEditor dio = new DiogenesEditor();
dio.Show();
} }
} }
} }

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();
} }