Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream sync #282

Merged
merged 46 commits into from
Oct 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0d2afb0
reduce c4 and c4 bundle price (#21102)
asperger-sind Oct 19, 2023
5825ffb
Automatic changelog update
PJBot Oct 19, 2023
f560f88
Remove 700 usages of Component.Owner (#21100)
DrSmugleaf Oct 19, 2023
aeaabc5
Update RobustToolbox to v169.0.0 (#21105)
DrSmugleaf Oct 19, 2023
69b38ef
Yeah (#21112)
coolmankid12345 Oct 20, 2023
2cb47e5
fix botany tools and air tank wide swing animations (#21103)
notquitehadouken Oct 20, 2023
d4aeba8
add craft rollerbed & wheelchair (#21110)
IntegerTempest Oct 20, 2023
5ae3a02
Automatic changelog update
PJBot Oct 20, 2023
5734f02
Fix ghost actions disappearing when toggling visibility of other ghos…
DrSmugleaf Oct 20, 2023
3a561ed
fixed localization for guardian (#21101)
Sirionaut Oct 20, 2023
68aa295
Add internal temperatures for cooking meats (#20659)
deltanedas Oct 20, 2023
f7108af
Automatic changelog update
PJBot Oct 20, 2023
82627ca
Orewall and cobblestone wall pack (#21034)
TheShuEd Oct 20, 2023
44bd12c
Fix replay infinite loop (#21129)
metalgearsloth Oct 20, 2023
77d9876
Automatic changelog update
PJBot Oct 20, 2023
8f06856
Fix rat king rummage audio (#21130)
metalgearsloth Oct 20, 2023
29ac3f3
Update Robust to v169.0.1 (#21139)
DrSmugleaf Oct 21, 2023
db81050
Automatic changelog update
PJBot Oct 21, 2023
2928ecf
Merge remote-tracking branch 'wizard/master' into upstream-sync
Rxup Oct 21, 2023
e2227c6
Make common netspeak get replaced in the chat (#20180)
Dutch-VanDerLinde Oct 21, 2023
93c345a
Automatic changelog update
PJBot Oct 21, 2023
9ea8e03
Social a-anxiety/st-st-stuttering t-trait. (#20500)
VasilisThePikachu Oct 21, 2023
498af49
Automatic changelog update
PJBot Oct 21, 2023
4fc45f3
Update RobustToolbox to v170.0.0 (#21149)
DrSmugleaf Oct 21, 2023
b589a12
Fix thrusters starting disabled (#21147)
DrSmugleaf Oct 21, 2023
0109e7a
Fix expeditions console not having any expeditions (#21148)
DrSmugleaf Oct 21, 2023
0b5fd38
Automatic changelog update
PJBot Oct 21, 2023
b44281a
Fix whitelist commands not giving feedback with 0 arguments, trim nam…
DrSmugleaf Oct 21, 2023
1aa69f2
upd
Rxup Oct 22, 2023
d282082
Telekinetic door prying fix (#21150)
nikthechampiongr Oct 22, 2023
3f241b4
emitter bolts can mine (#21135)
deltanedas Oct 22, 2023
082e3b9
Automatic changelog update
PJBot Oct 22, 2023
60bfdc4
Automatic changelog update
PJBot Oct 22, 2023
e2352fc
Update buckle jointrelay (#21079)
metalgearsloth Oct 22, 2023
a5f1683
RCD and tile placement fixes (#21132)
metalgearsloth Oct 22, 2023
e3eaba1
Fix inventory transform bug (#21144)
ElectroJr Oct 22, 2023
fbf4333
Maybe fix hand test failures (#21157)
ElectroJr Oct 22, 2023
975a8e8
Automatic changelog update
PJBot Oct 22, 2023
7c2a00d
Update submodule to 171.0.0 (#21158)
metalgearsloth Oct 22, 2023
c1bc177
Make secure crates weldable, for real this time (#21037)
iacore Oct 22, 2023
dc9f9b5
ignition source refactor (#21044)
deltanedas Oct 22, 2023
002d3be
The Quartermaster's Requisition Digi-board (#21023)
Endecc Oct 22, 2023
ef0c079
Automatic changelog update
PJBot Oct 22, 2023
5222ef8
fix
Rxup Oct 22, 2023
9c242e9
Merge remote-tracking branch 'wizard/master' into upstream-sync
Rxup Oct 22, 2023
747cf10
fix
Rxup Oct 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System.Linq;
using System.Numerics;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Shared.Enums;
using Robust.Shared.Map;
using System.Linq;
using System.Numerics;
using Robust.Shared.Map.Components;

namespace Content.Client.Administration.UI.SpawnExplosion;

Expand All @@ -13,7 +15,6 @@ public sealed class ExplosionDebugOverlay : Overlay
{
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IEyeManager _eyeManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;

public Dictionary<int, List<Vector2i>>? SpaceTiles;
public Dictionary<EntityUid, Dictionary<int, List<Vector2i>>> Tiles = new();
Expand Down Expand Up @@ -61,14 +62,15 @@ private void DrawScreen(OverlayDrawArgs args)
var handle = args.ScreenHandle;
Box2 gridBounds;
var xformQuery = _entityManager.GetEntityQuery<TransformComponent>();
var xformSystem = _entityManager.System<TransformSystem>();

foreach (var (gridId, tileSets) in Tiles)
{
if (!_mapManager.TryGetGrid(gridId, out var grid))
if (!_entityManager.TryGetComponent(gridId, out MapGridComponent? grid))
continue;

var gridXform = xformQuery.GetComponent(grid.Owner);
var (_, _, matrix, invMatrix) = gridXform.GetWorldPositionRotationMatrixWithInv(xformQuery);
var gridXform = xformQuery.GetComponent(gridId);
var (_, _, matrix, invMatrix) = xformSystem.GetWorldPositionRotationMatrixWithInv(gridXform, xformQuery);
gridBounds = invMatrix.TransformBox(args.WorldBounds).Enlarged(grid.TileSize * 2);
DrawText(handle, gridBounds, matrix, tileSets, grid.TileSize);
}
Expand Down Expand Up @@ -114,9 +116,9 @@ private void DrawText(
}
}

if (tileSets.ContainsKey(0))
if (tileSets.TryGetValue(0, out var set))
{
var epicenter = tileSets[0].First();
var epicenter = set.First();
var worldCenter = transform.Transform((epicenter + Vector2Helpers.Half) * tileSize);
var screenCenter = _eyeManager.WorldToScreen(worldCenter) + new Vector2(-24, -24);
var text = $"{Intensity[0]:F2}\nΣ={TotalIntensity:F1}\nΔ={Slope:F1}";
Expand All @@ -129,14 +131,15 @@ private void DrawWorld(in OverlayDrawArgs args)
var handle = args.WorldHandle;
Box2 gridBounds;
var xformQuery = _entityManager.GetEntityQuery<TransformComponent>();
var xformSystem = _entityManager.System<TransformSystem>();

foreach (var (gridId, tileSets) in Tiles)
{
if (!_mapManager.TryGetGrid(gridId, out var grid))
if (!_entityManager.TryGetComponent(gridId, out MapGridComponent? grid))
continue;

var gridXform = xformQuery.GetComponent(grid.Owner);
var (_, _, worldMatrix, invWorldMatrix) = gridXform.GetWorldPositionRotationMatrixWithInv(xformQuery);
var gridXform = xformQuery.GetComponent(gridId);
var (_, _, worldMatrix, invWorldMatrix) = xformSystem.GetWorldPositionRotationMatrixWithInv(gridXform, xformQuery);
gridBounds = invWorldMatrix.TransformBox(args.WorldBounds).Enlarged(grid.TileSize * 2);
handle.SetTransform(worldMatrix);
DrawTiles(handle, gridBounds, tileSets, SpaceTileSize);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
using Robust.Client.Player;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Map.Components;

namespace Content.Client.Administration.UI.Tabs.AtmosTab
Expand All @@ -17,16 +13,29 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab
[UsedImplicitly]
public sealed partial class AddAtmosWindow : DefaultWindow
{
private IEnumerable<MapGridComponent>? _data;
[Dependency] private readonly IPlayerManager _players = default!;
[Dependency] private readonly IEntityManager _entities = default!;

private readonly List<Entity<MapGridComponent>> _data = new();

public AddAtmosWindow()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
}

protected override void EnteredTree()
{
_data = IoCManager.Resolve<IMapManager>().GetAllGrids().Where(g => (int) g.Owner != 0);
foreach (var grid in _data)
_data.Clear();

var player = _players.LocalPlayer?.ControlledEntity;
var playerGrid = _entities.GetComponentOrNull<TransformComponent>(player)?.GridUid;
var query = IoCManager.Resolve<IEntityManager>().AllEntityQueryEnumerator<MapGridComponent>();

while (query.MoveNext(out var uid, out var grid))
{
var player = IoCManager.Resolve<IPlayerManager>().LocalPlayer?.ControlledEntity;
var playerGrid = IoCManager.Resolve<IEntityManager>().GetComponentOrNull<TransformComponent>(player)?.GridUid;
GridOptions.AddItem($"{grid.Owner} {(playerGrid == grid.Owner ? " (Current)" : "")}");
_data.Add((uid, grid));
GridOptions.AddItem($"{uid} {(playerGrid == uid ? " (Current)" : "")}");
}

GridOptions.OnItemSelected += eventArgs => GridOptions.SelectId(eventArgs.Id);
Expand All @@ -35,12 +44,8 @@ protected override void EnteredTree()

private void SubmitButtonOnOnPressed(BaseButton.ButtonEventArgs obj)
{
if (_data == null)
return;
var dataList = _data.ToList();
var entManager = IoCManager.Resolve<IEntityManager>();
var selectedGrid = dataList[GridOptions.SelectedId].Owner;
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand($"addatmos {entManager.GetNetEntity(selectedGrid)}");
var selectedGrid = _data[GridOptions.SelectedId].Owner;
IoCManager.Resolve<IClientConsoleHost>().ExecuteCommand($"addatmos {_entities.GetNetEntity(selectedGrid)}");
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System.Linq;
using Content.Client.Station;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
Expand Down Expand Up @@ -40,13 +39,34 @@ public ObjectsTab()

private void RefreshObjectList(ObjectsTabSelection selection)
{
var entities = selection switch
var entities = new List<EntityUid>();
switch (selection)
{
ObjectsTabSelection.Stations => _entityManager.EntitySysManager.GetEntitySystem<StationSystem>().Stations.ToList(),
ObjectsTabSelection.Grids => _entityManager.EntityQuery<MapGridComponent>(true).Select(x => x.Owner).ToList(),
ObjectsTabSelection.Maps => _entityManager.EntityQuery<MapComponent>(true).Select(x => x.Owner).ToList(),
_ => throw new ArgumentOutOfRangeException(nameof(selection), selection, null),
};
case ObjectsTabSelection.Stations:
entities.AddRange(_entityManager.EntitySysManager.GetEntitySystem<StationSystem>().Stations);
break;
case ObjectsTabSelection.Grids:
{
var query = _entityManager.AllEntityQueryEnumerator<MapGridComponent>();
while (query.MoveNext(out var uid, out _))
{
entities.Add(uid);
}

break;
}
case ObjectsTabSelection.Maps:
{
var query = _entityManager.AllEntityQueryEnumerator<MapComponent>();
while (query.MoveNext(out var uid, out _))
{
entities.Add(uid);
}
break;
}
default:
throw new ArgumentOutOfRangeException(nameof(selection), selection, null);
}

foreach (var control in _objects)
{
Expand Down
10 changes: 5 additions & 5 deletions Content.Client/Alerts/ClientAlertsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,20 @@ public IReadOnlyDictionary<AlertKey, AlertState>? ActiveAlerts
}
}

protected override void AfterShowAlert(AlertsComponent alertsComponent)
protected override void AfterShowAlert(Entity<AlertsComponent> alerts)
{
if (_playerManager.LocalPlayer?.ControlledEntity != alertsComponent.Owner)
if (_playerManager.LocalPlayer?.ControlledEntity != alerts.Owner)
return;

SyncAlerts?.Invoke(this, alertsComponent.Alerts);
SyncAlerts?.Invoke(this, alerts.Comp.Alerts);
}

protected override void AfterClearAlert(AlertsComponent alertsComponent)
protected override void AfterClearAlert(Entity<AlertsComponent> alertsComponent)
{
if (_playerManager.LocalPlayer?.ControlledEntity != alertsComponent.Owner)
return;

SyncAlerts?.Invoke(this, alertsComponent.Alerts);
SyncAlerts?.Invoke(this, alertsComponent.Comp.Alerts);
}

private void ClientAlertsHandleState(EntityUid uid, AlertsComponent component, ref AfterAutoHandleStateEvent args)
Expand Down
29 changes: 19 additions & 10 deletions Content.Client/Atmos/Overlays/AtmosDebugOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
using Content.Shared.Atmos.EntitySystems;
using Robust.Client.Graphics;
using Robust.Shared.Enums;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Map.Components;

namespace Content.Client.Atmos.Overlays
{
Expand All @@ -19,6 +17,7 @@ public sealed class AtmosDebugOverlay : Overlay
[Dependency] private readonly IMapManager _mapManager = default!;

public override OverlaySpace Space => OverlaySpace.WorldSpace;
private List<Entity<MapGridComponent>> _grids = new();

internal AtmosDebugOverlay(AtmosDebugOverlaySystem system)
{
Expand All @@ -41,10 +40,19 @@ protected override void Draw(in OverlayDrawArgs args)
// 3. "Is this going to make it harder for atmos programmers to add data that may not be chunk-friendly into the atmos debugger?"
// Nanotrasen needs YOU! to avoid premature optimization in critical debugging tools - 20kdc

foreach (var mapGrid in _mapManager.FindGridsIntersecting(mapId, worldBounds))
_grids.Clear();

_mapManager.FindGridsIntersecting(mapId, worldBounds, ref _grids, (EntityUid uid, MapGridComponent grid,
ref List<Entity<MapGridComponent>> state) =>
{
state.Add((uid, grid));
return true;
});

foreach (var (uid, mapGrid) in _grids)
{
if (!_atmosDebugOverlaySystem.HasData(mapGrid.Owner) ||
!_entManager.TryGetComponent<TransformComponent>(mapGrid.Owner, out var xform))
if (!_atmosDebugOverlaySystem.HasData(uid) ||
!_entManager.TryGetComponent<TransformComponent>(uid, out var xform))
continue;

drawHandle.SetTransform(xform.WorldMatrix);
Expand All @@ -53,17 +61,18 @@ protected override void Draw(in OverlayDrawArgs args)
{
foreach (var tile in mapGrid.GetTilesIntersecting(worldBounds))
{
var dataMaybeNull = _atmosDebugOverlaySystem.GetData(mapGrid.Owner, tile.GridIndices);
var dataMaybeNull = _atmosDebugOverlaySystem.GetData(uid, tile.GridIndices);
if (dataMaybeNull != null)
{
var data = (SharedAtmosDebugOverlaySystem.AtmosDebugOverlayData) dataMaybeNull;
if (pass == 0)
{
// -- Mole Count --
float total = 0;
switch (_atmosDebugOverlaySystem.CfgMode) {
switch (_atmosDebugOverlaySystem.CfgMode)
{
case AtmosDebugOverlayMode.TotalMoles:
foreach (float f in data.Moles)
foreach (var f in data.Moles)
{
total += f;
}
Expand All @@ -75,7 +84,7 @@ protected override void Draw(in OverlayDrawArgs args)
total = data.Temperature;
break;
}
var interp = ((total - _atmosDebugOverlaySystem.CfgBase) / _atmosDebugOverlaySystem.CfgScale);
var interp = (total - _atmosDebugOverlaySystem.CfgBase) / _atmosDebugOverlaySystem.CfgScale;
Color res;
if (_atmosDebugOverlaySystem.CfgCBM)
{
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Audio/AmbientSoundOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected override void Draw(in OverlayDrawArgs args)

if (ambientSound.Enabled)
{
if (_ambient.IsActive(ambientSound))
if (_ambient.IsActive((ent, ambientSound)))
{
worldHandle.DrawCircle(xformSystem.GetWorldPosition(xform), Size, Color.LightGreen.WithAlpha(Alpha * 2f));
}
Expand Down
Loading
Loading