Skip to content

Commit

Permalink
Merge pull request #1494 from space-syndicate/upstream-sync
Browse files Browse the repository at this point in the history
Upstream sync
  • Loading branch information
Morb0 authored Oct 11, 2023
2 parents 227ae95 + 6e2e112 commit bb11433
Show file tree
Hide file tree
Showing 592 changed files with 7,876 additions and 19,070 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/update-credits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Update Contrib and Patreons in credits

on:
workflow_dispatch:
schedule:
- cron: 0 0 * * 0

jobs:
get_credits:
runs-on: ubuntu-latest
# Hey there fork dev! If you like to include your own contributors in this then you can probably just change this to your own repo
# Do this in dump_github_contributors.ps1 too into your own repo
if: github.repository == 'space-wizards/space-station-14'

steps:
- uses: actions/[email protected]
with:
ref: master

- name: Get this week's Contributors
shell: pwsh
run: Tools/dump_github_contributors.ps1 > Resources/Credits/GitHub.txt

# TODO
#- name: Get this week's Patreons
# run: Tools/script2dumppatreons > Resources/Credits/Patrons.yml

- name: Commit new credit files
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update Credits
commit_author: PJBot <[email protected]>
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ PublishScripts/
# NuGet v3's project.json files produces more ignoreable files
*.nuget.props
*.nuget.targets
.nuget/

# Microsoft Azure Build Output
csx/
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Actions/ActionsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public sealed class ActionsSystem : SharedActionsSystem

public event Action<EntityUid>? OnActionAdded;
public event Action<EntityUid>? OnActionRemoved;
public event OnActionReplaced? ActionReplaced;
public event Action? ActionsUpdated;
public event Action<ActionsComponent>? LinkActions;
public event Action? UnlinkActions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,52 +1,45 @@
using System;
using Content.Shared.Chemistry;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;

