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)
{
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
{
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Server);
ScriptGenerator.GenerateScriptForClient(ScriptType.Server);
args = "-script " + quote + luafile + quote + (no3d ? " -no3d" : "") + " " + quote + mapfile + quote;
}
}
@ -394,7 +394,7 @@ namespace NovetusCMD
client.Exited += new EventHandler(ServerExited);
client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Server, GlobalVars.Map);
SecurityFuncs.RenameWindow(client, ScriptType.Server, GlobalVars.Map);
LocalVars.ProcessID = client.Id;
CreateTXT();
}
@ -452,35 +452,35 @@ namespace NovetusCMD
ConsolePrint("Server Information sent to file " + GlobalVars.BasePath + "\\" + LocalVars.ServerInfoFileName, 4);
}
}
static void ConsolePrint(string text, int type)
{
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);
}
static void ConsoleText(string text, ConsoleColor color)
static void ConsolePrint(string text, int type)
{
ConsoleText("[" + DateTime.Now.ToShortTimeString() + "] - ", 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;
}
ConsoleText(Environment.NewLine, ConsoleColor.White);
}
static void ConsoleText(string text, ConsoleColor color)
{
Console.ForegroundColor = color;
Console.Write(text);

View File

@ -19,9 +19,7 @@ public class ClientScript
{
int pFrom = code.IndexOf(tag) + tag.Length;
int pTo = code.LastIndexOf(endtag);
string result = code.Substring(pFrom, pTo - pFrom);
return result;
}
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")) {
return ScriptGenerator.ScriptType.Client;
} else if (tag.Contains("server") && endtag.Contains("server") || tag.Contains("no3d") && endtag.Contains("no3d")) {
return ScriptGenerator.ScriptType.Server;
} else if (tag.Contains("solo") && endtag.Contains("solo")) {
return ScriptGenerator.ScriptType.Solo;
} else if (tag.Contains("studio") && endtag.Contains("studio")) {
return ScriptGenerator.ScriptType.Studio;
} else {
return ScriptGenerator.ScriptType.None;
switch (tag)
{
case string client when client.Contains("client"):
return ScriptType.Client;
case string server when server.Contains("server"):
case string no3d when no3d.Contains("no3d"):
return ScriptType.Server;
case string solo when solo.Contains("solo"):
return ScriptType.Solo;
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) {
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 + "')";
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false && GlobalVars.SelectedClientInfo.UsesID == true) {
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player'," + GlobalVars.loadtext + "," + md5s + ",'" + GlobalVars.PlayerTripcode + "')";
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == true && GlobalVars.SelectedClientInfo.UsesID == false) {
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.loadtext + "," + md5s + ",'" + GlobalVars.PlayerTripcode + "')";
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false && GlobalVars.SelectedClientInfo.UsesID == false) {
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSConnect(0,'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'Player'," + GlobalVars.loadtext + "," + md5s + ",'" + GlobalVars.PlayerTripcode + "')";
} else {
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSConnect(" + GlobalVars.UserID + ",'" + GlobalVars.IP + "'," + GlobalVars.RobloxPort + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.loadtext + "," + md5s + ",'" + GlobalVars.PlayerTripcode + "')";
}
} else if (type == ScriptGenerator.ScriptType.Server) {
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSServer(" + GlobalVars.RobloxPort + "," + GlobalVars.PlayerLimit + "," + md5s + "); " + (!string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? LauncherFuncs.ChangeGameSettings() + " dofile('" + GlobalVars.AddonScriptPath + "');" : "");
} else if (type == ScriptGenerator.ScriptType.Solo) {
if (GlobalVars.SelectedClientInfo.UsesPlayerName == true && GlobalVars.SelectedClientInfo.UsesID == true) {
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")";
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false && GlobalVars.SelectedClientInfo.UsesID == true) {
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'Player'," + GlobalVars.sololoadtext + ")";
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == true && GlobalVars.SelectedClientInfo.UsesID == false) {
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSSolo(0,'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")";
} else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false && GlobalVars.SelectedClientInfo.UsesID == false) {
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSSolo(0,'Player'," + GlobalVars.sololoadtext + ")";
} else {
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSSolo(" + GlobalVars.UserID + ",'" + GlobalVars.PlayerName + "'," + GlobalVars.sololoadtext + ")";
}
} else if (type == ScriptGenerator.ScriptType.Studio) {
return LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "');";
} else {
return "";
switch (type)
{
case ScriptType.Client:
return LauncherFuncs.ChangeGameSettings() +
" dofile('" + luafile + "'); _G.CSConnect("
+ (GlobalVars.SelectedClientInfo.UsesID == true ? GlobalVars.UserID : 0) + ",'"
+ GlobalVars.IP + "',"
+ GlobalVars.RobloxPort + ",'"
+ (GlobalVars.SelectedClientInfo.UsesPlayerName == true ? GlobalVars.PlayerName : "Player") + "',"
+ GlobalVars.loadtext + ","
+ md5s + ",'"
+ GlobalVars.PlayerTripcode + "')";
case ScriptType.Server:
return LauncherFuncs.ChangeGameSettings() +
" dofile('" + luafile + "'); _G.CSServer("
+ GlobalVars.RobloxPort + ","
+ GlobalVars.PlayerLimit + ","
+ md5s + "); "
+ (!string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? LauncherFuncs.ChangeGameSettings() +
" dofile('" + GlobalVars.AddonScriptPath + "');" : "");
case ScriptType.Solo:
case ScriptType.EasterEgg:
return LauncherFuncs.ChangeGameSettings()
+ " dofile('" + luafile + "'); _G.CSSolo("
+ (GlobalVars.SelectedClientInfo.UsesID == true ? GlobalVars.UserID : 0) + ",'"
+ (GlobalVars.SelectedClientInfo.UsesPlayerName == true ? GlobalVars.PlayerName : "Player") + "',"
+ GlobalVars.sololoadtext + ")";
case ScriptType.Studio:
return LauncherFuncs.ChangeGameSettings()
+ " 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()
{
if (GlobalVars.Custom_Icon_Offline == "BC") {
return 1;
} else if (GlobalVars.Custom_Icon_Offline == "TBC") {
return 2;
} else if (GlobalVars.Custom_Icon_Offline == "OBC") {
return 3;
} else if (GlobalVars.Custom_Icon_Offline == "NBC") {
return 0;
switch (GlobalVars.Custom_Icon_Offline)
{
case "BC:":
return 1;
case "TBC:":
return 2;
case "OBC:":
return 3;
case "NBC:":
default:
return 0;
}
return 0;
}
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)
{
if (GlobalVars.SelectedClientInfo.Fix2007) {
ScriptGenerator.GenerateScriptForClient(GetTypeFromTag(tag, endtag));
ScriptGenerator.GenerateScriptForClient(GetTypeFromTag(tag));
}
string extractedCode = GetArgsFromTag(code, tag, endtag);
@ -177,7 +181,7 @@ public class ClientScript
.Replace("%extra%", GlobalVars.Custom_Extra)
.Replace("%extrad%", GlobalVars.extraGameDir + 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("%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)

View File

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

View File

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

View File

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

View File

@ -168,7 +168,7 @@ public class SecurityFuncs
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) {
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) {
while (exe.IsRunning() == true) {
@ -188,14 +188,41 @@ public class SecurityFuncs
worker.Dispose();
break;
}
if (type == ScriptGenerator.ScriptType.Client) {
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) {
SetWindowText(exe.MainWindowHandle, "Novetus " + GlobalVars.Version + " - " + clientname + " " + ScriptGenerator.GetNameForType(type) + (string.IsNullOrWhiteSpace(mapname) ? " [Place1]" : " [" + mapname + "]") + RandomStringTitle());
}else if (type == ScriptGenerator.ScriptType.EasterEgg) {
SetWindowText(exe.MainWindowHandle, ScriptGenerator.GetNameForType(type) + RandomStringTitle());
switch (type)
{
case ScriptType.Client:
SetWindowText(exe.MainWindowHandle, "Novetus "
+ GlobalVars.Version + " - "
+ 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);
}
} else {

View File

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

View File

@ -167,7 +167,7 @@ namespace NovetusLauncher
handlers.requestCallback += RequestCallback;
DiscordRpc.Initialize(GlobalVars.appid, ref handlers, true, "");
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, "", true);
LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "", true);
}
}
#endregion
@ -219,109 +219,107 @@ namespace NovetusLauncher
async void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage2"])//your specific tabname
{
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
//since we are async, DO THESE first or we'll clear out random stuff.
textBox3.Text = "Loading...";
string IP = await SecurityFuncs.GetExternalIPAddressAsync();
textBox3.Text = "";
string[] lines1 = {
SecurityFuncs.Base64Encode(IP),
SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()),
SecurityFuncs.Base64Encode(GlobalVars.SelectedClient)
};
string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1), true);
string[] lines2 = {
SecurityFuncs.Base64Encode("localhost"),
SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()),
SecurityFuncs.Base64Encode(GlobalVars.SelectedClient)
};
string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2), true);
string[] text = {
"Client: " + GlobalVars.SelectedClient,
"IP: " + IP,
"Port: " + GlobalVars.RobloxPort.ToString(),
"Map: " + GlobalVars.Map,
"Players: " + GlobalVars.PlayerLimit,
"Version: Novetus " + GlobalVars.Version,
"Online URI Link:",
URI,
"Local URI Link:",
URI2,
GlobalVars.IsWebServerOn == true ? "Web Server URL:" : "",
GlobalVars.IsWebServerOn == true ? "http://" + IP + ":" + GlobalVars.WebServer.Port.ToString() : "",
GlobalVars.IsWebServerOn == true ? "Local Web Server URL:" : "",
GlobalVars.IsWebServerOn == true ? GlobalVars.LocalWebServerURI : ""
};
switch (tabControl1.SelectedTab)
{
case TabPage pg2 when pg2 == tabControl1.TabPages["tabPage2"]:
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
//since we are async, DO THESE first or we'll clear out random stuff.
textBox3.Text = "Loading...";
string IP = await SecurityFuncs.GetExternalIPAddressAsync();
textBox3.Text = "";
string[] lines1 = {
SecurityFuncs.Base64Encode(IP),
SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()),
SecurityFuncs.Base64Encode(GlobalVars.SelectedClient)
};
string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1), true);
string[] lines2 = {
SecurityFuncs.Base64Encode("localhost"),
SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()),
SecurityFuncs.Base64Encode(GlobalVars.SelectedClient)
};
string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2), true);
string[] text = {
"Client: " + GlobalVars.SelectedClient,
"IP: " + IP,
"Port: " + GlobalVars.RobloxPort.ToString(),
"Map: " + GlobalVars.Map,
"Players: " + GlobalVars.PlayerLimit,
"Version: Novetus " + GlobalVars.Version,
"Online URI Link:",
URI,
"Local URI Link:",
URI2,
GlobalVars.IsWebServerOn == true ? "Web Server URL:" : "",
GlobalVars.IsWebServerOn == true ? "http://" + IP + ":" + GlobalVars.WebServer.Port.ToString() : "",
GlobalVars.IsWebServerOn == true ? "Local Web Server URL:" : "",
GlobalVars.IsWebServerOn == true ? GlobalVars.LocalWebServerURI : ""
};
foreach (string str in text)
{
if (!string.IsNullOrWhiteSpace(str))
{
textBox3.AppendText(str);
textBox3.AppendText(Environment.NewLine);
}
}
textBox3.SelectionStart = 0;
textBox3.ScrollToCaret();
}
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage4"])//your specific tabname
{
string mapdir = GlobalVars.MapsDir;
TreeNodeHelper.ListDirectory(treeView1, mapdir, ".rbxl");
TreeNodeHelper.CopyNodes(treeView1.Nodes,_fieldsTreeCache.Nodes);
treeView1.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.Map, treeView1.Nodes);
treeView1.Focus();
textBox3.Text = "";
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
}
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage3"])//your specific tabname
{
string clientdir = GlobalVars.ClientDir;
DirectoryInfo dinfo = new DirectoryInfo(clientdir);
DirectoryInfo[] Dirs = dinfo.GetDirectories();
foreach( DirectoryInfo dir in Dirs )
{
listBox2.Items.Add(dir.Name);
}
listBox2.SelectedItem = GlobalVars.SelectedClient;
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
textBox3.Text = "";
listBox3.Items.Clear();
listBox4.Items.Clear();
}
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage6"])//your specific tabname
{
string[] lines_server = File.ReadAllLines(GlobalVars.ConfigDir + "\\servers.txt");
string[] lines_ports = File.ReadAllLines(GlobalVars.ConfigDir + "\\ports.txt");
listBox3.Items.AddRange(lines_server);
listBox4.Items.AddRange(lines_ports);
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
textBox3.Text = "";
listBox2.Items.Clear();
}
else
{
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
textBox3.Text = "";
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
}
foreach (string str in text)
{
if (!string.IsNullOrWhiteSpace(str))
{
textBox3.AppendText(str);
textBox3.AppendText(Environment.NewLine);
}
}
textBox3.SelectionStart = 0;
textBox3.ScrollToCaret();
break;
case TabPage pg4 when pg4 == tabControl1.TabPages["tabPage4"]:
string mapdir = GlobalVars.MapsDir;
TreeNodeHelper.ListDirectory(treeView1, mapdir, ".rbxl");
TreeNodeHelper.CopyNodes(treeView1.Nodes, _fieldsTreeCache.Nodes);
treeView1.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.Map, treeView1.Nodes);
treeView1.Focus();
textBox3.Text = "";
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
break;
case TabPage pg3 when pg3 == tabControl1.TabPages["tabPage3"]:
string clientdir = GlobalVars.ClientDir;
DirectoryInfo dinfo = new DirectoryInfo(clientdir);
DirectoryInfo[] Dirs = dinfo.GetDirectories();
foreach (DirectoryInfo dir in Dirs)
{
listBox2.Items.Add(dir.Name);
}
listBox2.SelectedItem = GlobalVars.SelectedClient;
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
textBox3.Text = "";
listBox3.Items.Clear();
listBox4.Items.Clear();
break;
case TabPage pg6 when pg6 == tabControl1.TabPages["tabPage6"]:
string[] lines_server = File.ReadAllLines(GlobalVars.ConfigDir + "\\servers.txt");
string[] lines_ports = File.ReadAllLines(GlobalVars.ConfigDir + "\\ports.txt");
listBox3.Items.AddRange(lines_server);
listBox4.Items.AddRange(lines_ports);
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
textBox3.Text = "";
listBox2.Items.Clear();
break;
default:
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
textBox3.Text = "";
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
break;
}
}
void Button1Click(object sender, EventArgs e)
@ -516,53 +514,44 @@ namespace NovetusLauncher
label28.Text = GlobalVars.Map;
treeView1.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.Map, treeView1.Nodes);
treeView1.Focus();
//GlobalVars.Map = treeView1.SelectedNode.Text.ToString();
// GlobalVars.MapPath = treeView1.SelectedNode.FullPath.ToString().Replace(@"\", @"\\");
numericUpDown1.Value = Convert.ToDecimal(GlobalVars.RobloxPort);
numericUpDown2.Value = Convert.ToDecimal(GlobalVars.RobloxPort);
label37.Text = GlobalVars.IP;
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;
checkBox5.Checked = GlobalVars.ReShade;
checkBox6.Checked = GlobalVars.ReShadeFPSDisplay;
checkBox7.Checked = GlobalVars.ReShadePerformanceMode;
if (GlobalVars.GraphicsMode == 1)
switch (GlobalVars.GraphicsMode)
{
comboBox1.SelectedIndex = 0;
}
else if (GlobalVars.GraphicsMode == 2)
{
comboBox1.SelectedIndex = 1;
case GraphicsMode.DirectX:
comboBox1.SelectedIndex = 1;
break;
case GraphicsMode.OpenGL:
default:
comboBox1.SelectedIndex = 0;
break;
}
if (GlobalVars.QualityLevel == 1)
switch (GlobalVars.QualityLevel)
{
comboBox2.SelectedIndex = 0;
}
else if (GlobalVars.QualityLevel == 2)
{
comboBox2.SelectedIndex = 1;
}
else if (GlobalVars.QualityLevel == 3)
{
comboBox2.SelectedIndex = 2;
}
else if (GlobalVars.QualityLevel == 4)
{
comboBox2.SelectedIndex = 3;
}
else if (GlobalVars.QualityLevel == 5)
{
comboBox2.SelectedIndex = 4;
case QualityLevel.VeryLow:
comboBox2.SelectedIndex = 0;
break;
case QualityLevel.Low:
comboBox2.SelectedIndex = 1;
break;
case QualityLevel.Medium:
comboBox2.SelectedIndex = 2;
break;
case QualityLevel.High:
comboBox2.SelectedIndex = 3;
break;
case QualityLevel.Ultra:
default:
comboBox2.SelectedIndex = 4;
break;
}
ConsolePrint("Config loaded.", 3);
@ -596,30 +585,32 @@ namespace NovetusLauncher
{
LauncherFuncs.ReadClientValues(clientpath);
if (GlobalVars.SelectedClientInfo.UsesPlayerName == true)
{
textBox2.Enabled = true;
}
else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false)
{
textBox2.Enabled = false;
switch (GlobalVars.SelectedClientInfo.UsesPlayerName)
{
case true:
textBox2.Enabled = true;
break;
case false:
textBox2.Enabled = false;
break;
}
if (GlobalVars.SelectedClientInfo.UsesID == true)
switch (GlobalVars.SelectedClientInfo.UsesID)
{
textBox5.Enabled = true;
button4.Enabled = true;
if (GlobalVars.IP.Equals("localhost"))
{
checkBox3.Enabled = true;
}
}
else if (GlobalVars.SelectedClientInfo.UsesID == false)
{
textBox5.Enabled = false;
button4.Enabled = false;
checkBox3.Enabled = false;
GlobalVars.LocalPlayMode = false;
case true:
textBox5.Enabled = true;
button4.Enabled = true;
if (GlobalVars.IP.Equals("localhost"))
{
checkBox3.Enabled = true;
}
break;
case false:
textBox5.Enabled = false;
button4.Enabled = false;
checkBox3.Enabled = false;
GlobalVars.LocalPlayMode = false;
break;
}
if (!string.IsNullOrWhiteSpace(GlobalVars.SelectedClientInfo.Warning))
@ -660,14 +651,7 @@ namespace NovetusLauncher
void CheckBox1CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked == true)
{
GlobalVars.CloseOnLaunch = true;
}
else if (checkBox1.Checked == false)
{
GlobalVars.CloseOnLaunch = false;
}
GlobalVars.CloseOnLaunch = checkBox1.Checked;
}
void Button4Click(object sender, EventArgs e)
@ -690,19 +674,12 @@ namespace NovetusLauncher
{
GlobalVars.SelectedClient = listBox2.SelectedItem.ToString();
ReadClientValues(GlobalVars.SelectedClient);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, "");
LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
}
void CheckBox3CheckedChanged(object sender, EventArgs e)
{
if (checkBox3.Checked == true)
{
GlobalVars.LocalPlayMode = true;
}
else if (checkBox3.Checked == false)
{
GlobalVars.LocalPlayMode = false;
}
GlobalVars.LocalPlayMode = checkBox3.Checked;
}
void TextBox5TextChanged(object sender, EventArgs e)
@ -860,39 +837,38 @@ namespace NovetusLauncher
void ConsolePrint(string text, int type)
{
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.
void StartClient()
{
string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Client);
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Client);
string quote = "\"";
string args = "";
@ -900,11 +876,11 @@ namespace NovetusLauncher
{
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
{
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Client);
ScriptGenerator.GenerateScriptForClient(ScriptType.Client);
args = "-script " + quote + luafile + quote;
}
}
@ -964,13 +940,13 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ClientExited);
client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Client, GlobalVars.Map);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InMPGame, GlobalVars.Map);
SecurityFuncs.RenameWindow(client, ScriptType.Client, GlobalVars.Map);
LauncherFuncs.UpdateRichPresence(LauncherState.InMPGame, GlobalVars.Map);
}
void ClientExited(object sender, EventArgs e)
{
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, "");
LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
if (GlobalVars.CloseOnLaunch == true)
{
Visible = true;
@ -987,7 +963,7 @@ namespace NovetusLauncher
void EasterEggExited(object sender, EventArgs e)
{
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, "");
LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
label12.Text = LocalVars.prevsplash;
if (GlobalVars.CloseOnLaunch == true)
{
@ -998,7 +974,7 @@ namespace NovetusLauncher
void StartSolo()
{
string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Solo);
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Solo);
string mapfile = GlobalVars.MapPath;
string quote = "\"";
string args = "";
@ -1006,11 +982,11 @@ namespace NovetusLauncher
{
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
{
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Solo);
ScriptGenerator.GenerateScriptForClient(ScriptType.Solo);
args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote;
}
}
@ -1029,8 +1005,8 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ClientExited);
client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Solo, GlobalVars.Map);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InSoloGame, GlobalVars.Map);
SecurityFuncs.RenameWindow(client, ScriptType.Solo, GlobalVars.Map);
LauncherFuncs.UpdateRichPresence(LauncherState.InSoloGame, GlobalVars.Map);
}
catch (Exception ex) when (!Env.Debugging)
{
@ -1042,7 +1018,7 @@ namespace NovetusLauncher
void StartServer(bool no3d)
{
string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Server);
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Server);
string mapfile = GlobalVars.MapPath;
string quote = "\"";
string args = "";
@ -1050,11 +1026,11 @@ namespace NovetusLauncher
{
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
{
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Server);
ScriptGenerator.GenerateScriptForClient(ScriptType.Server);
args = "-script " + quote + luafile + quote + (no3d ? " -no3d" : "") + " " + quote + mapfile + quote;
}
}
@ -1081,7 +1057,7 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ServerExited);
client.Start();
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)
{
@ -1093,7 +1069,7 @@ namespace NovetusLauncher
void StartStudio(bool nomap)
{
string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Studio);
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Studio);
string mapfile = (nomap ? "" : GlobalVars.MapPath);
string mapname = (nomap ? "" : GlobalVars.Map);
string quote = "\"";
@ -1102,11 +1078,11 @@ namespace NovetusLauncher
{
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
{
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Studio);
ScriptGenerator.GenerateScriptForClient(ScriptType.Studio);
args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote;
}
}
@ -1125,8 +1101,8 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ClientExited);
client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Studio, mapname);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InStudio, mapname);
SecurityFuncs.RenameWindow(client, ScriptType.Studio, mapname);
LauncherFuncs.UpdateRichPresence(LauncherState.InStudio, mapname);
}
catch (Exception ex) when (!Env.Debugging)
{
@ -1139,7 +1115,7 @@ namespace NovetusLauncher
{
label12.Text = "<3";
string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.EasterEgg);
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.EasterEgg);
string mapfile = GlobalVars.ConfigDirData + "\\Appreciation.rbxl";
string quote = "\"";
string args = "";
@ -1147,11 +1123,11 @@ namespace NovetusLauncher
{
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
{
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.EasterEgg);
ScriptGenerator.GenerateScriptForClient(ScriptType.EasterEgg);
args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote;
}
}
@ -1170,8 +1146,8 @@ namespace NovetusLauncher
client.Start();
client.Exited += new EventHandler(EasterEggExited);
client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.EasterEgg, "");
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InEasterEggGame, "");
SecurityFuncs.RenameWindow(client, ScriptType.EasterEgg, "");
LauncherFuncs.UpdateRichPresence(LauncherState.InEasterEggGame, "");
}
catch (Exception ex) when (!Env.Debugging)
{
@ -1601,16 +1577,7 @@ namespace NovetusLauncher
void CheckBox4CheckedChanged(object sender, EventArgs e)
{
if (checkBox4.Checked == true)
{
GlobalVars.UPnP = true;
//checkBox8.Checked = false;
}
else if (checkBox4.Checked == false)
{
GlobalVars.UPnP = false;
//checkBox8.Checked = GlobalVars.UDP;
}
GlobalVars.UPnP = checkBox4.Checked;
}
void CheckBox4Click(object sender, EventArgs e)
@ -1679,17 +1646,9 @@ namespace NovetusLauncher
private void checkBox2_CheckedChanged(object sender, EventArgs e)
{
if (checkBox2.Checked == true && GlobalVars.DiscordPresence == false)
{
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.");
}
}
checkBox2.Checked = GlobalVars.DiscordPresence;
MessageBox.Show("Restart the launcher to apply changes.");
}
private void button27_Click(object sender, EventArgs e)
{
@ -1742,104 +1701,83 @@ namespace NovetusLauncher
{
LocalVars.Clicks += 1;
if (LocalVars.Clicks == 1)
switch(LocalVars.Clicks)
{
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();
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;
}
if (GlobalVars.CloseOnLaunch == true)
{
Visible = false;
}
break;
default:
break;
}
}
}
private void checkBox5_CheckedChanged(object sender, EventArgs e)
{
if (checkBox5.Checked == true)
{
GlobalVars.ReShade = true;
}
else if (checkBox5.Checked == false)
{
GlobalVars.ReShade = false;
}
GlobalVars.ReShade = checkBox5.Checked;
}
private void checkBox6_CheckedChanged(object sender, EventArgs e)
{
if (checkBox6.Checked == true)
{
GlobalVars.ReShadeFPSDisplay = true;
}
else if (checkBox6.Checked == false)
{
GlobalVars.ReShadeFPSDisplay = false;
}
GlobalVars.ReShadeFPSDisplay = checkBox6.Checked;
}
private void checkBox7_CheckedChanged(object sender, EventArgs e)
{
if (checkBox7.Checked == true)
{
GlobalVars.ReShadePerformanceMode = true;
}
else if (checkBox7.Checked == false)
{
GlobalVars.ReShadePerformanceMode = false;
}
GlobalVars.ReShadePerformanceMode = checkBox7.Checked;
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox1.SelectedIndex == 0)
switch (comboBox1.SelectedIndex)
{
GlobalVars.GraphicsMode = 1;
}
else if (comboBox1.SelectedIndex == 1)
{
GlobalVars.GraphicsMode = 2;
case 1:
GlobalVars.GraphicsMode = GraphicsMode.DirectX;
break;
default:
GlobalVars.GraphicsMode = GraphicsMode.OpenGL;
break;
}
}
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox2.SelectedIndex == 0)
switch (comboBox2.SelectedIndex)
{
GlobalVars.QualityLevel = 1;
}
else if (comboBox2.SelectedIndex == 1)
{
GlobalVars.QualityLevel = 2;
}
else if (comboBox2.SelectedIndex == 2)
{
GlobalVars.QualityLevel = 3;
}
else if (comboBox2.SelectedIndex == 3)
{
GlobalVars.QualityLevel = 4;
}
else if (comboBox2.SelectedIndex == 4)
{
GlobalVars.QualityLevel = 5;
case 0:
GlobalVars.QualityLevel = QualityLevel.VeryLow;
break;
case 1:
GlobalVars.QualityLevel = QualityLevel.Low;
break;
case 2:
GlobalVars.QualityLevel = QualityLevel.Medium;
break;
case 3:
GlobalVars.QualityLevel = QualityLevel.High;
break;
case 4:
default:
GlobalVars.QualityLevel = QualityLevel.Ultra;
break;
}
}
@ -1849,20 +1787,5 @@ namespace NovetusLauncher
WriteConfigValues();
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;
DiscordRpc.Initialize(GlobalVars.appid, ref handlers, true, "");
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, "", true);
LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "", true);
}
}
#endregion
@ -218,109 +218,107 @@ namespace NovetusLauncher
async void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage2"])//your specific tabname
{
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
//since we are async, DO THESE first or we'll clear out random stuff.
textBox3.Text = "Loading...";
string IP = await SecurityFuncs.GetExternalIPAddressAsync();
textBox3.Text = "";
string[] lines1 = {
SecurityFuncs.Base64Encode(IP),
SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()),
SecurityFuncs.Base64Encode(GlobalVars.SelectedClient)
};
string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1), true);
string[] lines2 = {
SecurityFuncs.Base64Encode("localhost"),
SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()),
SecurityFuncs.Base64Encode(GlobalVars.SelectedClient)
};
string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2), true);
string[] text = {
"Client: " + GlobalVars.SelectedClient,
"IP: " + IP,
"Port: " + GlobalVars.RobloxPort.ToString(),
"Map: " + GlobalVars.Map,
"Players: " + GlobalVars.PlayerLimit,
"Version: Novetus " + GlobalVars.Version,
"Online URI Link:",
URI,
"Local URI Link:",
URI2,
GlobalVars.IsWebServerOn == true ? "Web Server URL:" : "",
GlobalVars.IsWebServerOn == true ? "http://" + IP + ":" + GlobalVars.WebServer.Port.ToString() : "",
GlobalVars.IsWebServerOn == true ? "Local Web Server URL:" : "",
GlobalVars.IsWebServerOn == true ? GlobalVars.LocalWebServerURI : ""
};
switch (tabControl1.SelectedTab)
{
case TabPage pg2 when pg2 == tabControl1.TabPages["tabPage2"]:
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
//since we are async, DO THESE first or we'll clear out random stuff.
textBox3.Text = "Loading...";
string IP = await SecurityFuncs.GetExternalIPAddressAsync();
textBox3.Text = "";
string[] lines1 = {
SecurityFuncs.Base64Encode(IP),
SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()),
SecurityFuncs.Base64Encode(GlobalVars.SelectedClient)
};
string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1), true);
string[] lines2 = {
SecurityFuncs.Base64Encode("localhost"),
SecurityFuncs.Base64Encode(GlobalVars.RobloxPort.ToString()),
SecurityFuncs.Base64Encode(GlobalVars.SelectedClient)
};
string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2), true);
string[] text = {
"Client: " + GlobalVars.SelectedClient,
"IP: " + IP,
"Port: " + GlobalVars.RobloxPort.ToString(),
"Map: " + GlobalVars.Map,
"Players: " + GlobalVars.PlayerLimit,
"Version: Novetus " + GlobalVars.Version,
"Online URI Link:",
URI,
"Local URI Link:",
URI2,
GlobalVars.IsWebServerOn == true ? "Web Server URL:" : "",
GlobalVars.IsWebServerOn == true ? "http://" + IP + ":" + GlobalVars.WebServer.Port.ToString() : "",
GlobalVars.IsWebServerOn == true ? "Local Web Server URL:" : "",
GlobalVars.IsWebServerOn == true ? GlobalVars.LocalWebServerURI : ""
};
foreach (string str in text)
{
if (!string.IsNullOrWhiteSpace(str))
{
textBox3.AppendText(str);
textBox3.AppendText(Environment.NewLine);
}
}
textBox3.SelectionStart = 0;
textBox3.ScrollToCaret();
}
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage4"])//your specific tabname
{
string mapdir = GlobalVars.MapsDir;
TreeNodeHelper.ListDirectory(treeView1, mapdir, ".rbxl");
TreeNodeHelper.CopyNodes(treeView1.Nodes,_fieldsTreeCache.Nodes);
treeView1.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.Map, treeView1.Nodes);
treeView1.Focus();
textBox3.Text = "";
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
}
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage3"])//your specific tabname
{
string clientdir = GlobalVars.ClientDir;
DirectoryInfo dinfo = new DirectoryInfo(clientdir);
DirectoryInfo[] Dirs = dinfo.GetDirectories();
foreach( DirectoryInfo dir in Dirs )
{
listBox2.Items.Add(dir.Name);
}
listBox2.SelectedItem = GlobalVars.SelectedClient;
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
textBox3.Text = "";
listBox3.Items.Clear();
listBox4.Items.Clear();
}
else if (tabControl1.SelectedTab == tabControl1.TabPages["tabPage6"])//your specific tabname
{
string[] lines_server = File.ReadAllLines(GlobalVars.ConfigDir + "\\servers.txt");
string[] lines_ports = File.ReadAllLines(GlobalVars.ConfigDir + "\\ports.txt");
listBox3.Items.AddRange(lines_server);
listBox4.Items.AddRange(lines_ports);
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
textBox3.Text = "";
listBox2.Items.Clear();
}
else
{
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
textBox3.Text = "";
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
}
foreach (string str in text)
{
if (!string.IsNullOrWhiteSpace(str))
{
textBox3.AppendText(str);
textBox3.AppendText(Environment.NewLine);
}
}
textBox3.SelectionStart = 0;
textBox3.ScrollToCaret();
break;
case TabPage pg4 when pg4 == tabControl1.TabPages["tabPage4"]:
string mapdir = GlobalVars.MapsDir;
TreeNodeHelper.ListDirectory(treeView1, mapdir, ".rbxl");
TreeNodeHelper.CopyNodes(treeView1.Nodes, _fieldsTreeCache.Nodes);
treeView1.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.Map, treeView1.Nodes);
treeView1.Focus();
textBox3.Text = "";
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
break;
case TabPage pg3 when pg3 == tabControl1.TabPages["tabPage3"]:
string clientdir = GlobalVars.ClientDir;
DirectoryInfo dinfo = new DirectoryInfo(clientdir);
DirectoryInfo[] Dirs = dinfo.GetDirectories();
foreach (DirectoryInfo dir in Dirs)
{
listBox2.Items.Add(dir.Name);
}
listBox2.SelectedItem = GlobalVars.SelectedClient;
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
textBox3.Text = "";
listBox3.Items.Clear();
listBox4.Items.Clear();
break;
case TabPage pg6 when pg6 == tabControl1.TabPages["tabPage6"]:
string[] lines_server = File.ReadAllLines(GlobalVars.ConfigDir + "\\servers.txt");
string[] lines_ports = File.ReadAllLines(GlobalVars.ConfigDir + "\\ports.txt");
listBox3.Items.AddRange(lines_server);
listBox4.Items.AddRange(lines_ports);
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
textBox3.Text = "";
listBox2.Items.Clear();
break;
default:
treeView1.Nodes.Clear();
_fieldsTreeCache.Nodes.Clear();
textBox4.Text = "";
textBox3.Text = "";
listBox2.Items.Clear();
listBox3.Items.Clear();
listBox4.Items.Clear();
break;
}
}
void Button1Click(object sender, EventArgs e)
@ -515,21 +513,10 @@ namespace NovetusLauncher
label28.Text = GlobalVars.Map;
treeView1.SelectedNode = TreeNodeHelper.SearchTreeView(GlobalVars.Map, treeView1.Nodes);
treeView1.Focus();
//GlobalVars.Map = treeView1.SelectedNode.Text.ToString();
// GlobalVars.MapPath = treeView1.SelectedNode.FullPath.ToString().Replace(@"\", @"\\");
numericUpDown1.Value = Convert.ToDecimal(GlobalVars.RobloxPort);
numericUpDown2.Value = Convert.ToDecimal(GlobalVars.RobloxPort);
label37.Text = GlobalVars.IP;
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;
ConsolePrint("Config loaded.", 3);
@ -563,30 +550,32 @@ namespace NovetusLauncher
{
LauncherFuncs.ReadClientValues(clientpath);
if (GlobalVars.SelectedClientInfo.UsesPlayerName == true)
{
textBox2.Enabled = true;
}
else if (GlobalVars.SelectedClientInfo.UsesPlayerName == false)
{
textBox2.Enabled = false;
switch (GlobalVars.SelectedClientInfo.UsesPlayerName)
{
case true:
textBox2.Enabled = true;
break;
case false:
textBox2.Enabled = false;
break;
}
if (GlobalVars.SelectedClientInfo.UsesID == true)
switch (GlobalVars.SelectedClientInfo.UsesID)
{
textBox5.Enabled = true;
button4.Enabled = true;
if (GlobalVars.IP.Equals("localhost"))
{
checkBox3.Enabled = true;
}
}
else if (GlobalVars.SelectedClientInfo.UsesID == false)
{
textBox5.Enabled = false;
button4.Enabled = false;
checkBox3.Enabled = false;
GlobalVars.LocalPlayMode = false;
case true:
textBox5.Enabled = true;
button4.Enabled = true;
if (GlobalVars.IP.Equals("localhost"))
{
checkBox3.Enabled = true;
}
break;
case false:
textBox5.Enabled = false;
button4.Enabled = false;
checkBox3.Enabled = false;
GlobalVars.LocalPlayMode = false;
break;
}
if (!string.IsNullOrWhiteSpace(GlobalVars.SelectedClientInfo.Warning))
@ -624,19 +613,12 @@ namespace NovetusLauncher
GlobalVars.LocalPlayMode = false;
label37.Text = GlobalVars.IP;
}
void CheckBox1CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked == true)
{
GlobalVars.CloseOnLaunch = true;
}
else if (checkBox1.Checked == false)
{
GlobalVars.CloseOnLaunch = false;
}
GlobalVars.CloseOnLaunch = checkBox1.Checked;
}
void Button4Click(object sender, EventArgs e)
{
GeneratePlayerID();
@ -657,21 +639,14 @@ namespace NovetusLauncher
{
GlobalVars.SelectedClient = listBox2.SelectedItem.ToString();
ReadClientValues(GlobalVars.SelectedClient);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, "");
LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
}
void CheckBox3CheckedChanged(object sender, EventArgs e)
{
if (checkBox3.Checked == true)
{
GlobalVars.LocalPlayMode = true;
}
else if (checkBox3.Checked == false)
{
GlobalVars.LocalPlayMode = false;
}
GlobalVars.LocalPlayMode = checkBox3.Checked;
}
void TextBox5TextChanged(object sender, EventArgs e)
{
int parsedValue;
@ -823,43 +798,42 @@ namespace NovetusLauncher
WriteConfigValues();
ReadConfigValues();
}
void ConsolePrint(string text, int type)
{
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.
void StartClient()
{
string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Client);
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Client);
string quote = "\"";
string args = "";
@ -867,11 +841,11 @@ namespace NovetusLauncher
{
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
{
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Client);
ScriptGenerator.GenerateScriptForClient(ScriptType.Client);
args = "-script " + quote + luafile + quote;
}
}
@ -931,13 +905,13 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ClientExited);
client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Client, GlobalVars.Map);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InMPGame, GlobalVars.Map);
SecurityFuncs.RenameWindow(client, ScriptType.Client, GlobalVars.Map);
LauncherFuncs.UpdateRichPresence(LauncherState.InMPGame, GlobalVars.Map);
}
void ClientExited(object sender, EventArgs e)
{
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, "");
LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
if (GlobalVars.CloseOnLaunch == true)
{
Visible = true;
@ -954,7 +928,7 @@ namespace NovetusLauncher
void EasterEggExited(object sender, EventArgs e)
{
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, "");
LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
label12.Text = LocalVars.prevsplash;
if (GlobalVars.CloseOnLaunch == true)
{
@ -965,7 +939,7 @@ namespace NovetusLauncher
void StartSolo()
{
string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Solo);
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Solo);
string mapfile = GlobalVars.MapPath;
string quote = "\"";
string args = "";
@ -973,11 +947,11 @@ namespace NovetusLauncher
{
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
{
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Solo);
ScriptGenerator.GenerateScriptForClient(ScriptType.Solo);
args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote;
}
}
@ -996,8 +970,8 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ClientExited);
client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Solo, GlobalVars.Map);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InSoloGame, GlobalVars.Map);
SecurityFuncs.RenameWindow(client, ScriptType.Solo, GlobalVars.Map);
LauncherFuncs.UpdateRichPresence(LauncherState.InSoloGame, GlobalVars.Map);
}
catch (Exception ex) when (!Env.Debugging)
{
@ -1009,7 +983,7 @@ namespace NovetusLauncher
void StartServer(bool no3d)
{
string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Server);
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Server);
string mapfile = GlobalVars.MapPath;
string quote = "\"";
string args = "";
@ -1017,11 +991,11 @@ namespace NovetusLauncher
{
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
{
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Server);
ScriptGenerator.GenerateScriptForClient(ScriptType.Server);
args = "-script " + quote + luafile + quote + (no3d ? " -no3d" : "") + " " + quote + mapfile + quote;
}
}
@ -1048,7 +1022,7 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ServerExited);
client.Start();
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)
{
@ -1060,7 +1034,7 @@ namespace NovetusLauncher
void StartStudio(bool nomap)
{
string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.Studio);
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Studio);
string mapfile = (nomap ? "" : GlobalVars.MapPath);
string mapname = (nomap ? "" : GlobalVars.Map);
string quote = "\"";
@ -1069,11 +1043,11 @@ namespace NovetusLauncher
{
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
{
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Studio);
ScriptGenerator.GenerateScriptForClient(ScriptType.Studio);
args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote;
}
}
@ -1092,8 +1066,8 @@ namespace NovetusLauncher
client.Exited += new EventHandler(ClientExited);
client.Start();
client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.Studio, mapname);
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InStudio, mapname);
SecurityFuncs.RenameWindow(client, ScriptType.Studio, mapname);
LauncherFuncs.UpdateRichPresence(LauncherState.InStudio, mapname);
}
catch (Exception ex) when (!Env.Debugging)
{
@ -1106,7 +1080,7 @@ namespace NovetusLauncher
{
label12.Text = "<3";
string luafile = LauncherFuncs.GetLuaFileName();
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptGenerator.ScriptType.EasterEgg);
string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.EasterEgg);
string mapfile = GlobalVars.ConfigDirData + "\\Appreciation.rbxl";
string quote = "\"";
string args = "";
@ -1114,11 +1088,11 @@ namespace NovetusLauncher
{
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
{
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.EasterEgg);
ScriptGenerator.GenerateScriptForClient(ScriptType.EasterEgg);
args = "-script " + quote + luafile + quote + " " + quote + mapfile + quote;
}
}
@ -1137,8 +1111,8 @@ namespace NovetusLauncher
client.Start();
client.Exited += new EventHandler(EasterEggExited);
client.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(client, ScriptGenerator.ScriptType.EasterEgg, "");
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InEasterEggGame, "");
SecurityFuncs.RenameWindow(client, ScriptType.EasterEgg, "");
LauncherFuncs.UpdateRichPresence(LauncherState.InEasterEggGame, "");
}
catch (Exception ex) when (!Env.Debugging)
{
@ -1568,16 +1542,7 @@ namespace NovetusLauncher
void CheckBox4CheckedChanged(object sender, EventArgs e)
{
if (checkBox4.Checked == true)
{
GlobalVars.UPnP = true;
//checkBox8.Checked = false;
}
else if (checkBox4.Checked == false)
{
GlobalVars.UPnP = false;
//checkBox8.Checked = GlobalVars.UDP;
}
GlobalVars.UPnP = checkBox4.Checked;
}
void CheckBox4Click(object sender, EventArgs e)
@ -1644,21 +1609,13 @@ namespace NovetusLauncher
}
}
private void checkBox2_CheckedChanged(object sender, EventArgs e)
{
if (checkBox2.Checked == true && GlobalVars.DiscordPresence == false)
{
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 checkBox2_CheckedChanged(object sender, EventArgs e)
{
checkBox2.Checked = GlobalVars.DiscordPresence;
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;
}
@ -1703,42 +1660,40 @@ namespace NovetusLauncher
LoadLauncher();
}
private void label8_Click(object sender, EventArgs e)
{
if (LocalVars.Clicks < 10)
{
LocalVars.Clicks += 1;
private void label8_Click(object sender, EventArgs e)
{
if (LocalVars.Clicks < 10)
{
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();
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;
}
}
}
}
if (GlobalVars.CloseOnLaunch == true)
{
Visible = false;
}
break;
default:
break;
}
}
}
void SettingsButtonClick(object sender, EventArgs e)
{
@ -1773,20 +1728,5 @@ namespace NovetusLauncher
WriteConfigValues();
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;
checkBox6.Checked = GlobalVars.ReShadeFPSDisplay;
checkBox7.Checked = GlobalVars.ReShadePerformanceMode;
if (GlobalVars.GraphicsMode == 1)
switch (GlobalVars.GraphicsMode)
{
comboBox1.SelectedIndex = 0;
}
else if (GlobalVars.GraphicsMode == 2)
{
comboBox1.SelectedIndex = 1;
case GraphicsMode.DirectX:
comboBox1.SelectedIndex = 1;
break;
case GraphicsMode.OpenGL:
default:
comboBox1.SelectedIndex = 0;
break;
}
if (GlobalVars.QualityLevel == 1)
switch (GlobalVars.QualityLevel)
{
comboBox2.SelectedIndex = 0;
}
else if (GlobalVars.QualityLevel == 2)
{
comboBox2.SelectedIndex = 1;
}
else if (GlobalVars.QualityLevel == 3)
{
comboBox2.SelectedIndex = 2;
}
else if (GlobalVars.QualityLevel == 4)
{
comboBox2.SelectedIndex = 3;
}
else if (GlobalVars.QualityLevel == 5)
{
comboBox2.SelectedIndex = 4;
case QualityLevel.VeryLow:
comboBox2.SelectedIndex = 0;
break;
case QualityLevel.Low:
comboBox2.SelectedIndex = 1;
break;
case QualityLevel.Medium:
comboBox2.SelectedIndex = 2;
break;
case QualityLevel.High:
comboBox2.SelectedIndex = 3;
break;
case QualityLevel.Ultra:
default:
comboBox2.SelectedIndex = 4;
break;
}
}
private void checkBox5_CheckedChanged(object sender, EventArgs e)
{
if (checkBox5.Checked == true)
{
GlobalVars.ReShade = true;
}
else if (checkBox5.Checked == false)
{
GlobalVars.ReShade = false;
}
GlobalVars.ReShade = checkBox5.Checked;
}
private void checkBox6_CheckedChanged(object sender, EventArgs e)
{
if (checkBox6.Checked == true)
{
GlobalVars.ReShadeFPSDisplay = true;
}
else if (checkBox6.Checked == false)
{
GlobalVars.ReShadeFPSDisplay = false;
}
GlobalVars.ReShadeFPSDisplay = checkBox6.Checked;
}
private void checkBox7_CheckedChanged(object sender, EventArgs e)
{
if (checkBox7.Checked == true)
{
GlobalVars.ReShadePerformanceMode = true;
}
else if (checkBox7.Checked == false)
{
GlobalVars.ReShadePerformanceMode = false;
}
GlobalVars.ReShadePerformanceMode = checkBox7.Checked;
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox1.SelectedIndex == 0)
switch (comboBox1.SelectedIndex)
{
GlobalVars.GraphicsMode = 1;
}
else if (comboBox1.SelectedIndex == 1)
{
GlobalVars.GraphicsMode = 2;
case 1:
GlobalVars.GraphicsMode = GraphicsMode.DirectX;
break;
default:
GlobalVars.GraphicsMode = GraphicsMode.OpenGL;
break;
}
}
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
{
if (comboBox2.SelectedIndex == 0)
switch (comboBox2.SelectedIndex)
{
GlobalVars.QualityLevel = 1;
}
else if (comboBox2.SelectedIndex == 1)
{
GlobalVars.QualityLevel = 2;
}
else if (comboBox2.SelectedIndex == 2)
{
GlobalVars.QualityLevel = 3;
}
else if (comboBox2.SelectedIndex == 3)
{
GlobalVars.QualityLevel = 4;
}
else if (comboBox2.SelectedIndex == 4)
{
GlobalVars.QualityLevel = 5;
case 0:
GlobalVars.QualityLevel = QualityLevel.VeryLow;
break;
case 1:
GlobalVars.QualityLevel = QualityLevel.Low;
break;
case 2:
GlobalVars.QualityLevel = QualityLevel.Medium;
break;
case 3:
GlobalVars.QualityLevel = QualityLevel.High;
break;
case 4:
default:
GlobalVars.QualityLevel = QualityLevel.Ultra;
break;
}
}

View File

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

View File

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

View File

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

View File

@ -78,7 +78,7 @@ namespace NovetusURI
handlers.requestCallback += RequestCallback;
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)
{
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
{
ScriptGenerator.GenerateScriptForClient(ScriptGenerator.ScriptType.Client);
ScriptGenerator.GenerateScriptForClient(ScriptType.Client);
args = "-script " + quote + luafile + quote;
}
}
@ -177,14 +177,14 @@ namespace NovetusURI
clientproc.Exited += new EventHandler(ClientExited);
clientproc.Start();
clientproc.PriorityClass = ProcessPriorityClass.RealTime;
SecurityFuncs.RenameWindow(clientproc, ScriptGenerator.ScriptType.Client, "");
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InMPGame, "");
SecurityFuncs.RenameWindow(clientproc, ScriptType.Client, "");
LauncherFuncs.UpdateRichPresence(LauncherState.InMPGame, "");
this.Visible = false;
}
void ClientExited(object sender, EventArgs e)
{
LauncherFuncs.UpdateRichPresence(LauncherFuncs.LauncherState.InLauncher, "");
LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "");
this.Close();
}