Skip to content

Commit

Permalink
Merge branch 'master' into whitelist-permission-change
Browse files Browse the repository at this point in the history
  • Loading branch information
NullWanderer authored Mar 27, 2024
2 parents 10b339b + bd0e6f3 commit d6b7771
Show file tree
Hide file tree
Showing 1,132 changed files with 197,133 additions and 181,809 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/check-crlf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: CRLF Check

on:
pull_request:
types: [ opened, reopened, synchronize, ready_for_review ]

jobs:
build:
name: CRLF Check
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.6.0
- name: Check for CRLF
run: Tools/check_crlf.py
2 changes: 1 addition & 1 deletion .github/workflows/close-master-pr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Close PR's on master
name: Close PRs on master

on:
pull_request_target:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/labeler-untriaged.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Labels: Untriaged"

on:
issues:
types: [opened]

jobs:
add_label:
runs-on: ubuntu-latest
steps:
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: "Status: Untriaged"
1 change: 1 addition & 0 deletions Content.Client/Actions/ActionsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ private void BaseHandleState<T>(EntityUid uid, BaseActionComponent component, Ba
component.Container = EnsureEntity<T>(state.Container, uid);
component.EntityIcon = EnsureEntity<T>(state.EntityIcon, uid);
component.CheckCanInteract = state.CheckCanInteract;
component.CheckConsciousness = state.CheckConsciousness;
component.ClientExclusive = state.ClientExclusive;
component.Priority = state.Priority;
component.AttachedEntity = EnsureEntity<T>(state.AttachedEntity, uid);
Expand Down
18 changes: 11 additions & 7 deletions Content.Client/Administration/UI/AdminRemarks/AdminMessageEui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Shared.Administration.Notes;
using Content.Shared.Eui;
using JetBrains.Annotations;
using Robust.Client.UserInterface.Controls;
using static Content.Shared.Administration.Notes.AdminMessageEuiMsg;

namespace Content.Client.Administration.UI.AdminRemarks;
Expand All @@ -14,9 +15,8 @@ public sealed class AdminMessageEui : BaseEui
public AdminMessageEui()
{
_popup = new AdminMessagePopupWindow();
_popup.OnAcceptPressed += () => SendMessage(new Accept());
_popup.OnDismissPressed += () => SendMessage(new Dismiss());
_popup.OnClose += () => SendMessage(new CloseEuiMessage());
_popup.OnAcceptPressed += () => SendMessage(new Dismiss(true));
_popup.OnDismissPressed += () => SendMessage(new Dismiss(false));
}

public override void HandleState(EuiStateBase state)
Expand All @@ -26,13 +26,17 @@ public override void HandleState(EuiStateBase state)
return;
}

_popup.SetMessage(s.Message);
_popup.SetDetails(s.AdminName, s.AddedOn);
_popup.Timer = s.Time;
_popup.SetState(s);
}

public override void Opened()
{
_popup.OpenCentered();
_popup.UserInterfaceManager.WindowRoot.AddChild(_popup);
LayoutContainer.SetAnchorPreset(_popup, LayoutContainer.LayoutPreset.Wide);
}

