Skip to content

Commit a325f2c

Browse files
committed
panda's review
(tested: working as intended) Signed-off-by: Arufonsu <17498701+Arufonsu@users.noreply.github.com>
1 parent 2245cd1 commit a325f2c

2 files changed

Lines changed: 1 addition & 12 deletions

File tree

Intersect.Client.Core/Interface/Shared/AlertWindow.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public record struct Alert(string Message, string? Title = default, AlertType Ty
2020
public class AlertWindow : InputBox
2121
{
2222
private static readonly HashSet<AlertWindow> _instances = [];
23-
private readonly GwenEventHandler<EventArgs>? _handleCancel;
2423

2524
private AlertWindow(
2625
string title,
@@ -40,8 +39,6 @@ private AlertWindow(
4039
userData: userData
4140
)
4241
{
43-
_handleCancel = handleCancel;
44-
4542
Icon = GameContentManager.Current.GetTexture(
4643
TextureType.Gui,
4744
$"icon.alert.{alertType.ToString().ToLowerInvariant()}.png"
@@ -52,15 +49,6 @@ private AlertWindow(
5249

5350
var titleLabelMargin = TitleLabel.Margin;
5451
TitleLabel.Margin = titleLabelMargin with { Left = titleLabelMargin.Left + 4 };
55-
56-
// Subscribe to the Closed event to handle X button clicks
57-
Closed += OnWindowClosed;
58-
}
59-
60-
private void OnWindowClosed(Base sender, EventArgs args)
61-
{
62-
// Trigger the cancel handler when window is closed via X button
63-
_handleCancel?.Invoke(this, args);
6452
}
6553

6654
protected override void OnCanceled(Base sender, EventArgs args)

Intersect.Client.Core/Interface/Shared/InputBox.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,7 @@ protected InputBox(
580580

581581
Submitted += onSubmit;
582582
Canceled += onCancel;
583+
Closed += onCancel;
583584
}
584585

585586
private void YesButtonOnClicked(Base sender, MouseButtonState arguments)

0 commit comments

Comments
 (0)