Skip to content

Commit

Permalink
Merge branch 'master' into toiletbranch
Browse files Browse the repository at this point in the history
  • Loading branch information
brainfood1183 authored Mar 25, 2024
2 parents 96b99af + bd58954 commit 5f807ec
Show file tree
Hide file tree
Showing 361 changed files with 1,713,564 additions and 1,712,558 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"
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
23 changes: 11 additions & 12 deletions Content.Client/Disposal/Systems/DisposalUnitSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem

private const string AnimationKey = "disposal_unit_animation";

private const string DefaultFlushState = "disposal-flush";
private const string DefaultChargeState = "disposal-charging";

public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -93,20 +96,24 @@ private void OnAppearanceChange(EntityUid uid, SharedDisposalUnitComponent unit,
private void UpdateState(EntityUid uid, SharedDisposalUnitComponent unit, SpriteComponent sprite, AppearanceComponent appearance)
{
if (!_appearanceSystem.TryGetData<VisualState>(uid, Visuals.VisualState, out var state, appearance))
{
return;
}

sprite.LayerSetVisible(DisposalUnitVisualLayers.Unanchored, state == VisualState.UnAnchored);
sprite.LayerSetVisible(DisposalUnitVisualLayers.Base, state == VisualState.Anchored);
sprite.LayerSetVisible(DisposalUnitVisualLayers.OverlayFlush, state is VisualState.OverlayFlushing or VisualState.OverlayCharging);

var chargingState = sprite.LayerMapTryGet(DisposalUnitVisualLayers.BaseCharging, out var chargingLayer)
? sprite.LayerGetState(chargingLayer)
: new RSI.StateId(DefaultChargeState);

// This is a transient state so not too worried about replaying in range.
if (state == VisualState.OverlayFlushing)
{
if (!_animationSystem.HasRunningAnimation(uid, AnimationKey))
{
var flushState = new RSI.StateId("disposal-flush");
var flushState = sprite.LayerMapTryGet(DisposalUnitVisualLayers.BaseFlush, out var flushLayer)

Check failure on line 114 in Content.Client/Disposal/Systems/DisposalUnitSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

'DisposalUnitVisualLayers' does not contain a definition for 'BaseFlush'

Check failure on line 114 in Content.Client/Disposal/Systems/DisposalUnitSystem.cs

View workflow job for this annotation

GitHub Actions / YAML Linter

'DisposalUnitVisualLayers' does not contain a definition for 'BaseFlush'

Check failure on line 114 in Content.Client/Disposal/Systems/DisposalUnitSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'DisposalUnitVisualLayers' does not contain a definition for 'BaseFlush'

Check failure on line 114 in Content.Client/Disposal/Systems/DisposalUnitSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'DisposalUnitVisualLayers' does not contain a definition for 'BaseFlush'

Check failure on line 114 in Content.Client/Disposal/Systems/DisposalUnitSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'DisposalUnitVisualLayers' does not contain a definition for 'BaseFlush'

Check failure on line 114 in Content.Client/Disposal/Systems/DisposalUnitSystem.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'DisposalUnitVisualLayers' does not contain a definition for 'BaseFlush'

Check failure on line 114 in Content.Client/Disposal/Systems/DisposalUnitSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

'DisposalUnitVisualLayers' does not contain a definition for 'BaseFlush'

Check failure on line 114 in Content.Client/Disposal/Systems/DisposalUnitSystem.cs

View workflow job for this annotation

GitHub Actions / Test Packaging

'DisposalUnitVisualLayers' does not contain a definition for 'BaseFlush'
? sprite.LayerGetState(flushLayer)
: new RSI.StateId(DefaultFlushState);

// Setup the flush animation to play
var anim = new Animation
Expand All @@ -124,7 +131,7 @@ private void UpdateState(EntityUid uid, SharedDisposalUnitComponent unit, Sprite
// Return to base state (though, depending on how the unit is
// configured we might get an appearance change event telling
// us to go to charging state)
new AnimationTrackSpriteFlick.KeyFrame("disposal-charging", (float) unit.FlushDelay.TotalSeconds)
new AnimationTrackSpriteFlick.KeyFrame(chargingState, (float) unit.FlushDelay.TotalSeconds)
}
},
}
Expand All @@ -146,25 +153,17 @@ private void UpdateState(EntityUid uid, SharedDisposalUnitComponent unit, Sprite
}
}
else if (state == VisualState.OverlayCharging)
{
sprite.LayerSetState(DisposalUnitVisualLayers.OverlayFlush, new RSI.StateId("disposal-charging"));
}
else
{
_animationSystem.Stop(uid, AnimationKey);
}

if (!_appearanceSystem.TryGetData<HandleState>(uid, Visuals.Handle, out var handleState, appearance))
{
handleState = HandleState.Normal;
}

sprite.LayerSetVisible(DisposalUnitVisualLayers.OverlayEngaged, handleState != HandleState.Normal);

if (!_appearanceSystem.TryGetData<LightStates>(uid, Visuals.Light, out var lightState, appearance))
{
lightState = LightStates.Off;
}

sprite.LayerSetVisible(DisposalUnitVisualLayers.OverlayCharging,
(lightState & LightStates.Charging) != 0);
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ private void InputManagerOnFirstChanceOnKeyEvent(KeyEventArgs keyEvent, KeyEvent
Mod1 = mods[0],
Mod2 = mods[1],
Mod3 = mods[2],
Priority = 0,
Priority = _currentlyRebinding.Binding?.Priority ?? 0,
Type = bindType,
CanFocus = key == Keyboard.Key.MouseLeft
|| key == Keyboard.Key.MouseRight
Expand Down
12 changes: 6 additions & 6 deletions Content.Server/Administration/Systems/AdminVerbSystem.Smites.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ private void AddSmiteVerbs(GetVerbsEvent<Verb> args)
var fixtures = Comp<FixturesComponent>(args.Target);
xform.Anchored = false; // Just in case.
_physics.SetBodyType(args.Target, BodyType.Dynamic, manager: fixtures, body: physics);
_physics.SetBodyStatus(physics, BodyStatus.InAir);
_physics.SetBodyStatus(args.Target, physics, BodyStatus.InAir);
_physics.WakeBody(args.Target, manager: fixtures, body: physics);
foreach (var fixture in fixtures.Fixtures.Values)
Expand All @@ -424,8 +424,8 @@ private void AddSmiteVerbs(GetVerbsEvent<Verb> args)
_physics.SetLinearVelocity(args.Target, _random.NextVector2(1.5f, 1.5f), manager: fixtures, body: physics);
_physics.SetAngularVelocity(args.Target, MathF.PI * 12, manager: fixtures, body: physics);
_physics.SetLinearDamping(physics, 0f);
_physics.SetAngularDamping(physics, 0f);
_physics.SetLinearDamping(args.Target, physics, 0f);
_physics.SetAngularDamping(args.Target, physics, 0f);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-pinball-description")
Expand All @@ -444,7 +444,7 @@ private void AddSmiteVerbs(GetVerbsEvent<Verb> args)
xform.Anchored = false; // Just in case.
_physics.SetBodyType(args.Target, BodyType.Dynamic, body: physics);
_physics.SetBodyStatus(physics, BodyStatus.InAir);
_physics.SetBodyStatus(args.Target, physics, BodyStatus.InAir);
_physics.WakeBody(args.Target, manager: fixtures, body: physics);
foreach (var fixture in fixtures.Fixtures.Values)
Expand All @@ -454,8 +454,8 @@ private void AddSmiteVerbs(GetVerbsEvent<Verb> args)
_physics.SetLinearVelocity(args.Target, _random.NextVector2(8.0f, 8.0f), manager: fixtures, body: physics);
_physics.SetAngularVelocity(args.Target, MathF.PI * 12, manager: fixtures, body: physics);
_physics.SetLinearDamping(physics, 0f);
_physics.SetAngularDamping(physics, 0f);
_physics.SetLinearDamping(args.Target, physics, 0f);
_physics.SetAngularDamping(args.Target, physics, 0f);
},
Impact = LogImpact.Extreme,
Message = Loc.GetString("admin-smite-yeet-description")
Expand Down
16 changes: 14 additions & 2 deletions Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -718,9 +718,21 @@ private void AddTricksVerbs(GetVerbsEvent<Verb> args)
Icon = new SpriteSpecifier.Rsi(new("/Textures/Objects/Fun/caps.rsi"), "mag-6"),
Act = () =>
{
_quickDialog.OpenDialog(player, "Set Bullet Amount", $"Amount (max {ballisticAmmo.Capacity}):", (int amount) =>
_quickDialog.OpenDialog(player, "Set Bullet Amount", $"Amount (standard {ballisticAmmo.Capacity}):", (string amount) =>
{
ballisticAmmo.UnspawnedCount = amount;
if (!int.TryParse(amount, out var result))
return;
if (result > 0)
{
ballisticAmmo.UnspawnedCount = result;
}
else
{
ballisticAmmo.UnspawnedCount = 0;
}
_gun.UpdateBallisticAppearance(args.Target, ballisticAmmo);
});
},
Impact = LogImpact.Medium,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ private void OnPlayerStatusChanged(object? sender, SessionStatusEventArgs e)
tile.ExcitedGroup?.GetHashCode(),
tile.Space,
tile.MapAtmosphere,
tile.NoGridTile);
tile.NoGridTile,
tile.Air?.Immutable ?? false);
}