public override void Closed()
{
_popup.Orphan();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Control xmlns="https://spacestation14.io" Margin="0 0 0 8">
<BoxContainer Orientation="Vertical">
<RichTextLabel Name="Admin" Margin="0 0 0 4" />
<RichTextLabel Name="Message" Margin="2 0 0 0" />
</BoxContainer>
</Control>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using Content.Shared.Administration.Notes;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;

namespace Content.Client.Administration.UI.AdminRemarks;

[GenerateTypedNameReferences]
public sealed partial class AdminMessagePopupMessage : Control
{
public AdminMessagePopupMessage(AdminMessageEuiState.Message message)
{
RobustXamlLoader.Load(this);

Admin.SetMessage(FormattedMessage.FromMarkup(Loc.GetString(
"admin-notes-message-admin",
("admin", message.AdminName),
("date", message.AddedOn.ToLocalTime()))));

Message.SetMessage(message.Text);
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
<ui:FancyWindow xmlns="https://spacestation14.io"
xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls"
VerticalExpand="True" HorizontalExpand="True"
Title="{Loc admin-notes-message-window-title}"
MinSize="600 170">
<PanelContainer VerticalExpand="True" HorizontalExpand="True" StyleClasses="BackgroundDark">
<ScrollContainer HScrollEnabled="False" VerticalExpand="True" HorizontalExpand="True" Margin="4">
<BoxContainer Orientation="Vertical" SeparationOverride="10" VerticalAlignment="Bottom">
<Label Name="AdminLabel" Text="Loading..." />
<RichTextLabel Name="MessageLabel" />
<Control xmlns="https://spacestation14.io"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client">
<PanelContainer MouseFilter="Stop">
<PanelContainer.PanelOverride>
<!-- semi-transparent background -->
<gfx:StyleBoxFlat BackgroundColor="#000000AA" />
</PanelContainer.PanelOverride>

<Control HorizontalAlignment="Center" VerticalAlignment="Center" MaxWidth="600">
<PanelContainer StyleClasses="AngleRect" />

<BoxContainer Orientation="Vertical" Margin="4">
<RichTextLabel Name="Description" />

<!-- Contains actual messages -->
<ScrollContainer HScrollEnabled="False" Margin="4" VerticalExpand="True" ReturnMeasure="True" MaxHeight="400">
<BoxContainer Orientation="Vertical" Name="MessageContainer" Margin="0 2 0 0" />
</ScrollContainer>

<Label Name="WaitLabel" />
<BoxContainer Orientation="Horizontal">
<Button Name="DismissButton"
Text="{Loc 'admin-notes-message-dismiss'}" />
Text="{Loc 'admin-notes-message-dismiss'}"
Disabled="True"
HorizontalExpand="True"
StyleClasses="OpenRight" />
<Button Name="AcceptButton"
Text="{Loc 'admin-notes-message-accept'}"
Disabled="True" />
Disabled="True"
HorizontalExpand="True"
StyleClasses="OpenLeft" />
</BoxContainer>
</BoxContainer>
</ScrollContainer>
</Control>
</PanelContainer>
</ui:FancyWindow>
</Control>
Original file line number Diff line number Diff line change
@@ -1,56 +1,65 @@
using Content.Client.UserInterface.Controls;
using Content.Client.Stylesheets;
using Content.Shared.Administration.Notes;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Timing;
using Robust.Shared.Utility;

namespace Content.Client.Administration.UI.AdminRemarks;

[GenerateTypedNameReferences]
public sealed partial class AdminMessagePopupWindow : FancyWindow
public sealed partial class AdminMessagePopupWindow : Control
{
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);

Stylesheet = IoCManager.Resolve<IStylesheetManager>().SheetSpace;

AcceptButton.OnPressed += OnAcceptButtonPressed;
DismissButton.OnPressed += OnDismissButtonPressed;
}

public void SetMessage(string message)
public float Timer
{
MessageLabel.SetMessage(message);
get => _timer;
private set
{
WaitLabel.Text = Loc.GetString("admin-notes-message-wait", ("time", MathF.Floor(value)));
_timer = value;
}
}

public void SetDetails(string adminName, DateTime addedOn)
public void SetState(AdminMessageEuiState state)
{
AdminLabel.Text = Loc.GetString("admin-notes-message-admin", ("admin", adminName), ("date", addedOn));
Timer = (float) state.Time.TotalSeconds;

MessageContainer.RemoveAllChildren();

foreach (var message in state.Messages)
{
MessageContainer.AddChild(new AdminMessagePopupMessage(message));
}

Description.SetMessage(FormattedMessage.FromMarkup(Loc.GetString("admin-notes-message-desc", ("count", state.Messages.Length))));
}

private void OnDismissButtonPressed(BaseButton.ButtonEventArgs obj)
{
OnDismissPressed?.Invoke();
Close();
}

private void OnAcceptButtonPressed(BaseButton.ButtonEventArgs obj)
{
OnAcceptPressed?.Invoke();
Close();
}

protected override void FrameUpdate(FrameEventArgs args)
Expand All @@ -70,6 +79,7 @@ protected override void FrameUpdate(FrameEventArgs args)
else
{
AcceptButton.Disabled = false;
DismissButton.Disabled = false;
}
}
}
23 changes: 12 additions & 11 deletions Content.Client/Alerts/ClientAlertsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Robust.Client.Player;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;

namespace Content.Client.Alerts;

Expand All @@ -12,6 +13,7 @@ public sealed class ClientAlertsSystem : AlertsSystem
{
public AlertOrderPrototype? AlertOrder { get; set; }

[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;

Expand Down Expand Up @@ -49,24 +51,23 @@ public IReadOnlyDictionary<AlertKey, AlertState>? ActiveAlerts

protected override void AfterShowAlert(Entity<AlertsComponent> alerts)
{
if (_playerManager.LocalEntity != alerts.Owner)
return;

SyncAlerts?.Invoke(this, alerts.Comp.Alerts);
UpdateHud(alerts);
}

protected override void AfterClearAlert(Entity<AlertsComponent> alertsComponent)
protected override void AfterClearAlert(Entity<AlertsComponent> alerts)
{
if (_playerManager.LocalEntity != alertsComponent.Owner)
return;
UpdateHud(alerts);
}

SyncAlerts?.Invoke(this, alertsComponent.Comp.Alerts);
private void ClientAlertsHandleState(Entity<AlertsComponent> alerts, ref AfterAutoHandleStateEvent args)
{
UpdateHud(alerts);
}

private void ClientAlertsHandleState(EntityUid uid, AlertsComponent component, ref AfterAutoHandleStateEvent args)
private void UpdateHud(Entity<AlertsComponent> entity)
{
if (_playerManager.LocalEntity == uid)
SyncAlerts?.Invoke(this, component.Alerts);
if (_playerManager.LocalEntity == entity.Owner)
SyncAlerts?.Invoke(this, entity.Comp.Alerts);
}

private void OnPlayerAttached(EntityUid uid, AlertsComponent component, LocalPlayerAttachedEvent args)
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Antag/AntagStatusIconSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public override void Initialize()
SubscribeLocalEvent<RevolutionaryComponent, GetStatusIconsEvent>(GetRevIcon);
SubscribeLocalEvent<ZombieComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<HeadRevolutionaryComponent, GetStatusIconsEvent>(GetIcon);
SubscribeLocalEvent<InitialInfectedComponent, GetStatusIconsEvent>(GetIcon);
}

/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ private void DrawTooltip(DrawingHandleScreen handle, Vector2 pos, AtmosDebugOver
handle.DrawString(_font, pos, $"Map: {data.MapAtmosphere}");
pos += offset;
handle.DrawString(_font, pos, $"NoGrid: {data.NoGrid}");
pos += offset;
handle.DrawString(_font, pos, $"Immutable: {data.Immutable}");
}

private void GetGrids(MapId mapId, Box2Rotated box)
Expand Down
Loading

0 comments on commit d6b7771

Please sign in to comment.