diff --git a/Content.Client/Administration/UI/Tabs/AdminTab/AdminTab.xaml b/Content.Client/Administration/UI/Tabs/AdminTab/AdminTab.xaml index 8b68487547f..c5452731fc9 100644 --- a/Content.Client/Administration/UI/Tabs/AdminTab/AdminTab.xaml +++ b/Content.Client/Administration/UI/Tabs/AdminTab/AdminTab.xaml @@ -16,6 +16,7 @@ + diff --git a/Content.Client/_Goobstation/Administration/UI/TimeTransferPanel/TimeTransferEntry.xaml b/Content.Client/_Goobstation/Administration/UI/TimeTransferPanel/TimeTransferEntry.xaml new file mode 100644 index 00000000000..d6bbb49c196 --- /dev/null +++ b/Content.Client/_Goobstation/Administration/UI/TimeTransferPanel/TimeTransferEntry.xaml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Content.Client/_Goobstation/Administration/UI/TimeTransferPanel/TimeTransferEntry.xaml.cs b/Content.Client/_Goobstation/Administration/UI/TimeTransferPanel/TimeTransferEntry.xaml.cs new file mode 100644 index 00000000000..0c3d1da604a --- /dev/null +++ b/Content.Client/_Goobstation/Administration/UI/TimeTransferPanel/TimeTransferEntry.xaml.cs @@ -0,0 +1,46 @@ +using Content.Shared.Roles; +using Content.Shared.StatusIcon; +using Robust.Client.AutoGenerated; +using Robust.Client.GameObjects; +using Robust.Client.UserInterface.Controls; +using Robust.Client.UserInterface.XAML; +using Robust.Shared.Prototypes; + +namespace Content.Client._Goobstation.Administration.UI.TimeTransferPanel; + +[GenerateTypedNameReferences] +public sealed partial class TimeTransferEntry : BoxContainer +{ + public string PlaytimeTracker; + public string JobName; + + public TimeTransferEntry(JobPrototype jobProto, SpriteSystem spriteSystem, IPrototypeManager prototypeManager) + { + RobustXamlLoader.Load(this); + IoCManager.InjectDependencies(this); + + PlaytimeTracker = jobProto.PlayTimeTracker; + JobLabel.Text = jobProto.LocalizedName; + JobName = jobProto.LocalizedName; + + if (prototypeManager.TryIndex(jobProto.Icon, out var jobIcon)) + JobIcon.Texture = spriteSystem.Frame0(jobIcon.Icon); + } + + public void UpdateGroupVisibility(bool inGrouped) + { + TimeLabel.Visible = !inGrouped; + TimeEdit.Visible = !inGrouped; + GroupCheckbox.Visible = inGrouped; + } + + public string GetJobTimeString() + { + return TimeEdit.Text != null ? TimeEdit.Text : ""; + } + + public bool InGroup() + { + return GroupCheckbox.Pressed; + } +} diff --git a/Content.Client/_Goobstation/Administration/UI/TimeTransferPanel/TimeTransferPanel.xaml b/Content.Client/_Goobstation/Administration/UI/TimeTransferPanel/TimeTransferPanel.xaml new file mode 100644 index 00000000000..2c3d99e2f88 --- /dev/null +++ b/Content.Client/_Goobstation/Administration/UI/TimeTransferPanel/TimeTransferPanel.xaml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + +