Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Pspritechologist committed Apr 2, 2023
2 parents 0a1ea53 + d48f0c5 commit d058867
Show file tree
Hide file tree
Showing 889 changed files with 27,722 additions and 5,483 deletions.
15 changes: 1 addition & 14 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/Content.*/Administration/ @moonheart08 @PaulRitter @DrSmugleaf
/Content.*/Station/ @moonheart08
/Content.*/Maps/ @moonheart08
/Content.*/GameTicking/ @moonheart08 @Zumorica
/Content.*/GameTicking/ @moonheart08
/Resources/Server\ Info/ @moonheart08
/Resources/engineCommandPerms.yml @moonheart08
/Resources/clientCommandPerms.yml @moonheart08
Expand All @@ -16,19 +16,6 @@
/Resources/Prototypes/Entities/Mobs/Player/ @moonheart08 @mirrorcult @DrSmugleaf
/Resources/Prototypes/Entities/Mobs/Species/ @moonheart08 @mirrorcult @DrSmugleaf

/Content.*/Atmos/ @Zumorica
/Content.*/Botany/ @Zumorica
/Content.*/Construction/ @Zumorica
/Content.*/Holiday/ @Zumorica
/Content.*/Instruments/ @Zumorica
/Content.*/Stunnable/ @Zumorica
/Resources/Prototypes/game_* @Zumorica # Both game_presets.yml and game_rules.yml
/Resources/Prototypes/holidays.yml @Zumorica
/Resources/Prototypes/tool_qualities.yml @Zumorica
/Resources/Prototypes/Atmospherics/ @Zumorica
/Resources/Prototypes/Recipes/Construction @Zumorica
/Resources/Prototypes/Recipes/Crafting @Zumorica

/Content.*/Body/ @mirrorcult @DrSmugleaf
/Content.*/Chemistry/ @mirrorcult
/Content.*/StatusEffect/ @mirrorcult
Expand Down
4 changes: 3 additions & 1 deletion Content.Client/Administration/UI/Bwoink/BwoinkPanel.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
<BoxContainer
xmlns="https://spacestation14.io"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Orientation="Vertical"
HorizontalExpand="true">
HorizontalExpand="True">
<OutputPanel Name="TextOutput" VerticalExpand="true" />
<HistoryLineEdit Name="SenderLineEdit" />
<RichTextLabel Name="RelayedToDiscordLabel" Access="Public" Visible="False" />
</BoxContainer>
8 changes: 7 additions & 1 deletion Content.Client/Administration/UI/Bwoink/BwoinkPanel.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Utility;
using Content.Client.Administration.UI.CustomControls;

namespace Content.Client.Administration.UI.Bwoink
{
Expand All @@ -18,6 +17,13 @@ public sealed partial class BwoinkPanel : BoxContainer
public BwoinkPanel(Action<string> messageSender)
{
RobustXamlLoader.Load(this);

var msg = new FormattedMessage();
msg.PushColor(Color.LightGray);
msg.AddText(Loc.GetString("bwoink-system-messages-being-relayed-to-discord"));
msg.Pop();
RelayedToDiscordLabel.SetMessage(msg);

_messageSender = messageSender;

OnVisibilityChanged += c =>
Expand Down
16 changes: 8 additions & 8 deletions Content.Client/AlertLevel/AlertLevelDisplaySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,32 @@ public override void Initialize()
SubscribeLocalEvent<AlertLevelDisplayComponent, AppearanceChangeEvent>(OnAppearanceChange);
}

private void OnAppearanceChange(EntityUid uid, AlertLevelDisplayComponent component, ref AppearanceChangeEvent args)
private void OnAppearanceChange(EntityUid uid, AlertLevelDisplayComponent alertLevelDisplay, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
{
return;
}
var layer = args.Sprite.LayerMapReserveBlank(AlertLevelDisplay.Layer);

if (!args.Sprite.LayerMapTryGet(AlertLevelDisplay.Layer, out _))
if (args.AppearanceData.TryGetValue(AlertLevelDisplay.Powered, out var poweredObject))
{
var layer = args.Sprite.AddLayer(new RSI.StateId(component.AlertVisuals.Values.First()));
args.Sprite.LayerMapSet(AlertLevelDisplay.Layer, layer);
args.Sprite.LayerSetVisible(layer, poweredObject is true);
}

if (!args.AppearanceData.TryGetValue(AlertLevelDisplay.CurrentLevel, out var level))
{
args.Sprite.LayerSetState(AlertLevelDisplay.Layer, new RSI.StateId(component.AlertVisuals.Values.First()));
args.Sprite.LayerSetState(layer, alertLevelDisplay.AlertVisuals.Values.First());
return;
}

if (component.AlertVisuals.TryGetValue((string) level, out var visual))
if (alertLevelDisplay.AlertVisuals.TryGetValue((string) level, out var visual))
{
args.Sprite.LayerSetState(AlertLevelDisplay.Layer, new RSI.StateId(visual));
args.Sprite.LayerSetState(layer, visual);
}
else
{
args.Sprite.LayerSetState(AlertLevelDisplay.Layer, new RSI.StateId(component.AlertVisuals.Values.First()));
args.Sprite.LayerSetState(layer, alertLevelDisplay.AlertVisuals.Values.First());
}
}
}
9 changes: 7 additions & 2 deletions Content.Client/Atmos/EntitySystems/FireVisualizerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ private void OnShutdown(EntityUid uid, FireVisualsComponent component, Component
component.LightEntity = null;
}

