Skip to content

Commit

Permalink
Merge branch 'master' into rainbow-weed
Browse files Browse the repository at this point in the history
  • Loading branch information
potato1234x authored Mar 25, 2024
2 parents 6b0fd24 + a30fb1f commit ee895da
Show file tree
Hide file tree
Showing 1,857 changed files with 1,512,549 additions and 1,461,930 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 @@ -94,6 +94,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
5 changes: 5 additions & 0 deletions Content.Client/Administration/Managers/ClientAdminManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Shared.Administration.Managers;
using Robust.Client.Console;
using Robust.Client.Player;
using Robust.Client.UserInterface;
using Robust.Shared.ContentPack;
using Robust.Shared.Network;
using Robust.Shared.Player;
Expand All @@ -16,6 +17,7 @@ public sealed class ClientAdminManager : IClientAdminManager, IClientConGroupImp
[Dependency] private readonly IClientConGroupController _conGroup = default!;
[Dependency] private readonly IResourceManager _res = default!;
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly IUserInterfaceManager _userInterface = default!;

private AdminData? _adminData;
private readonly HashSet<string> _availableCommands = new();
Expand Down Expand Up @@ -101,6 +103,9 @@ private void UpdateMessageRx(MsgUpdateAdminStatus message)
{
var flagsText = string.Join("|", AdminFlagsHelper.FlagsToNames(_adminData.Flags));
_sawmill.Info($"Updated admin status: {_adminData.Active}/{_adminData.Title}/{flagsText}");

if (_adminData.Active)
_userInterface.DebugMonitors.SetMonitor(DebugMonitor.Coords, true);
}
else
{
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;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<BoxContainer Name="VolumeBox" Orientation="Vertical" HorizontalExpand="True" Margin="0 4"/>

<!-- The temperature / heat capacity / thermal energy of the solution -->
<Collapsible Orientation="Vertical">
<Collapsible>
<CollapsibleHeading Name="ThermalHeading" Title="{Loc 'admin-solutions-window-thermals'}" />
<CollapsibleBody>
<BoxContainer Name="ThermalBox" Orientation="Vertical" HorizontalExpand="True" Margin="0 4"/>
Expand All @@ -23,7 +23,7 @@
<ScrollContainer HorizontalExpand="True" VerticalExpand="True" Margin="0 4">
<BoxContainer Name="ReagentList" Orientation="Vertical"/>
</ScrollContainer>

<Button Name="AddButton" Text="{Loc 'admin-solutions-window-add-new-button'}" HorizontalExpand="True" Margin="0 4"/>
</BoxContainer>
</DefaultWindow>
25 changes: 13 additions & 12 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 All @@ -33,7 +35,7 @@ protected override void LoadPrototypes()

AlertOrder = _prototypeManager.EnumeratePrototypes<AlertOrderPrototype>().FirstOrDefault();
if (AlertOrder == null)
Log.Error("alert", "no alertOrder prototype found, alerts will be in random order");
Log.Error("No alertOrder prototype found, alerts will be in random order");
}

public IReadOnlyDictionary<AlertKey, AlertState>? ActiveAlerts
Expand All @@ -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
3 changes: 1 addition & 2 deletions Content.Client/Ame/UI/AmeControllerBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Content.Shared.Ame;
using Content.Shared.Ame.Components;
using JetBrains.Annotations;
using Robust.Client.GameObjects;

namespace Content.Client.Ame.UI
{
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Ame/UI/AmeWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Content.Client.UserInterface;
using Content.Shared.Ame;
using Content.Shared.Ame.Components;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
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: 1 addition & 1 deletion Content.Client/Atmos/Monitor/UI/Widgets/PumpControl.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<BoxContainer xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Orientation="Vertical" Margin="2 0 2 4">
<Collapsible Orientation="Vertical">
<Collapsible>
<CollapsibleHeading Name="CAddress" />
<!-- Upper row: toggle, direction, checks -->
<CollapsibleBody Margin="20 0 0 0">
Expand Down
Loading

0 comments on commit ee895da

Please sign in to comment.