From a15997707a5c118e495965517e1e11624b4b7312 Mon Sep 17 00:00:00 2001 From: lodicolo Date: Sat, 3 Aug 2024 15:53:57 -0400 Subject: [PATCH] chore: reformat CreditsWindow, RegistrationWindow (#2370) --- .../Interface/Menu/CreditsWindow.cs | 25 ++++++++--- .../Interface/Menu/RegistrationWindow.cs | 44 ++++++++++++++----- 2 files changed, 52 insertions(+), 17 deletions(-) diff --git a/Intersect.Client/Interface/Menu/CreditsWindow.cs b/Intersect.Client/Interface/Menu/CreditsWindow.cs index f8e5f330d0..783d45f40d 100644 --- a/Intersect.Client/Interface/Menu/CreditsWindow.cs +++ b/Intersect.Client/Interface/Menu/CreditsWindow.cs @@ -17,14 +17,20 @@ public CreditsWindow(Canvas parent, MainMenu mainMenu) : base(parent, "CreditsWi { _mainMenu = mainMenu; - _ = new Label(this, "CreditsHeader") { Text = Strings.Credits.Title }; + _ = new Label(this, "CreditsHeader") + { + Text = Strings.Credits.Title, + }; var creditsContent = new ScrollControl(this, "CreditsScrollview"); creditsContent.EnableScroll(false, true); _richLabel = new RichLabel(creditsContent, "CreditsLabel"); - var btnBack = new Button(this, "BackButton") { Text = Strings.Credits.Back }; + var btnBack = new Button(this, "BackButton") + { + Text = Strings.Credits.Back, + }; btnBack.Clicked += BackBtn_Clicked; LoadJsonUi(GameContentManager.UI.Menu, Graphics.Renderer?.GetResolutionString()); @@ -72,10 +78,15 @@ public override void Show() else { _richLabel.AddText( - text: line.Text, - color: new Color(line.TextColor?.A ?? 255, line.TextColor?.R ?? 255, line.TextColor?.G ?? 255, line.TextColor?.B ?? 255), - alignment: line.GetAlignment(), - font: GameContentManager.Current.GetFont(line.Font, line.Size) + line.Text, + new Color( + line.TextColor?.A ?? 255, + line.TextColor?.R ?? 255, + line.TextColor?.G ?? 255, + line.TextColor?.B ?? 255 + ), + line.GetAlignment(), + GameContentManager.Current.GetFont(line.Font, line.Size) ); _richLabel.AddLineBreak(); @@ -84,4 +95,4 @@ public override void Show() _ = _richLabel.SizeToChildren(false, true); } -} +} \ No newline at end of file diff --git a/Intersect.Client/Interface/Menu/RegistrationWindow.cs b/Intersect.Client/Interface/Menu/RegistrationWindow.cs index d56251326a..20874631f0 100644 --- a/Intersect.Client/Interface/Menu/RegistrationWindow.cs +++ b/Intersect.Client/Interface/Menu/RegistrationWindow.cs @@ -45,28 +45,52 @@ public RegistrationWindow(Canvas parent, MainMenu mainMenu) : base(parent, nameo //Register Email Label/Textbox var emailContainer = new ImagePanel(this, "EmailPanel"); - _ = new Label(emailContainer, "EmailLabel") { Text = Strings.Registration.Email }; - _textBoxEmail = new TextBox(emailContainer, "EmailField") { IsTabable = true }; + _ = new Label(emailContainer, "EmailLabel") + { + Text = Strings.Registration.Email, + }; + _textBoxEmail = new TextBox(emailContainer, "EmailField") + { + IsTabable = true, + }; _textBoxEmail.SubmitPressed += (s, e) => TryRegister(); //Register Password Label/Textbox var passwordContainer = new ImagePanel(this, "Password1Panel"); - _ = new Label(passwordContainer, "Password1Label") { Text = Strings.Registration.Password }; - _textBoxPassword = new TextBoxPassword(passwordContainer, "Password1Field") { IsTabable = true }; + _ = new Label(passwordContainer, "Password1Label") + { + Text = Strings.Registration.Password, + }; + _textBoxPassword = new TextBoxPassword(passwordContainer, "Password1Field") + { + IsTabable = true, + }; _textBoxPassword.SubmitPressed += (s, e) => TryRegister(); //Register Confirm Password Label/Textbox var confirmPasswordContainer = new ImagePanel(this, "Password2Panel"); - _ = new Label(confirmPasswordContainer, "Password2Label") { Text = Strings.Registration.ConfirmPassword }; - _textBoxConfirmPassword = new TextBoxPassword(confirmPasswordContainer, "Password2Field") { IsTabable = true }; + _ = new Label(confirmPasswordContainer, "Password2Label") + { + Text = Strings.Registration.ConfirmPassword, + }; + _textBoxConfirmPassword = new TextBoxPassword(confirmPasswordContainer, "Password2Field") + { + IsTabable = true, + }; _textBoxConfirmPassword.SubmitPressed += (s, e) => TryRegister(); //Register - Send Registration Button - _buttonRegister = new Button(this, "RegisterButton") { Text = Strings.Registration.Register }; + _buttonRegister = new Button(this, "RegisterButton") + { + Text = Strings.Registration.Register, + }; _buttonRegister.Clicked += (s, e) => TryRegister(); //Register - Back Button - var buttonBack = new Button(this, "BackButton") { Text = Strings.Registration.Back }; + var buttonBack = new Button(this, "BackButton") + { + Text = Strings.Registration.Back, + }; buttonBack.Clicked += (s, e) => { Hide(); @@ -99,7 +123,7 @@ public override void Show() _textBoxUsername.Focus(); } - void TryRegister() + private void TryRegister() { if (Globals.WaitingOnServer) { @@ -147,4 +171,4 @@ void TryRegister() ChatboxMsg.ClearMessages(); Hide(); } -} +} \ No newline at end of file