if (TryComp<SpriteComponent>(uid, out var sprite))
sprite.RemoveLayer(FireVisualLayers.Fire);
// Need LayerMapTryGet because Init fails if there's no existing sprite / appearancecomp
// which means in some setups (most frequently no AppearanceComp) the layer never exists.
if (TryComp<SpriteComponent>(uid, out var sprite) &&
sprite.LayerMapTryGet(FireVisualLayers.Fire, out var layer))
{
sprite.RemoveLayer(layer);
}
}

private void OnComponentInit(EntityUid uid, FireVisualsComponent component, ComponentInit args)
Expand Down
20 changes: 3 additions & 17 deletions Content.Client/Cargo/BUI/CargoShuttleConsoleBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Content.Client.Cargo.UI;
using Content.Shared.Cargo.BUI;
using Content.Shared.Cargo.Events;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;

namespace Content.Client.Cargo.BUI;

[UsedImplicitly]
public sealed class CargoShuttleConsoleBoundUserInterface : BoundUserInterface
{
private CargoShuttleMenu? _menu;
Expand All @@ -21,9 +21,7 @@ protected override void Open()
if (collection == null)
return;

_menu = new CargoShuttleMenu(collection.Resolve<IGameTiming>(), collection.Resolve<IPrototypeManager>(), collection.Resolve<IEntitySystemManager>().GetEntitySystem<SpriteSystem>());
_menu.ShuttleCallRequested += OnShuttleCall;
_menu.ShuttleRecallRequested += OnShuttleRecall;
_menu = new CargoShuttleMenu(collection.Resolve<IPrototypeManager>(), collection.Resolve<IEntitySystemManager>().GetEntitySystem<SpriteSystem>());
_menu.OnClose += Close;

_menu.OpenCentered();
Expand All @@ -38,24 +36,12 @@ protected override void Dispose(bool disposing)
}
}

private void OnShuttleRecall()
{
SendMessage(new CargoRecallShuttleMessage());
}

private void OnShuttleCall()
{
SendMessage(new CargoCallShuttleMessage());
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
if (state is not CargoShuttleConsoleBoundUserInterfaceState cargoState) return;
_menu?.SetAccountName(cargoState.AccountName);
_menu?.SetShuttleName(cargoState.ShuttleName);
_menu?.SetShuttleETA(cargoState.ShuttleETA);
_menu?.SetOrders(cargoState.Orders);
_menu?.SetCanRecall(cargoState.CanRecall);
}
}
6 changes: 0 additions & 6 deletions Content.Client/Cargo/UI/CargoShuttleMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@
<Label Name="ShuttleStatusLabel"
Text="{Loc 'cargo-console-menu-shuttle-status-away-text'}" />
</BoxContainer>
<Button Name="ShuttleCallButton"
Text="Call Shuttle"/>
<Button Name="ShuttleRecallButton"
Text="Recall Shuttle"
ToolTip="Needs to be out of range to recall."
Visible="False"/>
<Label Text="{Loc 'cargo-console-menu-orders-label'}" />
<PanelContainer VerticalExpand="True"
SizeFlagsStretchRatio="6">
Expand Down
62 changes: 1 addition & 61 deletions Content.Client/Cargo/UI/CargoShuttleMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
using Content.Shared.Cargo.Prototypes;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
Expand All @@ -14,23 +12,14 @@ namespace Content.Client.Cargo.UI
[GenerateTypedNameReferences]
public sealed partial class CargoShuttleMenu : FancyWindow
{
private readonly IGameTiming _timing;
private readonly IPrototypeManager _protoManager;
private readonly SpriteSystem _spriteSystem;

public Action? ShuttleCallRequested;
public Action? ShuttleRecallRequested;

private TimeSpan? _shuttleEta;

public CargoShuttleMenu(IGameTiming timing, IPrototypeManager protoManager, SpriteSystem spriteSystem)
public CargoShuttleMenu(IPrototypeManager protoManager, SpriteSystem spriteSystem)
{
RobustXamlLoader.Load(this);
_timing = timing;
_protoManager = protoManager;
_spriteSystem = spriteSystem;
ShuttleCallButton.OnPressed += OnCallPressed;
ShuttleRecallButton.OnPressed += OnRecallPressed;
Title = Loc.GetString("cargo-shuttle-console-menu-title");
}

Expand All @@ -44,33 +33,6 @@ public void SetShuttleName(string name)
ShuttleNameLabel.Text = name;
}

