Skip to content

Commit

Permalink
chore: refactor input box
Browse files Browse the repository at this point in the history
  • Loading branch information
WeylonSantana committed Jul 26, 2024
1 parent c0ee572 commit 7ca38c8
Show file tree
Hide file tree
Showing 18 changed files with 726 additions and 837 deletions.
4 changes: 2 additions & 2 deletions Intersect.Client.Framework/Gwen/Control/ResizableControl.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Intersect.Client.Framework.Gwen.ControlInternal;
using Intersect.Client.Framework.Gwen.ControlInternal;

using Newtonsoft.Json.Linq;

Expand All @@ -20,7 +20,7 @@ public partial class ResizableControl : Base
/// </summary>
/// <param name="parent">Parent control.</param>
/// <param name="name">name of this control</param>
public ResizableControl(Base parent, string? name) : base(parent, name)
public ResizableControl(Base? parent, string? name) : base(parent, name)
{
mResizer = new Resizer[10];
MinimumSize = new Point(5, 5);
Expand Down
2 changes: 1 addition & 1 deletion Intersect.Client.Framework/Gwen/Control/WindowControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public Padding InnerPanelPadding
/// <param name="title">Window title.</param>
/// <param name="modal">Determines whether the window should be modal.</param>
/// <param name="name">name of this control</param>
public WindowControl(Base parent, string? title = default, bool modal = false, string? name = default) : base(parent, name)
public WindowControl(Base? parent, string? title = default, bool modal = false, string? name = default) : base(parent, name)
{
mTitleBar = new Dragger(this);
mTitleBar.Height = 24;
Expand Down
7 changes: 3 additions & 4 deletions Intersect.Client/Core/Input.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Intersect.Client.General;
using Intersect.Client.Interface;
using Intersect.Client.Interface.Game;
using Intersect.Client.Interface.Shared;
using Intersect.Client.Maps;
using Intersect.Client.Networking;
using Intersect.Configuration;
Expand Down Expand Up @@ -82,12 +83,10 @@ public static void OnKeyPressed(Keys modifier, Keys key)
{
try
{
var iBox = (InputBox)Interface.Interface.InputBlockingElements[i];
if (iBox != null && !iBox.IsHidden)
if (Interface.Interface.InputBlockingElements[i] is InputBox inputBox && !inputBox.IsHidden)
{
iBox.okayBtn_Clicked(null, null);
inputBox.SubmitInput();
canFocusChat = false;

break;
}
}
Expand Down
Loading

0 comments on commit 7ca38c8

Please sign in to comment.