diff --git a/Intersect.Client/Interface/Menu/LoginWindow.cs b/Intersect.Client/Interface/Menu/LoginWindow.cs index 8b3c831676..f1d2ebd544 100644 --- a/Intersect.Client/Interface/Menu/LoginWindow.cs +++ b/Intersect.Client/Interface/Menu/LoginWindow.cs @@ -1,4 +1,5 @@ -using System.Security.Cryptography; +using System.Diagnostics; +using System.Security.Cryptography; using System.Text; using Intersect.Client.Core; @@ -51,6 +52,8 @@ public partial class LoginWindow : IMainMenuWindow private bool mUseSavedPass; + private Button mDiscordButton; // Discord button + //Init public LoginWindow(Canvas parent, MainMenu mainMenu) { @@ -119,6 +122,13 @@ public LoginWindow(Canvas parent, MainMenu mainMenu) }; mBackBtn.Clicked += BackBtn_Clicked; + // Discord Button + mDiscordButton = new Button(mLoginWindow, "DiscordButton") + { + Text = "Discord", // Button text + }; + mDiscordButton.Clicked += DiscordButton_Clicked; + LoadCredentials(); mLoginWindow.LoadJsonUi(GameContentManager.UI.Menu, Graphics.Renderer.GetResolutionString()); @@ -223,6 +233,25 @@ void LoginBtn_Clicked(Base sender, ClickedEventArgs arguments) TryLogin(); } + void DiscordButton_Clicked(Base sender, ClickedEventArgs arguments) + { + try + { + System.Diagnostics.Process.Start(new ProcessStartInfo + { + FileName = "cmd", + Arguments = $"/c start https://discord.com/", + UseShellExecute = false, + CreateNoWindow = true + }); + } + catch (Exception ex) + { + // Error if it doesn't open the link + Console.WriteLine($"Error opening Discord link: {ex.Message}"); + } + } + public void TryLogin() { if (Globals.WaitingOnServer) @@ -310,4 +339,4 @@ private void SaveCredentials() } -} +} \ No newline at end of file