diff --git a/Content.Client/Administration/UI/Logs/AdminLogsEui.cs b/Content.Client/Administration/UI/Logs/AdminLogsEui.cs
index 00cc21671d..5f4c57c63b 100644
--- a/Content.Client/Administration/UI/Logs/AdminLogsEui.cs
+++ b/Content.Client/Administration/UI/Logs/AdminLogsEui.cs
@@ -4,6 +4,10 @@ using Content.Shared.Administration;
using Content.Shared.Administration.Logs;
using Content.Shared.Eui;
using JetBrains.Annotations;
+using Robust.Client.Graphics;
+using Robust.Client.UserInterface;
+using Robust.Client.UserInterface.Controls;
+using Robust.Shared.IoC;
using static Content.Shared.Administration.AdminLogsEuiMsg;
namespace Content.Client.Administration.UI.Logs;
@@ -11,28 +15,54 @@ namespace Content.Client.Administration.UI.Logs;
[UsedImplicitly]
public class AdminLogsEui : BaseEui
{
+ [Dependency] private readonly IClyde _clyde = default!;
+ [Dependency] private readonly IUserInterfaceManager _uiManager = default!;
+
public AdminLogsEui()
{
- Window = new AdminLogsWindow();
- Window.OnClose += () => SendMessage(new Close());
- Window.LogSearch.OnTextEntered += _ => RequestLogs();
- Window.RefreshButton.OnPressed += _ => RequestLogs();
- Window.NextButton.OnPressed += _ => NextLogs();
+ var monitor = _clyde.EnumerateMonitors().First();
+
+ ClydeWindow = _clyde.CreateWindow(new WindowCreateParameters
+ {
+ Maximized = true,
+ Title = "Admin Logs",
+ Monitor = monitor
+ });
+
+ ClydeWindow.RequestClosed += OnRequestClosed;
+ ClydeWindow.DisposeOnClose = true;
+
+ LogsWindow = new AdminLogsWindow();
+ LogsWindow.LogSearch.OnTextEntered += _ => RequestLogs();
+ LogsWindow.RefreshButton.OnPressed += _ => RequestLogs();
+ LogsWindow.NextButton.OnPressed += _ => NextLogs();
+
+ Root = _uiManager.CreateWindowRoot(ClydeWindow);
+ Root.AddChild(LogsWindow);
}
- private AdminLogsWindow Window { get; }
+ private WindowRoot Root { get; }
+
+ private IClydeWindow ClydeWindow { get; }
+
+ private AdminLogsWindow LogsWindow { get; }
private bool FirstState { get; set; } = true;
+ private void OnRequestClosed(WindowRequestClosedEventArgs args)
+ {
+ SendMessage(new Close());
+ }
+
private void RequestLogs()
{
var request = new LogsRequest(
- Window.SelectedRoundId,
- Window.SelectedTypes.ToList(),
+ LogsWindow.SelectedRoundId,
+ LogsWindow.SelectedTypes.ToList(),
null,
null,
null,
- Window.SelectedPlayers.ToArray(),
+ LogsWindow.SelectedPlayers.ToArray(),
null,
null,
DateOrder.Descending);
@@ -54,16 +84,11 @@ public class AdminLogsEui : BaseEui
}
FirstState = false;
- Window.SetCurrentRound(state.RoundId);
- Window.SetRoundSpinBox(state.RoundId);
+ LogsWindow.SetCurrentRound(state.RoundId);
+ LogsWindow.SetRoundSpinBox(state.RoundId);
return true;
}
- public override void Opened()
- {
- Window.OpenCentered();
- }
-
public override void HandleState(EuiStateBase state)
{
var s = (AdminLogsEuiState) state;
@@ -75,8 +100,8 @@ public class AdminLogsEui : BaseEui
return;
}
- Window.SetCurrentRound(s.RoundId);
- Window.SetPlayers(s.Players);
+ LogsWindow.SetCurrentRound(s.RoundId);
+ LogsWindow.SetPlayers(s.Players);
if (first)
{
@@ -91,10 +116,10 @@ public class AdminLogsEui : BaseEui
switch (msg)
{
case NewLogs {Replace: true} newLogs:
- Window.SetLogs(newLogs.Logs);
+ LogsWindow.SetLogs(newLogs.Logs);
break;
case NewLogs {Replace: false} newLogs:
- Window.AddLogs(newLogs.Logs);
+ LogsWindow.AddLogs(newLogs.Logs);
break;
}
}
@@ -103,7 +128,10 @@ public class AdminLogsEui : BaseEui
{
base.Closed();
- Window.Close();
- Window.Dispose();
+ ClydeWindow.RequestClosed -= OnRequestClosed;
+
+ LogsWindow.Dispose();
+ Root.Dispose();
+ ClydeWindow.Dispose();
}
}
diff --git a/Content.Client/Administration/UI/Logs/AdminLogsWindow.xaml b/Content.Client/Administration/UI/Logs/AdminLogsWindow.xaml
index 1b47d0ee02..c52e9d8076 100644
--- a/Content.Client/Administration/UI/Logs/AdminLogsWindow.xaml
+++ b/Content.Client/Administration/UI/Logs/AdminLogsWindow.xaml
@@ -1,59 +1,64 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
diff --git a/Content.Client/Administration/UI/Logs/AdminLogsWindow.xaml.cs b/Content.Client/Administration/UI/Logs/AdminLogsWindow.xaml.cs
index 1c8a5cca04..7f589ea415 100644
--- a/Content.Client/Administration/UI/Logs/AdminLogsWindow.xaml.cs
+++ b/Content.Client/Administration/UI/Logs/AdminLogsWindow.xaml.cs
@@ -5,8 +5,8 @@ using Content.Client.Administration.UI.CustomControls;
using Content.Shared.Administration.Logs;
using Content.Shared.Database;
using Robust.Client.AutoGenerated;
+using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
-using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Localization;
using static Robust.Client.UserInterface.Controls.BaseButton;
@@ -15,7 +15,7 @@ using static Robust.Client.UserInterface.Controls.LineEdit;
namespace Content.Client.Administration.UI.Logs;
[GenerateTypedNameReferences]
-public partial class AdminLogsWindow : SS14Window
+public partial class AdminLogsWindow : Control
{
private readonly Comparer _adminLogTypeButtonComparer =
Comparer.Create((a, b) =>