public override void Update(float frameTime)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ private void FixGridAtmosCommand(IConsoleShell shell, string argstr, string[] ar
if (tile == null)
continue;

if (!_mapSystem.TryGetTile(gridComp, indices, out var gTile) || gTile.IsEmpty)
{
gridAtmosphere.Tiles.Remove(indices);
continue;
}

if (tile.Immutable && !IsTileSpace(euid, transform.MapUid, indices, gridComp))
{
tile = new GasMixture(tile.Volume) { Temperature = tile.Temperature };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private void UpdateHighPressure(float frameTime)
if (HasComp<MobStateComponent>(uid) &&
TryComp<PhysicsComponent>(uid, out var body))
{
_physics.SetBodyStatus(body, BodyStatus.OnGround);
_physics.SetBodyStatus(uid, body, BodyStatus.OnGround);
}

if (TryComp<FixturesComponent>(uid, out var fixtures))
Expand All @@ -75,7 +75,7 @@ private void AddMobMovedByPressure(EntityUid uid, MovedByPressureComponent compo
if (!TryComp<FixturesComponent>(uid, out var fixtures))
return;

_physics.SetBodyStatus(body, BodyStatus.InAir);
_physics.SetBodyStatus(uid, body, BodyStatus.InAir);

foreach (var (id, fixture) in fixtures.Fixtures)
{
Expand All @@ -94,9 +94,9 @@ private void HighPressureMovements(Entity<GridAtmosphereComponent> gridAtmospher
// TODO ATMOS finish this

// Don't play the space wind sound on tiles that are on fire...
if(tile.PressureDifference > 15 && !tile.Hotspot.Valid)
if (tile.PressureDifference > 15 && !tile.Hotspot.Valid)
{
if(_spaceWindSoundCooldown == 0 && !string.IsNullOrEmpty(SpaceWindSound))
if (_spaceWindSoundCooldown == 0 && !string.IsNullOrEmpty(SpaceWindSound))
{
var coordinates = _mapSystem.ToCenterCoordinates(tile.GridIndex, tile.GridIndices);
_audio.PlayPvs(SpaceWindSound, coordinates, AudioParams.Default.WithVariation(0.125f).WithVolume(MathHelper.Clamp(tile.PressureDifference / 10, 10, 100)));
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/Chemistry/EntitySystems/VaporSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ public void Start(Entity<VaporComponent> vapor, TransformComponent vaporXform, V
// Set Move
if (EntityManager.TryGetComponent(vapor, out PhysicsComponent? physics))
{
_physics.SetLinearDamping(physics, 0f);
_physics.SetAngularDamping(physics, 0f);
_physics.SetLinearDamping(vapor, physics, 0f);
_physics.SetAngularDamping(vapor, physics, 0f);

_throwing.TryThrow(vapor, dir, speed, user: user);

Expand Down
38 changes: 38 additions & 0 deletions Content.Server/DeviceNetwork/Systems/DeviceNetworkJammerSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Content.Server.DeviceNetwork.Components;
using Content.Shared.DeviceNetwork.Components;
using Robust.Server.GameObjects;

namespace Content.Server.DeviceNetwork.Systems;

public sealed class DeviceNetworkJammerSystem : EntitySystem
{
[Dependency] private TransformSystem _transform = default!;
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<TransformComponent, BeforePacketSentEvent>(BeforePacketSent);
}

private void BeforePacketSent(EntityUid uid, TransformComponent xform, BeforePacketSentEvent ev)
{
if (ev.Cancelled)
return;

var query = EntityQueryEnumerator<DeviceNetworkJammerComponent, TransformComponent>();

while (query.MoveNext(out _, out var jammerComp, out var jammerXform))
{
if (!jammerComp.JammableNetworks.Contains(ev.NetworkId))
continue;

if (jammerXform.Coordinates.InRange(EntityManager, _transform, ev.SenderTransform.Coordinates, jammerComp.Range)
|| jammerXform.Coordinates.InRange(EntityManager, _transform, xform.Coordinates, jammerComp.Range))
{
ev.Cancel();
return;
}
}
}

}
11 changes: 9 additions & 2 deletions Content.Server/DeviceNetwork/Systems/DeviceNetworkSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,14 @@ private void SendToConnections(ReadOnlySpan<DeviceNetworkComponent> connections,

var xform = Transform(packet.Sender);

BeforePacketSentEvent beforeEv = new(packet.Sender, xform, _transformSystem.GetWorldPosition(xform));
var senderPos = _transformSystem.GetWorldPosition(xform);

foreach (var connection in connections)
{
if (connection.Owner == packet.Sender)
continue;

BeforePacketSentEvent beforeEv = new(packet.Sender, xform, senderPos, connection.NetIdEnum.ToString());
RaiseLocalEvent(connection.Owner, beforeEv, false);

if (!beforeEv.Cancelled)
Expand Down Expand Up @@ -386,11 +387,17 @@ public sealed class BeforePacketSentEvent : CancellableEntityEventArgs
/// </summary>
public readonly Vector2 SenderPosition;

public BeforePacketSentEvent(EntityUid sender, TransformComponent xform, Vector2 senderPosition)
/// <summary>
/// The network the packet will be sent to.
/// </summary>
public readonly string NetworkId;

public BeforePacketSentEvent(EntityUid sender, TransformComponent xform, Vector2 senderPosition, string networkId)
{
Sender = sender;
SenderTransform = xform;
SenderPosition = senderPosition;
NetworkId = networkId;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Server.DeviceNetwork.Components;
using System.Diagnostics.CodeAnalysis;
using Content.Server.DeviceNetwork.Components;
using Content.Server.Medical.CrewMonitoring;
using Content.Server.Power.Components;
using Content.Server.Station.Systems;
Expand Down Expand Up @@ -38,7 +39,7 @@ public bool IsActiveServer(EntityUid serverId, SingletonDeviceNetServerComponent
/// <param name="address">The address of the active server if it exists</param>
/// <typeparam name="TComp">The component type that determines what type of server you're getting the address of</typeparam>
/// <returns>True if there is an active serve. False otherwise</returns>
public bool TryGetActiveServerAddress<TComp>(EntityUid stationId, out string? address) where TComp : IComponent
public bool TryGetActiveServerAddress<TComp>(EntityUid stationId, [NotNullWhen(true)] out string? address) where TComp : IComponent
{
var servers = EntityQueryEnumerator<
SingletonDeviceNetServerComponent,
Expand Down
38 changes: 19 additions & 19 deletions Content.Server/Holosign/HolosignProjectorComponent.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Server.Holosign
{
[RegisterComponent]
public sealed partial class HolosignProjectorComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField("signProto", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string SignProto = "HolosignWetFloor";

/// <summary>
/// How much charge a single use expends.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("chargeUse")]
public float ChargeUse = 50f;
}
}
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Server.Holosign
{
[RegisterComponent]
public sealed partial class HolosignProjectorComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField("signProto", customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string SignProto = "HolosignWetFloor";

/// <summary>
/// How much charge a single use expends.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("chargeUse")]
public float ChargeUse = 50f;
}
}
Loading

0 comments on commit 5f807ec

Please sign in to comment.