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 #1514

Merged
merged 31 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
344c107
FIX (#21091)
notquitehadouken Oct 18, 2023
badb601
Added implanter sprite (#20758)
LinkF2kkk Oct 18, 2023
8edd525
Display current load and maximum capacity (#20181)
daerSeebaer Oct 18, 2023
8adbd50
Automatic changelog update
PJBot Oct 18, 2023
064cb87
Accurate temperature alerts (#19913)
Errant-4 Oct 18, 2023
f20ed94
Automatic changelog update
PJBot Oct 18, 2023
9741aaa
Adjust warm donk pocket chemicals (#21052)
FluffiestFloof Oct 18, 2023
7b4ceb9
Add checkbox for toggle walking (#20926)
Oct 18, 2023
c92b99f
Tortilla dough, Taco shells, and Tacos (#20797)
phunnyguy Oct 18, 2023
dffc321
Automatic changelog update
PJBot Oct 18, 2023
414701d
Swaps HV/MV/LV scaling to supply power scaling (#20880)
TemporalOroboros Oct 18, 2023
9c25db8
Automatic changelog update
PJBot Oct 18, 2023
b419dbb
Make gibbing drop items again (#21047)
Doru991 Oct 18, 2023
68ed978
Automatic changelog update
PJBot Oct 18, 2023
83acaa5
Add security beacon (#21048)
IamVelcroboy Oct 19, 2023
4ca9227
Add sufix to sci flash (#21095)
VasilisThePikachu Oct 19, 2023
5703776
Atmos-tech's casual jumpsuit resprite (#20989)
KingFroozy Oct 19, 2023
3e32e75
Automatic changelog update
PJBot Oct 19, 2023
e04d6a3
Fixed players without headrevs ticked being picked anyway (#20895)
VasilisThePikachu Oct 19, 2023
0a4c16c
make meat sizzle when cooked (#20877)
deltanedas Oct 19, 2023
41ec40a
Automatic changelog update
PJBot Oct 19, 2023
3be48be
wet floor bomb properties (#20823)
Panzer-IV1 Oct 19, 2023
8d070d4
Allow Chemical Dispenser to be scrollable (#20800)
Itzbenz Oct 19, 2023
9bb6218
Added fun: Darts (#20582)
TheShuEd Oct 19, 2023
1a12892
Automatic changelog update
PJBot Oct 19, 2023
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
2af6663
Merge remote-tracking branch 'upstream/master' into upstream-sync
Morb0 Oct 19, 2023
5cce210
Update locale
Morb0 Oct 19, 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
20 changes: 17 additions & 3 deletions Content.Client/Ame/UI/AmeWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<DefaultWindow xmlns="https://spacestation14.io"
<DefaultWindow xmlns="https://spacestation14.io"
Title="{Loc 'ame-window-title'}"
MinSize="250 250">
<BoxContainer Orientation="Vertical">
<GridContainer Columns="2">
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'ame-window-engine-status-label'}" />
<Label Text=" " />
Expand Down Expand Up @@ -42,5 +42,19 @@
<Label Text=" " />
<Label Name="CoreCount" Text="0" />
</BoxContainer>
</BoxContainer>
<BoxContainer></BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'ame-window-power-currentsupply-label'}" />
<Label Text=" " />
<Label Name="CurrentPowerSupply" Text="0" />
<Label Text=" kW" />
</BoxContainer>
<BoxContainer></BoxContainer>
<BoxContainer Orientation="Horizontal">
<Label Text="{Loc 'ame-window-power-targetsupply-label'}" />
<Label Text=" " />
<Label Name="TargetedPowerSupply" Text="0" />
<Label Text=" kW" />
</BoxContainer>
</GridContainer>
</DefaultWindow>
3 changes: 3 additions & 0 deletions Content.Client/Ame/UI/AmeWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public void UpdateState(BoundUserInterfaceState state)

CoreCount.Text = $"{castState.CoreCount}";
InjectionAmount.Text = $"{castState.InjectionAmount}";
// format power statistics to pretty numbers
CurrentPowerSupply.Text = $"{castState.CurrentPowerSupply.ToString("N1")}";
TargetedPowerSupply.Text = $"{castState.TargetedPowerSupply.ToString("N1")}";
}
}
}
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