diff --git a/Novetus/NovetusCMD/Classes/CommandLineArguments.cs b/Novetus/NovetusCMD/Classes/CommandLineArguments.cs index b925a0a..9c54460 100644 --- a/Novetus/NovetusCMD/Classes/CommandLineArguments.cs +++ b/Novetus/NovetusCMD/Classes/CommandLineArguments.cs @@ -1,11 +1,15 @@ -using System.Collections.Specialized; +#region Usings +using System.Collections.Specialized; using System.Text.RegularExpressions; +#endregion namespace NovetusCMD { + #region CommandLineArguments public class CommandLineArguments { - //credit to GriffonRL on codeproject + //https://www.codeproject.com/Articles/3111/C-NET-Command-Line-Arguments-Parser + #region Arguments /// /// Arguments class /// @@ -102,6 +106,7 @@ namespace NovetusCMD Parameters.Add(Parameter, "true"); } } + #endregion // Retrieve a parameter value if it exists // (overriding C# indexer property) @@ -114,4 +119,5 @@ namespace NovetusCMD } } } + #endregion } diff --git a/Novetus/NovetusCMD/Classes/LocalFuncs.cs b/Novetus/NovetusCMD/Classes/LocalFuncs.cs new file mode 100644 index 0000000..d77397b --- /dev/null +++ b/Novetus/NovetusCMD/Classes/LocalFuncs.cs @@ -0,0 +1,89 @@ +#region Usings +using System; +using System.IO; +#endregion + +namespace NovetusCMD +{ + #region LocalFuncs + public class LocalFuncs + { + public static async void CreateTXT() + { + if (LocalVars.RequestToOutputInfo) + { + string IP = await SecurityFuncs.GetExternalIPAddressAsync(); + string[] lines1 = { + SecurityFuncs.Base64Encode(IP), + SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.RobloxPort.ToString()), + SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.SelectedClient) + }; + string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1, true)); + string[] lines2 = { + SecurityFuncs.Base64Encode("localhost"), + SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.RobloxPort.ToString()), + SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.SelectedClient) + }; + string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2, true)); + + string text = GlobalFuncs.MultiLine( + "Process ID: " + (LocalVars.ProcessID == 0 ? "N/A" : LocalVars.ProcessID.ToString()), + "Don't copy the Process ID when sharing the server.", + "--------------------", + "Server Info:", + "Client: " + GlobalVars.UserConfiguration.SelectedClient, + "IP: " + IP, + "Port: " + GlobalVars.UserConfiguration.RobloxPort.ToString(), + "Map: " + GlobalVars.UserConfiguration.Map, + "Players: " + GlobalVars.UserConfiguration.PlayerLimit, + "Version: Novetus " + GlobalVars.ProgramInformation.Version, + "Online URI Link:", + URI, + "Local URI Link:", + URI2, + GlobalVars.IsWebServerOn ? "Web Server URL:" : "", + GlobalVars.IsWebServerOn ? "http://" + IP + ":" + GlobalVars.WebServer.Port.ToString() : "", + GlobalVars.IsWebServerOn ? "Local Web Server URL:" : "", + GlobalVars.IsWebServerOn ? GlobalVars.LocalWebServerURI : "" + ); + + File.WriteAllText(GlobalPaths.BasePath + "\\" + LocalVars.ServerInfoFileName, GlobalFuncs.RemoveEmptyLines(text)); + ConsolePrint("Server Information sent to file " + GlobalPaths.BasePath + "\\" + LocalVars.ServerInfoFileName, 4); + } + } + + public 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); + } + + public static void ConsoleText(string text, ConsoleColor color) + { + Console.ForegroundColor = color; + Console.Write(text); + } + } + #endregion +} diff --git a/Novetus/NovetusCMD/Novetus.CMD.csproj b/Novetus/NovetusCMD/Novetus.CMD.csproj index 9f1c55f..ac2109b 100644 --- a/Novetus/NovetusCMD/Novetus.CMD.csproj +++ b/Novetus/NovetusCMD/Novetus.CMD.csproj @@ -122,9 +122,10 @@ + - + diff --git a/Novetus/NovetusCMD/NovetusCMD.cs b/Novetus/NovetusCMD/NovetusCMD.cs new file mode 100644 index 0000000..1ea2387 --- /dev/null +++ b/Novetus/NovetusCMD/NovetusCMD.cs @@ -0,0 +1,412 @@ +#region Usings +using System; +using Mono.Nat; +using System.Diagnostics; +using System.IO; +#endregion + +namespace NovetusCMD +{ + #region Novetus CMD Main Class + public static class NovetusCMD + { + #region UPnP + public static void InitUPnP() + { + if (GlobalVars.UserConfiguration.UPnP) + { + try + { + NetFuncs.InitUPnP(DeviceFound,DeviceLost); + LocalFuncs.ConsolePrint("UPnP: Service initialized", 3); + } + catch (Exception ex) + { + LocalFuncs.ConsolePrint("UPnP: Unable to initialize NetFuncs. Reason - " + ex.Message, 2); + } + } + } + + public static void StartUPnP(INatDevice device, Protocol protocol, int port) + { + if (GlobalVars.UserConfiguration.UPnP) + { + try + { + NetFuncs.StartUPnP(device,protocol,port); + LocalFuncs.ConsolePrint("UPnP: Port " + port + " opened on '" + device.GetExternalIP() + "' (" + protocol.ToString() + ")", 3); + } + catch (Exception ex) + { + LocalFuncs.ConsolePrint("UPnP: Unable to open port mapping. Reason - " + ex.Message, 2); + } + } + } + + public static void StopUPnP(INatDevice device, Protocol protocol, int port) + { + if (GlobalVars.UserConfiguration.UPnP) + { + try + { + NetFuncs.StopUPnP(device,protocol,port); + LocalFuncs.ConsolePrint("UPnP: Port " + port + " closed on '" + device.GetExternalIP() + "' (" + protocol.ToString() + ")", 3); + } + catch (Exception ex) + { + LocalFuncs.ConsolePrint("UPnP: Unable to close port mapping. Reason - " + ex.Message, 2); + } + } + } + + private static void DeviceFound(object sender, DeviceEventArgs args) + { + try + { + INatDevice device = args.Device; + LocalFuncs.ConsolePrint("UPnP: Device '" + device.GetExternalIP() + "' registered.", 3); + StartUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort); + StartUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort); + StartUPnP(device, Protocol.Udp, GlobalVars.WebServerPort); + StartUPnP(device, Protocol.Tcp, GlobalVars.WebServerPort); + } + catch (Exception ex) + { + LocalFuncs.ConsolePrint("UPnP: Unable to register device. Reason - " + ex.Message, 2); + } + } + + private static void DeviceLost(object sender, DeviceEventArgs args) + { + try + { + INatDevice device = args.Device; + LocalFuncs.ConsolePrint("UPnP: Device '" + device.GetExternalIP() + "' disconnected.", 3); + StopUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort); + StopUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort); + StopUPnP(device, Protocol.Udp, GlobalVars.WebServerPort); + StopUPnP(device, Protocol.Tcp, GlobalVars.WebServerPort); + } + catch (Exception ex) + { + LocalFuncs.ConsolePrint("UPnP: Unable to disconnect device. Reason - " + ex.Message, 2); + } + } + #endregion + + #region Web Server + static void StartWebServer() + { + if (SecurityFuncs.IsElevated) + { + try + { + GlobalVars.WebServer = new SimpleHTTPServer(GlobalPaths.ServerDir, GlobalVars.WebServerPort); + LocalFuncs.ConsolePrint("WebServer: Server is running on port: " + GlobalVars.WebServer.Port.ToString(), 3); + } + catch (Exception ex) + { + LocalFuncs.ConsolePrint("WebServer: Failed to launch WebServer. Some features may not function. (" + ex.Message + ")", 2); + } + } + else + { + LocalFuncs.ConsolePrint("WebServer: Failed to launch WebServer. Some features may not function. (Did not run as Administrator)", 2); + } + } + + static void StopWebServer() + { + if (SecurityFuncs.IsElevated) + { + try + { + LocalFuncs.ConsolePrint("WebServer: Server has stopped on port: " + GlobalVars.WebServer.Port.ToString(), 2); + GlobalVars.WebServer.Stop(); + } + catch (Exception ex) + { + LocalFuncs.ConsolePrint("WebServer: Failed to stop WebServer. Some features may not function. (" + ex.Message + ")", 2); + } + } + else + { + LocalFuncs.ConsolePrint("WebServer: Failed to stop WebServer. Some features may not function. (Did not run as Administrator)", 2); + } + } + #endregion + + #region Loading/Saving files + static void WriteConfigValues() + { + GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); + LocalFuncs.ConsolePrint("Config Saved.", 3); + } + + static void ReadConfigValues() + { + GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); + LocalFuncs.ConsolePrint("Config loaded.", 3); + ReadClientValues(GlobalVars.UserConfiguration.SelectedClient); + } + + static void ReadClientValues(string ClientName) + { + string clientpath = GlobalPaths.ClientDir + @"\\" + ClientName + @"\\clientinfo.nov"; + + if (!File.Exists(clientpath)) + { + LocalFuncs.ConsolePrint("ERROR - No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available.", 2); + GlobalVars.UserConfiguration.SelectedClient = GlobalVars.ProgramInformation.DefaultClient; + ReadClientValues(ClientName); + } + else + { + GlobalFuncs.ReadClientValues(clientpath); + LocalFuncs.ConsolePrint("Client '" + GlobalVars.UserConfiguration.SelectedClient + "' successfully loaded.", 3); + } + } + #endregion + + #region Main Program Function + public static void Main(string[] args) + { + GlobalFuncs.ReadInfoFile(GlobalPaths.ConfigDir + "\\" + GlobalPaths.InfoName, true); + Console.Title = "Novetus " + GlobalVars.ProgramInformation.Version + " CMD"; + + LocalFuncs.ConsolePrint("NovetusCMD version " + GlobalVars.ProgramInformation.Version + " loaded.", 1); + LocalFuncs.ConsolePrint("Novetus path: " + GlobalPaths.BasePath, 1); + + if (args.Length == 0) + { + LocalFuncs.ConsolePrint("Help: Command Line Arguments", 3); + LocalFuncs.ConsolePrint("---------", 1); + LocalFuncs.ConsolePrint("General", 3); + LocalFuncs.ConsolePrint("-no3d | Launches server in NoGraphics mode", 4); + LocalFuncs.ConsolePrint("-script | Loads an additional server script.", 4); + LocalFuncs.ConsolePrint("-outputinfo | Outputs all information about the running server to a text file.", 4); + LocalFuncs.ConsolePrint("-overrideconfig | Override the launcher settings.", 4); + LocalFuncs.ConsolePrint("-debug | Disables launching of the server for debugging purposes.", 4); + LocalFuncs.ConsolePrint("-nowebserver | Disables launching of the web server.", 4); + LocalFuncs.ConsolePrint("---------", 1); + LocalFuncs.ConsolePrint("Custom server options", 3); + LocalFuncs.ConsolePrint("-overrideconfig must be added in order for the below commands to function.", 5); + LocalFuncs.ConsolePrint("-upnp | Turns on NetFuncs.", 4); + LocalFuncs.ConsolePrint("-map | Sets the map.", 4); + LocalFuncs.ConsolePrint("-client | Sets the client.", 4); + LocalFuncs.ConsolePrint("-port | Sets the server port.", 4); + LocalFuncs.ConsolePrint("-maxplayers | Sets the number of players.", 4); + LocalFuncs.ConsolePrint("---------", 1); + } + else + { + CommandLineArguments.Arguments CommandLine = new CommandLineArguments.Arguments(args); + + if (CommandLine["no3d"] != null) + { + LocalVars.StartInNo3D = true; + LocalFuncs.ConsolePrint("NovetusCMD will now launch the server in No3D mode.", 4); + } + + if (CommandLine["overrideconfig"] != null) + { + LocalVars.OverrideINI = true; + LocalFuncs.ConsolePrint("NovetusCMD will no longer grab values from the INI file.", 4); + + if (CommandLine["upnp"] != null) + { + GlobalVars.UserConfiguration.UPnP = true; + LocalFuncs.ConsolePrint("NovetusCMD will now use UPnP for port forwarding.", 4); + } + + if (CommandLine["map"] != null) + { + GlobalVars.UserConfiguration.MapPath = CommandLine["map"]; + } + else + { + LocalFuncs.ConsolePrint("NovetusCMD will launch the server with the default map.", 4); + } + + if (CommandLine["client"] != null) + { + GlobalVars.UserConfiguration.SelectedClient = CommandLine["client"]; + } + else + { + LocalFuncs.ConsolePrint("NovetusCMD will launch the server with the default client.", 4); + } + + if (CommandLine["port"] != null) + { + GlobalVars.UserConfiguration.RobloxPort = Convert.ToInt32(CommandLine["port"]); + } + + if (CommandLine["maxplayers"] != null) + { + GlobalVars.UserConfiguration.PlayerLimit = Convert.ToInt32(CommandLine["maxplayers"]); + } + } + + if (CommandLine["outputinfo"] != null) + { + LocalVars.RequestToOutputInfo = true; + } + + if (CommandLine["debug"] != null) + { + LocalVars.DebugMode = true; + } + + if (CommandLine["nowebserver"] != null) + { + LocalVars.NoWebServer = true; + } + + if (CommandLine["script"] != null) + { + if (CommandLine["script"].Contains("rbxasset:") || CommandLine["script"].Contains("http:")) + { + GlobalPaths.AddonScriptPath = CommandLine["script"].Replace(@"\", @"\\"); + LocalFuncs.ConsolePrint("NovetusCMD detected a custom script. Loading " + GlobalPaths.AddonScriptPath, 4); + } + else + { + LocalFuncs.ConsolePrint("NovetusCMD cannot load '" + CommandLine["script"] + "' as it doesn't use a rbxasset path or URL.", 2); + } + } + } + + if (!LocalVars.OverrideINI) + { + LocalFuncs.ConsolePrint("NovetusCMD is now loading all server configurations from the INI file.", 5); + + if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName)) + { + LocalFuncs.ConsolePrint("WARNING 2 - " + GlobalPaths.ConfigName + " not found. Creating one with default values.", 5); + WriteConfigValues(); + } + + ReadConfigValues(); + } + else + { + ReadClientValues(GlobalVars.UserConfiguration.SelectedClient); + } + + InitUPnP(); + + if (!LocalVars.NoWebServer) + { + StartWebServer(); + } + + AppDomain.CurrentDomain.ProcessExit += new EventHandler(ProgramClose); + + LocalFuncs.ConsolePrint("Launching a " + GlobalVars.UserConfiguration.SelectedClient + " server on " + GlobalVars.UserConfiguration.Map + " with " + GlobalVars.UserConfiguration.PlayerLimit + " players.", 1); + + if (!LocalVars.DebugMode) + { + StartServer(LocalVars.StartInNo3D); + } + else + { + LocalFuncs.CreateTXT(); + } + Console.ReadKey(); + } + + static void ProgramClose(object sender, EventArgs e) + { + WriteConfigValues(); + if (GlobalVars.IsWebServerOn) + { + StopWebServer(); + } + if (LocalVars.ProcessID != 0) + { + if (GlobalFuncs.ProcessExists(LocalVars.ProcessID)) + { + Process proc = Process.GetProcessById(LocalVars.ProcessID); + proc.Kill(); + } + } + } + #endregion + + #region Client Loading (TODO MAKE THIS METHOD GLOBAL) + static void StartServer(bool no3d) + { + string luafile = ""; + if (!GlobalVars.SelectedClientInfo.Fix2007) + { + luafile = "rbxasset://scripts\\\\" + GlobalPaths.ScriptName + ".lua"; + } + else + { + luafile = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\scripts\\" + GlobalPaths.ScriptGenName + ".lua"; + } + string mapfile = GlobalVars.UserConfiguration.MapPath; + string rbxexe = ""; + if (GlobalVars.SelectedClientInfo.LegacyMode) + { + rbxexe = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\RobloxApp.exe"; + } + else + { + rbxexe = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\RobloxApp_server.exe"; + } + string quote = "\""; + string args = ""; + if (GlobalVars.SelectedClientInfo.CommandLineArgs.Equals("%args%")) + { + if (!GlobalVars.SelectedClientInfo.Fix2007) + { + args = quote + mapfile + "\" -script \"" + GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Server) + "; " + (!string.IsNullOrWhiteSpace(GlobalPaths.AddonScriptPath) ? "dofile('" + GlobalPaths.AddonScriptPath + "');" : "") + quote + (no3d ? " -no3d" : ""); + } + else + { + ScriptFuncs.Generator.GenerateScriptForClient(ScriptType.Server); + args = "-script " + quote + luafile + quote + (no3d ? " -no3d" : "") + " " + quote + mapfile + quote; + } + } + else + { + if (!no3d) + { + args = ScriptFuncs.ClientScript.CompileScript(GlobalVars.SelectedClientInfo.CommandLineArgs, "", "", mapfile, luafile, rbxexe); + } + else + { + args = ScriptFuncs.ClientScript.CompileScript(GlobalVars.SelectedClientInfo.CommandLineArgs, "", "", mapfile, luafile, rbxexe); + } + } + try + { + LocalFuncs.ConsolePrint("Server Loaded.", 4); + Process client = new Process(); + client.StartInfo.FileName = rbxexe; + client.StartInfo.Arguments = args; + client.EnableRaisingEvents = true; + ReadClientValues(GlobalVars.UserConfiguration.SelectedClient); + client.Exited += new EventHandler(ServerExited); + client.Start(); + client.PriorityClass = ProcessPriorityClass.RealTime; + SecurityFuncs.RenameWindow(client, ScriptType.Server, GlobalVars.UserConfiguration.Map); + LocalVars.ProcessID = client.Id; + LocalFuncs.CreateTXT(); + } + catch (Exception ex) + { + LocalFuncs.ConsolePrint("ERROR - Failed to launch Novetus. (" + ex.Message + ")", 2); + } + } + + static void ServerExited(object sender, EventArgs e) + { + Environment.Exit(0); + } + #endregion + } + #endregion +} \ No newline at end of file diff --git a/Novetus/NovetusCMD/Program.cs b/Novetus/NovetusCMD/Program.cs deleted file mode 100644 index bbbb2cc..0000000 --- a/Novetus/NovetusCMD/Program.cs +++ /dev/null @@ -1,489 +0,0 @@ -/* - * Created by SharpDevelop. - * User: Bitl - * Date: 6/15/2019 - * Time: 5:10 PM - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ -using System; -using Mono.Nat; -using System.Diagnostics; -using System.IO; -using static NovetusCMD.CommandLineArguments; - -namespace NovetusCMD -{ - public static class Program - { - public static void InitUPnP() - { - if (GlobalVars.UserConfiguration.UPnP) - { - try - { - NetFuncs.InitUPnP(DeviceFound,DeviceLost); - ConsolePrint("UPnP: Service initialized", 3); - } - catch (Exception ex) - { - ConsolePrint("UPnP: Unable to initialize NetFuncs. Reason - " + ex.Message, 2); - } - } - } - - public static void StartUPnP(INatDevice device, Protocol protocol, int port) - { - if (GlobalVars.UserConfiguration.UPnP) - { - try - { - NetFuncs.StartUPnP(device,protocol,port); - ConsolePrint("UPnP: Port " + port + " opened on '" + device.GetExternalIP() + "' (" + protocol.ToString() + ")", 3); - } - catch (Exception ex) - { - ConsolePrint("UPnP: Unable to open port mapping. Reason - " + ex.Message, 2); - } - } - } - - public static void StopUPnP(INatDevice device, Protocol protocol, int port) - { - if (GlobalVars.UserConfiguration.UPnP) - { - try - { - NetFuncs.StopUPnP(device,protocol,port); - ConsolePrint("UPnP: Port " + port + " closed on '" + device.GetExternalIP() + "' (" + protocol.ToString() + ")", 3); - } - catch (Exception ex) - { - ConsolePrint("UPnP: Unable to close port mapping. Reason - " + ex.Message, 2); - } - } - } - - private static void DeviceFound(object sender, DeviceEventArgs args) - { - try - { - INatDevice device = args.Device; - ConsolePrint("UPnP: Device '" + device.GetExternalIP() + "' registered.", 3); - StartUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort); - StartUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort); - StartUPnP(device, Protocol.Udp, GlobalVars.WebServerPort); - StartUPnP(device, Protocol.Tcp, GlobalVars.WebServerPort); - } - catch (Exception ex) - { - ConsolePrint("UPnP: Unable to register device. Reason - " + ex.Message, 2); - } - } - - private static void DeviceLost(object sender, DeviceEventArgs args) - { - try - { - INatDevice device = args.Device; - ConsolePrint("UPnP: Device '" + device.GetExternalIP() + "' disconnected.", 3); - StopUPnP(device, Protocol.Udp, GlobalVars.UserConfiguration.RobloxPort); - StopUPnP(device, Protocol.Tcp, GlobalVars.UserConfiguration.RobloxPort); - StopUPnP(device, Protocol.Udp, GlobalVars.WebServerPort); - StopUPnP(device, Protocol.Tcp, GlobalVars.WebServerPort); - } - catch (Exception ex) - { - ConsolePrint("UPnP: Unable to disconnect device. Reason - " + ex.Message, 2); - } - } - - static void StartWebServer() - { - if (SecurityFuncs.IsElevated) - { - try - { - GlobalVars.WebServer = new SimpleHTTPServer(GlobalPaths.ServerDir, GlobalVars.WebServerPort); - ConsolePrint("WebServer: Server is running on port: " + GlobalVars.WebServer.Port.ToString(), 3); - } - catch (Exception ex) - { - ConsolePrint("WebServer: Failed to launch WebServer. Some features may not function. (" + ex.Message + ")", 2); - } - } - else - { - ConsolePrint("WebServer: Failed to launch WebServer. Some features may not function. (Did not run as Administrator)", 2); - } - } - - static void StopWebServer() - { - if (SecurityFuncs.IsElevated) - { - try - { - ConsolePrint("WebServer: Server has stopped on port: " + GlobalVars.WebServer.Port.ToString(), 2); - GlobalVars.WebServer.Stop(); - } - catch (Exception ex) - { - ConsolePrint("WebServer: Failed to stop WebServer. Some features may not function. (" + ex.Message + ")", 2); - } - } - else - { - ConsolePrint("WebServer: Failed to stop WebServer. Some features may not function. (Did not run as Administrator)", 2); - } - } - - static void WriteConfigValues() - { - LauncherFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName, true); - ConsolePrint("Config Saved.", 3); - } - - static void ProgramClose(object sender, EventArgs e) - { - WriteConfigValues(); - if (GlobalVars.IsWebServerOn) - { - StopWebServer(); - } - if (LocalVars.ProcessID != 0) - { - if (GlobalVars.ProcessExists(LocalVars.ProcessID)) - { - Process proc = Process.GetProcessById(LocalVars.ProcessID); - proc.Kill(); - } - } - } - - static void ReadConfigValues() - { - LauncherFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName, false); - ConsolePrint("Config loaded.", 3); - ReadClientValues(GlobalVars.UserConfiguration.SelectedClient); - } - - static void ReadClientValues(string ClientName) - { - string clientpath = GlobalPaths.ClientDir + @"\\" + ClientName + @"\\clientinfo.nov"; - - if (!File.Exists(clientpath)) - { - ConsolePrint("ERROR - No clientinfo.nov detected with the client you chose. The client either cannot be loaded, or it is not available.", 2); - GlobalVars.UserConfiguration.SelectedClient = GlobalVars.ProgramInformation.DefaultClient; - ReadClientValues(ClientName); - } - else - { - LauncherFuncs.ReadClientValues(clientpath); - ConsolePrint("Client '" + GlobalVars.UserConfiguration.SelectedClient + "' successfully loaded.", 3); - } - } - - static string ProcessInput(string s) - { - return s; - } - - public static void Main(string[] args) - { - LauncherFuncs.ReadInfoFile(GlobalPaths.ConfigDir + "\\" + GlobalVars.InfoName, true); - Console.Title = "Novetus " + GlobalVars.ProgramInformation.Version + " CMD"; - - ConsolePrint("NovetusCMD version " + GlobalVars.ProgramInformation.Version + " loaded.", 1); - ConsolePrint("Novetus path: " + GlobalPaths.BasePath, 1); - - if (args.Length == 0) - { - ConsolePrint("Help: Command Line Arguments", 3); - ConsolePrint("---------", 1); - ConsolePrint("General", 3); - ConsolePrint("-no3d | Launches server in NoGraphics mode", 4); - ConsolePrint("-script | Loads an additional server script.", 4); - ConsolePrint("-outputinfo | Outputs all information about the running server to a text file.", 4); - ConsolePrint("-overrideconfig | Override the launcher settings.", 4); - ConsolePrint("-debug | Disables launching of the server for debugging purposes.", 4); - ConsolePrint("-nowebserver | Disables launching of the web server.", 4); - ConsolePrint("---------", 1); - ConsolePrint("Custom server options", 3); - ConsolePrint("-overrideconfig must be added in order for the below commands to function.", 5); - ConsolePrint("-upnp | Turns on NetFuncs.", 4); - ConsolePrint("-map | Sets the map.", 4); - ConsolePrint("-client | Sets the client.", 4); - ConsolePrint("-port | Sets the server port.", 4); - ConsolePrint("-maxplayers | Sets the number of players.", 4); - ConsolePrint("---------", 1); - } - else - { - Arguments CommandLine = new Arguments(args); - - if (CommandLine["no3d"] != null) - { - LocalVars.StartInNo3D = true; - ConsolePrint("NovetusCMD will now launch the server in No3D mode.", 4); - } - - if (CommandLine["overrideconfig"] != null) - { - LocalVars.OverrideINI = true; - ConsolePrint("NovetusCMD will no longer grab values from the INI file.", 4); - - if (CommandLine["upnp"] != null) - { - GlobalVars.UserConfiguration.UPnP = true; - ConsolePrint("NovetusCMD will now use UPnP for port forwarding.", 4); - } - - if (CommandLine["map"] != null) - { - GlobalVars.UserConfiguration.MapPath = CommandLine["map"]; - } - else - { - ConsolePrint("NovetusCMD will launch the server with the default map.", 4); - } - - if (CommandLine["client"] != null) - { - GlobalVars.UserConfiguration.SelectedClient = CommandLine["client"]; - } - else - { - ConsolePrint("NovetusCMD will launch the server with the default client.", 4); - } - - if (CommandLine["port"] != null) - { - GlobalVars.UserConfiguration.RobloxPort = Convert.ToInt32(CommandLine["port"]); - } - - if (CommandLine["maxplayers"] != null) - { - GlobalVars.UserConfiguration.PlayerLimit = Convert.ToInt32(CommandLine["maxplayers"]); - } - } - - if (CommandLine["outputinfo"] != null) - { - LocalVars.RequestToOutputInfo = true; - } - - if (CommandLine["debug"] != null) - { - LocalVars.DebugMode = true; - } - - if (CommandLine["nowebserver"] != null) - { - LocalVars.NoWebServer = true; - } - - if (CommandLine["script"] != null) - { - if (CommandLine["script"].Contains("rbxasset:") || CommandLine["script"].Contains("http:")) - { - GlobalVars.AddonScriptPath = CommandLine["script"].Replace(@"\", @"\\"); - ConsolePrint("NovetusCMD detected a custom script. Loading " + GlobalVars.AddonScriptPath, 4); - } - else - { - ConsolePrint("NovetusCMD cannot load '" + CommandLine["script"] + "' as it doesn't use a rbxasset path or URL.", 2); - } - } - } - - if (!LocalVars.OverrideINI) - { - ConsolePrint("NovetusCMD is now loading all server configurations from the INI file.", 5); - - if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName)) - { - ConsolePrint("WARNING 2 - " + GlobalVars.ConfigName + " not found. Creating one with default values.", 5); - WriteConfigValues(); - } - - ReadConfigValues(); - } - else - { - ReadClientValues(GlobalVars.UserConfiguration.SelectedClient); - } - - InitUPnP(); - - if (!LocalVars.NoWebServer) - { - StartWebServer(); - } - - AppDomain.CurrentDomain.ProcessExit += new EventHandler(ProgramClose); - - ConsolePrint("Launching a " + GlobalVars.UserConfiguration.SelectedClient + " server on " + GlobalVars.UserConfiguration.Map + " with " + GlobalVars.UserConfiguration.PlayerLimit + " players.", 1); - - if (!LocalVars.DebugMode) - { - StartServer(LocalVars.StartInNo3D); - } - else - { - CreateTXT(); - } - Console.ReadKey(); - } - - static void StartServer(bool no3d) - { - string luafile = ""; - if (!GlobalVars.SelectedClientInfo.Fix2007) - { - luafile = "rbxasset://scripts\\\\" + GlobalVars.ScriptName + ".lua"; - } - else - { - luafile = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptGenName + ".lua"; - } - string mapfile = GlobalVars.UserConfiguration.MapPath; - string rbxexe = ""; - if (GlobalVars.SelectedClientInfo.LegacyMode) - { - rbxexe = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\RobloxApp.exe"; - } - else - { - rbxexe = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\RobloxApp_server.exe"; - } - string quote = "\""; - string args = ""; - if (GlobalVars.SelectedClientInfo.CommandLineArgs.Equals("%args%")) - { - if (!GlobalVars.SelectedClientInfo.Fix2007) - { - args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Server) + "; " + (!string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? "dofile('" + GlobalVars.AddonScriptPath + "');" : "") + quote + (no3d ? " -no3d" : ""); - } - else - { - ScriptFuncs.Generator.GenerateScriptForClient(ScriptType.Server); - args = "-script " + quote + luafile + quote + (no3d ? " -no3d" : "") + " " + quote + mapfile + quote; - } - } - else - { - if (!no3d) - { - args = ScriptFuncs.ClientScript.CompileScript(GlobalVars.SelectedClientInfo.CommandLineArgs, "", "", mapfile, luafile, rbxexe); - } - else - { - args = ScriptFuncs.ClientScript.CompileScript(GlobalVars.SelectedClientInfo.CommandLineArgs, "", "", mapfile, luafile, rbxexe); - } - } - try - { - ConsolePrint("Server Loaded.", 4); - Process client = new Process(); - client.StartInfo.FileName = rbxexe; - client.StartInfo.Arguments = args; - client.EnableRaisingEvents = true; - ReadClientValues(GlobalVars.UserConfiguration.SelectedClient); - client.Exited += new EventHandler(ServerExited); - client.Start(); - client.PriorityClass = ProcessPriorityClass.RealTime; - SecurityFuncs.RenameWindow(client, ScriptType.Server, GlobalVars.UserConfiguration.Map); - LocalVars.ProcessID = client.Id; - CreateTXT(); - } - catch (Exception ex) - { - ConsolePrint("ERROR - Failed to launch Novetus. (" + ex.Message + ")", 2); - } - } - - static void ServerExited(object sender, EventArgs e) - { - Environment.Exit(0); - } - - static async void CreateTXT() - { - if (LocalVars.RequestToOutputInfo) - { - string IP = await SecurityFuncs.GetExternalIPAddressAsync(); - string[] lines1 = { - SecurityFuncs.Base64Encode(IP), - SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.RobloxPort.ToString()), - SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.SelectedClient) - }; - string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1, true)); - string[] lines2 = { - SecurityFuncs.Base64Encode("localhost"), - SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.RobloxPort.ToString()), - SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.SelectedClient) - }; - string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2, true)); - - string text = GlobalVars.MultiLine( - "Process ID: " + (LocalVars.ProcessID == 0 ? "N/A" : LocalVars.ProcessID.ToString()), - "Don't copy the Process ID when sharing the server.", - "--------------------", - "Server Info:", - "Client: " + GlobalVars.UserConfiguration.SelectedClient, - "IP: " + IP, - "Port: " + GlobalVars.UserConfiguration.RobloxPort.ToString(), - "Map: " + GlobalVars.UserConfiguration.Map, - "Players: " + GlobalVars.UserConfiguration.PlayerLimit, - "Version: Novetus " + GlobalVars.ProgramInformation.Version, - "Online URI Link:", - URI, - "Local URI Link:", - URI2, - GlobalVars.IsWebServerOn ? "Web Server URL:" : "", - GlobalVars.IsWebServerOn ? "http://" + IP + ":" + GlobalVars.WebServer.Port.ToString() : "", - GlobalVars.IsWebServerOn ? "Local Web Server URL:" : "", - GlobalVars.IsWebServerOn ? GlobalVars.LocalWebServerURI : "" - ); - - File.WriteAllText(GlobalPaths.BasePath + "\\" + LocalVars.ServerInfoFileName, GlobalVars.RemoveEmptyLines(text)); - ConsolePrint("Server Information sent to file " + GlobalPaths.BasePath + "\\" + LocalVars.ServerInfoFileName, 4); - } - } - - 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); - } - } -} \ No newline at end of file diff --git a/Novetus/NovetusCore/LauncherFuncs.cs b/Novetus/NovetusCore/GlobalFuncs.cs similarity index 95% rename from Novetus/NovetusCore/LauncherFuncs.cs rename to Novetus/NovetusCore/GlobalFuncs.cs index 90c7ad9..c47fdf9 100644 --- a/Novetus/NovetusCore/LauncherFuncs.cs +++ b/Novetus/NovetusCore/GlobalFuncs.cs @@ -4,30 +4,16 @@ using System.Diagnostics; using System.Drawing; using System.Drawing.Imaging; using System.IO; +using System.Linq; using System.Reflection; +using System.Text.RegularExpressions; +using System.Threading.Tasks; using System.Windows.Forms; #endregion -#region Launcher State -public enum LauncherState +#region Global Functions +public class GlobalFuncs { - InLauncher = 0, - InMPGame = 1, - InSoloGame = 2, - InStudio = 3, - InCustomization = 4, - InEasterEggGame = 5, - LoadingURI = 6 -} -#endregion - -#region Launcher Functions -public class LauncherFuncs -{ - public LauncherFuncs() - { - } - public static void ReadInfoFile(string infopath, bool cmd = false) { //READ @@ -167,7 +153,7 @@ public class LauncherFuncs if (userid.Equals("0")) { GeneratePlayerID(); - Config(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName, true); + Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); } else { @@ -191,7 +177,7 @@ public class LauncherFuncs if (string.IsNullOrWhiteSpace(SecurityFuncs.Base64Decode(tripcode))) { GenerateTripcode(); - Config(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName, true); + Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); } else { @@ -215,13 +201,13 @@ public class LauncherFuncs } } - if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization)) + if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization)) { - Customization(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization, true); + Customization(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization, true); } else { - Customization(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization, write); + Customization(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization, write); } ReShade(GlobalPaths.ConfigDir, "ReShade.ini", write); @@ -357,7 +343,7 @@ public class LauncherFuncs } } - ReloadLoadtextValue(); + ReloadLoadoutValue(); } public static void ReShadeValues(string cfgpath, bool write, bool setglobals) @@ -582,17 +568,17 @@ public class LauncherFuncs GlobalVars.UserCustomization.RightLegColorString = "Color [A=255, R=164, G=189, B=71]"; GlobalVars.UserCustomization.ExtraSelectionIsHat = false; GlobalVars.UserCustomization.ShowHatsInExtra = false; - ReloadLoadtextValue(); + ReloadLoadoutValue(); } - public static void ReloadLoadtextValue() + public static void ReloadLoadoutValue() { string hat1 = (!GlobalVars.UserCustomization.Hat1.EndsWith("-Solo.rbxm")) ? GlobalVars.UserCustomization.Hat1 : "NoHat.rbxm"; string hat2 = (!GlobalVars.UserCustomization.Hat2.EndsWith("-Solo.rbxm")) ? GlobalVars.UserCustomization.Hat2 : "NoHat.rbxm"; string hat3 = (!GlobalVars.UserCustomization.Hat3.EndsWith("-Solo.rbxm")) ? GlobalVars.UserCustomization.Hat3 : "NoHat.rbxm"; string extra = (!GlobalVars.UserCustomization.Extra.EndsWith("-Solo.rbxm")) ? GlobalVars.UserCustomization.Extra : "NoExtra.rbxm"; - GlobalVars.loadtext = "'" + hat1 + "','" + + GlobalVars.Loadout = "'" + hat1 + "','" + hat2 + "','" + hat3 + "'," + GlobalVars.UserCustomization.HeadColorID + "," + @@ -609,7 +595,7 @@ public class LauncherFuncs GlobalVars.UserCustomization.Icon + "','" + extra + "'"; - GlobalVars.sololoadtext = "'" + GlobalVars.UserCustomization.Hat1 + "','" + + GlobalVars.soloLoadout = "'" + GlobalVars.UserCustomization.Hat1 + "','" + GlobalVars.UserCustomization.Hat2 + "','" + GlobalVars.UserCustomization.Hat3 + "'," + GlobalVars.UserCustomization.HeadColorID + "," + @@ -708,7 +694,7 @@ public class LauncherFuncs return image; } - public static void UpdateRichPresence(LauncherState state, string mapname, bool initial = false) + public static void UpdateRichPresence(GlobalVars.LauncherState state, string mapname, bool initial = false) { if (GlobalVars.UserConfiguration.DiscordPresence) { @@ -722,49 +708,49 @@ public class LauncherFuncs switch (state) { - case LauncherState.InLauncher: + case GlobalVars.LauncherState.InLauncher: GlobalVars.presence.smallImageKey = GlobalVars.image_inlauncher; GlobalVars.presence.state = "In Launcher"; GlobalVars.presence.details = "Selected " + GlobalVars.UserConfiguration.SelectedClient; GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.ProgramInformation.Version; GlobalVars.presence.smallImageText = "In Launcher"; break; - case LauncherState.InMPGame: + case GlobalVars.LauncherState.InMPGame: GlobalVars.presence.smallImageKey = GlobalVars.image_ingame; GlobalVars.presence.details = ValidMapname; GlobalVars.presence.state = "In " + GlobalVars.UserConfiguration.SelectedClient + " Multiplayer Game"; GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.ProgramInformation.Version; GlobalVars.presence.smallImageText = "In " + GlobalVars.UserConfiguration.SelectedClient + " Multiplayer Game"; break; - case LauncherState.InSoloGame: + case GlobalVars.LauncherState.InSoloGame: GlobalVars.presence.smallImageKey = GlobalVars.image_ingame; GlobalVars.presence.details = ValidMapname; GlobalVars.presence.state = "In " + GlobalVars.UserConfiguration.SelectedClient + " Solo Game"; GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.ProgramInformation.Version; GlobalVars.presence.smallImageText = "In " + GlobalVars.UserConfiguration.SelectedClient + " Solo Game"; break; - case LauncherState.InStudio: + case GlobalVars.LauncherState.InStudio: GlobalVars.presence.smallImageKey = GlobalVars.image_instudio; GlobalVars.presence.details = ValidMapname; GlobalVars.presence.state = "In " + GlobalVars.UserConfiguration.SelectedClient + " Studio"; GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.ProgramInformation.Version; GlobalVars.presence.smallImageText = "In " + GlobalVars.UserConfiguration.SelectedClient + " Studio"; break; - case LauncherState.InCustomization: + case GlobalVars.LauncherState.InCustomization: GlobalVars.presence.smallImageKey = GlobalVars.image_incustomization; GlobalVars.presence.details = "Customizing " + GlobalVars.UserConfiguration.PlayerName; GlobalVars.presence.state = "In Character Customization"; GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.ProgramInformation.Version; GlobalVars.presence.smallImageText = "In Character Customization"; break; - case LauncherState.InEasterEggGame: + case GlobalVars.LauncherState.InEasterEggGame: GlobalVars.presence.smallImageKey = GlobalVars.image_ingame; GlobalVars.presence.details = ValidMapname; GlobalVars.presence.state = "Reading a message."; GlobalVars.presence.largeImageText = GlobalVars.UserConfiguration.PlayerName + " | Novetus " + GlobalVars.ProgramInformation.Version; GlobalVars.presence.smallImageText = "Reading a message."; break; - case LauncherState.LoadingURI: + case GlobalVars.LauncherState.LoadingURI: GlobalVars.presence.smallImageKey = GlobalVars.image_ingame; GlobalVars.presence.details = ValidMapname; GlobalVars.presence.state = "Joining a " + GlobalVars.UserConfiguration.SelectedClient + " Multiplayer Game"; @@ -880,11 +866,11 @@ public class LauncherFuncs if (!GlobalVars.SelectedClientInfo.Fix2007) { - luafile = "rbxasset://scripts\\\\" + GlobalVars.ScriptName + ".lua"; + luafile = "rbxasset://scripts\\\\" + GlobalPaths.ScriptName + ".lua"; } else { - luafile = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptGenName + ".lua"; + luafile = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\scripts\\" + GlobalPaths.ScriptGenName + ".lua"; } return luafile; @@ -923,5 +909,26 @@ public class LauncherFuncs return rbxexe; } + + public static string MultiLine(params string[] args) + { + return string.Join(Environment.NewLine, args); + } + + public static string RemoveEmptyLines(string lines) + { + return Regex.Replace(lines, @"^\s*$\n|\r", string.Empty, RegexOptions.Multiline).TrimEnd(); + } + + public static bool ProcessExists(int id) + { + return Process.GetProcesses().Any(x => x.Id == id); + } + + //task.delay is only available on net 4.5....... + public static async void Delay(int miliseconds) + { + await TaskEx.Delay(miliseconds); + } } #endregion diff --git a/Novetus/NovetusCore/GlobalPaths.cs b/Novetus/NovetusCore/GlobalPaths.cs index 3494e43..52fa106 100644 --- a/Novetus/NovetusCore/GlobalPaths.cs +++ b/Novetus/NovetusCore/GlobalPaths.cs @@ -7,6 +7,7 @@ using System.Reflection; public class GlobalPaths { + #region Base Game Paths public static readonly string RootPathLauncher = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); public static readonly string BasePathLauncher = RootPathLauncher.Replace(@"\", @"\\"); public static readonly string RootPath = Directory.GetParent(RootPathLauncher).ToString(); @@ -20,8 +21,9 @@ public class GlobalPaths public static readonly string MapsDirBase = "maps"; public static readonly string BaseGameDir = "rbxasset://../../../"; public static readonly string SharedDataGameDir = BaseGameDir + "shareddata/"; + #endregion - //customization + #region Customization Paths public static readonly string CustomPlayerDir = DataPath + "\\charcustom"; public static readonly string hatdir = CustomPlayerDir + "\\hats"; public static readonly string facedir = CustomPlayerDir + "\\faces"; @@ -40,8 +42,9 @@ public class GlobalPaths public static readonly string shirtGameDir = CharCustomGameDir + "shirts/"; public static readonly string pantsGameDir = CharCustomGameDir + "pants/"; public static readonly string extraGameDir = CharCustomGameDir + "custom/"; + #endregion - //webserver + #region Web Server Paths public static string WebServer_CustomPlayerDir = GlobalVars.WebServerURI + "/charcustom/"; public static string WebServer_HatDir = WebServer_CustomPlayerDir + "hats/"; public static string WebServer_FaceDir = WebServer_CustomPlayerDir + "faces/"; @@ -50,5 +53,19 @@ public class GlobalPaths public static string WebServer_ShirtDir = WebServer_CustomPlayerDir + "shirts/"; public static string WebServer_PantsDir = WebServer_CustomPlayerDir + "pants/"; public static string WebServer_ExtraDir = WebServer_CustomPlayerDir + "custom/"; + #endregion + + #region File Names + public static readonly string ConfigName = "config.ini"; + public static string ConfigNameCustomization = "config_customization.ini"; + public static readonly string InfoName = "info.ini"; + public static readonly string ScriptName = "CSMPFunctions"; + public static readonly string ScriptGenName = "CSMPBoot"; + #endregion + + #region Empty Paths (automatically changed) + public static string FullMapPath = ""; + public static string AddonScriptPath = ""; + #endregion } #endregion diff --git a/Novetus/NovetusCore/GlobalVars.cs b/Novetus/NovetusCore/GlobalVars.cs index d425ebd..3632a53 100644 --- a/Novetus/NovetusCore/GlobalVars.cs +++ b/Novetus/NovetusCore/GlobalVars.cs @@ -1,50 +1,58 @@ -#region Usings -using System; -using System.Diagnostics; -using System.Linq; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -#endregion - -/* - * change field names for all forms +/* + * change control names for all forms * Rewrite client launching into one function. - * add regions to ALL classes. - * maybe make enums print out the names in inis instead of the int value? + * add regions to ALL forms. */ #region Global Variables public static class GlobalVars { + #region Launcher State for Discord + public enum LauncherState + { + InLauncher = 0, + InMPGame = 1, + InSoloGame = 2, + InStudio = 3, + InCustomization = 4, + InEasterEggGame = 5, + LoadingURI = 6 + } + #endregion + + #region Class definitions public static FileFormat.ProgramInfo ProgramInformation = new FileFormat.ProgramInfo(); public static FileFormat.Config UserConfiguration = new FileFormat.Config(); - public static string IP = "localhost"; - public static string SharedArgs = ""; - public static readonly string ScriptName = "CSMPFunctions"; - public static readonly string ScriptGenName = "CSMPBoot"; + public static FileFormat.ClientInfo SelectedClientInfo = new FileFormat.ClientInfo(); + public static FileFormat.CustomizationConfig UserCustomization = new FileFormat.CustomizationConfig(); public static SimpleHTTPServer WebServer = null; + #endregion + + #region Joining + public static string IP = "localhost"; + public static int DefaultRobloxPort = 53640; + public static string SharedArgs = ""; + #endregion + + #region Customization + public static string Loadout = ""; + public static string soloLoadout = ""; + #endregion + + #region Booleans public static bool IsWebServerOn = false; public static bool IsSnapshot = false; - //misc vars - public static string FullMapPath = ""; - //weebserver + public static bool LocalPlayMode = false; + public static bool AdminMode = false; + #endregion + + #region Web Server Vars public static int WebServerPort = 40735; public static string LocalWebServerURI = "http://localhost:" + (WebServerPort).ToString(); public static string WebServerURI = "http://" + IP + ":" + (WebServerPort).ToString(); - //config name - public static readonly string ConfigName = "config.ini"; - public static string ConfigNameCustomization = "config_customization.ini"; - public static readonly string InfoName = "info.ini"; - //client shit - public static FileFormat.ClientInfo SelectedClientInfo = new FileFormat.ClientInfo(); - public static string AddonScriptPath = ""; - //charcustom - public static FileFormat.CustomizationConfig UserCustomization = new FileFormat.CustomizationConfig(); - public static string loadtext = ""; - public static string sololoadtext = ""; - //color menu. - public static bool AdminMode = false; - public static string important = ""; + #endregion + + #region Discord Variables //discord public static DiscordRPC.RichPresence presence; public static string appid = "505955125727330324"; @@ -53,26 +61,6 @@ public static class GlobalVars public static string image_inlauncher = "inlauncher_small"; public static string image_instudio = "instudio_small"; public static string image_incustomization = "incustomization_small"; - - public static string MultiLine(params string[] args) - { - return string.Join(Environment.NewLine, args); - } - - public static string RemoveEmptyLines(string lines) - { - return Regex.Replace(lines, @"^\s*$\n|\r", string.Empty, RegexOptions.Multiline).TrimEnd(); - } - - public static bool ProcessExists(int id) - { - return Process.GetProcesses().Any(x => x.Id == id); - } - - //task.delay is only available on net 4.5....... - public static async void Delay(int miliseconds) - { - await TaskEx.Delay(miliseconds); - } + #endregion } #endregion diff --git a/Novetus/NovetusCore/NovetusCore.projitems b/Novetus/NovetusCore/NovetusCore.projitems index eb692e6..2960e8b 100644 --- a/Novetus/NovetusCore/NovetusCore.projitems +++ b/Novetus/NovetusCore/NovetusCore.projitems @@ -15,7 +15,7 @@ - + diff --git a/Novetus/NovetusCore/ScriptFuncs.cs b/Novetus/NovetusCore/ScriptFuncs.cs index 53992b3..d6adde5 100644 --- a/Novetus/NovetusCore/ScriptFuncs.cs +++ b/Novetus/NovetusCore/ScriptFuncs.cs @@ -36,9 +36,9 @@ public class ScriptFuncs rbxexe = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\RobloxApp_client.exe"; } - string md5dir = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location); - string md5script = SecurityFuncs.CalculateMD5(GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptName + ".lua"); - string md5exe = SecurityFuncs.CalculateMD5(rbxexe); + string md5dir = SecurityFuncs.GenerateMD5(Assembly.GetExecutingAssembly().Location); + string md5script = SecurityFuncs.GenerateMD5(GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua"); + string md5exe = SecurityFuncs.GenerateMD5(rbxexe); string md5s = "'" + md5exe + "','" + md5dir + "','" + md5script + "'"; switch (type) @@ -49,7 +49,7 @@ public class ScriptFuncs + GlobalVars.IP + "'," + GlobalVars.UserConfiguration.RobloxPort + ",'" + (GlobalVars.SelectedClientInfo.UsesPlayerName ? GlobalVars.UserConfiguration.PlayerName : "Player") + "'," - + GlobalVars.loadtext + "," + + GlobalVars.Loadout + "," + md5s + ",'" + GlobalVars.UserConfiguration.PlayerTripcode + "')"; case ScriptType.Server: @@ -62,7 +62,7 @@ public class ScriptFuncs return "_G.CSSolo(" + (GlobalVars.SelectedClientInfo.UsesID ? GlobalVars.UserConfiguration.UserID : 0) + ",'" + (GlobalVars.SelectedClientInfo.UsesPlayerName ? GlobalVars.UserConfiguration.PlayerName : "Player") + "'," - + GlobalVars.sololoadtext + ")"; + + GlobalVars.soloLoadout + ")"; case ScriptType.Studio: return "_G.CSStudio()"; default: @@ -90,18 +90,18 @@ public class ScriptFuncs } public static void GenerateScriptForClient(ScriptType type) { - string code = GlobalVars.MultiLine( + string code = GlobalFuncs.MultiLine( "--Load Script", //scriptcontents, - LauncherFuncs.ChangeGameSettings(), - "dofile('rbxasset://scripts/" + GlobalVars.ScriptName + ".lua')", + GlobalFuncs.ChangeGameSettings(), + "dofile('rbxasset://scripts/" + GlobalPaths.ScriptName + ".lua')", GetScriptFuncForType(type), - !string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? "dofile('" + GlobalVars.AddonScriptPath + "')" : "" + !string.IsNullOrWhiteSpace(GlobalPaths.AddonScriptPath) ? "dofile('" + GlobalPaths.AddonScriptPath + "')" : "" ); List list = new List(Regex.Split(code, Environment.NewLine)); string[] convertedList = list.ToArray(); - File.WriteAllLines(GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptGenName + ".lua", convertedList); + File.WriteAllLines(GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\scripts\\" + GlobalPaths.ScriptGenName + ".lua", convertedList); } } #endregion @@ -147,32 +147,32 @@ public class ScriptFuncs switch (type) { case ScriptType.Client: - return LauncherFuncs.ChangeGameSettings() + + return GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSConnect(" + (GlobalVars.SelectedClientInfo.UsesID ? GlobalVars.UserConfiguration.UserID : 0) + ",'" + GlobalVars.IP + "'," + GlobalVars.UserConfiguration.RobloxPort + ",'" + (GlobalVars.SelectedClientInfo.UsesPlayerName ? GlobalVars.UserConfiguration.PlayerName : "Player") + "'," - + GlobalVars.loadtext + "," + + GlobalVars.Loadout + "," + md5s + ",'" + GlobalVars.UserConfiguration.PlayerTripcode + "')"; case ScriptType.Server: - return LauncherFuncs.ChangeGameSettings() + + return GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSServer(" + GlobalVars.UserConfiguration.RobloxPort + "," + GlobalVars.UserConfiguration.PlayerLimit + "," + md5s + "); " - + (!string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? LauncherFuncs.ChangeGameSettings() + - " dofile('" + GlobalVars.AddonScriptPath + "');" : ""); + + (!string.IsNullOrWhiteSpace(GlobalPaths.AddonScriptPath) ? GlobalFuncs.ChangeGameSettings() + + " dofile('" + GlobalPaths.AddonScriptPath + "');" : ""); case ScriptType.Solo: case ScriptType.EasterEgg: - return LauncherFuncs.ChangeGameSettings() + return GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CSSolo(" + (GlobalVars.SelectedClientInfo.UsesID ? GlobalVars.UserConfiguration.UserID : 0) + ",'" + (GlobalVars.SelectedClientInfo.UsesPlayerName ? GlobalVars.UserConfiguration.PlayerName : "Player") + "'," - + GlobalVars.sololoadtext + ")"; + + GlobalVars.soloLoadout + ")"; case ScriptType.Studio: - return LauncherFuncs.ChangeGameSettings() + return GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "');"; default: return ""; @@ -240,9 +240,9 @@ public class ScriptFuncs return ""; } - string md5dir = GlobalVars.SelectedClientInfo.AlreadyHasSecurity != true ? SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location) : ""; - string md5script = GlobalVars.SelectedClientInfo.AlreadyHasSecurity != true ? SecurityFuncs.CalculateMD5(GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptName + ".lua") : ""; - string md5exe = GlobalVars.SelectedClientInfo.AlreadyHasSecurity != true ? SecurityFuncs.CalculateMD5(rbxexe) : ""; + string md5dir = !GlobalVars.SelectedClientInfo.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(Assembly.GetExecutingAssembly().Location) : ""; + string md5script = !GlobalVars.SelectedClientInfo.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua") : ""; + string md5exe = !GlobalVars.SelectedClientInfo.AlreadyHasSecurity ? SecurityFuncs.GenerateMD5(rbxexe) : ""; string md5s = "'" + md5exe + "','" + md5dir + "','" + md5script + "'"; string compiled = extractedCode.Replace("%mapfile%", mapfile) .Replace("%luafile%", luafile) @@ -298,7 +298,7 @@ public class ScriptFuncs .Replace("%hat4ws%", GlobalPaths.WebServer_HatDir + GlobalVars.UserCustomization.Extra) .Replace("%mapfiled%", GlobalPaths.BaseGameDir + GlobalVars.UserConfiguration.MapPathSnip.Replace(@"\\", @"\")) .Replace("%tripcode%", GlobalVars.UserConfiguration.PlayerTripcode) - .Replace("%addonscriptpath%", GlobalVars.AddonScriptPath); + .Replace("%addonscriptpath%", GlobalPaths.AddonScriptPath); return compiled; } } diff --git a/Novetus/NovetusCore/SecurityFuncs.cs b/Novetus/NovetusCore/SecurityFuncs.cs index 18b69ab..3eb3ee8 100644 --- a/Novetus/NovetusCore/SecurityFuncs.cs +++ b/Novetus/NovetusCore/SecurityFuncs.cs @@ -87,25 +87,15 @@ public class SecurityFuncs public static bool checkClientMD5(string client) { - if (GlobalVars.AdminMode != true) { - if (GlobalVars.SelectedClientInfo.AlreadyHasSecurity != true) { + if (!GlobalVars.AdminMode) { + if (!GlobalVars.SelectedClientInfo.AlreadyHasSecurity) { string rbxexe = ""; if (GlobalVars.SelectedClientInfo.LegacyMode) { rbxexe = GlobalPaths.BasePath + "\\clients\\" + client + "\\RobloxApp.exe"; } else { rbxexe = GlobalPaths.BasePath + "\\clients\\" + client + "\\RobloxApp_client.exe"; } - using (var md5 = MD5.Create()) { - using (var stream = File.OpenRead(rbxexe)) { - byte[] hash = md5.ComputeHash(stream); - string clientMD5 = BitConverter.ToString(hash).Replace("-", ""); - if (clientMD5.Equals(GlobalVars.SelectedClientInfo.ClientMD5)) { - return true; - } else { - return false; - } - } - } + return CheckMD5(GlobalVars.SelectedClientInfo.ClientMD5, rbxexe); } else { return true; } @@ -116,20 +106,10 @@ public class SecurityFuncs public static bool checkScriptMD5(string client) { - if (GlobalVars.AdminMode != true) { - if (GlobalVars.SelectedClientInfo.AlreadyHasSecurity != true) { - string rbxscript = GlobalPaths.BasePath + "\\clients\\" + client + "\\content\\scripts\\" + GlobalVars.ScriptName + ".lua"; - using (var md5 = MD5.Create()) { - using (var stream = File.OpenRead(rbxscript)) { - byte[] hash = md5.ComputeHash(stream); - string clientMD5 = BitConverter.ToString(hash).Replace("-", ""); - if (clientMD5.Equals(GlobalVars.SelectedClientInfo.ScriptMD5)) { - return true; - } else { - return false; - } - } - } + if (!GlobalVars.AdminMode) { + if (!GlobalVars.SelectedClientInfo.AlreadyHasSecurity) { + string rbxscript = GlobalPaths.BasePath + "\\clients\\" + client + "\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua"; + return CheckMD5(GlobalVars.SelectedClientInfo.ScriptMD5, rbxscript); } else { return true; } @@ -137,8 +117,28 @@ public class SecurityFuncs return true; } } - - public static string CalculateMD5(string filename) + + public static bool CheckMD5(string MD5Hash, string path) + { + using (var md5 = MD5.Create()) + { + using (var stream = File.OpenRead(path)) + { + byte[] hash = md5.ComputeHash(stream); + string clientMD5 = BitConverter.ToString(hash).Replace("-", ""); + if (clientMD5.Equals(MD5Hash)) + { + return true; + } + else + { + return false; + } + } + } + } + + public static string GenerateMD5(string filename) { using (var md5 = MD5.Create()) { using (var stream = File.OpenRead(filename)) { @@ -161,7 +161,7 @@ public class SecurityFuncs public static void RenameWindow(Process exe, ScriptType type, string mapname) { - if (GlobalVars.SelectedClientInfo.AlreadyHasSecurity != true) { + if (!GlobalVars.SelectedClientInfo.AlreadyHasSecurity) { int time = 500; BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += (obj, e) => WorkerDoWork(exe, type, time, worker, GlobalVars.UserConfiguration.SelectedClient, mapname); @@ -173,7 +173,7 @@ public class SecurityFuncs { if (exe.IsRunning()) { while (exe.IsRunning()) { - if (exe.IsRunning() != true) { + if (!exe.IsRunning()) { worker.DoWork -= (obj, e) => WorkerDoWork(exe, type, time, worker, clientname, mapname); worker.CancelAsync(); worker.Dispose(); diff --git a/Novetus/NovetusLauncher/CharacterCustomization/CharacterCustomization.cs b/Novetus/NovetusLauncher/CharacterCustomization/CharacterCustomization.cs index bd6a36b..8164ceb 100644 --- a/Novetus/NovetusLauncher/CharacterCustomization/CharacterCustomization.cs +++ b/Novetus/NovetusLauncher/CharacterCustomization/CharacterCustomization.cs @@ -188,9 +188,9 @@ namespace NovetusLauncher } //discord - LauncherFuncs.UpdateRichPresence(LauncherState.InCustomization, GlobalVars.UserConfiguration.Map); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InCustomization, GlobalVars.UserConfiguration.Map); - LauncherFuncs.ReloadLoadtextValue(); + GlobalFuncs.ReloadLoadoutValue(); } void tabControl1_SelectedIndexChanged(object sender, EventArgs e) @@ -223,12 +223,12 @@ namespace NovetusLauncher try { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradirIcons + "\\" + GlobalVars.UserConfiguration.PlayerName + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradirIcons + "\\" + GlobalVars.UserConfiguration.PlayerName + ".png"); pictureBox10.Image = icon1; } catch (Exception) { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradir + "\\NoExtra.png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradir + "\\NoExtra.png"); pictureBox10.Image = icon1; } break; @@ -263,11 +263,11 @@ namespace NovetusLauncher listBox1.Enabled = true; listBox2.Enabled = true; listBox3.Enabled = true; - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); pictureBox1.Image = icon1; - Image icon2 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); + Image icon2 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); pictureBox2.Image = icon2; - Image icon3 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); + Image icon3 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); pictureBox3.Image = icon3; if (File.Exists(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + "_desc.txt")) { @@ -324,7 +324,7 @@ namespace NovetusLauncher } listBox4.SelectedItem = GlobalVars.UserCustomization.Face; listBox4.Enabled = true; - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.facedir + @"\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.facedir + @"\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); pictureBox4.Image = icon1; if (File.Exists(GlobalPaths.facedir + @"\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + "_desc.txt")) @@ -365,7 +365,7 @@ namespace NovetusLauncher } listBox5.SelectedItem = GlobalVars.UserCustomization.TShirt; listBox5.Enabled = true; - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.tshirtdir + @"\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.tshirtdir + @"\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); pictureBox5.Image = icon1; if (File.Exists(GlobalPaths.tshirtdir + @"\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + "_desc.txt")) @@ -380,7 +380,7 @@ namespace NovetusLauncher } catch (Exception) { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.tshirtdir + @"\\NoTShirt.png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.tshirtdir + @"\\NoTShirt.png"); pictureBox5.Image = icon1; } break; @@ -412,7 +412,7 @@ namespace NovetusLauncher } listBox6.SelectedItem = GlobalVars.UserCustomization.Shirt; listBox6.Enabled = true; - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.shirtdir + @"\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.shirtdir + @"\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); pictureBox6.Image = icon1; if (File.Exists(GlobalPaths.shirtdir + @"\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + "_desc.txt")) @@ -427,7 +427,7 @@ namespace NovetusLauncher } catch (Exception) { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.shirtdir + @"\\NoShirt.png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.shirtdir + @"\\NoShirt.png"); pictureBox6.Image = icon1; } break; @@ -459,7 +459,7 @@ namespace NovetusLauncher } listBox7.SelectedItem = GlobalVars.UserCustomization.Pants; listBox7.Enabled = true; - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.pantsdir + @"\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.pantsdir + @"\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); pictureBox7.Image = icon1; if (File.Exists(GlobalPaths.pantsdir + @"\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + "_desc.txt")) @@ -474,7 +474,7 @@ namespace NovetusLauncher } catch (Exception) { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.pantsdir + @"\\NoPants.png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.pantsdir + @"\\NoPants.png"); pictureBox7.Image = icon1; } break; @@ -505,7 +505,7 @@ namespace NovetusLauncher } listBox8.SelectedItem = GlobalVars.UserCustomization.Head; listBox8.Enabled = true; - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.headdir + @"\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.headdir + @"\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); pictureBox8.Image = icon1; if (File.Exists(GlobalPaths.headdir + @"\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + "_desc.txt")) @@ -572,7 +572,7 @@ namespace NovetusLauncher listBox9.Enabled = true; try { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; if (File.Exists(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) { @@ -587,7 +587,7 @@ namespace NovetusLauncher { if (Directory.Exists(GlobalPaths.hatdir)) { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; if (File.Exists(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) { @@ -616,8 +616,8 @@ namespace NovetusLauncher void CharacterCustomizationClose(object sender, CancelEventArgs e) { - LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, ""); - LauncherFuncs.ReloadLoadtextValue(); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, ""); + GlobalFuncs.ReloadLoadoutValue(); } // hats @@ -627,7 +627,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.hatdir)) { GlobalVars.UserCustomization.Hat1 = listBox1.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); pictureBox1.Image = icon1; if (File.Exists(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + "_desc.txt")) @@ -646,7 +646,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.hatdir)) { GlobalVars.UserCustomization.Hat2 = listBox2.SelectedItem.ToString(); - Image icon2 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); + Image icon2 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); pictureBox2.Image = icon2; if (File.Exists(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + "_desc.txt")) @@ -665,7 +665,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.hatdir)) { GlobalVars.UserCustomization.Hat3 = listBox3.SelectedItem.ToString(); - Image icon3 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); + Image icon3 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); pictureBox3.Image = icon3; if (File.Exists(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + "_desc.txt")) @@ -687,17 +687,17 @@ namespace NovetusLauncher int randomHat1 = random.Next(listBox1.Items.Count); listBox1.SelectedItem = listBox1.Items[randomHat1]; GlobalVars.UserCustomization.Hat1 = listBox1.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); pictureBox1.Image = icon1; int randomHat2 = random.Next(listBox2.Items.Count); listBox2.SelectedItem = listBox1.Items[randomHat2]; GlobalVars.UserCustomization.Hat2 = listBox2.SelectedItem.ToString(); - Image icon2 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); + Image icon2 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); pictureBox2.Image = icon2; int randomHat3 = random.Next(listBox3.Items.Count); listBox3.SelectedItem = listBox1.Items[randomHat3]; GlobalVars.UserCustomization.Hat3 = listBox3.SelectedItem.ToString(); - Image icon3 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); + Image icon3 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); pictureBox3.Image = icon3; if (File.Exists(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + "_desc.txt")) { @@ -734,15 +734,15 @@ namespace NovetusLauncher { listBox1.SelectedItem = "NoHat.rbxm"; GlobalVars.UserCustomization.Hat1 = listBox1.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); pictureBox1.Image = icon1; listBox2.SelectedItem = "NoHat.rbxm"; GlobalVars.UserCustomization.Hat2 = listBox2.SelectedItem.ToString(); - Image icon2 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); + Image icon2 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); pictureBox2.Image = icon2; listBox3.SelectedItem = "NoHat.rbxm"; GlobalVars.UserCustomization.Hat3 = listBox3.SelectedItem.ToString(); - Image icon3 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); + Image icon3 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); pictureBox3.Image = icon3; if (File.Exists(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + "_desc.txt")) { @@ -780,7 +780,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.facedir)) { GlobalVars.UserCustomization.Face = listBox4.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.facedir + "\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.facedir + "\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); pictureBox4.Image = icon1; if (File.Exists(GlobalPaths.facedir + @"\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + "_desc.txt")) @@ -802,7 +802,7 @@ namespace NovetusLauncher int randomFace1 = random.Next(listBox4.Items.Count); listBox4.SelectedItem = listBox4.Items[randomFace1]; GlobalVars.UserCustomization.Face = listBox4.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.facedir + "\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.facedir + "\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); pictureBox4.Image = icon1; if (File.Exists(GlobalPaths.facedir + @"\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + "_desc.txt")) @@ -822,7 +822,7 @@ namespace NovetusLauncher { listBox4.SelectedItem = "DefaultFace.rbxm"; GlobalVars.UserCustomization.Face = listBox4.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.facedir + "\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.facedir + "\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); pictureBox4.Image = icon1; if (File.Exists(GlobalPaths.facedir + @"\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + "_desc.txt")) @@ -847,7 +847,7 @@ namespace NovetusLauncher comboBox3.SelectedItem = "Roblox"; listBox5.SelectedItem = previtem; GlobalVars.UserCustomization.TShirt = listBox5.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.tshirtdir + "\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.tshirtdir + "\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); pictureBox5.Image = icon1; if (File.Exists(GlobalPaths.tshirtdir + @"\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + "_desc.txt")) @@ -871,7 +871,7 @@ namespace NovetusLauncher int randomTShirt1 = random.Next(listBox5.Items.Count); listBox5.SelectedItem = listBox5.Items[randomTShirt1]; GlobalVars.UserCustomization.TShirt = listBox5.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.tshirtdir + "\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.tshirtdir + "\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); pictureBox5.Image = icon1; if (File.Exists(GlobalPaths.tshirtdir + @"\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + "_desc.txt")) @@ -893,7 +893,7 @@ namespace NovetusLauncher comboBox3.SelectedItem = "Roblox"; listBox5.SelectedItem = "NoTShirt.rbxm"; GlobalVars.UserCustomization.TShirt = listBox5.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.tshirtdir + "\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.tshirtdir + "\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); pictureBox5.Image = icon1; if (File.Exists(GlobalPaths.tshirtdir + @"\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + "_desc.txt")) @@ -918,7 +918,7 @@ namespace NovetusLauncher comboBox2.SelectedItem = "Roblox"; listBox6.SelectedItem = previtem; GlobalVars.UserCustomization.Shirt = listBox6.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.shirtdir + "\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.shirtdir + "\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); pictureBox6.Image = icon1; if (File.Exists(GlobalPaths.shirtdir + @"\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + "_desc.txt")) @@ -942,7 +942,7 @@ namespace NovetusLauncher int randomShirt1 = random.Next(listBox6.Items.Count); listBox6.SelectedItem = listBox6.Items[randomShirt1]; GlobalVars.UserCustomization.Shirt = listBox6.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.shirtdir + "\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.shirtdir + "\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); pictureBox6.Image = icon1; if (File.Exists(GlobalPaths.shirtdir + @"\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + "_desc.txt")) @@ -964,7 +964,7 @@ namespace NovetusLauncher comboBox2.SelectedItem = "Roblox"; listBox6.SelectedItem = "NoShirt.rbxm"; GlobalVars.UserCustomization.Shirt = listBox6.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.shirtdir + "\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.shirtdir + "\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); pictureBox6.Image = icon1; if (File.Exists(GlobalPaths.shirtdir + @"\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + "_desc.txt")) @@ -989,7 +989,7 @@ namespace NovetusLauncher comboBox1.SelectedItem = "Roblox"; listBox7.SelectedItem = previtem; GlobalVars.UserCustomization.Pants = listBox7.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.pantsdir + "\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.pantsdir + "\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); pictureBox7.Image = icon1; if (File.Exists(GlobalPaths.pantsdir + @"\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + "_desc.txt")) @@ -1013,7 +1013,7 @@ namespace NovetusLauncher int randomPants1 = random.Next(listBox7.Items.Count); listBox7.SelectedItem = listBox7.Items[randomPants1]; GlobalVars.UserCustomization.Pants = listBox7.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.pantsdir + "\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.pantsdir + "\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); pictureBox7.Image = icon1; if (File.Exists(GlobalPaths.pantsdir + @"\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + "_desc.txt")) @@ -1035,7 +1035,7 @@ namespace NovetusLauncher comboBox1.SelectedItem = "Roblox"; listBox7.SelectedItem = "NoPants.rbxm"; GlobalVars.UserCustomization.Pants = listBox7.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.pantsdir + "\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.pantsdir + "\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); pictureBox7.Image = icon1; if (File.Exists(GlobalPaths.pantsdir + @"\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + "_desc.txt")) @@ -1056,7 +1056,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.headdir)) { GlobalVars.UserCustomization.Head = listBox8.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.headdir + "\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.headdir + "\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); pictureBox8.Image = icon1; if (File.Exists(GlobalPaths.headdir + @"\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + "_desc.txt")) @@ -1078,7 +1078,7 @@ namespace NovetusLauncher int randomHead1 = random.Next(listBox8.Items.Count); listBox8.SelectedItem = listBox8.Items[randomHead1]; GlobalVars.UserCustomization.Head = listBox8.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.headdir + "\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.headdir + "\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); pictureBox8.Image = icon1; if (File.Exists(GlobalPaths.headdir + @"\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + "_desc.txt")) @@ -1098,7 +1098,7 @@ namespace NovetusLauncher { listBox8.SelectedItem = "DefaultHead.rbxm"; GlobalVars.UserCustomization.Head = listBox8.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.headdir + "\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.headdir + "\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); pictureBox8.Image = icon1; if (File.Exists(GlobalPaths.headdir + @"\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + "_desc.txt")) @@ -1442,12 +1442,12 @@ namespace NovetusLauncher void Button43Click(object sender, EventArgs e) { - LauncherFuncs.ReloadLoadtextValue(); + GlobalFuncs.ReloadLoadoutValue(); string luafile = "rbxasset://scripts\\\\CSView.lua"; string mapfile = GlobalPaths.BasePathLauncher + "\\preview\\content\\fonts\\3DView.rbxl"; string rbxexe = GlobalPaths.BasePathLauncher + "\\preview\\3DView.exe"; string quote = "\""; - string args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CS3DView(0,'Player'," + GlobalVars.loadtext + ");" + quote; + string args = quote + mapfile + "\" -script \"" + GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CS3DView(0,'Player'," + GlobalVars.Loadout + ");" + quote; try { Process client = new Process(); @@ -1501,7 +1501,7 @@ namespace NovetusLauncher try { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = false; if (File.Exists(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1518,7 +1518,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.hatdir)) { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = true; if (File.Exists(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1544,7 +1544,7 @@ namespace NovetusLauncher try { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = false; if (File.Exists(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1561,7 +1561,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.hatdir)) { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = true; if (File.Exists(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1585,7 +1585,7 @@ namespace NovetusLauncher try { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = false; if (File.Exists(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1602,7 +1602,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.hatdir)) { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = true; if (File.Exists(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1668,7 +1668,7 @@ namespace NovetusLauncher try { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = false; if (File.Exists(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1685,7 +1685,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.hatdir)) { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = true; if (File.Exists(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1722,12 +1722,12 @@ namespace NovetusLauncher try { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradirIcons + "\\" + GlobalVars.UserConfiguration.PlayerName + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradirIcons + "\\" + GlobalVars.UserConfiguration.PlayerName + ".png"); pictureBox10.Image = icon1; } catch (Exception) { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradir + "\\NoExtra.png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradir + "\\NoExtra.png"); pictureBox10.Image = icon1; } } @@ -1784,7 +1784,7 @@ namespace NovetusLauncher private void button71_Click(object sender, EventArgs e) { - LauncherFuncs.Customization(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization, true); + GlobalFuncs.Customization(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization, true); MessageBox.Show("Outfit Saved!"); } diff --git a/Novetus/NovetusLauncher/CharacterCustomization/CharacterCustomization_legacy.cs b/Novetus/NovetusLauncher/CharacterCustomization/CharacterCustomization_legacy.cs index f38d2fb..e7bc80e 100644 --- a/Novetus/NovetusLauncher/CharacterCustomization/CharacterCustomization_legacy.cs +++ b/Novetus/NovetusLauncher/CharacterCustomization/CharacterCustomization_legacy.cs @@ -185,9 +185,9 @@ namespace NovetusLauncher } //discord - LauncherFuncs.UpdateRichPresence(LauncherState.InCustomization, GlobalVars.UserConfiguration.Map); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InCustomization, GlobalVars.UserConfiguration.Map); - LauncherFuncs.ReloadLoadtextValue(); + GlobalFuncs.ReloadLoadoutValue(); } void tabControl1_SelectedIndexChanged(object sender, EventArgs e) @@ -218,12 +218,12 @@ namespace NovetusLauncher try { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradirIcons + "\\" + GlobalVars.UserConfiguration.PlayerName + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradirIcons + "\\" + GlobalVars.UserConfiguration.PlayerName + ".png"); pictureBox10.Image = icon1; } catch (Exception) { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradir + "\\NoExtra.png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradir + "\\NoExtra.png"); pictureBox10.Image = icon1; } break; @@ -257,11 +257,11 @@ namespace NovetusLauncher listBox1.Enabled = true; listBox2.Enabled = true; listBox3.Enabled = true; - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); pictureBox1.Image = icon1; - Image icon2 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); + Image icon2 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); pictureBox2.Image = icon2; - Image icon3 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); + Image icon3 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); pictureBox3.Image = icon3; if (File.Exists(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + "_desc.txt")) { @@ -317,7 +317,7 @@ namespace NovetusLauncher } listBox4.SelectedItem = GlobalVars.UserCustomization.Face; listBox4.Enabled = true; - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.facedir + @"\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.facedir + @"\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); pictureBox4.Image = icon1; if (File.Exists(GlobalPaths.facedir + @"\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + "_desc.txt")) @@ -358,7 +358,7 @@ namespace NovetusLauncher } listBox5.SelectedItem = GlobalVars.UserCustomization.TShirt; listBox5.Enabled = true; - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.tshirtdir + @"\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.tshirtdir + @"\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); pictureBox5.Image = icon1; if (File.Exists(GlobalPaths.tshirtdir + @"\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + "_desc.txt")) @@ -373,7 +373,7 @@ namespace NovetusLauncher } catch (Exception) { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.tshirtdir + @"\\NoTShirt.png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.tshirtdir + @"\\NoTShirt.png"); pictureBox5.Image = icon1; } break; @@ -405,7 +405,7 @@ namespace NovetusLauncher } listBox6.SelectedItem = GlobalVars.UserCustomization.Shirt; listBox6.Enabled = true; - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.shirtdir + @"\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.shirtdir + @"\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); pictureBox6.Image = icon1; if (File.Exists(GlobalPaths.shirtdir + @"\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + "_desc.txt")) @@ -420,7 +420,7 @@ namespace NovetusLauncher } catch (Exception) { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.shirtdir + @"\\NoShirt.png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.shirtdir + @"\\NoShirt.png"); pictureBox6.Image = icon1; } break; @@ -452,7 +452,7 @@ namespace NovetusLauncher } listBox7.SelectedItem = GlobalVars.UserCustomization.Pants; listBox7.Enabled = true; - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.pantsdir + @"\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.pantsdir + @"\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); pictureBox7.Image = icon1; if (File.Exists(GlobalPaths.pantsdir + @"\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + "_desc.txt")) @@ -467,7 +467,7 @@ namespace NovetusLauncher } catch (Exception) { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.pantsdir + @"\\NoPants.png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.pantsdir + @"\\NoPants.png"); pictureBox7.Image = icon1; } break; @@ -497,7 +497,7 @@ namespace NovetusLauncher } listBox8.SelectedItem = GlobalVars.UserCustomization.Head; listBox8.Enabled = true; - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.headdir + @"\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.headdir + @"\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); pictureBox8.Image = icon1; if (File.Exists(GlobalPaths.headdir + @"\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + "_desc.txt")) @@ -563,7 +563,7 @@ namespace NovetusLauncher listBox9.Enabled = true; try { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; if (File.Exists(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) { @@ -578,7 +578,7 @@ namespace NovetusLauncher { if (Directory.Exists(GlobalPaths.hatdir)) { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; if (File.Exists(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) { @@ -607,8 +607,8 @@ namespace NovetusLauncher void CharacterCustomizationClose(object sender, CancelEventArgs e) { - LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, ""); - LauncherFuncs.ReloadLoadtextValue(); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, ""); + GlobalFuncs.ReloadLoadoutValue(); } // hats @@ -618,7 +618,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.hatdir)) { GlobalVars.UserCustomization.Hat1 = listBox1.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); pictureBox1.Image = icon1; if (File.Exists(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + "_desc.txt")) @@ -637,7 +637,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.hatdir)) { GlobalVars.UserCustomization.Hat2 = listBox2.SelectedItem.ToString(); - Image icon2 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); + Image icon2 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); pictureBox2.Image = icon2; if (File.Exists(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + "_desc.txt")) @@ -656,7 +656,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.hatdir)) { GlobalVars.UserCustomization.Hat3 = listBox3.SelectedItem.ToString(); - Image icon3 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); + Image icon3 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); pictureBox3.Image = icon3; if (File.Exists(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + "_desc.txt")) @@ -678,17 +678,17 @@ namespace NovetusLauncher int randomHat1 = random.Next(listBox1.Items.Count); listBox1.SelectedItem = listBox1.Items[randomHat1]; GlobalVars.UserCustomization.Hat1 = listBox1.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); pictureBox1.Image = icon1; int randomHat2 = random.Next(listBox2.Items.Count); listBox2.SelectedItem = listBox1.Items[randomHat2]; GlobalVars.UserCustomization.Hat2 = listBox2.SelectedItem.ToString(); - Image icon2 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); + Image icon2 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); pictureBox2.Image = icon2; int randomHat3 = random.Next(listBox3.Items.Count); listBox3.SelectedItem = listBox1.Items[randomHat3]; GlobalVars.UserCustomization.Hat3 = listBox3.SelectedItem.ToString(); - Image icon3 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); + Image icon3 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); pictureBox3.Image = icon3; if (File.Exists(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + "_desc.txt")) { @@ -725,15 +725,15 @@ namespace NovetusLauncher { listBox1.SelectedItem = "NoHat.rbxm"; GlobalVars.UserCustomization.Hat1 = listBox1.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + ".png"); pictureBox1.Image = icon1; listBox2.SelectedItem = "NoHat.rbxm"; GlobalVars.UserCustomization.Hat2 = listBox2.SelectedItem.ToString(); - Image icon2 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); + Image icon2 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat2.Replace(".rbxm", "") + ".png"); pictureBox2.Image = icon2; listBox3.SelectedItem = "NoHat.rbxm"; GlobalVars.UserCustomization.Hat3 = listBox3.SelectedItem.ToString(); - Image icon3 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); + Image icon3 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Hat3.Replace(".rbxm", "") + ".png"); pictureBox3.Image = icon3; if (File.Exists(GlobalPaths.hatdir + @"\\" + GlobalVars.UserCustomization.Hat1.Replace(".rbxm", "") + "_desc.txt")) { @@ -771,7 +771,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.facedir)) { GlobalVars.UserCustomization.Face = listBox4.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.facedir + "\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.facedir + "\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); pictureBox4.Image = icon1; if (File.Exists(GlobalPaths.facedir + @"\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + "_desc.txt")) @@ -793,7 +793,7 @@ namespace NovetusLauncher int randomFace1 = random.Next(listBox4.Items.Count); listBox4.SelectedItem = listBox4.Items[randomFace1]; GlobalVars.UserCustomization.Face = listBox4.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.facedir + "\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.facedir + "\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); pictureBox4.Image = icon1; if (File.Exists(GlobalPaths.facedir + @"\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + "_desc.txt")) @@ -813,7 +813,7 @@ namespace NovetusLauncher { listBox4.SelectedItem = "DefaultFace.rbxm"; GlobalVars.UserCustomization.Face = listBox4.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.facedir + "\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.facedir + "\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + ".png"); pictureBox4.Image = icon1; if (File.Exists(GlobalPaths.facedir + @"\\" + GlobalVars.UserCustomization.Face.Replace(".rbxm", "") + "_desc.txt")) @@ -838,7 +838,7 @@ namespace NovetusLauncher comboBox2.SelectedItem = "Roblox"; listBox5.SelectedItem = previtem; GlobalVars.UserCustomization.TShirt = listBox5.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.tshirtdir + "\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.tshirtdir + "\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); pictureBox5.Image = icon1; if (File.Exists(GlobalPaths.tshirtdir + @"\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + "_desc.txt")) @@ -862,7 +862,7 @@ namespace NovetusLauncher int randomTShirt1 = random.Next(listBox5.Items.Count); listBox5.SelectedItem = listBox5.Items[randomTShirt1]; GlobalVars.UserCustomization.TShirt = listBox5.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.tshirtdir + "\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.tshirtdir + "\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); pictureBox5.Image = icon1; if (File.Exists(GlobalPaths.tshirtdir + @"\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + "_desc.txt")) @@ -884,7 +884,7 @@ namespace NovetusLauncher comboBox2.SelectedItem = "Roblox"; listBox5.SelectedItem = "NoTShirt.rbxm"; GlobalVars.UserCustomization.TShirt = listBox5.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.tshirtdir + "\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.tshirtdir + "\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + ".png"); pictureBox5.Image = icon1; if (File.Exists(GlobalPaths.tshirtdir + @"\\" + GlobalVars.UserCustomization.TShirt.Replace(".rbxm", "") + "_desc.txt")) @@ -909,7 +909,7 @@ namespace NovetusLauncher comboBox1.SelectedItem = "Roblox"; listBox6.SelectedItem = previtem; GlobalVars.UserCustomization.Shirt = listBox6.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.shirtdir + "\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.shirtdir + "\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); pictureBox6.Image = icon1; if (File.Exists(GlobalPaths.shirtdir + @"\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + "_desc.txt")) @@ -933,7 +933,7 @@ namespace NovetusLauncher int randomShirt1 = random.Next(listBox6.Items.Count); listBox6.SelectedItem = listBox6.Items[randomShirt1]; GlobalVars.UserCustomization.Shirt = listBox6.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.shirtdir + "\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.shirtdir + "\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); pictureBox6.Image = icon1; if (File.Exists(GlobalPaths.shirtdir + @"\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + "_desc.txt")) @@ -955,7 +955,7 @@ namespace NovetusLauncher comboBox1.SelectedItem = "Roblox"; listBox6.SelectedItem = "NoShirt.rbxm"; GlobalVars.UserCustomization.Shirt = listBox6.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.shirtdir + "\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.shirtdir + "\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + ".png"); pictureBox6.Image = icon1; if (File.Exists(GlobalPaths.shirtdir + @"\\" + GlobalVars.UserCustomization.Shirt.Replace(".rbxm", "") + "_desc.txt")) @@ -980,7 +980,7 @@ namespace NovetusLauncher comboBox3.SelectedItem = "Roblox"; listBox7.SelectedItem = previtem; GlobalVars.UserCustomization.Pants = listBox7.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.pantsdir + "\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.pantsdir + "\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); pictureBox7.Image = icon1; if (File.Exists(GlobalPaths.pantsdir + @"\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + "_desc.txt")) @@ -1004,7 +1004,7 @@ namespace NovetusLauncher int randomPants1 = random.Next(listBox7.Items.Count); listBox7.SelectedItem = listBox7.Items[randomPants1]; GlobalVars.UserCustomization.Pants = listBox7.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.pantsdir + "\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.pantsdir + "\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); pictureBox7.Image = icon1; if (File.Exists(GlobalPaths.pantsdir + @"\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + "_desc.txt")) @@ -1026,7 +1026,7 @@ namespace NovetusLauncher comboBox3.SelectedItem = "Roblox"; listBox7.SelectedItem = "NoPants.rbxm"; GlobalVars.UserCustomization.Pants = listBox7.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.pantsdir + "\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.pantsdir + "\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + ".png"); pictureBox7.Image = icon1; if (File.Exists(GlobalPaths.pantsdir + @"\\" + GlobalVars.UserCustomization.Pants.Replace(".rbxm", "") + "_desc.txt")) @@ -1047,7 +1047,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.headdir)) { GlobalVars.UserCustomization.Head = listBox8.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.headdir + "\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.headdir + "\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); pictureBox8.Image = icon1; if (File.Exists(GlobalPaths.headdir + @"\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + "_desc.txt")) @@ -1069,7 +1069,7 @@ namespace NovetusLauncher int randomHead1 = random.Next(listBox8.Items.Count); listBox8.SelectedItem = listBox8.Items[randomHead1]; GlobalVars.UserCustomization.Head = listBox8.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.headdir + "\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.headdir + "\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); pictureBox8.Image = icon1; if (File.Exists(GlobalPaths.headdir + @"\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + "_desc.txt")) @@ -1089,7 +1089,7 @@ namespace NovetusLauncher { listBox8.SelectedItem = "DefaultHead.rbxm"; GlobalVars.UserCustomization.Head = listBox8.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.headdir + "\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.headdir + "\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + ".png"); pictureBox8.Image = icon1; if (File.Exists(GlobalPaths.headdir + @"\\" + GlobalVars.UserCustomization.Head.Replace(".rbxm", "") + "_desc.txt")) @@ -1433,12 +1433,12 @@ namespace NovetusLauncher void Button43Click(object sender, EventArgs e) { - LauncherFuncs.ReloadLoadtextValue(); + GlobalFuncs.ReloadLoadoutValue(); string luafile = "rbxasset://scripts\\\\CSView.lua"; string mapfile = GlobalPaths.BasePathLauncher + "\\preview\\content\\fonts\\3DView.rbxl"; string rbxexe = GlobalPaths.BasePathLauncher + "\\preview\\3DView.exe"; string quote = "\""; - string args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CS3DView(0,'Player'," + GlobalVars.loadtext + ");" + quote; + string args = quote + mapfile + "\" -script \"" + GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); _G.CS3DView(0,'Player'," + GlobalVars.Loadout + ");" + quote; try { Process client = new Process(); @@ -1492,7 +1492,7 @@ namespace NovetusLauncher try { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = false; if (File.Exists(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1509,7 +1509,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.hatdir)) { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = true; if (File.Exists(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1535,7 +1535,7 @@ namespace NovetusLauncher try { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = false; if (File.Exists(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1552,7 +1552,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.hatdir)) { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = true; if (File.Exists(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1576,7 +1576,7 @@ namespace NovetusLauncher try { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = false; if (File.Exists(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1593,7 +1593,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.hatdir)) { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = true; if (File.Exists(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1659,7 +1659,7 @@ namespace NovetusLauncher try { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = false; if (File.Exists(GlobalPaths.extradir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1676,7 +1676,7 @@ namespace NovetusLauncher if (Directory.Exists(GlobalPaths.hatdir)) { GlobalVars.UserCustomization.Extra = listBox9.SelectedItem.ToString(); - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + ".png"); pictureBox9.Image = icon1; GlobalVars.UserCustomization.ExtraSelectionIsHat = true; if (File.Exists(GlobalPaths.hatdir + "\\" + GlobalVars.UserCustomization.Extra.Replace(".rbxm", "") + "_desc.txt")) @@ -1713,12 +1713,12 @@ namespace NovetusLauncher try { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradirIcons + "\\" + GlobalVars.UserConfiguration.PlayerName + ".png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradirIcons + "\\" + GlobalVars.UserConfiguration.PlayerName + ".png"); pictureBox10.Image = icon1; } catch (Exception) { - Image icon1 = LauncherFuncs.LoadImage(GlobalPaths.extradir + "\\NoExtra.png"); + Image icon1 = GlobalFuncs.LoadImage(GlobalPaths.extradir + "\\NoExtra.png"); pictureBox10.Image = icon1; } } @@ -1775,7 +1775,7 @@ namespace NovetusLauncher private void button71_Click(object sender, EventArgs e) { - LauncherFuncs.Customization(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization, true); + GlobalFuncs.Customization(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization, true); MessageBox.Show("Outfit Saved!"); } diff --git a/Novetus/NovetusLauncher/Classes/LocalPaths.cs b/Novetus/NovetusLauncher/Classes/LocalPaths.cs index cc67ca8..e001ab2 100644 --- a/Novetus/NovetusLauncher/Classes/LocalPaths.cs +++ b/Novetus/NovetusLauncher/Classes/LocalPaths.cs @@ -1,11 +1,12 @@  namespace NovetusLauncher { + #region LocalPaths class LocalPaths { - //public static readonly string PluginPath = GlobalPaths.BasePath + "\\plugins"; + #region Asset Cache Paths - //assetcache + #region Base Paths public static readonly string DirFonts = "\\fonts"; public static readonly string DirSounds = "\\sounds"; public static readonly string DirTextures = "\\textures"; @@ -14,7 +15,27 @@ namespace NovetusLauncher public static readonly string SoundsGameDir = "sounds/"; public static readonly string TexturesGameDir = "textures/"; public static readonly string ScriptsGameDir = "scripts/"; - //item asset dirs + #endregion + + #region Asset Dirs + public static readonly string AssetCacheDir = GlobalPaths.DataPath + "\\assetcache"; + public static readonly string AssetCacheDirSky = AssetCacheDir + "\\sky"; + public static readonly string AssetCacheDirFonts = AssetCacheDir + DirFonts; + public static readonly string AssetCacheDirSounds = AssetCacheDir + DirSounds; + public static readonly string AssetCacheDirTextures = AssetCacheDir + DirTextures; + public static readonly string AssetCacheDirTexturesGUI = AssetCacheDirTextures + "\\gui"; + public static readonly string AssetCacheDirScripts = AssetCacheDir + DirScripts; + + public static readonly string AssetCacheGameDir = GlobalPaths.SharedDataGameDir + "assetcache/"; + public static readonly string AssetCacheFontsGameDir = AssetCacheGameDir + FontsGameDir; + public static readonly string AssetCacheSkyGameDir = AssetCacheGameDir + "sky/"; + public static readonly string AssetCacheSoundsGameDir = AssetCacheGameDir + SoundsGameDir; + public static readonly string AssetCacheTexturesGameDir = AssetCacheGameDir + TexturesGameDir; + public static readonly string AssetCacheTexturesGUIGameDir = AssetCacheTexturesGameDir + "gui/"; + public static readonly string AssetCacheScriptsGameDir = AssetCacheGameDir + ScriptsGameDir; + #endregion + + #region Item Dirs public static readonly string hatdirFonts = GlobalPaths.hatdir + DirFonts; public static readonly string hatdirTextures = GlobalPaths.hatdir + DirTextures; public static readonly string hatdirSounds = GlobalPaths.hatdir + DirSounds; @@ -36,21 +57,9 @@ namespace NovetusLauncher public static readonly string tshirtGameDirTextures = GlobalPaths.tshirtGameDir + TexturesGameDir; public static readonly string shirtGameDirTextures = GlobalPaths.shirtGameDir + TexturesGameDir; public static readonly string pantsGameDirTextures = GlobalPaths.pantsGameDir + TexturesGameDir; + #endregion - public static readonly string AssetCacheDir = GlobalPaths.DataPath + "\\assetcache"; - public static readonly string AssetCacheDirSky = AssetCacheDir + "\\sky"; - public static readonly string AssetCacheDirFonts = AssetCacheDir + DirFonts; - public static readonly string AssetCacheDirSounds = AssetCacheDir + DirSounds; - public static readonly string AssetCacheDirTextures = AssetCacheDir + DirTextures; - public static readonly string AssetCacheDirTexturesGUI = AssetCacheDirTextures + "\\gui"; - public static readonly string AssetCacheDirScripts = AssetCacheDir + DirScripts; - - public static readonly string AssetCacheGameDir = GlobalPaths.SharedDataGameDir + "assetcache/"; - public static readonly string AssetCacheFontsGameDir = AssetCacheGameDir + FontsGameDir; - public static readonly string AssetCacheSkyGameDir = AssetCacheGameDir + "sky/"; - public static readonly string AssetCacheSoundsGameDir = AssetCacheGameDir + SoundsGameDir; - public static readonly string AssetCacheTexturesGameDir = AssetCacheGameDir + TexturesGameDir; - public static readonly string AssetCacheTexturesGUIGameDir = AssetCacheTexturesGameDir + "gui/"; - public static readonly string AssetCacheScriptsGameDir = AssetCacheGameDir + ScriptsGameDir; + #endregion } + #endregion } diff --git a/Novetus/NovetusLauncher/Classes/Launcher/LocalVars.cs b/Novetus/NovetusLauncher/Classes/LocalVars.cs similarity index 56% rename from Novetus/NovetusLauncher/Classes/Launcher/LocalVars.cs rename to Novetus/NovetusLauncher/Classes/LocalVars.cs index 304793b..1704f25 100644 --- a/Novetus/NovetusLauncher/Classes/Launcher/LocalVars.cs +++ b/Novetus/NovetusLauncher/Classes/LocalVars.cs @@ -4,10 +4,13 @@ namespace NovetusLauncher #region LocalVars class LocalVars { + #region Easter Egg Variables public static int Clicks = 0; public static string prevsplash = ""; - public static int DefaultRobloxPort = 53640; - public static bool LocalPlayMode = false; + #endregion + #region Commands + public static string important = ""; + #endregion } #endregion } diff --git a/Novetus/NovetusLauncher/LauncherForm/Compact/LauncherFormCompact.Designer.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs similarity index 100% rename from Novetus/NovetusLauncher/LauncherForm/Compact/LauncherFormCompact.Designer.cs rename to Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs diff --git a/Novetus/NovetusLauncher/LauncherForm/Compact/LauncherFormCompact.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs similarity index 92% rename from Novetus/NovetusLauncher/LauncherForm/Compact/LauncherFormCompact.cs rename to Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs index 13305d0..b29699f 100644 --- a/Novetus/NovetusLauncher/LauncherForm/Compact/LauncherFormCompact.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.cs @@ -25,7 +25,7 @@ namespace NovetusLauncher public partial class LauncherFormCompact : Form { DiscordRPC.EventHandlers handlers; - + public LauncherFormCompact() { _fieldsTreeCache = new TreeView(); @@ -165,7 +165,7 @@ namespace NovetusLauncher handlers.requestCallback += RequestCallback; DiscordRPC.Initialize(GlobalVars.appid, ref handlers, true, ""); - LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "", true); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, "", true); } } #endregion @@ -322,7 +322,7 @@ namespace NovetusLauncher void Button1Click(object sender, EventArgs e) { - if (LocalVars.LocalPlayMode) + if (GlobalVars.LocalPlayMode) { GeneratePlayerID(); GenerateTripcode(); @@ -424,14 +424,14 @@ namespace NovetusLauncher ConsolePrint("ERROR - " + GlobalPaths.RootPath + "\\credits.txt not found.", 2); } - if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName)) + if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName)) { - ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName + " not found. Creating one with default values.", 5); + ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName + " not found. Creating one with default values.", 5); WriteConfigValues(); } - if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization)) + if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization)) { - ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization + " not found. Creating one with default values.", 5); + ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization + " not found. Creating one with default values.", 5); WriteCustomizationValues(); } if (!File.Exists(GlobalPaths.ConfigDir + "\\servers.txt")) @@ -471,7 +471,7 @@ namespace NovetusLauncher } label8.Text = Application.ProductVersion; - GlobalVars.important = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location); + LocalVars.important = SecurityFuncs.GenerateMD5(Assembly.GetExecutingAssembly().Location); label11.Text = GlobalVars.ProgramInformation.Version; label12.Text = SplashReader.GetSplash(); @@ -485,7 +485,7 @@ namespace NovetusLauncher void MainFormClose(object sender, CancelEventArgs e) { - if (LocalVars.LocalPlayMode != true) + if (!GlobalVars.LocalPlayMode) { WriteConfigValues(); } @@ -501,7 +501,7 @@ namespace NovetusLauncher void ReadConfigValues() { - LauncherFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName, false); + GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); checkBox1.Checked = GlobalVars.UserConfiguration.CloseOnLaunch; textBox5.Text = GlobalVars.UserConfiguration.UserID.ToString(); @@ -535,13 +535,13 @@ namespace NovetusLauncher void WriteConfigValues() { - LauncherFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName, true); + GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); ConsolePrint("Config Saved.", 3); } void WriteCustomizationValues() { - LauncherFuncs.Customization(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization, true); + GlobalFuncs.Customization(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization, true); ConsolePrint("Config Saved.", 3); } @@ -558,7 +558,7 @@ namespace NovetusLauncher } else { - LauncherFuncs.ReadClientValues(clientpath); + GlobalFuncs.ReadClientValues(clientpath); switch (GlobalVars.SelectedClientInfo.UsesPlayerName) { @@ -584,7 +584,7 @@ namespace NovetusLauncher textBox5.Enabled = false; button4.Enabled = false; checkBox3.Enabled = false; - LocalVars.LocalPlayMode = false; + GlobalVars.LocalPlayMode = false; break; } @@ -606,13 +606,13 @@ namespace NovetusLauncher void GeneratePlayerID() { - LauncherFuncs.GeneratePlayerID(); + GlobalFuncs.GeneratePlayerID(); textBox5.Text = Convert.ToString(GlobalVars.UserConfiguration.UserID); } void GenerateTripcode() { - LauncherFuncs.GenerateTripcode(); + GlobalFuncs.GenerateTripcode(); label18.Text = GlobalVars.UserConfiguration.PlayerTripcode; } @@ -620,7 +620,7 @@ namespace NovetusLauncher { GlobalVars.IP = textBox1.Text; checkBox3.Enabled = false; - LocalVars.LocalPlayMode = false; + GlobalVars.LocalPlayMode = false; label37.Text = GlobalVars.IP; } @@ -649,12 +649,12 @@ namespace NovetusLauncher { GlobalVars.UserConfiguration.SelectedClient = listBox2.SelectedItem.ToString(); ReadClientValues(GlobalVars.UserConfiguration.SelectedClient); - LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, ""); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, ""); } void CheckBox3CheckedChanged(object sender, EventArgs e) { - LocalVars.LocalPlayMode = checkBox3.Checked; + GlobalVars.LocalPlayMode = checkBox3.Checked; } void TextBox5TextChanged(object sender, EventArgs e) @@ -694,7 +694,7 @@ namespace NovetusLauncher GlobalVars.IP = listBox3.SelectedItem.ToString(); textBox1.Text = GlobalVars.IP; checkBox3.Enabled = false; - LocalVars.LocalPlayMode = false; + GlobalVars.LocalPlayMode = false; label37.Text = GlobalVars.IP; } @@ -804,7 +804,7 @@ namespace NovetusLauncher void ResetConfigValues() { - LauncherFuncs.ResetConfigValues(); + GlobalFuncs.ResetConfigValues(); WriteConfigValues(); ReadConfigValues(); } @@ -842,8 +842,8 @@ namespace NovetusLauncher //Rewrite these into one function. Preferably global. void StartClient() { - string luafile = LauncherFuncs.GetLuaFileName(); - string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Client); + string luafile = GlobalFuncs.GetLuaFileName(); + string rbxexe = GlobalFuncs.GetClientEXEDir(ScriptType.Client); string quote = "\""; string args = ""; @@ -851,7 +851,7 @@ namespace NovetusLauncher { if (!GlobalVars.SelectedClientInfo.Fix2007) { - args = "-script " + quote + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Client) + quote; + args = "-script " + quote + GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Client) + quote; } else { @@ -866,9 +866,9 @@ namespace NovetusLauncher try { ConsolePrint("Client Loaded.", 4); - if (GlobalVars.AdminMode != true) + if (!GlobalVars.AdminMode) { - if (GlobalVars.SelectedClientInfo.AlreadyHasSecurity != true) + if (!GlobalVars.SelectedClientInfo.AlreadyHasSecurity) { if (SecurityFuncs.checkClientMD5(GlobalVars.UserConfiguration.SelectedClient)) { @@ -916,12 +916,12 @@ namespace NovetusLauncher client.Start(); client.PriorityClass = ProcessPriorityClass.RealTime; SecurityFuncs.RenameWindow(client, ScriptType.Client, GlobalVars.UserConfiguration.Map); - LauncherFuncs.UpdateRichPresence(LauncherState.InMPGame, GlobalVars.UserConfiguration.Map); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InMPGame, GlobalVars.UserConfiguration.Map); } void ClientExited(object sender, EventArgs e) { - LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, ""); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, ""); if (GlobalVars.UserConfiguration.CloseOnLaunch) { Visible = true; @@ -938,7 +938,7 @@ namespace NovetusLauncher void EasterEggExited(object sender, EventArgs e) { - LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, ""); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, ""); label12.Text = LocalVars.prevsplash; if (GlobalVars.UserConfiguration.CloseOnLaunch) { @@ -948,8 +948,8 @@ namespace NovetusLauncher void StartSolo() { - string luafile = LauncherFuncs.GetLuaFileName(); - string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Solo); + string luafile = GlobalFuncs.GetLuaFileName(); + string rbxexe = GlobalFuncs.GetClientEXEDir(ScriptType.Solo); string mapfile = GlobalVars.UserConfiguration.MapPath; string quote = "\""; string args = ""; @@ -957,7 +957,7 @@ namespace NovetusLauncher { if (!GlobalVars.SelectedClientInfo.Fix2007) { - args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Solo) + quote; + args = quote + mapfile + "\" -script \"" + GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Solo) + quote; } else { @@ -981,7 +981,7 @@ namespace NovetusLauncher client.Start(); client.PriorityClass = ProcessPriorityClass.RealTime; SecurityFuncs.RenameWindow(client, ScriptType.Solo, GlobalVars.UserConfiguration.Map); - LauncherFuncs.UpdateRichPresence(LauncherState.InSoloGame, GlobalVars.UserConfiguration.Map); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InSoloGame, GlobalVars.UserConfiguration.Map); } catch (Exception ex) { @@ -992,8 +992,8 @@ namespace NovetusLauncher void StartServer(bool no3d) { - string luafile = LauncherFuncs.GetLuaFileName(); - string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Server); + string luafile = GlobalFuncs.GetLuaFileName(); + string rbxexe = GlobalFuncs.GetClientEXEDir(ScriptType.Server); string mapfile = GlobalVars.UserConfiguration.MapPath; string quote = "\""; string args = ""; @@ -1001,7 +1001,7 @@ namespace NovetusLauncher { if (!GlobalVars.SelectedClientInfo.Fix2007) { - args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Server) + "; " + (!string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? LauncherFuncs.ChangeGameSettings() + " dofile('" + GlobalVars.AddonScriptPath + "');" : "") + quote + (no3d ? " -no3d" : ""); + args = quote + mapfile + "\" -script \"" + GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Server) + "; " + (!string.IsNullOrWhiteSpace(GlobalPaths.AddonScriptPath) ? GlobalFuncs.ChangeGameSettings() + " dofile('" + GlobalPaths.AddonScriptPath + "');" : "") + quote + (no3d ? " -no3d" : ""); } else { @@ -1043,8 +1043,8 @@ namespace NovetusLauncher void StartStudio(bool nomap) { - string luafile = LauncherFuncs.GetLuaFileName(); - string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Studio); + string luafile = GlobalFuncs.GetLuaFileName(); + string rbxexe = GlobalFuncs.GetClientEXEDir(ScriptType.Studio); string mapfile = (nomap ? "" : GlobalVars.UserConfiguration.MapPath); string mapname = (nomap ? "" : GlobalVars.UserConfiguration.Map); string quote = "\""; @@ -1053,7 +1053,7 @@ namespace NovetusLauncher { if (!GlobalVars.SelectedClientInfo.Fix2007) { - args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Studio) + quote; + args = quote + mapfile + "\" -script \"" + GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Studio) + quote; } else { @@ -1077,7 +1077,7 @@ namespace NovetusLauncher client.Start(); client.PriorityClass = ProcessPriorityClass.RealTime; SecurityFuncs.RenameWindow(client, ScriptType.Studio, mapname); - LauncherFuncs.UpdateRichPresence(LauncherState.InStudio, mapname); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InStudio, mapname); } catch (Exception ex) { @@ -1089,8 +1089,8 @@ namespace NovetusLauncher void StartEasterEgg() { label12.Text = "<3"; - string luafile = LauncherFuncs.GetLuaFileName(); - string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.EasterEgg); + string luafile = GlobalFuncs.GetLuaFileName(); + string rbxexe = GlobalFuncs.GetClientEXEDir(ScriptType.EasterEgg); string mapfile = GlobalPaths.ConfigDirData + "\\Appreciation.rbxl"; string quote = "\""; string args = ""; @@ -1098,7 +1098,7 @@ namespace NovetusLauncher { if (!GlobalVars.SelectedClientInfo.Fix2007) { - args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.EasterEgg) + quote; + args = quote + mapfile + "\" -script \"" + GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.EasterEgg) + quote; } else { @@ -1122,7 +1122,7 @@ namespace NovetusLauncher client.Exited += new EventHandler(EasterEggExited); client.PriorityClass = ProcessPriorityClass.RealTime; SecurityFuncs.RenameWindow(client, ScriptType.EasterEgg, ""); - LauncherFuncs.UpdateRichPresence(LauncherState.InEasterEggGame, ""); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InEasterEggGame, ""); } catch (Exception ex) { @@ -1200,7 +1200,7 @@ namespace NovetusLauncher ConsolePrint("WebServer: Cannot restart web server. (" + ex.Message + ")", 2); } break; - case string important when string.Compare(important, GlobalVars.important, true, CultureInfo.InvariantCulture) == 0: + case string important when string.Compare(important, LocalVars.important, true, CultureInfo.InvariantCulture) == 0: GlobalVars.AdminMode = true; ConsolePrint("ADMIN MODE ENABLED.", 4); ConsolePrint("YOU ARE GOD.", 2); @@ -1299,9 +1299,9 @@ namespace NovetusLauncher void Button7Click(object sender, EventArgs e) { - numericUpDown1.Value = Convert.ToDecimal(LocalVars.DefaultRobloxPort); - numericUpDown2.Value = Convert.ToDecimal(LocalVars.DefaultRobloxPort); - GlobalVars.UserConfiguration.RobloxPort = LocalVars.DefaultRobloxPort; + numericUpDown1.Value = Convert.ToDecimal(GlobalVars.DefaultRobloxPort); + numericUpDown2.Value = Convert.ToDecimal(GlobalVars.DefaultRobloxPort); + GlobalVars.UserConfiguration.RobloxPort = GlobalVars.DefaultRobloxPort; } void Button23Click(object sender, EventArgs e) @@ -1311,9 +1311,9 @@ namespace NovetusLauncher void Button22Click(object sender, EventArgs e) { - numericUpDown1.Value = Convert.ToDecimal(LocalVars.DefaultRobloxPort); - numericUpDown2.Value = Convert.ToDecimal(LocalVars.DefaultRobloxPort); - GlobalVars.UserConfiguration.RobloxPort = LocalVars.DefaultRobloxPort; + numericUpDown1.Value = Convert.ToDecimal(GlobalVars.DefaultRobloxPort); + numericUpDown2.Value = Convert.ToDecimal(GlobalVars.DefaultRobloxPort); + GlobalVars.UserConfiguration.RobloxPort = GlobalVars.DefaultRobloxPort; } void TreeView1AfterSelect(object sender, TreeViewEventArgs e) diff --git a/Novetus/NovetusLauncher/LauncherForm/Compact/LauncherFormCompact.resx b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.resx similarity index 100% rename from Novetus/NovetusLauncher/LauncherForm/Compact/LauncherFormCompact.resx rename to Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.resx diff --git a/Novetus/NovetusLauncher/LauncherForm/Compact/LauncherFormCompactSettings.Designer.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.Designer.cs similarity index 100% rename from Novetus/NovetusLauncher/LauncherForm/Compact/LauncherFormCompactSettings.Designer.cs rename to Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.Designer.cs diff --git a/Novetus/NovetusLauncher/LauncherForm/Compact/LauncherFormCompactSettings.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.cs similarity index 97% rename from Novetus/NovetusLauncher/LauncherForm/Compact/LauncherFormCompactSettings.cs rename to Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.cs index 2685509..69d8a8e 100644 --- a/Novetus/NovetusLauncher/LauncherForm/Compact/LauncherFormCompactSettings.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.cs @@ -12,7 +12,7 @@ namespace NovetusLauncher void ReadConfigValues() { - LauncherFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName, false); + GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); checkBox5.Checked = GlobalVars.UserConfiguration.ReShade; checkBox6.Checked = GlobalVars.UserConfiguration.ReShadeFPSDisplay; checkBox7.Checked = GlobalVars.UserConfiguration.ReShadePerformanceMode; diff --git a/Novetus/NovetusLauncher/LauncherForm/Compact/LauncherFormCompactSettings.resx b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.resx similarity index 100% rename from Novetus/NovetusLauncher/LauncherForm/Compact/LauncherFormCompactSettings.resx rename to Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompactSettings.resx diff --git a/Novetus/NovetusLauncher/LauncherForm/Extended/LauncherFormExtended.Designer.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.Designer.cs similarity index 100% rename from Novetus/NovetusLauncher/LauncherForm/Extended/LauncherFormExtended.Designer.cs rename to Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.Designer.cs diff --git a/Novetus/NovetusLauncher/LauncherForm/Extended/LauncherFormExtended.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs similarity index 92% rename from Novetus/NovetusLauncher/LauncherForm/Extended/LauncherFormExtended.cs rename to Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs index dee848f..5a4813a 100644 --- a/Novetus/NovetusLauncher/LauncherForm/Extended/LauncherFormExtended.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.cs @@ -167,7 +167,7 @@ namespace NovetusLauncher handlers.requestCallback += RequestCallback; DiscordRPC.Initialize(GlobalVars.appid, ref handlers, true, ""); - LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, "", true); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, "", true); } } #endregion @@ -324,7 +324,7 @@ namespace NovetusLauncher void Button1Click(object sender, EventArgs e) { - if (LocalVars.LocalPlayMode) + if (GlobalVars.LocalPlayMode) { GeneratePlayerID(); GenerateTripcode(); @@ -426,14 +426,14 @@ namespace NovetusLauncher ConsolePrint("ERROR - " + GlobalPaths.RootPath + "\\credits.txt not found.", 2); } - if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName)) + if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName)) { - ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName + " not found. Creating one with default values.", 5); + ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName + " not found. Creating one with default values.", 5); WriteConfigValues(); } - if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization)) + if (!File.Exists(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization)) { - ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization + " not found. Creating one with default values.", 5); + ConsolePrint("WARNING - " + GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization + " not found. Creating one with default values.", 5); WriteCustomizationValues(); } if (!File.Exists(GlobalPaths.ConfigDir + "\\servers.txt")) @@ -473,7 +473,7 @@ namespace NovetusLauncher } label8.Text = Application.ProductVersion; - GlobalVars.important = SecurityFuncs.CalculateMD5(Assembly.GetExecutingAssembly().Location); + LocalVars.important = SecurityFuncs.GenerateMD5(Assembly.GetExecutingAssembly().Location); label11.Text = GlobalVars.ProgramInformation.Version; label12.Text = SplashReader.GetSplash(); @@ -487,7 +487,7 @@ namespace NovetusLauncher void MainFormClose(object sender, CancelEventArgs e) { - if (LocalVars.LocalPlayMode != true) + if (!GlobalVars.LocalPlayMode) { WriteConfigValues(); } @@ -503,7 +503,7 @@ namespace NovetusLauncher void ReadConfigValues() { - LauncherFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName, false); + GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); checkBox1.Checked = GlobalVars.UserConfiguration.CloseOnLaunch; textBox5.Text = GlobalVars.UserConfiguration.UserID.ToString(); @@ -571,13 +571,13 @@ namespace NovetusLauncher void WriteConfigValues() { - LauncherFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName, true); + GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); ConsolePrint("Config Saved.", 3); } void WriteCustomizationValues() { - LauncherFuncs.Customization(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigNameCustomization, true); + GlobalFuncs.Customization(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigNameCustomization, true); ConsolePrint("Config Saved.", 3); } @@ -594,7 +594,7 @@ namespace NovetusLauncher } else { - LauncherFuncs.ReadClientValues(clientpath); + GlobalFuncs.ReadClientValues(clientpath); switch (GlobalVars.SelectedClientInfo.UsesPlayerName) { @@ -620,7 +620,7 @@ namespace NovetusLauncher textBox5.Enabled = false; button4.Enabled = false; checkBox3.Enabled = false; - LocalVars.LocalPlayMode = false; + GlobalVars.LocalPlayMode = false; break; } @@ -642,13 +642,13 @@ namespace NovetusLauncher void GeneratePlayerID() { - LauncherFuncs.GeneratePlayerID(); + GlobalFuncs.GeneratePlayerID(); textBox5.Text = Convert.ToString(GlobalVars.UserConfiguration.UserID); } void GenerateTripcode() { - LauncherFuncs.GenerateTripcode(); + GlobalFuncs.GenerateTripcode(); label18.Text = GlobalVars.UserConfiguration.PlayerTripcode; } @@ -656,7 +656,7 @@ namespace NovetusLauncher { GlobalVars.IP = textBox1.Text; checkBox3.Enabled = false; - LocalVars.LocalPlayMode = false; + GlobalVars.LocalPlayMode = false; label37.Text = GlobalVars.IP; } @@ -685,12 +685,12 @@ namespace NovetusLauncher { GlobalVars.UserConfiguration.SelectedClient = listBox2.SelectedItem.ToString(); ReadClientValues(GlobalVars.UserConfiguration.SelectedClient); - LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, ""); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, ""); } void CheckBox3CheckedChanged(object sender, EventArgs e) { - LocalVars.LocalPlayMode = checkBox3.Checked; + GlobalVars.LocalPlayMode = checkBox3.Checked; } void TextBox5TextChanged(object sender, EventArgs e) @@ -730,7 +730,7 @@ namespace NovetusLauncher GlobalVars.IP = listBox3.SelectedItem.ToString(); textBox1.Text = GlobalVars.IP; checkBox3.Enabled = false; - LocalVars.LocalPlayMode = false; + GlobalVars.LocalPlayMode = false; label37.Text = GlobalVars.IP; } @@ -840,7 +840,7 @@ namespace NovetusLauncher void ResetConfigValues() { - LauncherFuncs.ResetConfigValues(); + GlobalFuncs.ResetConfigValues(); WriteConfigValues(); ReadConfigValues(); } @@ -878,8 +878,8 @@ namespace NovetusLauncher //Rewrite these into one function. Preferably global. void StartClient() { - string luafile = LauncherFuncs.GetLuaFileName(); - string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Client); + string luafile = GlobalFuncs.GetLuaFileName(); + string rbxexe = GlobalFuncs.GetClientEXEDir(ScriptType.Client); string quote = "\""; string args = ""; @@ -887,7 +887,7 @@ namespace NovetusLauncher { if (!GlobalVars.SelectedClientInfo.Fix2007) { - args = "-script " + quote + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Client) + quote; + args = "-script " + quote + GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Client) + quote; } else { @@ -902,7 +902,7 @@ namespace NovetusLauncher try { ConsolePrint("Client Loaded.", 4); - if (GlobalVars.AdminMode != true) + if (!GlobalVars.AdminMode) { if (GlobalVars.SelectedClientInfo.AlreadyHasSecurity != true) { @@ -952,12 +952,12 @@ namespace NovetusLauncher client.Start(); client.PriorityClass = ProcessPriorityClass.RealTime; SecurityFuncs.RenameWindow(client, ScriptType.Client, GlobalVars.UserConfiguration.Map); - LauncherFuncs.UpdateRichPresence(LauncherState.InMPGame, GlobalVars.UserConfiguration.Map); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InMPGame, GlobalVars.UserConfiguration.Map); } void ClientExited(object sender, EventArgs e) { - LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, ""); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, ""); if (GlobalVars.UserConfiguration.CloseOnLaunch) { Visible = true; @@ -974,7 +974,7 @@ namespace NovetusLauncher void EasterEggExited(object sender, EventArgs e) { - LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, ""); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, ""); label12.Text = LocalVars.prevsplash; if (GlobalVars.UserConfiguration.CloseOnLaunch) { @@ -984,8 +984,8 @@ namespace NovetusLauncher void StartSolo() { - string luafile = LauncherFuncs.GetLuaFileName(); - string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Solo); + string luafile = GlobalFuncs.GetLuaFileName(); + string rbxexe = GlobalFuncs.GetClientEXEDir(ScriptType.Solo); string mapfile = GlobalVars.UserConfiguration.MapPath; string quote = "\""; string args = ""; @@ -993,7 +993,7 @@ namespace NovetusLauncher { if (!GlobalVars.SelectedClientInfo.Fix2007) { - args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Solo) + quote; + args = quote + mapfile + "\" -script \"" + GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Solo) + quote; } else { @@ -1017,7 +1017,7 @@ namespace NovetusLauncher client.Start(); client.PriorityClass = ProcessPriorityClass.RealTime; SecurityFuncs.RenameWindow(client, ScriptType.Solo, GlobalVars.UserConfiguration.Map); - LauncherFuncs.UpdateRichPresence(LauncherState.InSoloGame, GlobalVars.UserConfiguration.Map); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InSoloGame, GlobalVars.UserConfiguration.Map); } catch (Exception ex) { @@ -1028,8 +1028,8 @@ namespace NovetusLauncher void StartServer(bool no3d) { - string luafile = LauncherFuncs.GetLuaFileName(); - string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Server); + string luafile = GlobalFuncs.GetLuaFileName(); + string rbxexe = GlobalFuncs.GetClientEXEDir(ScriptType.Server); string mapfile = GlobalVars.UserConfiguration.MapPath; string quote = "\""; string args = ""; @@ -1037,7 +1037,7 @@ namespace NovetusLauncher { if (!GlobalVars.SelectedClientInfo.Fix2007) { - args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Server) + "; " + (!string.IsNullOrWhiteSpace(GlobalVars.AddonScriptPath) ? LauncherFuncs.ChangeGameSettings() + " dofile('" + GlobalVars.AddonScriptPath + "');" : "") + quote + (no3d ? " -no3d" : ""); + args = quote + mapfile + "\" -script \"" + GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Server) + "; " + (!string.IsNullOrWhiteSpace(GlobalPaths.AddonScriptPath) ? GlobalFuncs.ChangeGameSettings() + " dofile('" + GlobalPaths.AddonScriptPath + "');" : "") + quote + (no3d ? " -no3d" : ""); } else { @@ -1079,8 +1079,8 @@ namespace NovetusLauncher void StartStudio(bool nomap) { - string luafile = LauncherFuncs.GetLuaFileName(); - string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.Studio); + string luafile = GlobalFuncs.GetLuaFileName(); + string rbxexe = GlobalFuncs.GetClientEXEDir(ScriptType.Studio); string mapfile = (nomap ? "" : GlobalVars.UserConfiguration.MapPath); string mapname = (nomap ? "" : GlobalVars.UserConfiguration.Map); string quote = "\""; @@ -1089,7 +1089,7 @@ namespace NovetusLauncher { if (!GlobalVars.SelectedClientInfo.Fix2007) { - args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Studio) + quote; + args = quote + mapfile + "\" -script \"" + GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Studio) + quote; } else { @@ -1113,7 +1113,7 @@ namespace NovetusLauncher client.Start(); client.PriorityClass = ProcessPriorityClass.RealTime; SecurityFuncs.RenameWindow(client, ScriptType.Studio, mapname); - LauncherFuncs.UpdateRichPresence(LauncherState.InStudio, mapname); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InStudio, mapname); } catch (Exception ex) { @@ -1125,8 +1125,8 @@ namespace NovetusLauncher void StartEasterEgg() { label12.Text = "<3"; - string luafile = LauncherFuncs.GetLuaFileName(); - string rbxexe = LauncherFuncs.GetClientEXEDir(ScriptType.EasterEgg); + string luafile = GlobalFuncs.GetLuaFileName(); + string rbxexe = GlobalFuncs.GetClientEXEDir(ScriptType.EasterEgg); string mapfile = GlobalPaths.ConfigDirData + "\\Appreciation.rbxl"; string quote = "\""; string args = ""; @@ -1134,7 +1134,7 @@ namespace NovetusLauncher { if (!GlobalVars.SelectedClientInfo.Fix2007) { - args = quote + mapfile + "\" -script \"" + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.EasterEgg) + quote; + args = quote + mapfile + "\" -script \"" + GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.EasterEgg) + quote; } else { @@ -1158,7 +1158,7 @@ namespace NovetusLauncher client.Exited += new EventHandler(EasterEggExited); client.PriorityClass = ProcessPriorityClass.RealTime; SecurityFuncs.RenameWindow(client, ScriptType.EasterEgg, ""); - LauncherFuncs.UpdateRichPresence(LauncherState.InEasterEggGame, ""); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InEasterEggGame, ""); } catch (Exception ex) { @@ -1236,7 +1236,7 @@ namespace NovetusLauncher ConsolePrint("WebServer: Cannot restart web server. (" + ex.Message + ")", 2); } break; - case string important when string.Compare(important, GlobalVars.important, true, CultureInfo.InvariantCulture) == 0: + case string important when string.Compare(important, LocalVars.important, true, CultureInfo.InvariantCulture) == 0: GlobalVars.AdminMode = true; ConsolePrint("ADMIN MODE ENABLED.", 4); ConsolePrint("YOU ARE GOD.", 2); @@ -1335,9 +1335,9 @@ namespace NovetusLauncher void Button7Click(object sender, EventArgs e) { - numericUpDown1.Value = Convert.ToDecimal(LocalVars.DefaultRobloxPort); - numericUpDown2.Value = Convert.ToDecimal(LocalVars.DefaultRobloxPort); - GlobalVars.UserConfiguration.RobloxPort = LocalVars.DefaultRobloxPort; + numericUpDown1.Value = Convert.ToDecimal(GlobalVars.DefaultRobloxPort); + numericUpDown2.Value = Convert.ToDecimal(GlobalVars.DefaultRobloxPort); + GlobalVars.UserConfiguration.RobloxPort = GlobalVars.DefaultRobloxPort; } void Button23Click(object sender, EventArgs e) @@ -1347,9 +1347,9 @@ namespace NovetusLauncher void Button22Click(object sender, EventArgs e) { - numericUpDown1.Value = Convert.ToDecimal(LocalVars.DefaultRobloxPort); - numericUpDown2.Value = Convert.ToDecimal(LocalVars.DefaultRobloxPort); - GlobalVars.UserConfiguration.RobloxPort = LocalVars.DefaultRobloxPort; + numericUpDown1.Value = Convert.ToDecimal(GlobalVars.DefaultRobloxPort); + numericUpDown2.Value = Convert.ToDecimal(GlobalVars.DefaultRobloxPort); + GlobalVars.UserConfiguration.RobloxPort = GlobalVars.DefaultRobloxPort; } void TreeView1AfterSelect(object sender, TreeViewEventArgs e) diff --git a/Novetus/NovetusLauncher/LauncherForm/Extended/LauncherFormExtended.resx b/Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.resx similarity index 100% rename from Novetus/NovetusLauncher/LauncherForm/Extended/LauncherFormExtended.resx rename to Novetus/NovetusLauncher/Forms/LauncherForm/Extended/LauncherFormExtended.resx diff --git a/Novetus/NovetusLauncher/SDK/AssetLocalizer.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/AssetLocalizer.Designer.cs similarity index 100% rename from Novetus/NovetusLauncher/SDK/AssetLocalizer.Designer.cs rename to Novetus/NovetusLauncher/Forms/SDK/AssetLocalizer.Designer.cs diff --git a/Novetus/NovetusLauncher/SDK/AssetLocalizer.cs b/Novetus/NovetusLauncher/Forms/SDK/AssetLocalizer.cs similarity index 100% rename from Novetus/NovetusLauncher/SDK/AssetLocalizer.cs rename to Novetus/NovetusLauncher/Forms/SDK/AssetLocalizer.cs diff --git a/Novetus/NovetusLauncher/SDK/AssetLocalizer.resx b/Novetus/NovetusLauncher/Forms/SDK/AssetLocalizer.resx similarity index 100% rename from Novetus/NovetusLauncher/SDK/AssetLocalizer.resx rename to Novetus/NovetusLauncher/Forms/SDK/AssetLocalizer.resx diff --git a/Novetus/NovetusLauncher/SDK/ClientScriptDocumentation.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/ClientScriptDocumentation.Designer.cs similarity index 100% rename from Novetus/NovetusLauncher/SDK/ClientScriptDocumentation.Designer.cs rename to Novetus/NovetusLauncher/Forms/SDK/ClientScriptDocumentation.Designer.cs diff --git a/Novetus/NovetusLauncher/SDK/ClientScriptDocumentation.cs b/Novetus/NovetusLauncher/Forms/SDK/ClientScriptDocumentation.cs similarity index 100% rename from Novetus/NovetusLauncher/SDK/ClientScriptDocumentation.cs rename to Novetus/NovetusLauncher/Forms/SDK/ClientScriptDocumentation.cs diff --git a/Novetus/NovetusLauncher/SDK/ClientScriptDocumentation.resx b/Novetus/NovetusLauncher/Forms/SDK/ClientScriptDocumentation.resx similarity index 100% rename from Novetus/NovetusLauncher/SDK/ClientScriptDocumentation.resx rename to Novetus/NovetusLauncher/Forms/SDK/ClientScriptDocumentation.resx diff --git a/Novetus/NovetusLauncher/SDK/ClientinfoCreator.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs similarity index 100% rename from Novetus/NovetusLauncher/SDK/ClientinfoCreator.Designer.cs rename to Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.Designer.cs diff --git a/Novetus/NovetusLauncher/SDK/ClientinfoCreator.cs b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs similarity index 96% rename from Novetus/NovetusLauncher/SDK/ClientinfoCreator.cs rename to Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs index 2efdaff..e9f4e32 100644 --- a/Novetus/NovetusLauncher/SDK/ClientinfoCreator.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.cs @@ -94,7 +94,7 @@ namespace NovetusLauncher ClientName = "\\RobloxApp.exe"; } - string ClientMD5 = File.Exists(SelectedClientInfoPath + ClientName) ? SecurityFuncs.CalculateMD5(SelectedClientInfoPath + ClientName) : ""; + string ClientMD5 = File.Exists(SelectedClientInfoPath + ClientName) ? SecurityFuncs.GenerateMD5(SelectedClientInfoPath + ClientName) : ""; if (!string.IsNullOrWhiteSpace(ClientMD5)) { @@ -107,7 +107,7 @@ namespace NovetusLauncher MessageBox.Show("Cannot load '" + ClientName.Trim('/') + "'. Please make sure you selected the directory","Novetus Launcher - Error while generating MD5 for client", MessageBoxButtons.OK, MessageBoxIcon.Error); } - string ClientScriptMD5 = File.Exists(SelectedClientInfoPath + "\\content\\scripts\\" + GlobalVars.ScriptName + ".lua") ? SecurityFuncs.CalculateMD5(SelectedClientInfoPath + "\\content\\scripts\\" + GlobalVars.ScriptName + ".lua") : ""; + string ClientScriptMD5 = File.Exists(SelectedClientInfoPath + "\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua") ? SecurityFuncs.GenerateMD5(SelectedClientInfoPath + "\\content\\scripts\\" + GlobalPaths.ScriptName + ".lua") : ""; if (!string.IsNullOrWhiteSpace(ClientScriptMD5)) { @@ -117,7 +117,7 @@ namespace NovetusLauncher } else { - MessageBox.Show("Cannot load '" + GlobalVars.ScriptName + ".lua'. Please make sure you selected the directory","Novetus Launcher - Error while generating MD5 for script", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show("Cannot load '" + GlobalPaths.ScriptName + ".lua'. Please make sure you selected the directory","Novetus Launcher - Error while generating MD5 for script", MessageBoxButtons.OK, MessageBoxIcon.Error); } MessageBox.Show("MD5s generated.","Novetus Launcher - Novetus Client SDK", MessageBoxButtons.OK, MessageBoxIcon.Information); @@ -234,7 +234,7 @@ namespace NovetusLauncher IsVersion2 = false; } - if (GlobalVars.AdminMode != true) + if (!GlobalVars.AdminMode) { bool bline8 = Convert.ToBoolean(locked); if (bline8) diff --git a/Novetus/NovetusLauncher/SDK/ClientinfoCreator.resx b/Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.resx similarity index 100% rename from Novetus/NovetusLauncher/SDK/ClientinfoCreator.resx rename to Novetus/NovetusLauncher/Forms/SDK/ClientinfoCreator.resx diff --git a/Novetus/NovetusLauncher/SDK/DiogenesEditor.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/DiogenesEditor.Designer.cs similarity index 100% rename from Novetus/NovetusLauncher/SDK/DiogenesEditor.Designer.cs rename to Novetus/NovetusLauncher/Forms/SDK/DiogenesEditor.Designer.cs diff --git a/Novetus/NovetusLauncher/SDK/DiogenesEditor.cs b/Novetus/NovetusLauncher/Forms/SDK/DiogenesEditor.cs similarity index 100% rename from Novetus/NovetusLauncher/SDK/DiogenesEditor.cs rename to Novetus/NovetusLauncher/Forms/SDK/DiogenesEditor.cs diff --git a/Novetus/NovetusLauncher/SDK/DiogenesEditor.resx b/Novetus/NovetusLauncher/Forms/SDK/DiogenesEditor.resx similarity index 100% rename from Novetus/NovetusLauncher/SDK/DiogenesEditor.resx rename to Novetus/NovetusLauncher/Forms/SDK/DiogenesEditor.resx diff --git a/Novetus/NovetusLauncher/SDK/ItemMaker.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/ItemMaker.Designer.cs similarity index 100% rename from Novetus/NovetusLauncher/SDK/ItemMaker.Designer.cs rename to Novetus/NovetusLauncher/Forms/SDK/ItemMaker.Designer.cs diff --git a/Novetus/NovetusLauncher/SDK/ItemMaker.cs b/Novetus/NovetusLauncher/Forms/SDK/ItemMaker.cs similarity index 97% rename from Novetus/NovetusLauncher/SDK/ItemMaker.cs rename to Novetus/NovetusLauncher/Forms/SDK/ItemMaker.cs index a3ed4d2..03781db 100644 --- a/Novetus/NovetusLauncher/SDK/ItemMaker.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/ItemMaker.cs @@ -37,7 +37,7 @@ namespace NovetusLauncher { try { - string version = ((numericUpDown1.Value != 0) && (isWebSite != true)) ? "&version=" + numericUpDown1.Value : ""; + string version = ((numericUpDown1.Value != 0) && (!isWebSite)) ? "&version=" + numericUpDown1.Value : ""; string fullURL = url + textBox2.Text + version; if (!isWebSite) diff --git a/Novetus/NovetusLauncher/SDK/ItemMaker.resx b/Novetus/NovetusLauncher/Forms/SDK/ItemMaker.resx similarity index 100% rename from Novetus/NovetusLauncher/SDK/ItemMaker.resx rename to Novetus/NovetusLauncher/Forms/SDK/ItemMaker.resx diff --git a/Novetus/NovetusLauncher/SDK/NovetusSDK.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/NovetusSDK.Designer.cs similarity index 100% rename from Novetus/NovetusLauncher/SDK/NovetusSDK.Designer.cs rename to Novetus/NovetusLauncher/Forms/SDK/NovetusSDK.Designer.cs diff --git a/Novetus/NovetusLauncher/SDK/NovetusSDK.cs b/Novetus/NovetusLauncher/Forms/SDK/NovetusSDK.cs similarity index 97% rename from Novetus/NovetusLauncher/SDK/NovetusSDK.cs rename to Novetus/NovetusLauncher/Forms/SDK/NovetusSDK.cs index f14e35c..4cf9e2b 100644 --- a/Novetus/NovetusLauncher/SDK/NovetusSDK.cs +++ b/Novetus/NovetusLauncher/Forms/SDK/NovetusSDK.cs @@ -41,7 +41,7 @@ namespace NovetusLauncher private void NovetusSDK_Close(object sender, CancelEventArgs e) { - LauncherFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName, true); + GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); } private void listBox1_SelectedIndexChanged(object sender, EventArgs e) diff --git a/Novetus/NovetusLauncher/SDK/NovetusSDK.resx b/Novetus/NovetusLauncher/Forms/SDK/NovetusSDK.resx similarity index 100% rename from Novetus/NovetusLauncher/SDK/NovetusSDK.resx rename to Novetus/NovetusLauncher/Forms/SDK/NovetusSDK.resx diff --git a/Novetus/NovetusLauncher/SDK/Obj2MeshV1GUI.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/Obj2MeshV1GUI.Designer.cs similarity index 100% rename from Novetus/NovetusLauncher/SDK/Obj2MeshV1GUI.Designer.cs rename to Novetus/NovetusLauncher/Forms/SDK/Obj2MeshV1GUI.Designer.cs diff --git a/Novetus/NovetusLauncher/SDK/Obj2MeshV1GUI.cs b/Novetus/NovetusLauncher/Forms/SDK/Obj2MeshV1GUI.cs similarity index 100% rename from Novetus/NovetusLauncher/SDK/Obj2MeshV1GUI.cs rename to Novetus/NovetusLauncher/Forms/SDK/Obj2MeshV1GUI.cs diff --git a/Novetus/NovetusLauncher/SDK/Obj2MeshV1GUI.resx b/Novetus/NovetusLauncher/Forms/SDK/Obj2MeshV1GUI.resx similarity index 100% rename from Novetus/NovetusLauncher/SDK/Obj2MeshV1GUI.resx rename to Novetus/NovetusLauncher/Forms/SDK/Obj2MeshV1GUI.resx diff --git a/Novetus/NovetusLauncher/SDK/SplashTester.Designer.cs b/Novetus/NovetusLauncher/Forms/SDK/SplashTester.Designer.cs similarity index 100% rename from Novetus/NovetusLauncher/SDK/SplashTester.Designer.cs rename to Novetus/NovetusLauncher/Forms/SDK/SplashTester.Designer.cs diff --git a/Novetus/NovetusLauncher/SDK/SplashTester.cs b/Novetus/NovetusLauncher/Forms/SDK/SplashTester.cs similarity index 100% rename from Novetus/NovetusLauncher/SDK/SplashTester.cs rename to Novetus/NovetusLauncher/Forms/SDK/SplashTester.cs diff --git a/Novetus/NovetusLauncher/SDK/SplashTester.resx b/Novetus/NovetusLauncher/Forms/SDK/SplashTester.resx similarity index 100% rename from Novetus/NovetusLauncher/SDK/SplashTester.resx rename to Novetus/NovetusLauncher/Forms/SDK/SplashTester.resx diff --git a/Novetus/NovetusLauncher/Novetus.Launcher.csproj b/Novetus/NovetusLauncher/Novetus.Launcher.csproj index 7d39d94..fc7d715 100644 --- a/Novetus/NovetusLauncher/Novetus.Launcher.csproj +++ b/Novetus/NovetusLauncher/Novetus.Launcher.csproj @@ -141,69 +141,69 @@ - + Component - + Form - + LauncherFormCompact.cs - + Form - + LauncherFormCompactSettings.cs - + Form - + ClientinfoCreator.cs - + Form - + ClientScriptDocumentation.cs - + Form - + DiogenesEditor.cs - + Form - + ItemMaker.cs - + Form - + Obj2MeshV1GUI.cs - + Form - + SplashTester.cs - + Form - + NovetusSDK.cs - + Form - + AssetLocalizer.cs @@ -211,13 +211,13 @@ True Resources.resx - + Form - + LauncherFormExtended.cs - + @@ -227,37 +227,37 @@ CharacterCustomization.cs - + LauncherFormCompact.cs - + LauncherFormCompactSettings.cs - + ClientinfoCreator.cs - + ClientScriptDocumentation.cs - + DiogenesEditor.cs - + ItemMaker.cs - + Obj2MeshV1GUI.cs - + SplashTester.cs - + LauncherFormExtended.cs - + NovetusSDK.cs - + AssetLocalizer.cs diff --git a/Novetus/NovetusLauncher/Program.cs b/Novetus/NovetusLauncher/NovetusLauncher.cs similarity index 66% rename from Novetus/NovetusLauncher/Program.cs rename to Novetus/NovetusLauncher/NovetusLauncher.cs index c8da554..4ad77a9 100644 --- a/Novetus/NovetusLauncher/Program.cs +++ b/Novetus/NovetusLauncher/NovetusLauncher.cs @@ -1,21 +1,12 @@ -/* - * Created by SharpDevelop. - * User: BITL-Gaming - * Date: 10/7/2016 - * Time: 3:01 PM - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ +#region Usings using System; -using System.Linq; using System.Windows.Forms; +#endregion namespace NovetusLauncher { - /// - /// Class with program entry point. - /// - internal sealed class Program + #region Novetus Launcher Main Class + internal sealed class NovetusLauncher { static string ProcessInput(string s) { @@ -31,8 +22,8 @@ namespace NovetusLauncher Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - LauncherFuncs.ReadInfoFile(GlobalPaths.ConfigDir + "\\" + GlobalVars.InfoName); - LauncherFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName, false); + GlobalFuncs.ReadInfoFile(GlobalPaths.ConfigDir + "\\" + GlobalPaths.InfoName); + GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); if (args.Length == 0) { switch (GlobalVars.UserConfiguration.LauncherStyle) @@ -59,4 +50,5 @@ namespace NovetusLauncher } } } + #endregion } diff --git a/Novetus/NovetusURI/InstallForm.Designer.cs b/Novetus/NovetusURI/Forms/InstallForm.Designer.cs similarity index 100% rename from Novetus/NovetusURI/InstallForm.Designer.cs rename to Novetus/NovetusURI/Forms/InstallForm.Designer.cs diff --git a/Novetus/NovetusURI/InstallForm.cs b/Novetus/NovetusURI/Forms/InstallForm.cs similarity index 100% rename from Novetus/NovetusURI/InstallForm.cs rename to Novetus/NovetusURI/Forms/InstallForm.cs diff --git a/Novetus/NovetusURI/InstallForm.resx b/Novetus/NovetusURI/Forms/InstallForm.resx similarity index 100% rename from Novetus/NovetusURI/InstallForm.resx rename to Novetus/NovetusURI/Forms/InstallForm.resx diff --git a/Novetus/NovetusURI/LoaderForm.Designer.cs b/Novetus/NovetusURI/Forms/LoaderForm.Designer.cs similarity index 100% rename from Novetus/NovetusURI/LoaderForm.Designer.cs rename to Novetus/NovetusURI/Forms/LoaderForm.Designer.cs diff --git a/Novetus/NovetusURI/LoaderForm.cs b/Novetus/NovetusURI/Forms/LoaderForm.cs similarity index 89% rename from Novetus/NovetusURI/LoaderForm.cs rename to Novetus/NovetusURI/Forms/LoaderForm.cs index 3dab717..fa90324 100644 --- a/Novetus/NovetusURI/LoaderForm.cs +++ b/Novetus/NovetusURI/Forms/LoaderForm.cs @@ -78,7 +78,7 @@ namespace NovetusURI handlers.requestCallback += RequestCallback; DiscordRPC.Initialize(GlobalVars.appid, ref handlers, true, ""); - LauncherFuncs.UpdateRichPresence(LauncherState.LoadingURI, "", true); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.LoadingURI, "", true); } } @@ -97,11 +97,11 @@ namespace NovetusURI string luafile = ""; if (!GlobalVars.SelectedClientInfo.Fix2007) { - luafile = "rbxasset://scripts\\\\" + GlobalVars.ScriptName + ".lua"; + luafile = "rbxasset://scripts\\\\" + GlobalPaths.ScriptName + ".lua"; } else { - luafile = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\scripts\\" + GlobalVars.ScriptGenName + ".lua"; + luafile = GlobalPaths.ClientDir + @"\\" + GlobalVars.UserConfiguration.SelectedClient + @"\\content\\scripts\\" + GlobalPaths.ScriptGenName + ".lua"; } string rbxexe = ""; if (GlobalVars.SelectedClientInfo.LegacyMode) @@ -118,7 +118,7 @@ namespace NovetusURI { if (!GlobalVars.SelectedClientInfo.Fix2007) { - args = "-script " + quote + LauncherFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Client) + quote; + args = "-script " + quote + GlobalFuncs.ChangeGameSettings() + " dofile('" + luafile + "'); " + ScriptFuncs.Generator.GetScriptFuncForType(ScriptType.Client) + quote; } else { @@ -132,9 +132,9 @@ namespace NovetusURI } try { - if (GlobalVars.AdminMode != true) + if (!GlobalVars.AdminMode) { - if (GlobalVars.SelectedClientInfo.AlreadyHasSecurity != true) + if (!GlobalVars.SelectedClientInfo.AlreadyHasSecurity) { if (SecurityFuncs.checkClientMD5(GlobalVars.UserConfiguration.SelectedClient)) { @@ -178,13 +178,13 @@ namespace NovetusURI clientproc.Start(); clientproc.PriorityClass = ProcessPriorityClass.RealTime; SecurityFuncs.RenameWindow(clientproc, ScriptType.Client, ""); - LauncherFuncs.UpdateRichPresence(LauncherState.InMPGame, ""); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InMPGame, ""); this.Visible = false; } void ClientExited(object sender, EventArgs e) { - LauncherFuncs.UpdateRichPresence(LauncherState.InLauncher, ""); + GlobalFuncs.UpdateRichPresence(GlobalVars.LauncherState.InLauncher, ""); this.Close(); } @@ -219,7 +219,7 @@ namespace NovetusURI } else { - LauncherFuncs.ReadClientValues(clientpath); + GlobalFuncs.ReadClientValues(clientpath); } } } diff --git a/Novetus/NovetusURI/LoaderForm.resx b/Novetus/NovetusURI/Forms/LoaderForm.resx similarity index 100% rename from Novetus/NovetusURI/LoaderForm.resx rename to Novetus/NovetusURI/Forms/LoaderForm.resx diff --git a/Novetus/NovetusURI/QuickConfigure.Designer.cs b/Novetus/NovetusURI/Forms/QuickConfigure.Designer.cs similarity index 100% rename from Novetus/NovetusURI/QuickConfigure.Designer.cs rename to Novetus/NovetusURI/Forms/QuickConfigure.Designer.cs diff --git a/Novetus/NovetusURI/QuickConfigure.cs b/Novetus/NovetusURI/Forms/QuickConfigure.cs similarity index 89% rename from Novetus/NovetusURI/QuickConfigure.cs rename to Novetus/NovetusURI/Forms/QuickConfigure.cs index c324914..8c0214b 100644 --- a/Novetus/NovetusURI/QuickConfigure.cs +++ b/Novetus/NovetusURI/Forms/QuickConfigure.cs @@ -33,7 +33,7 @@ namespace NovetusURI void QuickConfigureLoad(object sender, EventArgs e) { - ReadConfigValues(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName); + ReadConfigValues(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName); } void Button3Click(object sender, EventArgs e) @@ -43,7 +43,7 @@ namespace NovetusURI void ReadConfigValues(string cfgpath) { - LauncherFuncs.Config(cfgpath, false); + GlobalFuncs.Config(cfgpath, false); textBox2.Text = GlobalVars.UserConfiguration.UserID.ToString(); label3.Text = GlobalVars.UserConfiguration.PlayerTripcode.ToString(); textBox1.Text = GlobalVars.UserConfiguration.PlayerName; @@ -51,7 +51,7 @@ namespace NovetusURI void GeneratePlayerID() { - LauncherFuncs.GeneratePlayerID(); + GlobalFuncs.GeneratePlayerID(); textBox2.Text = GlobalVars.UserConfiguration.UserID.ToString(); } @@ -93,7 +93,7 @@ namespace NovetusURI void QuickConfigureClose(object sender, CancelEventArgs e) { - LauncherFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName, true); + GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, true); LocalVars.ReadyToLaunch = true; } } diff --git a/Novetus/NovetusURI/QuickConfigure.resx b/Novetus/NovetusURI/Forms/QuickConfigure.resx similarity index 100% rename from Novetus/NovetusURI/QuickConfigure.resx rename to Novetus/NovetusURI/Forms/QuickConfigure.resx diff --git a/Novetus/NovetusURI/Novetus.URI.csproj b/Novetus/NovetusURI/Novetus.URI.csproj index 74524bf..500d1f8 100644 --- a/Novetus/NovetusURI/Novetus.URI.csproj +++ b/Novetus/NovetusURI/Novetus.URI.csproj @@ -86,28 +86,28 @@ - + Form - + InstallForm.cs - + - + Form - + LoaderForm.cs - + Form - + QuickConfigure.cs - + InstallForm.cs @@ -120,10 +120,10 @@ Resources.resx True - + LoaderForm.cs - + QuickConfigure.cs @@ -150,9 +150,7 @@ - - - + SET path=$(SolutionDir)build diff --git a/Novetus/NovetusURI/Program.cs b/Novetus/NovetusURI/NovetusURI.cs similarity index 77% rename from Novetus/NovetusURI/Program.cs rename to Novetus/NovetusURI/NovetusURI.cs index 0b9857f..a91d1ae 100644 --- a/Novetus/NovetusURI/Program.cs +++ b/Novetus/NovetusURI/NovetusURI.cs @@ -1,12 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +#region Usings +using System; using System.Windows.Forms; +#endregion namespace NovetusURI { - internal sealed class Program + #region Novetus URI Main Class + internal sealed class NovetusURI { static string ProcessInput(string s) { @@ -21,7 +21,7 @@ namespace NovetusURI { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - LauncherFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalVars.ConfigName, false); + GlobalFuncs.Config(GlobalPaths.ConfigDir + "\\" + GlobalPaths.ConfigName, false); if (args.Length == 0) { Application.Run(new InstallForm()); @@ -36,6 +36,6 @@ namespace NovetusURI Application.Run(new LoaderForm()); } } - } + #endregion }