public void SetShuttleETA(TimeSpan? eta)
{
_shuttleEta = eta;

if (eta == null)
{
ShuttleCallButton.Visible = false;
ShuttleRecallButton.Visible = true;
}
else
{
ShuttleRecallButton.Visible = false;
ShuttleCallButton.Visible = true;
ShuttleCallButton.Disabled = true;
}
}

private void OnRecallPressed(BaseButton.ButtonEventArgs obj)
{
ShuttleRecallRequested?.Invoke();
}

private void OnCallPressed(BaseButton.ButtonEventArgs obj)
{
ShuttleCallRequested?.Invoke();
}

public void SetOrders(List<CargoOrderData> orders)
{
Orders.DisposeAllChildren();
Expand Down Expand Up @@ -102,27 +64,5 @@ public void SetOrders(List<CargoOrderData> orders)
Orders.AddChild(row);
}
}

public void SetCanRecall(bool canRecall)
{
ShuttleRecallButton.Disabled = !canRecall;
}

protected override void Draw(DrawingHandleScreen handle)
{
base.Draw(handle);

var remaining = _shuttleEta - _timing.CurTime;

if (remaining == null || remaining <= TimeSpan.Zero)
{
ShuttleStatusLabel.Text = $"Available";
ShuttleCallButton.Disabled = false;
}
else
{
ShuttleStatusLabel.Text = $"Available in: {remaining.Value.TotalSeconds:0.0}";
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Rounding;
using Robust.Client.GameObjects;
using Robust.Shared.Prototypes;

Expand Down Expand Up @@ -41,7 +42,6 @@ protected override void OnAppearanceChange(EntityUid uid, SolutionContainerVisua
Logger.Error("Attempted to set solution container visuals volume ratio on " + ToPrettyString(uid) + " to a value greater than 1. Volume should never be greater than max volume!");
fraction = 1f;
}

if (component.Metamorphic)
{
if (args.Sprite.LayerMapTryGet(component.BaseLayer, out var baseLayer))
Expand Down Expand Up @@ -79,7 +79,7 @@ protected override void OnAppearanceChange(EntityUid uid, SolutionContainerVisua
}
}

var closestFillSprite = (int) Math.Round(fraction * component.MaxFillLevels);
int closestFillSprite = ContentHelpers.RoundToLevels(fraction, 1, component.MaxFillLevels + 1);

if (closestFillSprite > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public sealed class CommunicationsConsoleBoundUserInterface : BoundUserInterface

public CommunicationsConsoleBoundUserInterface(ClientUserInterfaceComponent owner, Enum uiKey) : base(owner, uiKey)
{

}

protected override void Open()
Expand Down
16 changes: 16 additions & 0 deletions Content.Client/Communications/UI/CommunicationsConsoleMenu.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'comms-console-menu-title'}"
MinSize="350 225">
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True" Margin="5">
<LineEdit Name="MessageInput" PlaceHolder="{Loc 'comms-console-menu-announcement-placeholder'}" HorizontalExpand="True" Margin="0 0 0 5" />
<Button Name="AnnounceButton" Text="{Loc 'comms-console-menu-announcement-button'}" StyleClasses="OpenLeft" Access="Public" />

<OptionButton Name="AlertLevelButton" StyleClasses="OpenRight" Access="Public" />

<Control MinSize="10 10" />

<RichTextLabel Name="CountdownLabel" VerticalExpand="True" />
<Button Name="EmergencyShuttleButton" Text="Placeholder Text" Access="Public" />
</BoxContainer>
</controls:FancyWindow>
Loading

0 comments on commit d058867

Please sign in to comment.