2021-10-13 12:15:28 -05:00
|
|
|
using System;
|
|
|
|
|
using Content.Shared.Localizations;
|
|
|
|
|
using Robust.Client.AutoGenerated;
|
|
|
|
|
using Robust.Client.UserInterface.Controls;
|
|
|
|
|
using Robust.Client.UserInterface.CustomControls;
|
|
|
|
|
using Robust.Client.UserInterface.XAML;
|
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
using Robust.Shared.Localization;
|
|
|
|
|
|
|
|
|
|
namespace Content.Client.Administration.UI.Tabs.AdminTab
|
|
|
|
|
{
|
|
|
|
|
[GenerateTypedNameReferences]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed partial class AdminShuttleWindow : DefaultWindow
|
2021-10-13 12:15:28 -05:00
|
|
|
{
|
|
|
|
|
public AdminShuttleWindow()
|
|
|
|
|
{
|
|
|
|
|
RobustXamlLoader.Load(this);
|
|
|
|
|
IoCManager.InjectDependencies(this);
|
|
|
|
|
|
|
|
|
|
_callShuttleTime.OnTextChanged += CallShuttleTimeOnOnTextChanged;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void CallShuttleTimeOnOnTextChanged(LineEdit.LineEditEventArgs obj)
|
|
|
|
|
{
|
|
|
|
|
var loc = IoCManager.Resolve<ILocalizationManager>();
|
|
|
|
|
_callShuttleButton.Disabled = !TimeSpan.TryParseExact(obj.Text, Localization.TimeSpanMinutesFormats, loc.DefaultCulture, out _);
|
|
|
|
|
_callShuttleButton.Command = $"callshuttle {obj.Text}";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|