namespace Content.Client.Chemistry.Visualizers
{
[RegisterComponent]
public sealed partial class SolutionContainerVisualsComponent : Component
{
[DataField("maxFillLevels")]
[DataField]
public int MaxFillLevels = 0;
[DataField("fillBaseName")]
[DataField]
public string? FillBaseName = null;
[DataField("layer")]
public SolutionContainerLayers FillLayer = SolutionContainerLayers.Fill;
[DataField("baseLayer")]
[DataField]
public SolutionContainerLayers Layer = SolutionContainerLayers.Fill;
[DataField]
public SolutionContainerLayers BaseLayer = SolutionContainerLayers.Base;
[DataField("overlayLayer")]
[DataField]
public SolutionContainerLayers OverlayLayer = SolutionContainerLayers.Overlay;
[DataField("changeColor")]
[DataField]
public bool ChangeColor = true;
[DataField("emptySpriteName")]
[DataField]
public string? EmptySpriteName = null;
[DataField("emptySpriteColor")]
[DataField]
public Color EmptySpriteColor = Color.White;
[DataField("metamorphic")]
[DataField]
public bool Metamorphic = false;
[DataField("metamorphicDefaultSprite")]
[DataField]
public SpriteSpecifier? MetamorphicDefaultSprite;
[DataField("metamorphicNameFull")]
public string MetamorphicNameFull = "transformable-container-component-glass";
[DataField]
public LocId MetamorphicNameFull = "transformable-container-component-glass";

/// <summary>
/// Which solution of the SolutionContainerManagerComponent to represent.
/// If not set, will work as default.
/// </summary>
[DataField("solutionName")]
[DataField]
public string? SolutionName;

[DataField("initialName")]
[DataField]
public string InitialName = string.Empty;

[DataField("initialDescription")]
[DataField]
public string InitialDescription = string.Empty;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected override void OnAppearanceChange(EntityUid uid, SolutionContainerVisua
if (args.Sprite == null)
return;

if (!args.Sprite.LayerMapTryGet(component.FillLayer, out var fillLayer))
if (!args.Sprite.LayerMapTryGet(component.Layer, out var fillLayer))
return;

// Currently some solution methods such as overflowing will try to update appearance with a
Expand Down
12 changes: 0 additions & 12 deletions Content.Client/CombatMode/CombatModeSystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Content.Client.Hands.Systems;
using Content.Shared.CCVar;
using Content.Shared.CombatMode;
using Content.Shared.Targeting;
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.Player;
Expand Down Expand Up @@ -44,11 +43,6 @@ public override void Shutdown()
base.Shutdown();
}

private void OnTargetingZoneChanged(TargetingZone obj)
{
EntityManager.RaisePredictiveEvent(new CombatModeSystemMessages.SetTargetZoneMessage(obj));
}

public bool IsInCombatMode()
{
var entity = _playerManager.LocalPlayer?.ControlledEntity;
Expand All @@ -65,12 +59,6 @@ public override void SetInCombatMode(EntityUid entity, bool value, CombatModeCom
UpdateHud(entity);
}

public override void SetActiveZone(EntityUid entity, TargetingZone zone, CombatModeComponent? component = null)
{
base.SetActiveZone(entity, zone, component);
UpdateHud(entity);
}

private void UpdateHud(EntityUid entity)
{
if (entity != _playerManager.LocalPlayer?.ControlledEntity || !Timing.IsFirstTimePredicted)
Expand Down
3 changes: 2 additions & 1 deletion Content.Client/Commands/HideMechanismsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public sealed class HideMechanismsCommand : IConsoleCommand
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var entityManager = IoCManager.Resolve<IEntityManager>();
var containerSys = entityManager.System<SharedContainerSystem>();
var organs = entityManager.EntityQuery<OrganComponent>(true);

foreach (var part in organs)
Expand All @@ -27,7 +28,7 @@ public void Execute(IConsoleShell shell, string argStr, string[] args)
sprite.ContainerOccluded = false;

var tempParent = part.Owner;
while (tempParent.TryGetContainer(out var container))
while (containerSys.TryGetContainingContainer(tempParent, out var container))
{
if (!container.ShowContents)
{
Expand Down
30 changes: 30 additions & 0 deletions Content.Client/Ghost/GhostToggleSelfVisibility.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Content.Shared.Ghost;
using Robust.Client.GameObjects;
using Robust.Shared.Console;

namespace Content.Client.Ghost;

public sealed class GhostToggleSelfVisibility : IConsoleCommand
{
public string Command => "toggleselfghost";
public string Description => "Toggles seeing your own ghost.";
public string Help => "toggleselfghost";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
var attachedEntity = shell.Player?.AttachedEntity;
if (!attachedEntity.HasValue)
return;

var entityManager = IoCManager.Resolve<IEntityManager>();
if (!entityManager.HasComponent<GhostComponent>(attachedEntity))
{
shell.WriteError("Entity must be a ghost.");
return;
}

if (!entityManager.TryGetComponent(attachedEntity, out SpriteComponent? spriteComponent))
return;

spriteComponent.Visible = !spriteComponent.Visible;
}
}
3 changes: 2 additions & 1 deletion Content.Client/Instruments/UI/InstrumentMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ private bool PlayCheck()
if (localPlayer.ControlledEntity == instrumentEnt)
return true;

var container = _owner.Entities.System<SharedContainerSystem>();
// If we're a handheld instrument, we might be in a container. Get it just in case.
instrumentEnt.TryGetContainerMan(out var conMan);
container.TryGetContainingContainer(instrumentEnt, out var conMan);

// If the instrument is handheld and we're not holding it, we return.
if ((instrument.Handheld && (conMan == null || conMan.Owner != localPlayer.ControlledEntity)))
Expand Down
6 changes: 4 additions & 2 deletions Content.Client/Interactable/InteractionSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ namespace Content.Client.Interactable
{
public sealed class InteractionSystem : SharedInteractionSystem
{
[Dependency] private readonly SharedContainerSystem _container = default!;

public override bool CanAccessViaStorage(EntityUid user, EntityUid target)
{
if (!EntityManager.EntityExists(target))
return false;

if (!target.TryGetContainer(out var container))
if (!_container.TryGetContainingContainer(target, out var container))
return false;

if (!TryComp(container.Owner, out StorageComponent? storage))
if (!HasComp<StorageComponent>(container.Owner))
return false;

// we don't check if the user can access the storage entity itself. This should be handed by the UI system.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Robust.Client.Input;
using Robust.Shared.Map;

namespace Content.Client.DragDrop;
namespace Content.Client.Interaction;

/// <summary>
/// Helper for implementing drag and drop interactions.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.CombatMode;
using Content.Client.Gameplay;
using Content.Client.Outline;
Expand All @@ -7,7 +8,6 @@
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.Popups;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Input;
Expand All @@ -20,15 +20,13 @@
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using System.Numerics;
using DrawDepth = Content.Shared.DrawDepth.DrawDepth;

namespace Content.Client.DragDrop;
namespace Content.Client.Interaction;

/// <summary>
/// Handles clientside drag and drop logic
/// </summary>
[UsedImplicitly]
public sealed class DragDropSystem : SharedDragDropSystem
{
[Dependency] private readonly IStateManager _stateManager = default!;
Expand All @@ -45,8 +43,6 @@ public sealed class DragDropSystem : SharedDragDropSystem
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;

private ISawmill _sawmill = default!;

// how often to recheck possible targets (prevents calling expensive
// check logic each update)
private const float TargetRecheckInterval = 0.25f;
Expand Down Expand Up @@ -110,7 +106,6 @@ public sealed class DragDropSystem : SharedDragDropSystem
public override void Initialize()
{
base.Initialize();
_sawmill = Logger.GetSawmill("drag_drop");
UpdatesOutsidePrediction = true;
UpdatesAfter.Add(typeof(SharedEyeSystem));

Expand Down Expand Up @@ -263,7 +258,7 @@ private void StartDrag()
return;
}

_sawmill.Warning($"Unable to display drag shadow for {ToPrettyString(_draggedEntity.Value)} because it has no sprite component.");
Log.Warning($"Unable to display drag shadow for {ToPrettyString(_draggedEntity.Value)} because it has no sprite component.");
}

private bool UpdateDrag(float frameTime)
Expand Down Expand Up @@ -392,7 +387,7 @@ private bool OnUseMouseUp(in PointerInputCmdHandler.PointerInputCmdArgs args)
}

// tell the server about the drop attempt
RaiseNetworkEvent(new DragDropRequestEvent(GetNetEntity(_draggedEntity.Value), GetNetEntity(entity)));
RaisePredictiveEvent(new DragDropRequestEvent(GetNetEntity(_draggedEntity.Value), GetNetEntity(entity)));
EndDrag();
return true;
}
Expand Down
33 changes: 0 additions & 33 deletions Content.Client/Movement/Systems/ClimbSystem.cs

This file was deleted.

14 changes: 11 additions & 3 deletions Content.Client/PDA/Ringer/RingerBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Content.Shared.PDA;
using Content.Shared.PDA.Ringer;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Shared.Timing;

namespace Content.Client.PDA.Ringer
{
Expand Down Expand Up @@ -29,9 +29,17 @@ protected override void Open()

_menu.SetRingerButton.OnPressed += _ =>
{
if (!TryGetRingtone(out var ringtone)) return;
if (!TryGetRingtone(out var ringtone))
return;

SendMessage(new RingerSetRingtoneMessage(ringtone));
_menu.SetRingerButton.Disabled = true;

Timer.Spawn(333, () =>
{
if (_menu is { Disposed: false, SetRingerButton: { Disposed: false } ringer})
ringer.Disabled = false;
});
};
}

Expand Down Expand Up @@ -74,7 +82,7 @@ protected override void UpdateState(BoundUserInterfaceState state)

}

_menu.TestRingerButton.Visible = !msg.IsPlaying;
_menu.TestRingerButton.Disabled = msg.IsPlaying;
}


Expand Down
Loading

0 comments on commit bb11433

Please sign in to comment.