Skip to content

Commit

Permalink
Merge branch 'space-syndicate:master' into HatchAirlock-Resprite
Browse files Browse the repository at this point in the history
  • Loading branch information
xKREKS authored May 19, 2024
2 parents b19455f + 52e7eb9 commit 81d5aec
Show file tree
Hide file tree
Showing 502 changed files with 142,218 additions and 65,415 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Content.Shared.Access;
using Content.Shared.Access.Components;
using Content.Shared.Access;
using Content.Shared.Access.Systems;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.CrewManifest;
Expand Down
3 changes: 3 additions & 0 deletions Content.Client/Actions/ActionsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,10 @@ public void TriggerAction(EntityUid actionId, BaseActionComponent action)
if (action.ClientExclusive)
{
if (instantAction.Event != null)
{
instantAction.Event.Performer = user;
instantAction.Event.Action = actionId;
}

PerformAction(user, actions, actionId, instantAction, instantAction.Event, GameTiming.CurTime);
}
Expand Down
7 changes: 7 additions & 0 deletions Content.Client/Administration/Systems/AdminFrozenSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Content.Shared.Administration;

namespace Content.Client.Administration.Systems;

public sealed class AdminFrozenSystem : SharedAdminFrozenSystem
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
using Robust.Client.GameObjects;
using Robust.Client.Player;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
Expand All @@ -22,7 +23,7 @@ public sealed partial class SpawnExplosionWindow : DefaultWindow
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IEntityManager _entMan = default!;

private readonly SharedTransformSystem _transform = default!;

private readonly SpawnExplosionEui _eui;
private List<MapId> _mapData = new();
Expand All @@ -37,6 +38,7 @@ public SpawnExplosionWindow(SpawnExplosionEui eui)
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_transform = _entMan.System<TransformSystem>();
_eui = eui;

ExplosionOption.OnItemSelected += ExplosionSelected;
Expand Down Expand Up @@ -104,7 +106,7 @@ private void SetLocation()

_pausePreview = true;
MapOptions.Select(_mapData.IndexOf(transform.MapID));
(MapX.Value, MapY.Value) = transform.MapPosition.Position;
(MapX.Value, MapY.Value) = _transform.GetMapCoordinates(_playerManager.LocalEntity!.Value, xform: transform).Position;
_pausePreview = false;

UpdatePreview();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Corvax.Interfaces.Client;
using Content.Corvax.Interfaces.Shared;
using Content.Shared.Administration.Events;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
Expand Down Expand Up @@ -30,7 +30,7 @@ public PanicBunkerTab()
MinOverallHours.OnFocusExit += args => SendMinOverallHours(args.Text);
_minOverallHours = MinOverallHours.Text;
// Corvax-VPNGuard-Start
var haveSecrets = IoCManager.Instance!.TryResolveType<IClientSponsorsManager>(out _); // TODO: Probably need better way to detect Secrets module
var haveSecrets = IoCManager.Instance!.TryResolveType<ISharedSponsorsManager>(out _); // TODO: Probably need better way to detect Secrets module
if (haveSecrets)
{
VPNContainer.Visible = true;
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Audio/Jukebox/JukeboxBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace Content.Client.Audio.Jukebox;

public sealed class JukeboxBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IPrototypeManager _protoManager = default!;

[ViewVariables]
Expand Down
7 changes: 3 additions & 4 deletions Content.Client/Chemistry/UI/ReagentCardControl.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Control xmlns="https://spacestation14.io">
<Control xmlns="https://spacestation14.io" HorizontalExpand="True">
<BoxContainer Name="MainContainer"
Orientation="Horizontal"
SetWidth="160">
HorizontalExpand="True">
<PanelContainer Name="ColorPanel"
VerticalExpand="True"
SetWidth="7"
Expand All @@ -16,8 +16,7 @@
VerticalExpand="True"
HorizontalExpand="True"
Margin="-5 0 0 0">
<Label Name="ReagentNameLabel"
StyleClasses="LabelSubText" />
<Label Name="ReagentNameLabel" />
<Label Name="FillLabel"
StyleClasses="LabelSubText"
Margin="0 -5 0 0" />
Expand Down
6 changes: 4 additions & 2 deletions Content.Client/Chemistry/UI/ReagentCardControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ public ReagentCardControl(ReagentInventoryItem item)
StorageSlotId = item.StorageSlotId;
ColorPanel.PanelOverride = new StyleBoxFlat { BackgroundColor = item.ReagentColor };
ReagentNameLabel.Text = item.ReagentLabel;
ReagentNameLabel.FontColorOverride = Color.White;
FillLabel.Text = item.StoredAmount;
FillLabel.Text = Loc.GetString("reagent-dispenser-window-quantity-label-text", ("quantity", item.Quantity));;
EjectButtonIcon.Text = Loc.GetString("reagent-dispenser-window-eject-container-button");

if (item.Quantity == 0.0)
MainButton.Disabled = true;

MainButton.OnPressed += args => OnPressed?.Invoke(StorageSlotId);
EjectButton.OnPressed += args => OnEjectButtonPressed?.Invoke(StorageSlotId);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Client.Guidebook.Components;
using Content.Shared.Chemistry;
using Content.Shared.Containers.ItemSlots;
using JetBrains.Annotations;
Expand Down Expand Up @@ -34,6 +35,7 @@ protected override void Open()
_window = new()
{
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName,
HelpGuidebookIds = EntMan.GetComponent<GuideHelpComponent>(Owner).Guides
};

_window.OpenCentered();
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Chemistry/UI/ReagentDispenserWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
xmlns:ui="clr-namespace:Content.Client.Chemistry.UI"
Title="{Loc 'reagent-dispenser-bound-user-interface-title'}"
MinSize="680 460">
MinSize="600 300"
SetSize="800 500">
<BoxContainer Orientation="Horizontal">
<BoxContainer Orientation="Vertical" MinWidth="170">
<Label Text="{Loc 'reagent-dispenser-window-amount-to-dispense-label'}" HorizontalAlignment="Center" />
Expand Down
24 changes: 0 additions & 24 deletions Content.Client/Chemistry/UI/ReagentDispenserWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,28 +121,4 @@ public void UpdateContainerInfo(ReagentDispenserBoundUserInterfaceState state)
}
}
}

