Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: refactor input box #2348

Merged
merged 1 commit into from
Jul 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading