This repository has been archived by the owner on Oct 23, 2024. It is now read-only.
forked from estacaoespacialpirata/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'nyano' into nyanopirata
- Loading branch information
Showing
3,018 changed files
with
321,292 additions
and
124,459 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
Content.Client/Administration/UI/AdminRemarks/AdminMessageEui.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using Content.Client.Eui; | ||
using Content.Shared.Administration.Notes; | ||
using Content.Shared.Eui; | ||
using JetBrains.Annotations; | ||
using static Content.Shared.Administration.Notes.AdminMessageEuiMsg; | ||
|
||
namespace Content.Client.Administration.UI.AdminRemarks; | ||
|
||
[UsedImplicitly] | ||
public sealed class AdminMessageEui : BaseEui | ||
{ | ||
private readonly AdminMessagePopupWindow _popup; | ||
|
||
public AdminMessageEui() | ||
{ | ||
_popup = new AdminMessagePopupWindow(); | ||
_popup.OnAcceptPressed += () => SendMessage(new Accept()); | ||
_popup.OnDismissPressed += () => SendMessage(new Dismiss()); | ||
_popup.OnClose += () => SendMessage(new CloseEuiMessage()); | ||
} | ||
|
||
public override void HandleState(EuiStateBase state) | ||
{ | ||
if (state is not AdminMessageEuiState s) | ||
{ | ||
return; | ||
} | ||
|
||
_popup.SetMessage(s.Message); | ||
_popup.SetDetails(s.AdminName, s.AddedOn); | ||
_popup.Timer = s.Time; | ||
} | ||
|
||
public override void Opened() | ||
{ | ||
_popup.OpenCentered(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupWindow.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<ui:FancyWindow xmlns="https://spacestation14.io" | ||
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls" | ||
xmlns:graphics="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client" | ||
VerticalExpand="True" HorizontalExpand="True" | ||
Title="{Loc admin-notes-message-window-title}" | ||
MinSize="600 170"> | ||
<PanelContainer VerticalExpand="True" HorizontalExpand="True"> | ||
<PanelContainer.PanelOverride> | ||
<graphics:StyleBoxFlat BackgroundColor="#25252A" /> | ||
</PanelContainer.PanelOverride> | ||
<ScrollContainer HScrollEnabled="False" VerticalExpand="True" HorizontalExpand="True" Margin="4"> | ||
<BoxContainer Orientation="Vertical" SeparationOverride="10" VerticalAlignment="Bottom"> | ||
<Label Name="AdminLabel" Text="Loading..." /> | ||
<RichTextLabel Name="MessageLabel" /> | ||
<Label Name="WaitLabel" /> | ||
<BoxContainer Orientation="Horizontal"> | ||
<Button Name="DismissButton" | ||
Text="{Loc 'admin-notes-message-dismiss'}" /> | ||
<Button Name="AcceptButton" | ||
Text="{Loc 'admin-notes-message-accept'}" | ||
Disabled="True" /> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</ScrollContainer> | ||
</PanelContainer> | ||
</ui:FancyWindow> |
75 changes: 75 additions & 0 deletions
75
Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupWindow.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
using Content.Client.UserInterface.Controls; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface.XAML; | ||
using Robust.Shared.Timing; | ||
|
||
namespace Content.Client.Administration.UI.AdminRemarks; | ||
|
||
[GenerateTypedNameReferences] | ||
public sealed partial class AdminMessagePopupWindow : FancyWindow | ||
{ | ||
private float _timer = float.MaxValue; | ||
public float Timer | ||
{ | ||
get => _timer; | ||
set | ||
{ | ||
WaitLabel.Text = Loc.GetString("admin-notes-message-wait", ("time", MathF.Floor(value))); | ||
_timer = value; | ||
} | ||
} | ||
|
||
public event Action? OnDismissPressed; | ||
public event Action? OnAcceptPressed; | ||
|
||
public AdminMessagePopupWindow() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
|
||
AcceptButton.OnPressed += OnAcceptButtonPressed; | ||
DismissButton.OnPressed += OnDismissButtonPressed; | ||
} | ||
|
||
public void SetMessage(string message) | ||
{ | ||
MessageLabel.SetMessage(message); | ||
} | ||
|
||
public void SetDetails(string adminName, DateTime addedOn) | ||
{ | ||
AdminLabel.Text = Loc.GetString("admin-notes-message-admin", ("admin", adminName), ("date", addedOn)); | ||
} | ||
|
||
private void OnDismissButtonPressed(BaseButton.ButtonEventArgs obj) | ||
{ | ||
OnDismissPressed?.Invoke(); | ||
Close(); | ||
} | ||
|
||
private void OnAcceptButtonPressed(BaseButton.ButtonEventArgs obj) | ||
{ | ||
OnAcceptPressed?.Invoke(); | ||
Close(); | ||
} | ||
|
||
protected override void FrameUpdate(FrameEventArgs args) | ||
{ | ||
base.FrameUpdate(args); | ||
|
||
if (!AcceptButton.Disabled) | ||
return; | ||
|
||
if (Timer > 0.0) | ||
{ | ||
if (Timer - args.DeltaSeconds < 0) | ||
Timer = 0; | ||
else | ||
Timer -= args.DeltaSeconds; | ||
} | ||
else | ||
{ | ||
AcceptButton.Disabled = false; | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
Content.Client/Administration/UI/AdminRemarks/AdminRemarksWindow.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<ui:FancyWindow xmlns="https://spacestation14.io" | ||
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls" | ||
xmlns:graphics="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client" | ||
VerticalExpand="True" HorizontalExpand="True" | ||
Title="{Loc admin-remarks-title}" | ||
SetSize="600 400"> | ||
<PanelContainer> | ||
<PanelContainer.PanelOverride> | ||
<graphics:StyleBoxFlat BackgroundColor="#25252A" /> | ||
</PanelContainer.PanelOverride> | ||
<BoxContainer Orientation="Vertical" Margin="4"> | ||
<ScrollContainer VerticalExpand="True" HorizontalExpand="True" HScrollEnabled="False"> | ||
<BoxContainer Orientation="Vertical" Name="NotesContainer" Access="Public" VerticalExpand="True" /> | ||
</ScrollContainer> | ||
</BoxContainer> | ||
</PanelContainer> | ||
</ui:FancyWindow> |
Oops, something went wrong.