public sealed class DispenseReagentButton : Button
{
public string ReagentId { get; }

public DispenseReagentButton(string reagentId, string text, string amount)
{
AddStyleClass("OpenRight");
ReagentId = reagentId;
Text = text + " " + amount;
}
}

public sealed class EjectJugButton : Button
{
public string ReagentId { get; }

public EjectJugButton(string reagentId)
{
AddStyleClass("OpenLeft");
ReagentId = reagentId;
Text = "⏏";
}
}
}
35 changes: 22 additions & 13 deletions Content.Client/Corvax/TTS/HumanoidProfileEditor.TTS.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using System.Linq;
using Content.Client.Corvax.TTS;
using Content.Client.Lobby;
using Content.Corvax.Interfaces.Shared;
using Content.Shared.Corvax.TTS;
using Content.Shared.Preferences;
using Content.Corvax.Interfaces.Client;

namespace Content.Client.Preferences.UI;
namespace Content.Client.Lobby.UI;

public sealed partial class HumanoidProfileEditor
{
private IClientSponsorsManager? _sponsorsMgr;
private List<TTSVoicePrototype> _voiceList = default!;
private ISharedSponsorsManager? _sponsorsMgr;
private List<TTSVoicePrototype> _voiceList = new();

private void InitializeVoice()
{
Expand All @@ -20,13 +20,14 @@ private void InitializeVoice()
.OrderBy(o => Loc.GetString(o.Name))
.ToList();

_voiceButton.OnItemSelected += args =>
VoiceButton.OnItemSelected += args =>
{
_voiceButton.SelectId(args.Id);
VoiceButton.SelectId(args.Id);
SetVoice(_voiceList[args.Id].ID);
};

_voicePlayButton.OnPressed += _ => { UserInterfaceManager.GetUIController<LobbyUIController>().PlayTTS(); };
VoicePlayButton.OnPressed += _ => PlayPreviewTTS();

IoCManager.Instance!.TryResolveType(out _sponsorsMgr);
}

Expand All @@ -35,7 +36,7 @@ private void UpdateTTSVoicesControls()
if (Profile is null)
return;

_voiceButton.Clear();
VoiceButton.Clear();

var firstVoiceChoiceId = 1;
for (var i = 0; i < _voiceList.Count; i++)
Expand All @@ -45,25 +46,33 @@ private void UpdateTTSVoicesControls()
continue;

var name = Loc.GetString(voice.Name);
_voiceButton.AddItem(name, i);
VoiceButton.AddItem(name, i);

if (firstVoiceChoiceId == 1)
firstVoiceChoiceId = i;

if (_sponsorsMgr is null)
continue;
if (voice.SponsorOnly && _sponsorsMgr != null &&
!_sponsorsMgr.Prototypes.Contains(voice.ID))
!_sponsorsMgr.GetClientPrototypes().Contains(voice.ID))
{
_voiceButton.SetItemDisabled(_voiceButton.GetIdx(i), true);
VoiceButton.SetItemDisabled(VoiceButton.GetIdx(i), true);
}
}

var voiceChoiceId = _voiceList.FindIndex(x => x.ID == Profile.Voice);
if (!_voiceButton.TrySelectId(voiceChoiceId) &&
_voiceButton.TrySelectId(firstVoiceChoiceId))
if (!VoiceButton.TrySelectId(voiceChoiceId) &&
VoiceButton.TrySelectId(firstVoiceChoiceId))
{
SetVoice(_voiceList[firstVoiceChoiceId].ID);
}
}

private void PlayPreviewTTS()
{
if (Profile is null)
return;

_entManager.System<TTSSystem>().RequestPreviewTTS(Profile.Voice);
}
}
18 changes: 0 additions & 18 deletions Content.Client/Corvax/TTS/LobbyUIController.TTS.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Content.Client.CriminalRecords.Systems;

public sealed class CriminalRecordsConsoleSystem : SharedCriminalRecordsConsoleSystem
{
}
public sealed class CriminalRecordsConsoleSystem : SharedCriminalRecordsConsoleSystem;
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Content.Client.CriminalRecords.Systems;

public sealed class CriminalRecordsHackerSystem : SharedCriminalRecordsHackerSystem
{
}
public sealed class CriminalRecordsHackerSystem : SharedCriminalRecordsHackerSystem;
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using Content.Shared.CriminalRecords.Systems;

namespace Content.Client.CriminalRecords.Systems;

public sealed class CriminalRecordsSystem : SharedCriminalRecordsSystem;
4 changes: 3 additions & 1 deletion Content.Client/Decals/ToggleDecalCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ namespace Content.Client.Decals;

public sealed class ToggleDecalCommand : IConsoleCommand
{
[Dependency] private readonly IEntityManager _e = default!;

public string Command => "toggledecals";
public string Description => "Toggles decaloverlay";
public string Help => $"{Command}";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
EntitySystem.Get<DecalSystem>().ToggleOverlay();
_e.System<DecalSystem>().ToggleOverlay();
}
}
3 changes: 2 additions & 1 deletion Content.Client/Decals/UI/DecalPlacerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Content.Client.Decals.UI;
public sealed partial class DecalPlacerWindow : DefaultWindow
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IEntityManager _e = default!;

private readonly DecalPlacementSystem _decalPlacementSystem;

Expand All @@ -39,7 +40,7 @@ public DecalPlacerWindow()
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);

_decalPlacementSystem = EntitySystem.Get<DecalPlacementSystem>();
_decalPlacementSystem = _e.System<DecalPlacementSystem>();

// This needs to be done in C# so we can have custom stuff passed in the constructor
// and thus have a proper step size
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Disposal/Systems/DisposalUnitSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private void UpdateState(EntityUid uid, SharedDisposalUnitComponent unit, Sprite
}
}
else if (state == VisualState.OverlayCharging)
sprite.LayerSetState(DisposalUnitVisualLayers.OverlayFlush, new RSI.StateId("disposal-charging"));
sprite.LayerSetState(DisposalUnitVisualLayers.OverlayFlush, chargingState);
else
_animationSystem.Stop(uid, AnimationKey);

Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
using Content.Client.Input;
using Content.Client.IoC;
using Content.Client.Launcher;
using Content.Client.Lobby;
using Content.Client.MainMenu;
using Content.Client.Parallax.Managers;
using Content.Client.Players.PlayTimeTracking;
using Content.Client.Preferences;
using Content.Client.Radiation.Overlays;
using Content.Client.Replay;
using Content.Client.Screenshot;
Expand Down
5 changes: 4 additions & 1 deletion Content.Client/GPS/UI/HandheldGpsStatusControl.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Content.Client.GPS.Components;
using Content.Client.Message;
using Content.Client.Stylesheets;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Timing;
Expand All @@ -13,11 +14,13 @@ public sealed class HandheldGpsStatusControl : Control
private readonly RichTextLabel _label;
private float _updateDif;
private readonly IEntityManager _entMan;
private readonly SharedTransformSystem _transform;

public HandheldGpsStatusControl(Entity<HandheldGPSComponent> parent)
{
_parent = parent;
_entMan = IoCManager.Resolve<IEntityManager>();
_transform = _entMan.System<TransformSystem>();
_label = new RichTextLabel { StyleClasses = { StyleNano.StyleClassItemStatus } };
AddChild(_label);
UpdateGpsDetails();
Expand All @@ -41,7 +44,7 @@ private void UpdateGpsDetails()
var posText = "Error";
if (_entMan.TryGetComponent(_parent, out TransformComponent? transComp))
{
var pos = transComp.MapPosition;
var pos = _transform.GetMapCoordinates(_parent.Owner, xform: transComp);
var x = (int) pos.X;
var y = (int) pos.Y;
posText = $"({x}, {y})";
Expand Down
5 changes: 5 additions & 0 deletions Content.Client/Guidebook/GuidebookSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ private void OnGetVerbs(EntityUid uid, GuideHelpComponent component, GetVerbsEve
});
}

public void OpenHelp(List<string> guides)
{
OnGuidebookOpen?.Invoke(guides, null, null, true, guides[0]);
}

private void OnInteract(EntityUid uid, GuideHelpComponent component, ActivateInWorldEvent args)
{
if (!_timing.IsFirstTimePredicted)
Expand Down
Loading

0 comments on commit 81d5aec

Please sign in to comment.