mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
merge remote wizden/master
This commit is contained in:
commit
f8bc2e5786
717 changed files with 11239 additions and 4384 deletions
1
.github/workflows/build-test-debug.yml
vendored
1
.github/workflows/build-test-debug.yml
vendored
|
|
@ -16,6 +16,7 @@ jobs:
|
|||
os: [ubuntu-latest]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
timeout-minutes: 30
|
||||
|
||||
steps:
|
||||
- name: Checkout Master
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ public sealed partial class JobStatusSystem : SharedJobStatusSystem
|
|||
{
|
||||
[Dependency] private ShowJobIconsSystem _showJobIcons = default!;
|
||||
[Dependency] private ShowCrewIconsSystem _showCrewIcons = default!;
|
||||
[Dependency] private IPrototypeManager _prototype = default!;
|
||||
|
||||
private static readonly ProtoId<SecurityIconPrototype> CrewBorderIcon = "CrewBorderIcon";
|
||||
private static readonly ProtoId<SecurityIconPrototype> CrewUncertainBorderIcon = "CrewUncertainBorderIcon";
|
||||
|
|
@ -26,14 +25,14 @@ public sealed partial class JobStatusSystem : SharedJobStatusSystem
|
|||
private void OnGetStatusIconsEvent(Entity<JobStatusComponent> ent, ref GetStatusIconsEvent ev)
|
||||
{
|
||||
if (_showJobIcons.IsActive && ent.Comp.JobStatusIcon != null)
|
||||
ev.StatusIcons.Add(_prototype.Index(ent.Comp.JobStatusIcon));
|
||||
ev.StatusIcons.Add(ProtoMan.Index(ent.Comp.JobStatusIcon));
|
||||
|
||||
if (_showCrewIcons.IsActive)
|
||||
{
|
||||
if (_showCrewIcons.UncertainCrewBorder)
|
||||
ev.StatusIcons.Add(_prototype.Index(CrewUncertainBorderIcon));
|
||||
ev.StatusIcons.Add(ProtoMan.Index(CrewUncertainBorderIcon));
|
||||
else if (ent.Comp.IsCrew)
|
||||
ev.StatusIcons.Add(_prototype.Index(CrewBorderIcon));
|
||||
ev.StatusIcons.Add(ProtoMan.Index(CrewBorderIcon));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ using Robust.Shared.Serialization.Markdown;
|
|||
using Robust.Shared.Serialization.Markdown.Mapping;
|
||||
using Robust.Shared.Serialization.Markdown.Sequence;
|
||||
using Robust.Shared.Serialization.Markdown.Value;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
using YamlDotNet.RepresentationModel;
|
||||
|
||||
|
|
@ -30,7 +29,6 @@ namespace Content.Client.Actions
|
|||
|
||||
[Dependency] private SharedChargesSystem _sharedCharges = default!;
|
||||
[Dependency] private IPlayerManager _playerManager = default!;
|
||||
[Dependency] private IPrototypeManager _proto = default!;
|
||||
[Dependency] private IResourceManager _resources = default!;
|
||||
[Dependency] private MetaDataSystem _metaData = default!;
|
||||
[Dependency] private ISerializationManager _serialization = default!;
|
||||
|
|
@ -257,7 +255,7 @@ namespace Content.Client.Actions
|
|||
else if (map.TryGet<ValueDataNode>("entity", out var entityNode))
|
||||
{
|
||||
var id = new EntProtoId(entityNode.Value);
|
||||
var proto = _proto.Index(id);
|
||||
var proto = ProtoMan.Index(id);
|
||||
actionId = Spawn(MappingEntityAction);
|
||||
SetIcon(actionId, new SpriteSpecifier.EntityPrototype(id));
|
||||
SetEvent(actionId, new StartPlacementActionEvent()
|
||||
|
|
@ -270,7 +268,7 @@ namespace Content.Client.Actions
|
|||
else if (map.TryGet<ValueDataNode>("tileId", out var tileNode))
|
||||
{
|
||||
var id = new ProtoId<ContentTileDefinition>(tileNode.Value);
|
||||
var proto = _proto.Index(id);
|
||||
var proto = ProtoMan.Index(id);
|
||||
actionId = Spawn(MappingEntityAction);
|
||||
if (proto.Sprite is {} sprite)
|
||||
SetIcon(actionId, new SpriteSpecifier.Texture(sprite));
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ internal sealed partial class AdminQuickInfoCommand : LocalizedEntityCommands
|
|||
internal sealed partial class AdminQuickInfoSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private AdminSystem _adminSystem = null!;
|
||||
[Dependency] private IPrototypeManager _prototypeManager = null!;
|
||||
|
||||
public event Action<QuickInfoShared.SingleEntityInfo>? EntityResponseReceived;
|
||||
|
||||
|
|
@ -152,7 +151,7 @@ internal sealed partial class AdminQuickInfoSystem : EntitySystem
|
|||
|
||||
sb.AppendMarkupLine(Loc.GetString("admin-quick-info-job", ("job", _playerInfo.StartingJob)));
|
||||
|
||||
if (_playerInfo.RoleProto is { } roleId && _system._prototypeManager.Resolve(roleId, out var role))
|
||||
if (_playerInfo.RoleProto is { } roleId && _system.ProtoMan.Resolve(roleId, out var role))
|
||||
{
|
||||
var roleColor = role.Color.ToHex();
|
||||
var symbol = _playerInfo.Antag ? role.Symbol : "";
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ using Robust.Client.Graphics;
|
|||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Administration.Systems
|
||||
{
|
||||
|
|
@ -18,7 +17,6 @@ namespace Content.Client.Administration.Systems
|
|||
[Dependency] private IUserInterfaceManager _userInterfaceManager = default!;
|
||||
[Dependency] private IConfigurationManager _configurationManager = default!;
|
||||
[Dependency] private SharedRoleSystem _roles = default!;
|
||||
[Dependency] private IPrototypeManager _proto = default!;
|
||||
|
||||
private AdminNameOverlay _adminNameOverlay = default!;
|
||||
|
||||
|
|
@ -36,7 +34,7 @@ namespace Content.Client.Administration.Systems
|
|||
_userInterfaceManager,
|
||||
_configurationManager,
|
||||
_roles,
|
||||
_proto);
|
||||
ProtoMan);
|
||||
_adminManager.AdminStatusUpdated += OnAdminStatusUpdated;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
<controls:ConfirmButton Name="ServerShutdownButton" Text="{Loc server-shutdown}" />
|
||||
<cc:CommandButton Name="SetOocButton" Command="setooc" Text="{Loc server-ooc-toggle}" ToggleMode="True" />
|
||||
<cc:CommandButton Name="SetLoocButton" Command="setlooc" Text="{Loc server-looc-toggle}" ToggleMode="True" />
|
||||
<cc:CommandButton Name="SetDeadChatButton" Command="setdeadchat" Text="{Loc server-dead-chat-toggle}" ToggleMode="True" />
|
||||
</GridContainer>
|
||||
|
||||
<BoxContainer Orientation="Vertical">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Globalization;
|
||||
using System.Globalization;
|
||||
using Content.Shared.CCVar;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Console;
|
||||
|
|
@ -21,6 +21,7 @@ namespace Content.Client.Administration.UI.Tabs
|
|||
|
||||
_config.OnValueChanged(CCVars.OocEnabled, OocEnabledChanged, true);
|
||||
_config.OnValueChanged(CCVars.LoocEnabled, LoocEnabledChanged, true);
|
||||
_config.OnValueChanged(CCVars.DeadChatEnabled, DeadChatEnabledChanged, true);
|
||||
_config.OnValueChanged(CCVars.AfkTime, AfkTimeChanged, true);
|
||||
_config.OnValueChanged(CCVars.AdminAfkTime, AdminAfkTimeChanged, true);
|
||||
_config.OnValueChanged(CCVars.AfkConfirmTimeout, AfkConfirmTimeoutChanged, true);
|
||||
|
|
@ -57,6 +58,11 @@ namespace Content.Client.Administration.UI.Tabs
|
|||
SetLoocButton.Pressed = value;
|
||||
}
|
||||
|
||||
private void DeadChatEnabledChanged(bool value)
|
||||
{
|
||||
SetDeadChatButton.Pressed = value;
|
||||
}
|
||||
|
||||
private void AfkTimeChanged(float value)
|
||||
{
|
||||
AfkTime.PlaceHolder = value.ToString(CultureInfo.InvariantCulture);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ public sealed partial class ClientAlertsSystem : AlertsSystem
|
|||
public AlertOrderPrototype? AlertOrder { get; set; }
|
||||
|
||||
[Dependency] private IPlayerManager _playerManager = default!;
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private IUserInterfaceManager _ui = default!;
|
||||
|
||||
public event EventHandler? ClearAlerts;
|
||||
|
|
@ -39,7 +38,7 @@ public sealed partial class ClientAlertsSystem : AlertsSystem
|
|||
{
|
||||
base.LoadPrototypes();
|
||||
|
||||
AlertOrder = _prototypeManager.EnumeratePrototypes<AlertOrderPrototype>().FirstOrDefault();
|
||||
AlertOrder = ProtoMan.EnumeratePrototypes<AlertOrderPrototype>().FirstOrDefault();
|
||||
if (AlertOrder == null)
|
||||
Log.Error("No alertOrder prototype found, alerts will be in random order");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ using Robust.Client.GameObjects;
|
|||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Placement;
|
||||
using Robust.Client.Placement.Modes;
|
||||
using Robust.Client.Utility;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
|
|
@ -27,7 +26,6 @@ public sealed partial class AlignAtmosPipeLayers : SnapgridCenter
|
|||
{
|
||||
[Dependency] private IEntityManager _entityManager = default!;
|
||||
[Dependency] private IPrototypeManager _protoManager = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private IEyeManager _eyeManager = default!;
|
||||
|
||||
private readonly SharedMapSystem _mapSystem;
|
||||
|
|
@ -87,7 +85,7 @@ public sealed partial class AlignAtmosPipeLayers : SnapgridCenter
|
|||
if (pManager.PlacementType != PlacementTypes.None)
|
||||
return;
|
||||
|
||||
MouseCoords = _unalignedMouseCoords.AlignWithClosestGridTile(SearchBoxSize, _entityManager, _mapManager);
|
||||
MouseCoords = _unalignedMouseCoords.AlignWithClosestGridTile(SearchBoxSize, _entityManager);
|
||||
|
||||
var gridId = _transformSystem.GetGrid(MouseCoords);
|
||||
|
||||
|
|
@ -169,7 +167,7 @@ public sealed partial class AlignAtmosPipeLayers : SnapgridCenter
|
|||
if (!_protoManager.TryIndex<EntityPrototype>(pManager.CurrentPermission.EntityType, out var currentProto))
|
||||
return;
|
||||
|
||||
if (!currentProto.TryGetComponent<AtmosPipeLayersComponent>(out var atmosPipeLayers, _entityManager.ComponentFactory))
|
||||
if (!currentProto.TryComp<AtmosPipeLayersComponent>(out var atmosPipeLayers, _entityManager.ComponentFactory))
|
||||
return;
|
||||
|
||||
if (!_pipeLayersSystem.TryGetAlternativePrototype(atmosPipeLayers, layer, out var newProtoId))
|
||||
|
|
@ -181,7 +179,7 @@ public sealed partial class AlignAtmosPipeLayers : SnapgridCenter
|
|||
pManager.CurrentPermission.EntityType = newProtoId;
|
||||
|
||||
// Update the appearance of the ghost sprite
|
||||
if (newProto.TryGetComponent<SpriteComponent>(out var sprite, _entityManager.ComponentFactory))
|
||||
if (newProto.TryComp<SpriteComponent>(out var sprite, _entityManager.ComponentFactory))
|
||||
{
|
||||
var textures = new List<IDirectionalTextureProvider>();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using Content.Shared.Atmos.Piping.Unary.Components;
|
||||
using Content.Shared.SprayPainter.Prototypes;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Atmos.EntitySystems;
|
||||
|
||||
|
|
@ -10,14 +9,12 @@ namespace Content.Client.Atmos.EntitySystems;
|
|||
/// </summary>
|
||||
public sealed partial class GasCanisterAppearanceSystem : VisualizerSystem<GasCanisterComponent>
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
protected override void OnAppearanceChange(EntityUid uid, GasCanisterComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
if (!AppearanceSystem.TryGetData<string>(uid, PaintableVisuals.Prototype, out var protoName, args.Component) || args.Sprite is not { } old)
|
||||
return;
|
||||
|
||||
if (!_prototypeManager.HasIndex(protoName))
|
||||
if (!ProtoMan.HasIndex(protoName))
|
||||
return;
|
||||
|
||||
// Create the given prototype and get its first layer.
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ namespace Content.Client.Atmos.Overlays;
|
|||
public sealed partial class AtmosDebugOverlay : Overlay
|
||||
{
|
||||
[Dependency] private IEntityManager _entManager = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private IInputManager _input = default!;
|
||||
[Dependency] private IUserInterfaceManager _ui = default!;
|
||||
[Dependency] private IResourceCache _cache = default!;
|
||||
|
|
@ -262,7 +261,7 @@ public sealed partial class AtmosDebugOverlay : Overlay
|
|||
private void GetGrids(MapId mapId, Box2Rotated box)
|
||||
{
|
||||
_grids.Clear();
|
||||
_mapManager.FindGridsIntersecting(
|
||||
_map.FindGridsIntersecting(
|
||||
mapId,
|
||||
box,
|
||||
ref _grids,
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ public sealed partial class GasTileDangerousTemperatureOverlay : Overlay
|
|||
public override bool RequestScreenTexture { get; set; } = false;
|
||||
|
||||
[Dependency] private IEntityManager _entManager = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private IClyde _clyde = default!;
|
||||
|
||||
private GasTileOverlaySystem? _gasTileOverlay;
|
||||
private readonly SharedMapSystem _mapSys;
|
||||
private readonly SharedTransformSystem _xformSys;
|
||||
private EntityQuery<GasTileOverlayComponent> _overlayQuery;
|
||||
|
||||
|
|
@ -37,6 +37,7 @@ public sealed partial class GasTileDangerousTemperatureOverlay : Overlay
|
|||
public GasTileDangerousTemperatureOverlay()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_mapSys = _entManager.System<SharedMapSystem>();
|
||||
_xformSys = _entManager.System<SharedTransformSystem>();
|
||||
|
||||
_overlayQuery = _entManager.GetEntityQuery<GasTileOverlayComponent>();
|
||||
|
|
@ -174,7 +175,7 @@ public sealed partial class GasTileDangerousTemperatureOverlay : Overlay
|
|||
() =>
|
||||
{
|
||||
_grids.Clear();
|
||||
_mapManager.FindGridsIntersecting(mapId, worldAABB, ref _grids);
|
||||
_mapSys.FindGridsIntersecting(mapId, worldAABB, ref _grids);
|
||||
|
||||
foreach (var grid in _grids)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ public sealed partial class GasTileFireOverlay : Overlay
|
|||
[Dependency] private IPrototypeManager _protoMan = default!;
|
||||
[Dependency] private IResourceCache _resourceCache = default!;
|
||||
[Dependency] private IEntityManager _entManager = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
|
||||
public override OverlaySpace Space => OverlaySpace.WorldSpaceEntities | OverlaySpace.WorldSpaceBelowWorld;
|
||||
private static readonly ProtoId<ShaderPrototype> UnshadedShader = "unshaded";
|
||||
|
|
@ -113,7 +112,7 @@ public sealed partial class GasTileFireOverlay : Overlay
|
|||
return;
|
||||
|
||||
// TODO: WorldBounds callback.
|
||||
_mapManager.FindGridsIntersecting(args.MapId, args.WorldAABB, ref gridState,
|
||||
_mapSystem.FindGridsIntersecting(args.MapId, args.WorldAABB, ref gridState,
|
||||
static (EntityUid uid, MapGridComponent grid,
|
||||
ref (Box2Rotated WorldBounds,
|
||||
DrawingHandleWorld drawHandle,
|
||||
|
|
|
|||
|
|
@ -28,12 +28,12 @@ public sealed partial class GasTileHeatBlurOverlay : Overlay
|
|||
private static readonly ProtoId<ShaderPrototype> HeatOverlayShader = "HeatBlur";
|
||||
|
||||
[Dependency] private IEntityManager _entManager = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private IPrototypeManager _proto = default!;
|
||||
[Dependency] private IClyde _clyde = default!;
|
||||
[Dependency] private IConfigurationManager _configManager = default!;
|
||||
[Dependency] private IResourceCache _resourceCache = default!;
|
||||
|
||||
private readonly SharedMapSystem _maps;
|
||||
private readonly SharedTransformSystem _xformSys;
|
||||
private readonly ShaderInstance _shader;
|
||||
|
||||
|
|
@ -63,6 +63,7 @@ public sealed partial class GasTileHeatBlurOverlay : Overlay
|
|||
public GasTileHeatBlurOverlay()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_maps = _entManager.System<SharedMapSystem>();
|
||||
_xformSys = _entManager.System<SharedTransformSystem>();
|
||||
|
||||
_noiseTexture = _resourceCache.GetTexture("/Textures/Effects/HeatBlur/perlin_noise.png");
|
||||
|
|
@ -126,7 +127,7 @@ public sealed partial class GasTileHeatBlurOverlay : Overlay
|
|||
() =>
|
||||
{
|
||||
_intersectingGrids.Clear();
|
||||
_mapManager.FindGridsIntersecting(mapId, worldAABB, ref _intersectingGrids);
|
||||
_maps.FindGridsIntersecting(mapId, worldAABB, ref _intersectingGrids);
|
||||
foreach (var grid in _intersectingGrids)
|
||||
{
|
||||
if (!overlayQuery.TryGetComponent(grid.Owner, out var comp))
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ public sealed partial class GasTileVisibleGasOverlay : Overlay
|
|||
[Dependency] private IEntityManager _entManager = default!;
|
||||
[Dependency] private IResourceCache _resourceCache = default!;
|
||||
[Dependency] private IPrototypeManager _protoManager = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
|
||||
private static readonly ProtoId<ShaderPrototype> UnshadedShader = "unshaded";
|
||||
|
||||
|
|
@ -142,7 +141,7 @@ public sealed partial class GasTileVisibleGasOverlay : Overlay
|
|||
return;
|
||||
|
||||
// TODO: WorldBounds callback.
|
||||
_mapManager.FindGridsIntersecting(args.MapId,
|
||||
_mapSystem.FindGridsIntersecting(args.MapId,
|
||||
args.WorldAABB,
|
||||
ref gridState,
|
||||
static (EntityUid uid,
|
||||
|
|
|
|||
|
|
@ -24,7 +24,6 @@ public sealed partial class ContentAudioSystem
|
|||
[Dependency] private IGameTiming _timing = default!;
|
||||
[Dependency] private ILogManager _logManager = default!;
|
||||
[Dependency] private IPlayerManager _player = default!;
|
||||
[Dependency] private IPrototypeManager _proto = default!;
|
||||
[Dependency] private IRobustRandom _random = default!;
|
||||
[Dependency] private IStateManager _state = default!;
|
||||
[Dependency] private RulesSystem _rules = default!;
|
||||
|
|
@ -106,7 +105,7 @@ public sealed partial class ContentAudioSystem
|
|||
private void SetupAmbientSounds()
|
||||
{
|
||||
_ambientSounds.Clear();
|
||||
foreach (var ambience in _proto.EnumeratePrototypes<AmbientMusicPrototype>())
|
||||
foreach (var ambience in ProtoMan.EnumeratePrototypes<AmbientMusicPrototype>())
|
||||
{
|
||||
var tracks = _ambientSounds.GetOrNew(ambience.ID);
|
||||
RefreshTracks(ambience.Sound, tracks, null);
|
||||
|
|
@ -131,7 +130,7 @@ public sealed partial class ContentAudioSystem
|
|||
if (collection.Collection == null)
|
||||
break;
|
||||
|
||||
var slothCud = _proto.Index<SoundCollectionPrototype>(collection.Collection);
|
||||
var slothCud = ProtoMan.Index<SoundCollectionPrototype>(collection.Collection);
|
||||
tracks.AddRange(slothCud.PickFiles);
|
||||
break;
|
||||
case SoundPathSpecifier path:
|
||||
|
|
@ -167,7 +166,7 @@ public sealed partial class ContentAudioSystem
|
|||
{
|
||||
var player = _player.LocalSession?.AttachedEntity;
|
||||
|
||||
if (player == null || _musicProto == null || !_rules.IsTrue(player.Value, _proto.Index<RulesPrototype>(_musicProto.Rules)))
|
||||
if (player == null || _musicProto == null || !_rules.IsTrue(player.Value, ProtoMan.Index<RulesPrototype>(_musicProto.Rules)))
|
||||
{
|
||||
FadeOut(_ambientMusicStream, duration: AmbientMusicFadeTime);
|
||||
_musicProto = null;
|
||||
|
|
@ -241,12 +240,12 @@ public sealed partial class ContentAudioSystem
|
|||
if (ev.Cancelled)
|
||||
return null;
|
||||
|
||||
var ambiences = _proto.EnumeratePrototypes<AmbientMusicPrototype>().ToList();
|
||||
var ambiences = ProtoMan.EnumeratePrototypes<AmbientMusicPrototype>().ToList();
|
||||
ambiences.Sort((x, y) => y.Priority.CompareTo(x.Priority));
|
||||
|
||||
foreach (var amb in ambiences)
|
||||
{
|
||||
if (!_rules.IsTrue(player.Value, _proto.Index<RulesPrototype>(amb.Rules)))
|
||||
if (!_rules.IsTrue(player.Value, ProtoMan.Index<RulesPrototype>(amb.Rules)))
|
||||
continue;
|
||||
|
||||
return amb;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ namespace Content.Client.Audio.Jukebox;
|
|||
|
||||
public sealed partial class JukeboxSystem : SharedJukeboxSystem
|
||||
{
|
||||
[Dependency] private IPrototypeManager _protoManager = default!;
|
||||
[Dependency] private AnimationPlayerSystem _animationPlayer = default!;
|
||||
[Dependency] private SharedAppearanceSystem _appearanceSystem = default!;
|
||||
[Dependency] private SharedUserInterfaceSystem _uiSystem = default!;
|
||||
|
|
@ -21,13 +20,13 @@ public sealed partial class JukeboxSystem : SharedJukeboxSystem
|
|||
SubscribeLocalEvent<JukeboxComponent, AnimationCompletedEvent>(OnAnimationCompleted);
|
||||
SubscribeLocalEvent<JukeboxComponent, AfterAutoHandleStateEvent>(OnJukeboxAfterState);
|
||||
|
||||
_protoManager.PrototypesReloaded += OnProtoReload;
|
||||
ProtoMan.PrototypesReloaded += OnProtoReload;
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
{
|
||||
base.Shutdown();
|
||||
_protoManager.PrototypesReloaded -= OnProtoReload;
|
||||
ProtoMan.PrototypesReloaded -= OnProtoReload;
|
||||
}
|
||||
|
||||
private void OnProtoReload(PrototypesReloadedEventArgs obj)
|
||||
|
|
|
|||
|
|
@ -1,14 +1,11 @@
|
|||
using Content.Shared.BarSign;
|
||||
using Content.Shared.Power;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.BarSign;
|
||||
|
||||
public sealed partial class BarSignVisualizerSystem : VisualizerSystem<BarSignComponent>
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
protected override void OnAppearanceChange(EntityUid uid, BarSignComponent component, ref AppearanceChangeEvent args)
|
||||
{
|
||||
AppearanceSystem.TryGetData<bool>(uid, PowerDeviceVisuals.Powered, out var powered, args.Component);
|
||||
|
|
@ -16,7 +13,7 @@ public sealed partial class BarSignVisualizerSystem : VisualizerSystem<BarSignCo
|
|||
|
||||
if (powered
|
||||
&& currentSign != null
|
||||
&& _prototypeManager.Resolve<BarSignPrototype>(currentSign, out var proto))
|
||||
&& ProtoMan.Resolve<BarSignPrototype>(currentSign, out var proto))
|
||||
{
|
||||
SpriteSystem.LayerSetSprite((uid, args.Sprite), 0, proto.Icon);
|
||||
args.Sprite?.LayerSetShader(0, "unshaded");
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ using Content.Shared.Humanoid;
|
|||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client.Body;
|
||||
|
|
@ -15,7 +14,6 @@ namespace Content.Client.Body;
|
|||
public sealed partial class VisualBodySystem : SharedVisualBodySystem
|
||||
{
|
||||
[Dependency] private IConfigurationManager _cfg = default!;
|
||||
[Dependency] private IPrototypeManager _prototype = default!;
|
||||
[Dependency] private DisplacementMapSystem _displacement = default!;
|
||||
[Dependency] private MarkingManager _marking = default!;
|
||||
[Dependency] private SpriteSystem _sprite = default!;
|
||||
|
|
@ -149,7 +147,7 @@ public sealed partial class VisualBodySystem : SharedVisualBodySystem
|
|||
if (!censorNudity)
|
||||
yield break;
|
||||
|
||||
var group = _prototype.Index(ent.Comp.MarkingData.Group);
|
||||
var group = ProtoMan.Index(ent.Comp.MarkingData.Group);
|
||||
foreach (var layer in ent.Comp.MarkingData.Layers)
|
||||
{
|
||||
if (!group.Limits.TryGetValue(layer, out var layerLimits))
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
using Content.Shared.Chat.TypingIndicator;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Content.Shared.Inventory;
|
||||
|
||||
namespace Content.Client.Chat.TypingIndicator;
|
||||
|
||||
public sealed partial class TypingIndicatorVisualizerSystem : VisualizerSystem<TypingIndicatorComponent>
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private InventorySystem _inventory = default!;
|
||||
|
||||
protected override void OnAppearanceChange(EntityUid uid, TypingIndicatorComponent component, ref AppearanceChangeEvent args)
|
||||
|
|
@ -27,7 +25,7 @@ public sealed partial class TypingIndicatorVisualizerSystem : VisualizerSystem<T
|
|||
if (overrideIndicator != null)
|
||||
currentTypingIndicator = overrideIndicator.Value;
|
||||
|
||||
if (!_prototypeManager.Resolve(currentTypingIndicator, out var proto))
|
||||
if (!ProtoMan.Resolve(currentTypingIndicator, out var proto))
|
||||
{
|
||||
Log.Error($"Unknown typing indicator id: {component.TypingIndicatorPrototype}");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -4,11 +4,9 @@ using Content.Shared.Atmos.Prototypes;
|
|||
using Content.Shared.Body;
|
||||
using Content.Shared.Chemistry;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Components.SolutionManager;
|
||||
using Content.Shared.Chemistry.Reaction;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Kitchen.Components;
|
||||
using Content.Shared.Prototypes;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Chemistry.EntitySystems;
|
||||
|
|
@ -53,12 +51,12 @@ public sealed partial class ChemistryGuideDataSystem : SharedChemistryGuideDataS
|
|||
{
|
||||
// this doesn't check what prototypes are being reloaded because, to be frank, we use a lot of them.
|
||||
_reagentSources.Clear();
|
||||
foreach (var reagent in PrototypeManager.EnumeratePrototypes<ReagentPrototype>())
|
||||
foreach (var reagent in ProtoMan.EnumeratePrototypes<ReagentPrototype>())
|
||||
{
|
||||
_reagentSources.Add(reagent.ID, new());
|
||||
}
|
||||
|
||||
foreach (var reaction in PrototypeManager.EnumeratePrototypes<ReactionPrototype>())
|
||||
foreach (var reaction in ProtoMan.EnumeratePrototypes<ReactionPrototype>())
|
||||
{
|
||||
if (!reaction.Source)
|
||||
continue;
|
||||
|
|
@ -72,7 +70,7 @@ public sealed partial class ChemistryGuideDataSystem : SharedChemistryGuideDataS
|
|||
}
|
||||
}
|
||||
|
||||
foreach (var gas in PrototypeManager.EnumeratePrototypes<GasPrototype>())
|
||||
foreach (var gas in ProtoMan.EnumeratePrototypes<GasPrototype>())
|
||||
{
|
||||
if (gas.Reagent == null)
|
||||
continue;
|
||||
|
|
@ -85,20 +83,20 @@ public sealed partial class ChemistryGuideDataSystem : SharedChemistryGuideDataS
|
|||
|
||||
// store the names of the entities used so we don't get repeats in the guide.
|
||||
var usedNames = new List<string>();
|
||||
foreach (var entProto in PrototypeManager.EnumeratePrototypes<EntityPrototype>())
|
||||
foreach (var entProto in ProtoMan.EnumeratePrototypes<EntityPrototype>())
|
||||
{
|
||||
if (entProto.Abstract || usedNames.Contains(entProto.Name))
|
||||
continue;
|
||||
|
||||
if (!entProto.TryGetComponent<ExtractableComponent>(out var extractableComponent, EntityManager.ComponentFactory))
|
||||
if (!entProto.TryComp(out ExtractableComponent? extractableComponent, Factory))
|
||||
continue;
|
||||
|
||||
//these bloat the hell out of blood/fat
|
||||
if (entProto.HasComponent<OrganComponent>())
|
||||
if (entProto.HasComp<OrganComponent>(Factory))
|
||||
continue;
|
||||
|
||||
//these feel obvious...
|
||||
if (entProto.HasComponent<PillComponent>())
|
||||
if (entProto.HasComp<PillComponent>(Factory))
|
||||
continue;
|
||||
|
||||
if (extractableComponent.JuiceSolution is { } juiceSolution)
|
||||
|
|
|
|||
|
|
@ -2,19 +2,16 @@
|
|||
using Content.Client.Items;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.EntitySystems;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Chemistry.EntitySystems;
|
||||
|
||||
public sealed partial class InjectorStatusControlSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private SharedSolutionContainerSystem _solutionContainers = default!;
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
Subs.ItemStatus<InjectorComponent>(injector => new InjectorStatusControl(injector, _solutionContainers, _prototypeManager));
|
||||
Subs.ItemStatus<InjectorComponent>(injector => new InjectorStatusControl(injector, _solutionContainers, ProtoMan));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,13 +8,11 @@ using Content.Shared.Hands;
|
|||
using Content.Shared.Item;
|
||||
using Content.Shared.Rounding;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Chemistry.Visualizers;
|
||||
|
||||
public sealed partial class SolutionContainerVisualsSystem : VisualizerSystem<SolutionContainerVisualsComponent>
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototype = default!;
|
||||
[Dependency] private ItemSystem _itemSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
|
|
@ -131,7 +129,7 @@ public sealed partial class SolutionContainerVisualsSystem : VisualizerSystem<So
|
|||
args.Component))
|
||||
return null;
|
||||
|
||||
var reagentProto = _prototype.Index<ReagentPrototype>(baseOverride);
|
||||
var reagentProto = ProtoMan.Index<ReagentPrototype>(baseOverride);
|
||||
|
||||
if (SpriteSystem.LayerMapTryGet(ent, component.OverlayLayer, out var overlayLayer, false))
|
||||
SpriteSystem.LayerSetVisible(ent, overlayLayer, reagentProto.MetamorphicSprite is not null);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
using System.Linq;
|
||||
using Content.Client.PDA;
|
||||
using Content.Client.PDA;
|
||||
using Content.Shared.Clothing.Components;
|
||||
using Content.Shared.Clothing.EntitySystems;
|
||||
using Content.Shared.Inventory;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
|
|
@ -35,14 +33,14 @@ public sealed class ChameleonClothingSystem : SharedChameleonClothingSystem
|
|||
{
|
||||
base.UpdateSprite(uid, proto);
|
||||
if (TryComp(uid, out SpriteComponent? sprite)
|
||||
&& proto.TryGetComponent(out SpriteComponent? otherSprite, Factory))
|
||||
&& proto.TryComp(out SpriteComponent? otherSprite, Factory))
|
||||
{
|
||||
sprite.CopyFrom(otherSprite);
|
||||
}
|
||||
|
||||
// Edgecase for PDAs to include visuals when UI is open
|
||||
if (TryComp(uid, out PdaBorderColorComponent? borderColor)
|
||||
&& proto.TryGetComponent(out PdaBorderColorComponent? otherBorderColor, Factory))
|
||||
&& proto.TryComp(out PdaBorderColorComponent? otherBorderColor, Factory))
|
||||
{
|
||||
borderColor.BorderColor = otherBorderColor.BorderColor;
|
||||
borderColor.AccentHColor = otherBorderColor.AccentHColor;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public sealed partial class ChameleonBoundUserInterface : BoundUserInterface
|
|||
if (string.IsNullOrEmpty(target) || !_proto.Resolve(target, out EntityPrototype? proto))
|
||||
continue;
|
||||
|
||||
if (!proto.TryGetComponent(out TagComponent? tag, EntMan.ComponentFactory) || !_tag.HasTag(tag, st.RequiredTag))
|
||||
if (!proto.TryComp(out TagComponent? tag, EntMan.ComponentFactory) || !_tag.HasTag(tag, st.RequiredTag))
|
||||
continue;
|
||||
|
||||
newTargets.Add(target);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ using Robust.Shared.Input.Binding;
|
|||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client.Construction
|
||||
{
|
||||
|
|
@ -87,9 +86,9 @@ namespace Content.Client.Construction
|
|||
{
|
||||
_recipesMetadataCache.Clear();
|
||||
|
||||
foreach (var constructionProto in PrototypeManager.EnumeratePrototypes<ConstructionPrototype>())
|
||||
foreach (var constructionProto in ProtoMan.EnumeratePrototypes<ConstructionPrototype>())
|
||||
{
|
||||
if (!PrototypeManager.Resolve(constructionProto.Graph, out var graphProto))
|
||||
if (!ProtoMan.Resolve(constructionProto.Graph, out var graphProto))
|
||||
continue;
|
||||
|
||||
if (constructionProto.TargetNode is not { } targetNodeId)
|
||||
|
|
@ -130,7 +129,7 @@ namespace Content.Client.Construction
|
|||
// If we got the id of the prototype, we exit the “recursion” by clearing the stack.
|
||||
stack.Clear();
|
||||
|
||||
if (!PrototypeManager.Resolve(entityId, out var proto))
|
||||
if (!ProtoMan.Resolve(entityId, out var proto))
|
||||
continue;
|
||||
|
||||
var name = constructionProto.SetName.HasValue ? Loc.GetString(constructionProto.SetName) : proto.Name;
|
||||
|
|
@ -178,7 +177,7 @@ namespace Content.Client.Construction
|
|||
"construction-ghost-examine-message",
|
||||
("name", component.Prototype.Name)));
|
||||
|
||||
if (!PrototypeManager.Resolve(component.Prototype.Graph, out var graph))
|
||||
if (!ProtoMan.Resolve(component.Prototype.Graph, out var graph))
|
||||
return;
|
||||
|
||||
var startNode = graph.Nodes[component.Prototype.StartNode];
|
||||
|
|
@ -279,7 +278,7 @@ namespace Content.Client.Construction
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!TryGetRecipePrototype(prototype.ID, out var targetProtoId) || !PrototypeManager.TryIndex(targetProtoId, out EntityPrototype? targetProto))
|
||||
if (!TryGetRecipePrototype(prototype.ID, out var targetProtoId) || !ProtoMan.TryIndex(targetProtoId, out EntityPrototype? targetProto))
|
||||
return false;
|
||||
|
||||
if (GhostPresent(loc))
|
||||
|
|
@ -301,7 +300,7 @@ namespace Content.Client.Construction
|
|||
|
||||
var sprite = Comp<SpriteComponent>(ghost.Value);
|
||||
|
||||
if (targetProto.TryGetComponent(out IconComponent? icon, EntityManager.ComponentFactory))
|
||||
if (targetProto.TryComp(out IconComponent? icon, EntityManager.ComponentFactory))
|
||||
{
|
||||
_sprite.AddBlankLayer((ghost.Value, sprite), 0);
|
||||
_sprite.LayerSetSprite((ghost.Value, sprite), 0, icon.Icon);
|
||||
|
|
@ -313,9 +312,9 @@ namespace Content.Client.Construction
|
|||
var dummy = EntityManager.SpawnEntity(targetProtoId, MapCoordinates.Nullspace);
|
||||
var targetSprite = EnsureComp<SpriteComponent>(dummy);
|
||||
EntityManager.System<AppearanceSystem>().OnChangeData(dummy, targetSprite);
|
||||
|
||||
var ghostDrawDepth = sprite.DrawDepth;
|
||||
_sprite.CopySprite((dummy, targetSprite), (ghost.Value, sprite));
|
||||
|
||||
_sprite.SetDrawDepth((ghost.Value, sprite), ghostDrawDepth);
|
||||
for (var i = 0; i < sprite.AllLayers.Count(); i++)
|
||||
{
|
||||
sprite.LayerSetShader(i, "unshaded");
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@ public sealed partial class FlatpackSystem : SharedFlatpackSystem
|
|||
if (!_appearance.TryGetData<string>(ent, FlatpackVisuals.Machine, out var machineBoardId) || args.Sprite == null)
|
||||
return;
|
||||
|
||||
if (!PrototypeManager.TryIndex<EntityPrototype>(machineBoardId, out var machineBoardPrototype))
|
||||
if (!ProtoMan.TryIndex<EntityPrototype>(machineBoardId, out var machineBoardPrototype))
|
||||
return;
|
||||
|
||||
if (!machineBoardPrototype.TryGetComponent<SpriteComponent>(out var sprite, EntityManager.ComponentFactory))
|
||||
if (!machineBoardPrototype.TryComp(out SpriteComponent? sprite, EntityManager.ComponentFactory))
|
||||
return;
|
||||
|
||||
Color? color = null;
|
||||
|
|
|
|||
|
|
@ -25,4 +25,5 @@
|
|||
</ItemGroup>
|
||||
<Import Project="..\RobustToolbox\MSBuild\Robust.Properties.targets" />
|
||||
<Import Project="..\RobustToolbox\MSBuild\XamlIL.targets" />
|
||||
<Import Project="..\RobustToolbox\MSBuild\Robust.EntitySystemSubscriptionsGenerator.targets" />
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -55,10 +55,10 @@ namespace Content.Client.ContextMenu.UI
|
|||
Text = text;
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
protected override void ExitedTree()
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
_subMenu?.Dispose();
|
||||
base.ExitedTree();
|
||||
_subMenu?.Orphan();
|
||||
_subMenu = null;
|
||||
ParentMenu = null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,11 +70,11 @@ namespace Content.Client.ContextMenu.UI
|
|||
};
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
protected override void ExitedTree()
|
||||
{
|
||||
base.ExitedTree();
|
||||
MenuBody.OnChildRemoved -= ctrl => _uiController.OnRemoveElement(this, ctrl);
|
||||
ParentElement = null;
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ namespace Content.Client.ContextMenu.UI
|
|||
|
||||
Close();
|
||||
RootMenu.OnPopupHide -= Close;
|
||||
RootMenu.Dispose();
|
||||
RootMenu.Orphan();
|
||||
RootMenu = default!;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,9 +41,9 @@ namespace Content.Client.ContextMenu.UI
|
|||
UpdateEntity();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
protected override void ExitedTree()
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
base.ExitedTree();
|
||||
Entity = null;
|
||||
Count = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ namespace Content.Client.ContextMenu.UI
|
|||
|
||||
// remove the element
|
||||
var parent = element.ParentMenu?.ParentElement;
|
||||
element.Dispose();
|
||||
element.Orphan();
|
||||
Elements.Remove(entity);
|
||||
|
||||
// update any parent elements
|
||||
|
|
@ -340,7 +340,7 @@ namespace Content.Client.ContextMenu.UI
|
|||
if (entity == null)
|
||||
{
|
||||
// This whole element has no associated entities. We should remove it
|
||||
element.Dispose();
|
||||
element.Orphan();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -352,7 +352,7 @@ namespace Content.Client.ContextMenu.UI
|
|||
// There was only one entity in the sub-menu. So we will just remove the sub-menu and point directly to
|
||||
// that entity.
|
||||
element.Entity = entity;
|
||||
element.SubMenu.Dispose();
|
||||
element.SubMenu.Orphan();
|
||||
element.SubMenu = null;
|
||||
Elements[entity.Value] = element;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ namespace Content.Client.CrewManifest;
|
|||
|
||||
public sealed partial class CrewManifestSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
private Dictionary<string, Dictionary<string, int>> _jobDepartmentLookup = new();
|
||||
private HashSet<string> _departments = new();
|
||||
|
||||
|
|
@ -40,7 +38,7 @@ public sealed partial class CrewManifestSystem : EntitySystem
|
|||
{
|
||||
_jobDepartmentLookup.Clear();
|
||||
_departments.Clear();
|
||||
foreach (var department in _prototypeManager.EnumeratePrototypes<DepartmentPrototype>())
|
||||
foreach (var department in ProtoMan.EnumeratePrototypes<DepartmentPrototype>())
|
||||
{
|
||||
_departments.Add(department.ID);
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ namespace Content.Client.Damage;
|
|||
/// </summary>
|
||||
public sealed partial class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponent>
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private DamageableSystem _damageable = default!;
|
||||
|
||||
public override void Initialize()
|
||||
|
|
@ -153,7 +152,7 @@ public sealed partial class DamageVisualsSystem : VisualizerSystem<DamageVisuals
|
|||
// If the damage container on our entity's DamageableComponent
|
||||
// is not null, we can try to check through its groups.
|
||||
if (injurableComponent.DamageContainer != null
|
||||
&& _prototypeManager.Resolve<DamageContainerPrototype>(injurableComponent.DamageContainer, out var damageContainer))
|
||||
&& ProtoMan.Resolve<DamageContainerPrototype>(injurableComponent.DamageContainer, out var damageContainer))
|
||||
{
|
||||
// Are we using damage overlay sprites by group?
|
||||
// Check if the container matches the supported groups,
|
||||
|
|
@ -189,7 +188,7 @@ public sealed partial class DamageVisualsSystem : VisualizerSystem<DamageVisuals
|
|||
// Ditto above, but instead we go through every group.
|
||||
else // oh boy! time to enumerate through every single group!
|
||||
{
|
||||
var damagePrototypeIdList = _prototypeManager.EnumeratePrototypes<DamageGroupPrototype>()
|
||||
var damagePrototypeIdList = ProtoMan.EnumeratePrototypes<DamageGroupPrototype>()
|
||||
.Select((p, _) => p.ID)
|
||||
.ToList();
|
||||
if (damageVisComp.DamageOverlayGroups != null)
|
||||
|
|
@ -524,7 +523,7 @@ public sealed partial class DamageVisualsSystem : VisualizerSystem<DamageVisuals
|
|||
if (!damageVisComp.Overlay && damageGroup != damageVisComp.DamageGroup)
|
||||
continue;
|
||||
|
||||
if (!_prototypeManager.TryIndex<DamageGroupPrototype>(damageGroup, out var damageGroupPrototype)
|
||||
if (!ProtoMan.TryIndex<DamageGroupPrototype>(damageGroup, out var damageGroupPrototype)
|
||||
|| !damage.TryGetDamageInGroup(damageGroupPrototype, out var damageTotal))
|
||||
continue;
|
||||
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ public sealed partial class DecalPlacementSystem : EntitySystem
|
|||
{
|
||||
[Dependency] private IInputManager _inputManager = default!;
|
||||
[Dependency] private IOverlayManager _overlay = default!;
|
||||
[Dependency] private IPrototypeManager _protoMan = default!;
|
||||
[Dependency] private InputSystem _inputSystem = default!;
|
||||
[Dependency] private MetaDataSystem _metaData = default!;
|
||||
[Dependency] private SharedActionsSystem _actions = default!;
|
||||
[Dependency] private SharedMapSystem _maps = default!;
|
||||
[Dependency] private SharedTransformSystem _transform = default!;
|
||||
[Dependency] private SpriteSystem _sprite = default!;
|
||||
|
||||
|
|
@ -42,14 +42,14 @@ public sealed partial class DecalPlacementSystem : EntitySystem
|
|||
public (DecalPrototype? Decal, bool Snap, Angle Angle, Color Color) GetActiveDecal()
|
||||
{
|
||||
return _active && _decalId != null ?
|
||||
(_protoMan.Index<DecalPrototype>(_decalId), _snap, _decalAngle, _decalColor) :
|
||||
(ProtoMan.Index<DecalPrototype>(_decalId), _snap, _decalAngle, _decalColor) :
|
||||
(null, false, Angle.Zero, Color.Wheat);
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
_overlay.AddOverlay(new DecalPlacementOverlay(this, _transform, _sprite));
|
||||
_overlay.AddOverlay(new DecalPlacementOverlay(this, _maps, _transform, _sprite));
|
||||
|
||||
CommandBinds.Builder.Bind(EngineKeyFunctions.EditorPlaceObject, new PointerStateInputCmdHandler(
|
||||
(session, coords, uid) =>
|
||||
|
|
@ -143,7 +143,7 @@ public sealed partial class DecalPlacementSystem : EntitySystem
|
|||
if (ev.Action != null)
|
||||
return;
|
||||
|
||||
if (_decalId == null || !_protoMan.TryIndex<DecalPrototype>(_decalId, out var decalProto))
|
||||
if (_decalId == null || !ProtoMan.TryIndex<DecalPrototype>(_decalId, out var decalProto))
|
||||
return;
|
||||
|
||||
var actionEvent = new PlaceDecalActionEvent()
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Content.Client.Decals
|
|||
{
|
||||
base.Initialize();
|
||||
|
||||
_overlay = new DecalOverlay(_sprites, EntityManager, PrototypeManager);
|
||||
_overlay = new DecalOverlay(_sprites, EntityManager, ProtoMan);
|
||||
_overlayManager.AddOverlay(_overlay);
|
||||
|
||||
SubscribeLocalEvent<DecalGridComponent, ComponentHandleState>(OnHandleState);
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@ using Robust.Client.GameObjects;
|
|||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Input;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Decals.Overlays;
|
||||
|
||||
|
|
@ -12,17 +10,18 @@ public sealed partial class DecalPlacementOverlay : Overlay
|
|||
{
|
||||
[Dependency] private IEyeManager _eyeManager = default!;
|
||||
[Dependency] private IInputManager _inputManager = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
private readonly DecalPlacementSystem _placement;
|
||||
private readonly SharedMapSystem _maps;
|
||||
private readonly SharedTransformSystem _transform;
|
||||
private readonly SpriteSystem _sprite;
|
||||
|
||||
public override OverlaySpace Space => OverlaySpace.WorldSpaceEntities;
|
||||
|
||||
public DecalPlacementOverlay(DecalPlacementSystem placement, SharedTransformSystem transform, SpriteSystem sprite)
|
||||
public DecalPlacementOverlay(DecalPlacementSystem placement, SharedMapSystem maps, SharedTransformSystem transform, SpriteSystem sprite)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_placement = placement;
|
||||
_maps = maps;
|
||||
_transform = transform;
|
||||
_sprite = sprite;
|
||||
ZIndex = 1000;
|
||||
|
|
@ -42,7 +41,7 @@ public sealed partial class DecalPlacementOverlay : Overlay
|
|||
return;
|
||||
|
||||
// No map support for decals
|
||||
if (!_mapManager.TryFindGridAt(mousePos, out var gridUid, out var grid))
|
||||
if (!_maps.TryFindGridAt(mousePos, out var gridUid, out var grid))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ namespace Content.Client.Delivery;
|
|||
public sealed partial class DeliveryVisualizerSystem : VisualizerSystem<DeliveryComponent>
|
||||
{
|
||||
[Dependency] private SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private IPrototypeManager _prototype = default!;
|
||||
|
||||
private static readonly ProtoId<JobIconPrototype> UnknownIcon = "JobIconUnknown";
|
||||
|
||||
|
|
@ -22,9 +21,9 @@ public sealed partial class DeliveryVisualizerSystem : VisualizerSystem<Delivery
|
|||
if (string.IsNullOrEmpty(job))
|
||||
job = UnknownIcon;
|
||||
|
||||
if (!_prototype.TryIndex<JobIconPrototype>(job, out var icon))
|
||||
if (!ProtoMan.TryIndex<JobIconPrototype>(job, out var icon))
|
||||
{
|
||||
SpriteSystem.LayerSetTexture((uid, args.Sprite), DeliveryVisualLayers.JobStamp, SpriteSystem.Frame0(_prototype.Index(UnknownIcon).Icon));
|
||||
SpriteSystem.LayerSetTexture((uid, args.Sprite), DeliveryVisualLayers.JobStamp, SpriteSystem.Frame0(ProtoMan.Index(UnknownIcon).Icon));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.DoAfter;
|
||||
|
||||
|
|
@ -15,13 +13,12 @@ public sealed partial class DoAfterSystem : SharedDoAfterSystem
|
|||
{
|
||||
[Dependency] private IOverlayManager _overlay = default!;
|
||||
[Dependency] private IPlayerManager _player = default!;
|
||||
[Dependency] private IPrototypeManager _prototype = default!;
|
||||
[Dependency] private MetaDataSystem _metadata = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
_overlay.AddOverlay(new DoAfterOverlay(EntityManager, _prototype, GameTiming, _player));
|
||||
_overlay.AddOverlay(new DoAfterOverlay(EntityManager, ProtoMan, GameTiming, _player));
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
|
|
|
|||
|
|
@ -3,15 +3,12 @@ using Content.Shared.Doors.Systems;
|
|||
using Content.Shared.SprayPainter.Prototypes;
|
||||
using Robust.Client.Animations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Doors;
|
||||
|
||||
public sealed partial class DoorSystem : SharedDoorSystem
|
||||
{
|
||||
[Dependency] private AnimationPlayerSystem _animationSystem = default!;
|
||||
[Dependency] private IComponentFactory _componentFactory = default!;
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private SpriteSystem _sprite = default!;
|
||||
|
||||
public override void Initialize()
|
||||
|
|
@ -209,10 +206,10 @@ public sealed partial class DoorSystem : SharedDoorSystem
|
|||
|
||||
private void UpdateSpriteLayers(Entity<SpriteComponent> sprite, string targetProto)
|
||||
{
|
||||
if (!_prototypeManager.Resolve(targetProto, out var target))
|
||||
if (!ProtoMan.Resolve(targetProto, out var target))
|
||||
return;
|
||||
|
||||
if (!target.TryGetComponent(out SpriteComponent? targetSprite, _componentFactory))
|
||||
if (!target.TryComp(out SpriteComponent? targetSprite, Factory))
|
||||
return;
|
||||
|
||||
_sprite.SetBaseRsi(sprite.AsNullable(), targetSprite.BaseRSI);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ namespace Content.Client.Eui
|
|||
|
||||
private readonly Dictionary<uint, EuiData> _openUis = new();
|
||||
|
||||
/// <summary>
|
||||
/// Initialisation of the EuiManager.
|
||||
/// </summary>
|
||||
public void Initialize()
|
||||
{
|
||||
_net.RegisterNetMessage<MsgEuiCtl>(RxMsgCtl);
|
||||
|
|
|
|||
|
|
@ -386,6 +386,10 @@ namespace Content.Client.Examine
|
|||
vbox.AddChild(buttonsHBox);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handler for the OnClick Event of a Verb Button.
|
||||
/// </summary>
|
||||
/// <param name="obj">The event args</param>
|
||||
public void VerbButtonPressed(BaseButton.ButtonEventArgs obj)
|
||||
{
|
||||
if (obj.Button is ExamineButton button)
|
||||
|
|
@ -396,6 +400,12 @@ namespace Content.Client.Examine
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Open and fills by query to server an examine menu with the correct tooltip and menu items.
|
||||
/// </summary>
|
||||
/// <param name="entity">The entity examined.</param>
|
||||
/// <param name="centeredOnCursor">If the popup should be on the cursor or the entity's screen position.</param>
|
||||
/// <param name="userOverride">An optional user object; if null we assume the client's player entity.</param>
|
||||
public void DoExamine(EntityUid entity, bool centeredOnCursor = true, EntityUid? userOverride = null)
|
||||
{
|
||||
var playerEnt = userOverride ?? _playerManager.LocalEntity;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,18 @@
|
|||
using Content.Shared.Explosion.EntitySystems;
|
||||
namespace Content.Client.Explosion;
|
||||
|
||||
/// <summary>
|
||||
/// The Visual Component for the Cluster Grenade.
|
||||
/// <see cref="ScatteringGrenadeSystem"/>
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[Access(typeof(ClusterGrenadeVisualizerSystem))]
|
||||
public sealed partial class ClusterGrenadeVisualsComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to select the correct layer from the rsi together with the grenade amount.
|
||||
/// <see cref="ClusterGrenadeVisualizerSystem.OnAppearanceChange"/>
|
||||
/// </summary>
|
||||
[DataField("state")]
|
||||
public string? State;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ using Robust.Client.Graphics;
|
|||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Graphics.RSI;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Explosion;
|
||||
|
||||
|
|
@ -14,7 +13,6 @@ namespace Content.Client.Explosion;
|
|||
/// </summary>
|
||||
public sealed partial class ExplosionOverlaySystem : EntitySystem
|
||||
{
|
||||
[Dependency] private IPrototypeManager _protoMan = default!;
|
||||
[Dependency] private IResourceCache _resCache = default!;
|
||||
[Dependency] private IOverlayManager _overlayMan = default!;
|
||||
[Dependency] private SharedPointLightSystem _lights = default!;
|
||||
|
|
@ -61,7 +59,7 @@ public sealed partial class ExplosionOverlaySystem : EntitySystem
|
|||
{
|
||||
EnsureComp<ExplosionVisualsTexturesComponent>(uid);
|
||||
|
||||
if (!_protoMan.TryIndex(component.ExplosionType, out ExplosionPrototype? type) ||
|
||||
if (!ProtoMan.TryIndex(component.ExplosionType, out ExplosionPrototype? type) ||
|
||||
!TryComp(uid, out ExplosionVisualsTexturesComponent? textures))
|
||||
{
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ using Robust.Shared.Graphics;
|
|||
|
||||
namespace Content.Client.Explosion;
|
||||
|
||||
/// <summary>
|
||||
/// The client side visuals system for explosions.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed partial class ExplosionVisualsTexturesComponent : Component
|
||||
{
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ namespace Content.Client.Gameplay
|
|||
[Dependency] private IPlayerManager _playerManager = default!;
|
||||
[Dependency] private IEntitySystemManager _entitySystemManager = default!;
|
||||
[Dependency] private IGameTiming _timing = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] protected IUserInterfaceManager UserInterfaceManager = default!;
|
||||
[Dependency] private IEntityManager _entityManager = default!;
|
||||
[Dependency] private IViewVariablesManager _vvm = default!;
|
||||
|
|
@ -240,7 +239,7 @@ namespace Content.Client.Gameplay
|
|||
var transformSystem = _entitySystemManager.GetEntitySystem<SharedTransformSystem>();
|
||||
var mapSystem = _entitySystemManager.GetEntitySystem<MapSystem>();
|
||||
|
||||
coordinates = _mapManager.TryFindGridAt(mousePosWorld, out var uid, out _) ?
|
||||
coordinates = mapSystem.TryFindGridAt(mousePosWorld, out var uid, out _) ?
|
||||
mapSystem.MapToGrid(uid, mousePosWorld) :
|
||||
transformSystem.ToCoordinates(mousePosWorld);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ using Content.Shared.Chat.TypingIndicator;
|
|||
using Content.Shared.Holopad;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
|
|
@ -12,7 +11,6 @@ namespace Content.Client.Holopad;
|
|||
|
||||
public sealed partial class HolopadSystem : SharedHolopadSystem
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private IGameTiming _timing = default!;
|
||||
[Dependency] private SpriteSystem _sprite = default!;
|
||||
|
||||
|
|
@ -120,7 +118,7 @@ public sealed partial class HolopadSystem : SharedHolopadSystem
|
|||
// Find the texture height of the largest layer
|
||||
float texHeight = sprite.AllLayers.Max(x => x.PixelSize.Y);
|
||||
|
||||
var instance = _prototypeManager.Index<ShaderPrototype>(holopadHologram.ShaderName).InstanceUnique();
|
||||
var instance = ProtoMan.Index<ShaderPrototype>(holopadHologram.ShaderName).InstanceUnique();
|
||||
instance.SetParameter("color1", new Vector3(holopadHologram.Color1.R, holopadHologram.Color1.G, holopadHologram.Color1.B));
|
||||
instance.SetParameter("color2", new Vector3(holopadHologram.Color2.R, holopadHologram.Color2.G, holopadHologram.Color2.B));
|
||||
instance.SetParameter("alpha", holopadHologram.Alpha);
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ public sealed partial class DragDropSystem : SharedDragDropSystem
|
|||
[Dependency] private IInputManager _inputManager = default!;
|
||||
[Dependency] private IEyeManager _eyeManager = default!;
|
||||
[Dependency] private IPlayerManager _playerManager = default!;
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private IConfigurationManager _cfgMan = default!;
|
||||
[Dependency] private InteractionOutlineSystem _outline = default!;
|
||||
[Dependency] private SharedInteractionSystem _interactionSystem = default!;
|
||||
|
|
@ -112,8 +111,8 @@ public sealed partial class DragDropSystem : SharedDragDropSystem
|
|||
|
||||
Subs.CVar(_cfgMan, CCVars.DragDropDeadZone, SetDeadZone, true);
|
||||
|
||||
_dropTargetInRangeShader = _prototypeManager.Index(ShaderDropTargetInRange).Instance();
|
||||
_dropTargetOutOfRangeShader = _prototypeManager.Index(ShaderDropTargetOutOfRange).Instance();
|
||||
_dropTargetInRangeShader = ProtoMan.Index(ShaderDropTargetInRange).Instance();
|
||||
_dropTargetOutOfRangeShader = ProtoMan.Index(ShaderDropTargetOutOfRange).Instance();
|
||||
// needs to fire on mouseup and mousedown so we can detect a drag / drop
|
||||
CommandBinds.Builder
|
||||
.BindBefore(EngineKeyFunctions.Use, new PointerInputCmdHandler(OnUse, false, true), new[] { typeof(SharedInteractionSystem) })
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Linq;
|
||||
using Content.Client.Clothing;
|
||||
using Content.Client.Examine;
|
||||
using Content.Client.Pointing;
|
||||
using Content.Client.Verbs.UI;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Inventory;
|
||||
|
|
@ -23,6 +24,7 @@ namespace Content.Client.Inventory
|
|||
[Dependency] private IUserInterfaceManager _ui = default!;
|
||||
[Dependency] private ClientClothingSystem _clothingVisualsSystem = default!;
|
||||
[Dependency] private ExamineSystem _examine = default!;
|
||||
[Dependency] private PointingSystem _pointing = default!;
|
||||
|
||||
public Action<SlotData>? EntitySlotUpdate = null;
|
||||
public Action<SlotData>? OnSlotAdded = null;
|
||||
|
|
@ -237,6 +239,19 @@ namespace Content.Client.Inventory
|
|||
RaisePredictiveEvent(new InteractInventorySlotEvent(GetNetEntity(item.Value), altInteract: true));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Points at an item in the inventory
|
||||
/// </summary>
|
||||
/// <param name="slot">The slot to point at</param>
|
||||
/// <param name="uid">The inventory entity containing the slot</param>
|
||||
public void UIInventoryPointAt(string slot, EntityUid uid)
|
||||
{
|
||||
if (!TryGetSlotEntity(uid, slot, out var item))
|
||||
return;
|
||||
|
||||
_pointing.TryPointAtEntity(GetNetEntity(item.Value));
|
||||
}
|
||||
|
||||
protected override void UpdateInventoryTemplate(Entity<InventoryComponent> ent)
|
||||
{
|
||||
base.UpdateInventoryTemplate(ent);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using Content.Shared.Maps;
|
|||
using Robust.Client.Graphics;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Map.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
|
|
@ -23,9 +23,10 @@ public sealed partial class AmbientOcclusionOverlay : Overlay
|
|||
[Dependency] private IClyde _clyde = default!;
|
||||
[Dependency] private IConfigurationManager _cfgManager = default!;
|
||||
[Dependency] private IEntityManager _entManager = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private IPrototypeManager _proto = default!;
|
||||
|
||||
private List<Entity<MapGridComponent>> _cachedGrids = new();
|
||||
|
||||
public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowEntities;
|
||||
|
||||
private readonly OverlayResourceCache<CachedResources> _resources = new ();
|
||||
|
|
@ -115,7 +116,9 @@ public sealed partial class AmbientOcclusionOverlay : Overlay
|
|||
// Don't want lighting affecting it.
|
||||
worldHandle.UseShader(_proto.Index(UnshadedShader).Instance());
|
||||
|
||||
foreach (var grid in _mapManager.FindGridsIntersecting(mapId, worldBounds))
|
||||
_cachedGrids.Clear();
|
||||
maps.FindGridsIntersecting(mapId, worldBounds, ref _cachedGrids);
|
||||
foreach (var grid in _cachedGrids)
|
||||
{
|
||||
var transform = xformSystem.GetWorldMatrix(grid.Owner);
|
||||
var worldToTextureMatrix = Matrix3x2.Multiply(transform, invMatrix);
|
||||
|
|
@ -126,7 +129,7 @@ public sealed partial class AmbientOcclusionOverlay : Overlay
|
|||
if (turfSystem.IsSpace(tileRef))
|
||||
continue;
|
||||
|
||||
var bounds = lookups.GetLocalBounds(tileRef, grid.TileSize);
|
||||
var bounds = lookups.GetLocalBounds(tileRef, grid.Comp.TileSize);
|
||||
worldHandle.DrawRect(bounds, Color.White);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ namespace Content.Client.Light;
|
|||
public sealed partial class RoofOverlay : Overlay
|
||||
{
|
||||
private readonly IEntityManager _entManager;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private IOverlayManager _overlay = default!;
|
||||
|
||||
private readonly EntityLookupSystem _lookup;
|
||||
|
|
@ -56,7 +55,7 @@ public sealed partial class RoofOverlay : Overlay
|
|||
var target = lightRes.EnlargedLightTarget;
|
||||
|
||||
_grids.Clear();
|
||||
_mapManager.FindGridsIntersecting(args.MapId, bounds, ref _grids, approx: true, includeMap: true);
|
||||
_mapSystem.FindGridsIntersecting(args.MapId, bounds, ref _grids, approx: true, includeMap: true);
|
||||
var lightScale = viewport.LightRenderTarget.Size / (Vector2) viewport.Size;
|
||||
var scale = viewport.RenderScale / (Vector2.One / lightScale);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ public sealed partial class SunShadowOverlay : Overlay
|
|||
|
||||
[Dependency] private IClyde _clyde = default!;
|
||||
[Dependency] private IEntityManager _entManager = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private IPrototypeManager _protoManager = default!;
|
||||
private readonly EntityLookupSystem _lookup;
|
||||
private readonly SharedMapSystem _mapSys;
|
||||
private readonly SharedTransformSystem _xformSys;
|
||||
|
||||
private readonly HashSet<Entity<SunShadowCastComponent>> _shadows = new();
|
||||
|
|
@ -31,6 +31,7 @@ public sealed partial class SunShadowOverlay : Overlay
|
|||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_xformSys = _entManager.System<SharedTransformSystem>();
|
||||
_mapSys = _entManager.System<SharedMapSystem>();
|
||||
_lookup = _entManager.System<EntityLookupSystem>();
|
||||
ZIndex = AfterLightTargetOverlay.ContentZIndex + 1;
|
||||
}
|
||||
|
|
@ -46,7 +47,7 @@ public sealed partial class SunShadowOverlay : Overlay
|
|||
return;
|
||||
|
||||
_grids.Clear();
|
||||
_mapManager.FindGridsIntersecting(args.MapId,
|
||||
_mapSys.FindGridsIntersecting(args.MapId,
|
||||
args.WorldBounds.Enlarged(SunShadowComponent.MaxLength),
|
||||
ref _grids);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ public sealed partial class TileEmissionOverlay : Overlay
|
|||
{
|
||||
public override OverlaySpace Space => OverlaySpace.BeforeLighting;
|
||||
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private IOverlayManager _overlay = default!;
|
||||
|
||||
private SharedMapSystem _mapSystem;
|
||||
|
|
@ -50,7 +49,7 @@ public sealed partial class TileEmissionOverlay : Overlay
|
|||
var target = lightoverlay.GetCachedForViewport(args.Viewport).EnlargedLightTarget;
|
||||
var viewport = args.Viewport;
|
||||
_grids.Clear();
|
||||
_mapManager.FindGridsIntersecting(mapId, bounds, ref _grids, approx: true);
|
||||
_mapSystem.FindGridsIntersecting(mapId, bounds, ref _grids, approx: true);
|
||||
|
||||
if (_grids.Count == 0)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
using System.Linq;
|
||||
using Content.Client.UserInterface.Systems.Guidebook;
|
||||
using Content.Shared.Chat.Prototypes;
|
||||
using Content.Shared.Guidebook;
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Humanoid.Prototypes;
|
||||
using Content.Shared.Preferences;
|
||||
using Content.Shared.Speech.Components;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
|
@ -17,6 +19,7 @@ public sealed partial class HumanoidProfileEditor
|
|||
|
||||
private ColorSelectorSliders _rgbSkinColorSelector;
|
||||
private List<SpeciesPrototype> _species = new();
|
||||
private List<EmoteSoundsPrototype> _voices = new();
|
||||
private static readonly ProtoId<GuideEntryPrototype> DefaultSpeciesGuidebook = "Species";
|
||||
|
||||
public void UpdateSpeciesGuidebookIcon()
|
||||
|
|
@ -98,6 +101,34 @@ public sealed partial class HumanoidProfileEditor
|
|||
EyeColorPicker.SetData(Profile.Appearance.EyeColor);
|
||||
}
|
||||
|
||||
private void UpdateVoiceControls()
|
||||
{
|
||||
if (Profile == null)
|
||||
return;
|
||||
|
||||
VoiceButton.Clear();
|
||||
_voices.Clear();
|
||||
|
||||
var speciesPrototype = _prototypeManager.Index(Profile.Species);
|
||||
var availableVoices = speciesPrototype.Voices;
|
||||
|
||||
_voices.AddRange(availableVoices.Select(protoId => _prototypeManager.Index(protoId)));
|
||||
|
||||
if (_voices.All(proto => Profile?.Voice != proto.ID))
|
||||
SetVoice(speciesPrototype.DefaultSoundsBySex[(int)Profile.Sex]);
|
||||
|
||||
for (var i = 0; i < availableVoices.Count; i++)
|
||||
{
|
||||
var name = Loc.GetString(_voices[i].VoiceSelectorName);
|
||||
VoiceButton.AddItem(name, i);
|
||||
|
||||
if (Profile?.Voice.Equals(_voices[i].ID) == true)
|
||||
{
|
||||
VoiceButton.SelectId(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateSkinColor()
|
||||
{
|
||||
if (Profile == null)
|
||||
|
|
@ -193,6 +224,7 @@ public sealed partial class HumanoidProfileEditor
|
|||
// In case there's species restrictions for loadouts
|
||||
RefreshLoadouts();
|
||||
UpdateSexControls(); // update sex for new species
|
||||
UpdateVoiceControls();
|
||||
UpdateSpeciesGuidebookIcon();
|
||||
ReloadPreview();
|
||||
}
|
||||
|
|
@ -220,12 +252,23 @@ public sealed partial class HumanoidProfileEditor
|
|||
break;
|
||||
}
|
||||
|
||||
// this does the same as above but for voice
|
||||
if (_prototypeManager.TryIndex(Profile?.Species, out var prototype))
|
||||
SetVoice(prototype.DefaultSoundsBySex[(int)newSex]);
|
||||
|
||||
UpdateGenderControls();
|
||||
UpdateVoiceControls();
|
||||
UpdateTTSVoicesControls(); // Corvax-TTS
|
||||
_markingsModel.SetOrganSexes(newSex);
|
||||
ReloadPreview();
|
||||
}
|
||||
|
||||
private void SetVoice(ProtoId<EmoteSoundsPrototype> newVoice)
|
||||
{
|
||||
Profile = Profile?.WithVoice(newVoice);
|
||||
IsDirty = true;
|
||||
}
|
||||
|
||||
private void SetGender(Gender newGender)
|
||||
{
|
||||
Profile = Profile?.WithGender(newGender);
|
||||
|
|
|
|||
|
|
@ -74,6 +74,12 @@
|
|||
<Control HorizontalExpand="True"/>
|
||||
<OptionButton Name="SexButton" HorizontalAlignment="Right" />
|
||||
</BoxContainer>
|
||||
<!-- Voice -->
|
||||
<BoxContainer HorizontalExpand="True">
|
||||
<Label Text="{Loc 'humanoid-profile-editor-voice-label'}" />
|
||||
<Control HorizontalExpand="True" />
|
||||
<OptionButton Name="VoiceButton" HorizontalAlignment="Right" />
|
||||
</BoxContainer>
|
||||
<!-- Pronouns -->
|
||||
<BoxContainer HorizontalExpand="True">
|
||||
<Label Text="{Loc 'humanoid-profile-editor-pronouns-label'}" />
|
||||
|
|
|
|||
|
|
@ -164,6 +164,16 @@ namespace Content.Client.Lobby.UI
|
|||
|
||||
#endregion Sex
|
||||
|
||||
#region Voice
|
||||
|
||||
VoiceButton.OnItemSelected += args =>
|
||||
{
|
||||
VoiceButton.SelectId(args.Id);
|
||||
SetVoice(_voices[args.Id]);
|
||||
};
|
||||
|
||||
#endregion
|
||||
|
||||
#region Age
|
||||
|
||||
AgeEdit.OnTextChanged += args =>
|
||||
|
|
@ -373,6 +383,7 @@ namespace Content.Client.Lobby.UI
|
|||
UpdateNameEdit();
|
||||
UpdateFlavorTextEdit();
|
||||
UpdateSexControls();
|
||||
UpdateVoiceControls();
|
||||
UpdateGenderControls();
|
||||
UpdateSkinColor();
|
||||
UpdateSpawnPriorityControls();
|
||||
|
|
|
|||
|
|
@ -21,9 +21,8 @@ public sealed partial class MultipartMachineSystem : SharedMultipartMachineSyste
|
|||
private readonly Color _partiallyTransparent = new Color(255, 255, 255, 180);
|
||||
|
||||
[Dependency] private SpriteSystem _sprite = default!;
|
||||
[Dependency] private IPrototypeManager _prototype = default!;
|
||||
[Dependency] private MetaDataSystem _metaData = default!;
|
||||
[Dependency] private ISerializationManager _serialization= default!;
|
||||
[Dependency] private ISerializationManager _serialization = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
|
@ -70,7 +69,7 @@ public sealed partial class MultipartMachineSystem : SharedMultipartMachineSyste
|
|||
if (part.GhostProto == null)
|
||||
continue;
|
||||
|
||||
var entProto = _prototype.Index(part.GhostProto.Value);
|
||||
var entProto = ProtoMan.Index(part.GhostProto.Value);
|
||||
if (!entProto.Components.TryGetComponent("Sprite", out var s) || s is not SpriteComponent protoSprite)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using Robust.Client.UserInterface;
|
|||
using Robust.Client.UserInterface.RichText;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client.MapText;
|
||||
|
|
@ -17,7 +16,6 @@ public sealed partial class MapTextSystem : SharedMapTextSystem
|
|||
[Dependency] private IUserInterfaceManager _uiManager = default!;
|
||||
[Dependency] private SharedTransformSystem _transform = default!;
|
||||
[Dependency] private IResourceCache _resourceCache = default!;
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private IOverlayManager _overlayManager = default!;
|
||||
|
||||
private MapTextOverlay _overlay = default!;
|
||||
|
|
@ -28,18 +26,18 @@ public sealed partial class MapTextSystem : SharedMapTextSystem
|
|||
SubscribeLocalEvent<MapTextComponent, ComponentStartup>(OnComponentStartup);
|
||||
SubscribeLocalEvent<MapTextComponent, ComponentHandleState>(HandleCompState);
|
||||
|
||||
_overlay = new MapTextOverlay(_configManager, EntityManager, _uiManager, _transform, _resourceCache, _prototypeManager);
|
||||
_overlay = new MapTextOverlay(_configManager, EntityManager, _uiManager, _transform, _resourceCache, ProtoMan);
|
||||
_overlayManager.AddOverlay(_overlay);
|
||||
|
||||
// TODO move font prototype to robust.shared, then use ProtoId<FontPrototype>
|
||||
DebugTools.Assert(_prototypeManager.HasIndex<FontPrototype>(SharedMapTextComponent.DefaultFont));
|
||||
DebugTools.Assert(ProtoMan.HasIndex<FontPrototype>(SharedMapTextComponent.DefaultFont));
|
||||
}
|
||||
|
||||
private void OnComponentStartup(Entity<MapTextComponent> ent, ref ComponentStartup args)
|
||||
{
|
||||
CacheText(ent.Comp);
|
||||
// TODO move font prototype to robust.shared, then use ProtoId<FontPrototype>
|
||||
DebugTools.Assert(_prototypeManager.HasIndex<FontPrototype>(ent.Comp.FontId));
|
||||
DebugTools.Assert(ProtoMan.HasIndex<FontPrototype>(ent.Comp.FontId));
|
||||
}
|
||||
|
||||
private void HandleCompState(Entity<MapTextComponent> ent, ref ComponentHandleState args)
|
||||
|
|
@ -65,12 +63,12 @@ public sealed partial class MapTextSystem : SharedMapTextSystem
|
|||
? Loc.GetString(component.LocText)
|
||||
: component.Text;
|
||||
|
||||
if (!_prototypeManager.TryIndex<FontPrototype>(component.FontId, out var fontPrototype))
|
||||
if (!ProtoMan.TryIndex<FontPrototype>(component.FontId, out var fontPrototype))
|
||||
{
|
||||
component.CachedText = Loc.GetString("map-text-font-error");
|
||||
component.Color = Color.Red;
|
||||
|
||||
if(_prototypeManager.TryIndex<FontPrototype>(SharedMapTextComponent.DefaultFont, out var @default))
|
||||
if (ProtoMan.TryIndex<FontPrototype>(SharedMapTextComponent.DefaultFont, out var @default))
|
||||
component.CachedFont = new VectorFont(_resourceCache.GetResource<FontResource>(@default.Path), 14);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ public sealed partial class MappingState : GameplayStateBase
|
|||
[Dependency] private IEntityNetworkManager _entityNetwork = default!;
|
||||
[Dependency] private IInputManager _input = default!;
|
||||
[Dependency] private ILogManager _log = default!;
|
||||
[Dependency] private IMapManager _mapMan = default!;
|
||||
[Dependency] private MappingManager _mapping = default!;
|
||||
[Dependency] private IOverlayManager _overlays = default!;
|
||||
[Dependency] private IPlacementManager _placement = default!;
|
||||
|
|
@ -56,6 +55,7 @@ public sealed partial class MappingState : GameplayStateBase
|
|||
private EntityMenuUIController _entityMenuController = default!;
|
||||
|
||||
private DecalPlacementSystem _decal = default!;
|
||||
private MapSystem _maps = default!;
|
||||
private SpriteSystem _sprite = default!;
|
||||
private TransformSystem _transform = default!;
|
||||
private VerbSystem _verbs = default!;
|
||||
|
|
@ -207,6 +207,7 @@ public sealed partial class MappingState : GameplayStateBase
|
|||
_entityMenuController = UserInterfaceManager.GetUIController<EntityMenuUIController>();
|
||||
|
||||
_decal = _entityManager.System<DecalPlacementSystem>();
|
||||
_maps = _entityManager.System<MapSystem>();
|
||||
_sprite = _entityManager.System<SpriteSystem>();
|
||||
_transform = _entityManager.System<TransformSystem>();
|
||||
_verbs = _entityManager.System<VerbSystem>();
|
||||
|
|
@ -795,7 +796,7 @@ public sealed partial class MappingState : GameplayStateBase
|
|||
{
|
||||
var mapPos = _transform.ToMapCoordinates(coords);
|
||||
|
||||
if (_mapMan.TryFindGridAt(mapPos, out var gridUid, out var grid) &&
|
||||
if (_maps.TryFindGridAt(mapPos, out var gridUid, out var grid) &&
|
||||
_entityManager.System<SharedMapSystem>().TryGetTileRef(gridUid, grid, coords, out var tileRef) &&
|
||||
_allPrototypesDict.TryGetValue(_entityManager.System<TurfSystem>().GetContentTileDefinition(tileRef), out button))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ public sealed partial class GridDraggingSystem : SharedGridDraggingSystem
|
|||
[Dependency] private IEyeManager _eyeManager = default!;
|
||||
[Dependency] private IGameTiming _gameTiming = default!;
|
||||
[Dependency] private IInputManager _inputManager = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private SharedMapSystem _mapSystem = default!;
|
||||
[Dependency] private InputSystem _inputSystem = default!;
|
||||
[Dependency] private SharedTransformSystem _transformSystem = default!;
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ public sealed partial class GridDraggingSystem : SharedGridDraggingSystem
|
|||
|
||||
if (_dragging == null)
|
||||
{
|
||||
if (!_mapManager.TryFindGridAt(mousePos, out var gridUid, out var grid))
|
||||
if (!_mapSystem.TryFindGridAt(mousePos, out var gridUid, out var grid))
|
||||
return;
|
||||
|
||||
StartDragging(gridUid, Vector2.Transform(mousePos.Position, _transformSystem.GetInvWorldMatrix(gridUid)));
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@ public sealed partial class FloorOcclusionSystem : SharedFloorOcclusionSystem
|
|||
{
|
||||
private static readonly ProtoId<ShaderPrototype> HorizontalCut = "HorizontalCut";
|
||||
|
||||
[Dependency] private IPrototypeManager _proto = default!;
|
||||
|
||||
[Dependency] private EntityQuery<SpriteComponent> _spriteQuery = default!;
|
||||
|
||||
public override void Initialize()
|
||||
|
|
@ -48,7 +46,7 @@ public sealed partial class FloorOcclusionSystem : SharedFloorOcclusionSystem
|
|||
if (!_spriteQuery.Resolve(sprite.Owner, ref sprite.Comp, false))
|
||||
return;
|
||||
|
||||
var shader = _proto.Index(HorizontalCut).Instance();
|
||||
var shader = ProtoMan.Index(HorizontalCut).Instance();
|
||||
|
||||
if (sprite.Comp.PostShader is not null && sprite.Comp.PostShader != shader)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ namespace Content.Client.NPC
|
|||
[Dependency] private IEyeManager _eyeManager = default!;
|
||||
[Dependency] private IGameTiming _timing = default!;
|
||||
[Dependency] private IInputManager _inputManager = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private IOverlayManager _overlayManager = default!;
|
||||
[Dependency] private IResourceCache _cache = default!;
|
||||
[Dependency] private NPCSteeringSystem _steering = default!;
|
||||
|
|
@ -39,7 +38,7 @@ namespace Content.Client.NPC
|
|||
}
|
||||
else if (!_overlayManager.HasOverlay<PathfindingOverlay>())
|
||||
{
|
||||
_overlayManager.AddOverlay(new PathfindingOverlay(EntityManager, _eyeManager, _inputManager, _mapManager, _cache, this, _mapSystem, _transformSystem));
|
||||
_overlayManager.AddOverlay(new PathfindingOverlay(EntityManager, _eyeManager, _inputManager, _cache, this, _mapSystem, _transformSystem));
|
||||
}
|
||||
|
||||
if ((value & PathfindingDebugMode.Steering) != 0x0)
|
||||
|
|
@ -137,7 +136,6 @@ namespace Content.Client.NPC
|
|||
private readonly IEntityManager _entManager;
|
||||
private readonly IEyeManager _eyeManager;
|
||||
private readonly IInputManager _inputManager;
|
||||
private readonly IMapManager _mapManager;
|
||||
private readonly PathfindingSystem _system;
|
||||
private readonly MapSystem _mapSystem;
|
||||
private readonly SharedTransformSystem _transformSystem;
|
||||
|
|
@ -151,7 +149,6 @@ namespace Content.Client.NPC
|
|||
IEntityManager entManager,
|
||||
IEyeManager eyeManager,
|
||||
IInputManager inputManager,
|
||||
IMapManager mapManager,
|
||||
IResourceCache cache,
|
||||
PathfindingSystem system,
|
||||
MapSystem mapSystem,
|
||||
|
|
@ -160,7 +157,6 @@ namespace Content.Client.NPC
|
|||
_entManager = entManager;
|
||||
_eyeManager = eyeManager;
|
||||
_inputManager = inputManager;
|
||||
_mapManager = mapManager;
|
||||
_system = system;
|
||||
_mapSystem = mapSystem;
|
||||
_transformSystem = transformSystem;
|
||||
|
|
@ -193,7 +189,7 @@ namespace Content.Client.NPC
|
|||
var found = false;
|
||||
|
||||
_grids.Clear();
|
||||
_mapManager.FindGridsIntersecting(mouseWorldPos.MapId, aabb, ref _grids);
|
||||
_mapSystem.FindGridsIntersecting(mouseWorldPos.MapId, aabb, ref _grids);
|
||||
|
||||
foreach (var grid in _grids)
|
||||
{
|
||||
|
|
@ -269,7 +265,7 @@ namespace Content.Client.NPC
|
|||
if ((_system.Modes & PathfindingDebugMode.Poly) != 0x0 &&
|
||||
mouseWorldPos.MapId == args.MapId)
|
||||
{
|
||||
if (!_mapManager.TryFindGridAt(mouseWorldPos, out var gridUid, out var grid) || !xformQuery.TryGetComponent(gridUid, out var gridXform))
|
||||
if (!_mapSystem.TryFindGridAt(mouseWorldPos, out var gridUid, out var grid) || !xformQuery.TryGetComponent(gridUid, out var gridXform))
|
||||
return;
|
||||
|
||||
if (!_system.Polys.TryGetValue(_entManager.GetNetEntity(gridUid), out var data))
|
||||
|
|
@ -346,7 +342,7 @@ namespace Content.Client.NPC
|
|||
mouseWorldPos.MapId == args.MapId)
|
||||
{
|
||||
_grids.Clear();
|
||||
_mapManager.FindGridsIntersecting(mouseWorldPos.MapId, aabb, ref _grids);
|
||||
_mapSystem.FindGridsIntersecting(mouseWorldPos.MapId, aabb, ref _grids);
|
||||
|
||||
foreach (var grid in _grids)
|
||||
{
|
||||
|
|
@ -408,7 +404,7 @@ namespace Content.Client.NPC
|
|||
mouseWorldPos.MapId == args.MapId)
|
||||
{
|
||||
_grids.Clear();
|
||||
_mapManager.FindGridsIntersecting(args.MapId, aabb, ref _grids);
|
||||
_mapSystem.FindGridsIntersecting(args.MapId, aabb, ref _grids);
|
||||
|
||||
foreach (var grid in _grids)
|
||||
{
|
||||
|
|
@ -447,7 +443,7 @@ namespace Content.Client.NPC
|
|||
mouseWorldPos.MapId == args.MapId)
|
||||
{
|
||||
_grids.Clear();
|
||||
_mapManager.FindGridsIntersecting(args.MapId, aabb, ref _grids);
|
||||
_mapSystem.FindGridsIntersecting(args.MapId, aabb, ref _grids);
|
||||
|
||||
foreach (var grid in _grids)
|
||||
{
|
||||
|
|
@ -506,7 +502,7 @@ namespace Content.Client.NPC
|
|||
if ((_system.Modes & PathfindingDebugMode.Chunks) != 0x0)
|
||||
{
|
||||
_grids.Clear();
|
||||
_mapManager.FindGridsIntersecting(args.MapId, args.WorldBounds, ref _grids);
|
||||
_mapSystem.FindGridsIntersecting(args.MapId, args.WorldBounds, ref _grids);
|
||||
|
||||
foreach (var grid in _grids)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@ using JetBrains.Annotations;
|
|||
using Robust.Client.Graphics;
|
||||
using Robust.Client.Input;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Client.NodeContainer
|
||||
{
|
||||
|
|
@ -16,7 +13,6 @@ namespace Content.Client.NodeContainer
|
|||
{
|
||||
[Dependency] private IOverlayManager _overlayManager = default!;
|
||||
[Dependency] private EntityLookupSystem _entityLookup = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private IInputManager _inputManager = default!;
|
||||
[Dependency] private IResourceCache _resourceCache = default!;
|
||||
|
||||
|
|
@ -88,7 +84,6 @@ namespace Content.Client.NodeContainer
|
|||
var overlay = new NodeVisualizationOverlay(
|
||||
this,
|
||||
_entityLookup,
|
||||
_mapManager,
|
||||
_inputManager,
|
||||
_resourceCache,
|
||||
EntityManager);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ namespace Content.Client.NodeContainer
|
|||
{
|
||||
private readonly NodeGroupSystem _system;
|
||||
private readonly EntityLookupSystem _lookup;
|
||||
private readonly IMapManager _mapManager;
|
||||
private readonly IInputManager _inputManager;
|
||||
private readonly IEntityManager _entityManager;
|
||||
private readonly SharedTransformSystem _transformSystem;
|
||||
|
|
@ -38,14 +37,12 @@ namespace Content.Client.NodeContainer
|
|||
public NodeVisualizationOverlay(
|
||||
NodeGroupSystem system,
|
||||
EntityLookupSystem lookup,
|
||||
IMapManager mapManager,
|
||||
IInputManager inputManager,
|
||||
IResourceCache cache,
|
||||
IEntityManager entityManager)
|
||||
{
|
||||
_system = system;
|
||||
_lookup = lookup;
|
||||
_mapManager = mapManager;
|
||||
_inputManager = inputManager;
|
||||
_entityManager = entityManager;
|
||||
_transformSystem = _entityManager.System<SharedTransformSystem>();
|
||||
|
|
@ -119,7 +116,7 @@ namespace Content.Client.NodeContainer
|
|||
var xformQuery = _entityManager.GetEntityQuery<TransformComponent>();
|
||||
|
||||
_grids.Clear();
|
||||
_mapManager.FindGridsIntersecting(map, worldAABB, ref _grids);
|
||||
_mapSystem.FindGridsIntersecting(map, worldAABB, ref _grids);
|
||||
|
||||
foreach (var grid in _grids)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ public sealed partial class TargetOutlineSystem : EntitySystem
|
|||
[Dependency] private EntityLookupSystem _lookup = default!;
|
||||
[Dependency] private IInputManager _inputManager = default!;
|
||||
[Dependency] private IPlayerManager _playerManager = default!;
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private SharedInteractionSystem _interactionSystem = default!;
|
||||
[Dependency] private EntityWhitelistSystem _whitelistSystem = default!;
|
||||
[Dependency] private SharedTransformSystem _transformSystem = default!;
|
||||
|
|
@ -83,8 +82,8 @@ public sealed partial class TargetOutlineSystem : EntitySystem
|
|||
{
|
||||
base.Initialize();
|
||||
|
||||
_shaderTargetValid = _prototypeManager.Index(ShaderTargetValid).InstanceUnique();
|
||||
_shaderTargetInvalid = _prototypeManager.Index(ShaderTargetInvalid).InstanceUnique();
|
||||
_shaderTargetValid = ProtoMan.Index(ShaderTargetValid).InstanceUnique();
|
||||
_shaderTargetInvalid = ProtoMan.Index(ShaderTargetInvalid).InstanceUnique();
|
||||
}
|
||||
|
||||
public void Disable()
|
||||
|
|
|
|||
61
Content.Client/Overlays/NightVisionOverlay.cs
Normal file
61
Content.Client/Overlays/NightVisionOverlay.cs
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
using Robust.Client.Graphics;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Overlays;
|
||||
|
||||
/// <summary>
|
||||
/// Fullscreen overlay that applies the night-vision shader to the rendered screen.
|
||||
/// </summary>
|
||||
public sealed partial class NightVisionOverlay : Overlay
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
|
||||
private static readonly ProtoId<ShaderPrototype> Shader = "NightVision";
|
||||
private readonly ShaderInstance _nightVisionShader;
|
||||
|
||||
public Color OverlayColor { get; private set; } = Color.White;
|
||||
public Color LightingColor { get; private set; } = Color.White;
|
||||
public float NoiseAmount { get; private set; }
|
||||
public float NoiseMultiplier { get; private set; }
|
||||
|
||||
public override OverlaySpace Space => OverlaySpace.BeforeLighting | OverlaySpace.WorldSpace;
|
||||
public override bool RequestScreenTexture => true;
|
||||
|
||||
public NightVisionOverlay()
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
_nightVisionShader = _prototypeManager.Index(Shader).InstanceUnique();
|
||||
}
|
||||
|
||||
public void SetParameters(Color overlayColor, Color lightingColor, float noiseAmount, float noiseMultiplier)
|
||||
{
|
||||
OverlayColor = overlayColor;
|
||||
LightingColor = lightingColor;
|
||||
NoiseAmount = noiseAmount;
|
||||
NoiseMultiplier = noiseMultiplier;
|
||||
}
|
||||
|
||||
protected override void Draw(in OverlayDrawArgs args)
|
||||
{
|
||||
if (ScreenTexture == null)
|
||||
return;
|
||||
|
||||
var handle = args.WorldHandle;
|
||||
var isSpace = args.Space == OverlaySpace.WorldSpace;
|
||||
|
||||
if (isSpace)
|
||||
{
|
||||
_nightVisionShader.SetParameter("SCREEN_TEXTURE", ScreenTexture);
|
||||
_nightVisionShader.SetParameter("noise_amount", NoiseAmount);
|
||||
_nightVisionShader.SetParameter("noise_multiplier", NoiseMultiplier);
|
||||
handle.UseShader(_nightVisionShader);
|
||||
}
|
||||
|
||||
var drawingColor = isSpace ? OverlayColor : LightingColor;
|
||||
handle.DrawRect(args.WorldBounds, drawingColor);
|
||||
|
||||
if (isSpace)
|
||||
handle.UseShader(null);
|
||||
}
|
||||
}
|
||||
70
Content.Client/Overlays/NightVisionOverlaySystem.cs
Normal file
70
Content.Client/Overlays/NightVisionOverlaySystem.cs
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
using Content.Shared.Inventory.Events;
|
||||
using Content.Shared.Overlays;
|
||||
using Robust.Client.Graphics;
|
||||
|
||||
namespace Content.Client.Overlays;
|
||||
|
||||
/// <summary>
|
||||
/// Shows/hides the <see cref="NightVisionOverlay"/> based on whether the observed
|
||||
/// entity has a <see cref="NightVisionComponent"/> equipped.
|
||||
/// </summary>
|
||||
public sealed partial class NightVisionOverlaySystem : EquipmentHudSystem<NightVisionComponent>
|
||||
{
|
||||
[Dependency] private IOverlayManager _overlayMan = default!;
|
||||
|
||||
private NightVisionOverlay _overlay = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
_overlay = new NightVisionOverlay();
|
||||
|
||||
SubscribeLocalEvent<NightVisionComponent, AfterAutoHandleStateEvent>(OnHandleState);
|
||||
}
|
||||
|
||||
protected override void UpdateInternal(RefreshEquipmentHudEvent<NightVisionComponent> component)
|
||||
{
|
||||
base.UpdateInternal(component);
|
||||
|
||||
// Find the component with the lowest noise.
|
||||
NightVisionComponent? nvision = null;
|
||||
var bestNoise = float.MaxValue;
|
||||
foreach (var comp in component.Components)
|
||||
{
|
||||
if (!comp.Enabled)
|
||||
continue;
|
||||
|
||||
var noise = comp.NoiseAmount * comp.NoiseMultiplier;
|
||||
if (noise < bestNoise)
|
||||
{
|
||||
nvision = comp;
|
||||
bestNoise = noise;
|
||||
}
|
||||
}
|
||||
|
||||
// There is no active night vision components, so we disable the overlay.
|
||||
if (nvision == null)
|
||||
{
|
||||
DeactivateInternal();
|
||||
return;
|
||||
}
|
||||
|
||||
_overlay.SetParameters(nvision.OverlayColor, nvision.LightingColor, nvision.NoiseAmount, nvision.NoiseMultiplier);
|
||||
|
||||
if (!_overlayMan.HasOverlay<NightVisionOverlay>())
|
||||
_overlayMan.AddOverlay(_overlay);
|
||||
}
|
||||
|
||||
protected override void DeactivateInternal()
|
||||
{
|
||||
base.DeactivateInternal();
|
||||
|
||||
_overlayMan.RemoveOverlay(_overlay);
|
||||
}
|
||||
|
||||
private void OnHandleState(Entity<NightVisionComponent> ent, ref AfterAutoHandleStateEvent args)
|
||||
{
|
||||
RefreshOverlay();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +1,11 @@
|
|||
using Content.Shared.Overlays;
|
||||
using Content.Shared.Security.Components;
|
||||
using Content.Shared.StatusIcon;
|
||||
using Content.Shared.StatusIcon.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Overlays;
|
||||
|
||||
public sealed partial class ShowCriminalRecordIconsSystem : EquipmentHudSystem<ShowCriminalRecordIconsComponent>
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototype = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
|
@ -22,7 +18,7 @@ public sealed partial class ShowCriminalRecordIconsSystem : EquipmentHudSystem<S
|
|||
if (!IsActive)
|
||||
return;
|
||||
|
||||
if (_prototype.Resolve(component.StatusIcon, out var iconPrototype))
|
||||
if (ProtoMan.Resolve(component.StatusIcon, out var iconPrototype))
|
||||
ev.StatusIcons.Add(iconPrototype);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using Content.Shared.Inventory.Events;
|
||||
using Content.Shared.Overlays;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Overlays;
|
||||
|
||||
|
|
@ -11,7 +10,6 @@ namespace Content.Client.Overlays;
|
|||
public sealed partial class ShowHealthBarsSystem : EquipmentHudSystem<ShowHealthBarsComponent>
|
||||
{
|
||||
[Dependency] private IOverlayManager _overlayMan = default!;
|
||||
[Dependency] private IPrototypeManager _prototype = default!;
|
||||
|
||||
private EntityHealthBarOverlay _overlay = default!;
|
||||
|
||||
|
|
@ -21,7 +19,7 @@ public sealed partial class ShowHealthBarsSystem : EquipmentHudSystem<ShowHealth
|
|||
|
||||
SubscribeLocalEvent<ShowHealthBarsComponent, AfterAutoHandleStateEvent>(OnHandleState);
|
||||
|
||||
_overlay = new(EntityManager, _prototype);
|
||||
_overlay = new(EntityManager, ProtoMan);
|
||||
}
|
||||
|
||||
private void OnHandleState(Entity<ShowHealthBarsComponent> ent, ref AfterAutoHandleStateEvent args)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ using Content.Shared.Mobs.Components;
|
|||
using Content.Shared.Overlays;
|
||||
using Content.Shared.StatusIcon;
|
||||
using Content.Shared.StatusIcon.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Content.Shared.Damage.Components;
|
||||
|
||||
namespace Content.Client.Overlays;
|
||||
|
|
@ -14,8 +13,6 @@ namespace Content.Client.Overlays;
|
|||
/// </summary>
|
||||
public sealed partial class ShowHealthIconsSystem : EquipmentHudSystem<ShowHealthIconsComponent>
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototypeMan = default!;
|
||||
|
||||
[ViewVariables]
|
||||
public HashSet<string> DamageContainers = new();
|
||||
|
||||
|
|
@ -81,9 +78,9 @@ public sealed partial class ShowHealthIconsSystem : EquipmentHudSystem<ShowHealt
|
|||
if (TryComp<MobStateComponent>(entity, out var state))
|
||||
{
|
||||
// Since there is no MobState for a rotting mob, we have to deal with this case first.
|
||||
if (HasComp<RottingComponent>(entity) && _prototypeMan.Resolve(injurableComp.RottingIcon, out var rottingIcon))
|
||||
if (HasComp<RottingComponent>(entity) && ProtoMan.Resolve(injurableComp.RottingIcon, out var rottingIcon))
|
||||
result.Add(rottingIcon);
|
||||
else if (injurableComp.HealthIcons.TryGetValue(state.CurrentState, out var value) && _prototypeMan.Resolve(value, out var icon))
|
||||
else if (injurableComp.HealthIcons.TryGetValue(state.CurrentState, out var value) && ProtoMan.Resolve(value, out var icon))
|
||||
result.Add(icon);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
using Content.Shared.Mindshield.Components;
|
||||
using Content.Shared.Overlays;
|
||||
using Content.Shared.StatusIcon;
|
||||
using Content.Shared.StatusIcon.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Overlays;
|
||||
|
||||
public sealed partial class ShowMindShieldIconsSystem : EquipmentHudSystem<ShowMindShieldIconsComponent>
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototype = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
|
@ -21,9 +17,9 @@ public sealed partial class ShowMindShieldIconsSystem : EquipmentHudSystem<ShowM
|
|||
// ...imagine cheating in a game about silly paper dolls
|
||||
private void OnGetStatusIconsEventFake(EntityUid uid, FakeMindShieldComponent component, ref GetStatusIconsEvent ev)
|
||||
{
|
||||
if(!IsActive)
|
||||
if (!IsActive)
|
||||
return;
|
||||
if (component.IsEnabled && _prototype.Resolve(component.MindShieldStatusIcon, out var fakeStatusIconPrototype))
|
||||
if (component.IsEnabled && ProtoMan.Resolve(component.MindShieldStatusIcon, out var fakeStatusIconPrototype))
|
||||
ev.StatusIcons.Add(fakeStatusIconPrototype);
|
||||
}
|
||||
|
||||
|
|
@ -32,7 +28,7 @@ public sealed partial class ShowMindShieldIconsSystem : EquipmentHudSystem<ShowM
|
|||
if (!IsActive)
|
||||
return;
|
||||
|
||||
if (_prototype.Resolve(component.MindShieldStatusIcon, out var iconPrototype))
|
||||
if (ProtoMan.Resolve(component.MindShieldStatusIcon, out var iconPrototype))
|
||||
ev.StatusIcons.Add(iconPrototype);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,14 +2,11 @@ using Content.Shared.Overlays;
|
|||
using Content.Shared.NukeOps;
|
||||
using Content.Shared.StatusIcon;
|
||||
using Content.Shared.StatusIcon.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Overlays;
|
||||
|
||||
public sealed partial class ShowSyndicateIconsSystem : EquipmentHudSystem<ShowSyndicateIconsComponent>
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototype = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
|
@ -22,7 +19,7 @@ public sealed partial class ShowSyndicateIconsSystem : EquipmentHudSystem<ShowSy
|
|||
if (!IsActive)
|
||||
return;
|
||||
|
||||
if (_prototype.TryIndex<FactionIconPrototype>(component.SyndStatusIcon, out var iconPrototype))
|
||||
if (ProtoMan.TryIndex<FactionIconPrototype>(component.SyndStatusIcon, out var iconPrototype))
|
||||
ev.StatusIcons.Add(iconPrototype);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public sealed partial class StencilOverlay
|
|||
_grids.Clear();
|
||||
|
||||
// idk if this is safe to cache in a field and clear sloth help
|
||||
_mapManager.FindGridsIntersecting(mapId, worldAABB, ref _grids);
|
||||
_map.FindGridsIntersecting(mapId, worldAABB, ref _grids);
|
||||
|
||||
foreach (var grid in _grids)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ public sealed partial class StencilOverlay : Overlay
|
|||
[Dependency] private IClyde _clyde = default!;
|
||||
[Dependency] private IEntityManager _entManager = default!;
|
||||
[Dependency] private IGameTiming _timing = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private IPrototypeManager _protoManager = default!;
|
||||
private readonly ParallaxSystem _parallax;
|
||||
private readonly SharedTransformSystem _transform;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ using DrawDepth = Content.Shared.DrawDepth.DrawDepth;
|
|||
|
||||
namespace Content.Client.Pointing;
|
||||
|
||||
public sealed partial class PointingSystem : SharedPointingSystem
|
||||
public sealed partial class PointingSystem
|
||||
{
|
||||
[Dependency] private SpriteSystem _sprite = default!;
|
||||
|
||||
|
|
@ -48,12 +48,21 @@ public sealed partial class PointingSystem : SharedPointingSystem
|
|||
Text = Loc.GetString("pointing-verb-get-data-text"),
|
||||
Icon = new SpriteSpecifier.Texture(new("/Textures/Interface/VerbIcons/point.svg.192dpi.png")),
|
||||
ClientExclusive = true,
|
||||
Act = () => RaiseNetworkEvent(new PointingAttemptEvent(GetNetEntity(args.Target)))
|
||||
Act = () => TryPointAtEntity(GetNetEntity(args.Target))
|
||||
};
|
||||
|
||||
args.Verbs.Add(verb);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to point at a target entity
|
||||
/// </summary>
|
||||
/// <param name="target">The target to point at</param>
|
||||
public void TryPointAtEntity(NetEntity target)
|
||||
{
|
||||
RaiseNetworkEvent(new PointingAttemptEvent(target));
|
||||
}
|
||||
|
||||
private void OnArrowStartup(EntityUid uid, PointingArrowComponent component, ComponentStartup args)
|
||||
{
|
||||
if (TryComp<SpriteComponent>(uid, out var sprite))
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System.Linq;
|
||||
using Content.Shared.Containers;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Shared.Popups;
|
||||
|
|
@ -12,7 +11,6 @@ using Robust.Shared.Collections;
|
|||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Map;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Replays;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
|
|
@ -24,7 +22,6 @@ namespace Content.Client.Popups
|
|||
[Dependency] private IInputManager _inputManager = default!;
|
||||
[Dependency] private IOverlayManager _overlay = default!;
|
||||
[Dependency] private IPlayerManager _playerManager = default!;
|
||||
[Dependency] private IPrototypeManager _prototype = default!;
|
||||
[Dependency] private IGameTiming _timing = default!;
|
||||
[Dependency] private IUserInterfaceManager _uiManager = default!;
|
||||
[Dependency] private IReplayRecordingManager _replayRecording = default!;
|
||||
|
|
@ -52,7 +49,7 @@ namespace Content.Client.Popups
|
|||
_configManager,
|
||||
EntityManager,
|
||||
_playerManager,
|
||||
_prototype,
|
||||
ProtoMan,
|
||||
_uiManager,
|
||||
_uiManager.GetUIController<PopupUIController>(),
|
||||
_examine,
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ namespace Content.Client.RCD;
|
|||
public sealed partial class AlignRCDConstruction : PlacementMode
|
||||
{
|
||||
[Dependency] private IEntityManager _entityManager = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
private readonly SharedMapSystem _mapSystem;
|
||||
private readonly HandsSystem _handsSystem;
|
||||
private readonly RCDSystem _rcdSystem;
|
||||
|
|
@ -46,7 +45,7 @@ public sealed partial class AlignRCDConstruction : PlacementMode
|
|||
public override void AlignPlacementMode(ScreenCoordinates mouseScreen)
|
||||
{
|
||||
_unalignedMouseCoords = ScreenToCursorGrid(mouseScreen);
|
||||
MouseCoords = _unalignedMouseCoords.AlignWithClosestGridTile(SearchBoxSize, _entityManager, _mapManager);
|
||||
MouseCoords = _unalignedMouseCoords.AlignWithClosestGridTile(SearchBoxSize, _entityManager);
|
||||
|
||||
var gridId = _transformSystem.GetGrid(MouseCoords);
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using Content.Shared.RCD.Components;
|
|||
using Robust.Client.Placement;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.Enums;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.RCD;
|
||||
|
||||
|
|
@ -18,7 +17,6 @@ public sealed partial class RCDConstructionGhostSystem : EntitySystem
|
|||
|
||||
[Dependency] private IPlayerManager _playerManager = default!;
|
||||
[Dependency] private IPlacementManager _placementManager = default!;
|
||||
[Dependency] private IPrototypeManager _protoManager = default!;
|
||||
[Dependency] private HandsSystem _hands = default!;
|
||||
|
||||
private Direction _placementDirection = default;
|
||||
|
|
@ -55,7 +53,7 @@ public sealed partial class RCDConstructionGhostSystem : EntitySystem
|
|||
|
||||
return;
|
||||
}
|
||||
var prototype = _protoManager.Index(rcd.ProtoId);
|
||||
var prototype = ProtoMan.Index(rcd.ProtoId);
|
||||
|
||||
// Update the direction the RCD prototype based on the placer direction
|
||||
if (_placementDirection != _placementManager.Direction)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using Content.Shared.Revolutionary.Components;
|
||||
using Content.Shared.Revolutionary;
|
||||
using Content.Shared.StatusIcon.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Revolutionary;
|
||||
|
||||
|
|
@ -10,8 +9,6 @@ namespace Content.Client.Revolutionary;
|
|||
/// </summary>
|
||||
public sealed partial class RevolutionarySystem : SharedRevolutionarySystem
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototype = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
|
@ -25,13 +22,13 @@ public sealed partial class RevolutionarySystem : SharedRevolutionarySystem
|
|||
if (HasComp<HeadRevolutionaryComponent>(ent))
|
||||
return;
|
||||
|
||||
if (_prototype.Resolve(ent.Comp.StatusIcon, out var iconPrototype))
|
||||
if (ProtoMan.Resolve(ent.Comp.StatusIcon, out var iconPrototype))
|
||||
args.StatusIcons.Add(iconPrototype);
|
||||
}
|
||||
|
||||
private void GetHeadRevIcon(Entity<HeadRevolutionaryComponent> ent, ref GetStatusIconsEvent args)
|
||||
{
|
||||
if (_prototype.Resolve(ent.Comp.StatusIcon, out var iconPrototype))
|
||||
if (ProtoMan.Resolve(ent.Comp.StatusIcon, out var iconPrototype))
|
||||
args.StatusIcons.Add(iconPrototype);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@ using Content.Shared.Mind.Components;
|
|||
using Content.Shared.Mobs.Systems;
|
||||
using Content.Shared.NPC;
|
||||
using Content.Shared.SSDIndicator;
|
||||
using Content.Shared.StatusIcon;
|
||||
using Content.Shared.StatusIcon.Components;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.SSDIndicator;
|
||||
|
||||
|
|
@ -15,7 +13,6 @@ namespace Content.Client.SSDIndicator;
|
|||
/// </summary>
|
||||
public sealed partial class SSDIndicatorSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototype = default!;
|
||||
[Dependency] private IConfigurationManager _cfg = default!;
|
||||
[Dependency] private MobStateSystem _mobState = default!;
|
||||
|
||||
|
|
@ -34,7 +31,7 @@ public sealed partial class SSDIndicatorSystem : EntitySystem
|
|||
!HasComp<ActiveNPCComponent>(uid) &&
|
||||
HasComp<MindExaminableComponent>(uid))
|
||||
{
|
||||
args.StatusIcons.Add(_prototype.Index(component.Icon));
|
||||
args.StatusIcons.Add(ProtoMan.Index(component.Icon));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ namespace Content.Client.Sandbox
|
|||
{
|
||||
[Dependency] private IClientAdminManager _adminManager = default!;
|
||||
[Dependency] private IClientConsoleHost _consoleHost = default!;
|
||||
[Dependency] private IMapManager _map = default!;
|
||||
[Dependency] private IPlacementManager _placement = default!;
|
||||
[Dependency] private ContentEyeSystem _contentEye = default!;
|
||||
[Dependency] private SharedTransformSystem _transform = default!;
|
||||
|
|
@ -116,7 +115,7 @@ namespace Content.Client.Sandbox
|
|||
|
||||
// Try copy tile.
|
||||
|
||||
if (!_map.TryFindGridAt(_transform.ToMapCoordinates(coords), out var gridUid, out var grid) || !_mapSystem.TryGetTileRef(gridUid, grid, coords, out var tileRef))
|
||||
if (!_mapSystem.TryFindGridAt(_transform.ToMapCoordinates(coords), out var gridUid, out var grid) || !_mapSystem.TryGetTileRef(gridUid, grid, coords, out var tileRef))
|
||||
return false;
|
||||
|
||||
if (_placement.Eraser)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ public sealed partial class MapScreen : BoxContainer
|
|||
{
|
||||
[Dependency] private IEntityManager _entManager = default!;
|
||||
[Dependency] private IGameTiming _timing = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private IRobustRandom _random = default!;
|
||||
private readonly SharedAudioSystem _audio;
|
||||
private readonly SharedMapSystem _maps;
|
||||
|
|
@ -311,7 +310,7 @@ public sealed partial class MapScreen : BoxContainer
|
|||
};
|
||||
|
||||
_mapHeadings.Add(mapComp.MapId, gridContents);
|
||||
foreach (var grid in _mapManager.GetAllGrids(mapComp.MapId))
|
||||
foreach (var grid in _maps.GetAllGrids(mapComp.MapId))
|
||||
{
|
||||
_entManager.TryGetComponent(grid.Owner, out IFFComponent? iffComp);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ namespace Content.Client.Shuttles.UI;
|
|||
public sealed partial class ShuttleDockControl : BaseShuttleControl
|
||||
{
|
||||
[Dependency] private IGameTiming _timing = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
private readonly DockingSystem _dockSystem;
|
||||
private readonly SharedMapSystem _maps;
|
||||
private readonly SharedShuttleSystem _shuttles;
|
||||
private readonly SharedTransformSystem _xformSystem;
|
||||
|
||||
|
|
@ -62,6 +62,7 @@ public sealed partial class ShuttleDockControl : BaseShuttleControl
|
|||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
_dockSystem = EntManager.System<DockingSystem>();
|
||||
_maps = EntManager.System<SharedMapSystem>();
|
||||
_shuttles = EntManager.System<SharedShuttleSystem>();
|
||||
_xformSystem = EntManager.System<SharedTransformSystem>();
|
||||
MinSize = new Vector2(SizeFull, SizeFull);
|
||||
|
|
@ -121,7 +122,7 @@ public sealed partial class ShuttleDockControl : BaseShuttleControl
|
|||
// Draw nearby grids
|
||||
var controlBounds = PixelSizeBox;
|
||||
_grids.Clear();
|
||||
_mapManager.FindGridsIntersecting(gridXform.MapID, viewBoundsWorld, ref _grids);
|
||||
_maps.FindGridsIntersecting(gridXform.MapID, viewBoundsWorld, ref _grids);
|
||||
|
||||
// offset the dotted-line position to the bounds.
|
||||
Vector2? viewedDockPos = _viewedState != null ? MidPointVector : null;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Content.Client.Shuttles.UI;
|
|||
[GenerateTypedNameReferences]
|
||||
public sealed partial class ShuttleNavControl : BaseShuttleControl
|
||||
{
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
private readonly SharedMapSystem _maps;
|
||||
private readonly SharedShuttleSystem _shuttles;
|
||||
private readonly SharedTransformSystem _transform;
|
||||
|
||||
|
|
@ -52,6 +52,7 @@ public sealed partial class ShuttleNavControl : BaseShuttleControl
|
|||
public ShuttleNavControl() : base(64f, 256f, 256f)
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
_maps = EntManager.System<SharedMapSystem>();
|
||||
_shuttles = EntManager.System<SharedShuttleSystem>();
|
||||
_transform = EntManager.System<SharedTransformSystem>();
|
||||
}
|
||||
|
|
@ -187,7 +188,7 @@ public sealed partial class ShuttleNavControl : BaseShuttleControl
|
|||
var viewAABB = viewBounds.CalcBoundingBox();
|
||||
|
||||
_grids.Clear();
|
||||
_mapManager.FindGridsIntersecting(xform.MapID, new Box2(mapPos.Position - MaxRadarRangeVector, mapPos.Position + MaxRadarRangeVector), ref _grids, approx: true, includeMap: false);
|
||||
_maps.FindGridsIntersecting(xform.MapID, new Box2(mapPos.Position - MaxRadarRangeVector, mapPos.Position + MaxRadarRangeVector), ref _grids, approx: true, includeMap: false);
|
||||
|
||||
// Draw other grids... differently
|
||||
foreach (var grid in _grids)
|
||||
|
|
|
|||
|
|
@ -60,12 +60,12 @@ public sealed partial class SprayPainterSystem : SharedSprayPainterSystem
|
|||
{
|
||||
PaintableGroupsByCategory.Clear();
|
||||
PaintableStylesByGroup.Clear();
|
||||
foreach (var category in Proto.EnumeratePrototypes<PaintableGroupCategoryPrototype>().OrderBy(x => x.ID))
|
||||
foreach (var category in ProtoMan.EnumeratePrototypes<PaintableGroupCategoryPrototype>().OrderBy(x => x.ID))
|
||||
{
|
||||
var groupList = new List<string>();
|
||||
foreach (var groupId in category.Groups)
|
||||
{
|
||||
if (!Proto.Resolve(groupId, out var group))
|
||||
if (!ProtoMan.Resolve(groupId, out var group))
|
||||
continue;
|
||||
|
||||
groupList.Add(groupId);
|
||||
|
|
@ -77,7 +77,7 @@ public sealed partial class SprayPainterSystem : SharedSprayPainterSystem
|
|||
}
|
||||
|
||||
Decals.Clear();
|
||||
foreach (var decalPrototype in Proto.EnumeratePrototypes<DecalPrototype>().OrderBy(x => x.ID))
|
||||
foreach (var decalPrototype in ProtoMan.EnumeratePrototypes<DecalPrototype>().OrderBy(x => x.ID))
|
||||
{
|
||||
if (!decalPrototype.Tags.Contains("station")
|
||||
&& !decalPrototype.Tags.Contains("markings")
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using Content.Client.Interactable.Components;
|
||||
using Content.Client.StatusIcon;
|
||||
using Content.Shared.Stealth;
|
||||
using Content.Shared.Stealth.Components;
|
||||
using Robust.Client.GameObjects;
|
||||
|
|
@ -12,7 +11,6 @@ public sealed partial class StealthSystem : SharedStealthSystem
|
|||
{
|
||||
private static readonly ProtoId<ShaderPrototype> Shader = "Stealth";
|
||||
|
||||
[Dependency] private IPrototypeManager _protoMan = default!;
|
||||
[Dependency] private SharedTransformSystem _transformSystem = default!;
|
||||
[Dependency] private SpriteSystem _sprite = default!;
|
||||
|
||||
|
|
@ -22,7 +20,7 @@ public sealed partial class StealthSystem : SharedStealthSystem
|
|||
{
|
||||
base.Initialize();
|
||||
|
||||
_shader = _protoMan.Index(Shader).InstanceUnique();
|
||||
_shader = ProtoMan.Index(Shader).InstanceUnique();
|
||||
|
||||
SubscribeLocalEvent<StealthComponent, ComponentShutdown>(OnShutdown);
|
||||
SubscribeLocalEvent<StealthComponent, ComponentStartup>(OnStartup);
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
using Content.Shared.SprayPainter.Prototypes;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Storage.Visualizers;
|
||||
|
||||
public sealed partial class EntityStorageVisualizerSystem : VisualizerSystem<EntityStorageVisualsComponent>
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private IComponentFactory _componentFactory = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
|
@ -42,13 +38,13 @@ public sealed partial class EntityStorageVisualizerSystem : VisualizerSystem<Ent
|
|||
var forceRedrawBase = false;
|
||||
if (AppearanceSystem.TryGetData<string>(uid, PaintableVisuals.Prototype, out var prototype, args.Component))
|
||||
{
|
||||
if (_prototypeManager.Resolve(prototype, out var proto))
|
||||
if (ProtoMan.Resolve(prototype, out var proto))
|
||||
{
|
||||
if (proto.TryGetComponent(out SpriteComponent? sprite, _componentFactory))
|
||||
if (proto.TryComp(out SpriteComponent? sprite, Factory))
|
||||
{
|
||||
SpriteSystem.SetBaseRsi((uid, args.Sprite), sprite.BaseRSI);
|
||||
}
|
||||
if (proto.TryGetComponent(out EntityStorageVisualsComponent? visuals, _componentFactory))
|
||||
if (proto.TryComp(out EntityStorageVisualsComponent? visuals, Factory))
|
||||
{
|
||||
comp.StateBaseOpen = visuals.StateBaseOpen;
|
||||
comp.StateBaseClosed = visuals.StateBaseClosed;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public sealed class SurveillanceCameraMonitorBoundUserInterface : BoundUserInter
|
|||
_window.CameraDisconnect += OnCameraDisconnect;
|
||||
|
||||
var xform = EntMan.GetComponent<TransformComponent>(Owner);
|
||||
var gridUid = xform.GridUid ?? xform.MapUid;
|
||||
var gridUid = xform.GridUid;
|
||||
|
||||
if (gridUid is not null)
|
||||
_window?.SetMap(gridUid.Value);
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ public sealed partial class SurveillanceCameraMonitorWindow : DefaultWindow
|
|||
[Dependency] private IPrototypeManager _prototypeManager = default!;
|
||||
[Dependency] private IResourceCache _resourceCache = default!;
|
||||
[Dependency] private IEntityManager _entityManager = default!;
|
||||
[Dependency] private IEntityNetworkManager _entityNetManager = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Triggered when a camera is selected.
|
||||
|
|
@ -224,6 +225,6 @@ public sealed partial class SurveillanceCameraMonitorWindow : DefaultWindow
|
|||
if (!string.IsNullOrEmpty(marker.Address))
|
||||
CameraSelected?.Invoke(marker.Address, marker.Subnet);
|
||||
else
|
||||
_entityManager.RaisePredictiveEvent(new RequestCameraMarkerUpdateMessage(netEntity));
|
||||
_entityNetManager.SendSystemNetworkMessage(new RequestCameraMarkerUpdateMessage(netEntity));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public sealed partial class SurveillanceCameraNavMapControl : NavMapControl
|
|||
private readonly Texture _invalidTexture;
|
||||
|
||||
private string _activeCameraAddress = string.Empty;
|
||||
private HashSet<string> _availableSubnets = new();
|
||||
private HashSet<string> _availableSubnets = [];
|
||||
private (Dictionary<NetEntity, CameraMarker> Cameras, string ActiveAddress, HashSet<string> AvailableSubnets) _lastState;
|
||||
|
||||
public bool EnableCameraSelection { get; set; }
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ public sealed partial class ChatUIController : IOnSystemChanged<CharacterInfoSys
|
|||
[Dependency] private ILocalizationManager _loc = default!;
|
||||
[UISystemDependency] private readonly CharacterInfoSystem _characterInfo = default!;
|
||||
|
||||
private string _chatSpeechDoubleQuoteBegin = default!;
|
||||
|
||||
private static readonly Regex StartDoubleQuote = new("\"$");
|
||||
private static readonly Regex EndDoubleQuote = new("^\"|(?<=^@)\"");
|
||||
private static readonly Regex StartAtSign = new("^@");
|
||||
|
|
@ -53,6 +55,8 @@ public sealed partial class ChatUIController : IOnSystemChanged<CharacterInfoSys
|
|||
{
|
||||
UpdateHighlights(highlights, true);
|
||||
}
|
||||
|
||||
_chatSpeechDoubleQuoteBegin = _loc.GetString("chat-manager-speech-double-quote-begin");
|
||||
}
|
||||
|
||||
public void OnSystemLoaded(CharacterInfoSystem system)
|
||||
|
|
@ -120,7 +124,8 @@ public sealed partial class ChatUIController : IOnSystemChanged<CharacterInfoSys
|
|||
|
||||
// Make sure the character's name is highlighted only when mentioned directly (eg. it's said by someone),
|
||||
// for example in 'Name Surname says, "..."' 'Name Surname' won't be highlighted.
|
||||
keyword = StartAtSign.Replace(keyword, @"(?<=(?<=^.?OOC:.*:.*)|(?<=,.*"".*)|(?<=\n.*))");
|
||||
keyword = StartAtSign.Replace(keyword,
|
||||
$"(?<=(?<=^.?OOC:.*:.*)|(?<=,.*{_chatSpeechDoubleQuoteBegin}.*)|(?<=\\n.*))");
|
||||
|
||||
_highlights.Add(keyword);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -287,25 +287,30 @@ public sealed partial class InventoryUIController : UIController, IOnStateEntere
|
|||
return;
|
||||
}
|
||||
|
||||
if (args.Function == ContentKeyFunctions.ExamineEntity)
|
||||
switch (args.Function)
|
||||
{
|
||||
_inventorySystem.UIInventoryExamine(slot, _playerUid.Value);
|
||||
}
|
||||
else if (args.Function == EngineKeyFunctions.UseSecondary)
|
||||
{
|
||||
_inventorySystem.UIInventoryOpenContextMenu(slot, _playerUid.Value);
|
||||
}
|
||||
else if (args.Function == ContentKeyFunctions.ActivateItemInWorld)
|
||||
{
|
||||
_inventorySystem.UIInventoryActivateItem(slot, _playerUid.Value);
|
||||
}
|
||||
else if (args.Function == ContentKeyFunctions.AltActivateItemInWorld)
|
||||
{
|
||||
_inventorySystem.UIInventoryAltActivateItem(slot, _playerUid.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
case var _ when args.Function == ContentKeyFunctions.ExamineEntity:
|
||||
_inventorySystem.UIInventoryExamine(slot, _playerUid.Value);
|
||||
break;
|
||||
|
||||
case var _ when args.Function == EngineKeyFunctions.UseSecondary:
|
||||
_inventorySystem.UIInventoryOpenContextMenu(slot, _playerUid.Value);
|
||||
break;
|
||||
|
||||
case var _ when args.Function == ContentKeyFunctions.ActivateItemInWorld:
|
||||
_inventorySystem.UIInventoryActivateItem(slot, _playerUid.Value);
|
||||
break;
|
||||
|
||||
case var _ when args.Function == ContentKeyFunctions.AltActivateItemInWorld:
|
||||
_inventorySystem.UIInventoryAltActivateItem(slot, _playerUid.Value);
|
||||
break;
|
||||
|
||||
case var _ when args.Function == ContentKeyFunctions.Point:
|
||||
_inventorySystem.UIInventoryPointAt(slot, _playerUid.Value);
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
args.Handle();
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ using Content.Client.Verbs.UI;
|
|||
using Content.Shared.CCVar;
|
||||
using Content.Shared.Input;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Pointing;
|
||||
using Content.Shared.Storage;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.Input;
|
||||
|
|
@ -42,6 +43,7 @@ public sealed partial class StorageUIController : UIController, IOnSystemChanged
|
|||
[Dependency] private CloseRecentWindowUIController _closeRecentWindowUIController = default!;
|
||||
[UISystemDependency] private readonly StorageSystem _storage = default!;
|
||||
[UISystemDependency] private readonly UserInterfaceSystem _ui = default!;
|
||||
[UISystemDependency] private readonly Pointing.PointingSystem _pointing = default!;
|
||||
|
||||
private readonly DragDropHelper<ItemGridPiece> _menuDragHelper;
|
||||
|
||||
|
|
@ -282,6 +284,11 @@ public sealed partial class StorageUIController : UIController, IOnSystemChanged
|
|||
EntityManager.RaisePredictiveEvent(new InteractInventorySlotEvent(EntityManager.GetNetEntity(control.Entity), altInteract: true));
|
||||
args.Handle();
|
||||
}
|
||||
else if (args.Function == ContentKeyFunctions.Point)
|
||||
{
|
||||
_pointing.TryPointAtEntity(EntityManager.GetNetEntity(control.Entity));
|
||||
args.Handle();
|
||||
}
|
||||
|
||||
window.FlagDirty();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem
|
|||
|
||||
EntityCoordinates coordinates;
|
||||
|
||||
if (MapManager.TryFindGridAt(mousePos, out var gridUid, out _))
|
||||
if (Maps.TryFindGridAt(mousePos, out var gridUid, out _))
|
||||
{
|
||||
coordinates = TransformSystem.ToCoordinates(gridUid, mousePos);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ public sealed partial class TetherGunSystem : SharedTetherGunSystem
|
|||
[Dependency] private IEyeManager _eyeManager = default!;
|
||||
[Dependency] private IGameTiming _timing = default!;
|
||||
[Dependency] private IInputManager _input = default!;
|
||||
[Dependency] private IMapManager _mapManager = default!;
|
||||
[Dependency] private IOverlayManager _overlay = default!;
|
||||
[Dependency] private IPlayerManager _player = default!;
|
||||
[Dependency] private MapSystem _mapSystem = default!;
|
||||
|
|
@ -73,7 +72,7 @@ public sealed partial class TetherGunSystem : SharedTetherGunSystem
|
|||
|
||||
EntityCoordinates coords;
|
||||
|
||||
if (_mapManager.TryFindGridAt(mouseWorldPos, out var gridUid, out _))
|
||||
if (_mapSystem.TryFindGridAt(mouseWorldPos, out var gridUid, out _))
|
||||
{
|
||||
coords = TransformSystem.ToCoordinates(gridUid, mouseWorldPos);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,13 @@
|
|||
using System.Linq;
|
||||
using Content.Shared.Body;
|
||||
using Content.Shared.Ghost;
|
||||
using Content.Shared.StatusIcon;
|
||||
using Content.Shared.StatusIcon.Components;
|
||||
using Content.Shared.Zombies;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.Zombies;
|
||||
|
||||
public sealed partial class ZombieSystem : SharedZombieSystem
|
||||
{
|
||||
[Dependency] private IPrototypeManager _prototype = default!;
|
||||
[Dependency] private SpriteSystem _sprite = default!;
|
||||
|
||||
public override void Initialize()
|
||||
|
|
@ -25,7 +21,7 @@ public sealed partial class ZombieSystem : SharedZombieSystem
|
|||
|
||||
private void GetZombieIcon(Entity<ZombieComponent> ent, ref GetStatusIconsEvent args)
|
||||
{
|
||||
var iconPrototype = _prototype.Index(ent.Comp.StatusIcon);
|
||||
var iconPrototype = ProtoMan.Index(ent.Comp.StatusIcon);
|
||||
args.StatusIcons.Add(iconPrototype);
|
||||
}
|
||||
|
||||
|
|
@ -34,7 +30,7 @@ public sealed partial class ZombieSystem : SharedZombieSystem
|
|||
if (HasComp<ZombieComponent>(ent))
|
||||
return;
|
||||
|
||||
var iconPrototype = _prototype.Index(ent.Comp.StatusIcon);
|
||||
var iconPrototype = ProtoMan.Index(ent.Comp.StatusIcon);
|
||||
args.StatusIcons.Add(iconPrototype);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public sealed class RetractableItemActionTest : InteractionTest
|
|||
var armBladeActionProto = ProtoMan.Index(ArmBladeActionProtoId);
|
||||
|
||||
// Find the component
|
||||
Assert.That(armBladeActionProto.TryGetComponent<RetractableItemActionComponent>(out var actionComp, SEntMan.ComponentFactory));
|
||||
Assert.That(armBladeActionProto.TryComp<RetractableItemActionComponent>(out var actionComp, SEntMan.ComponentFactory));
|
||||
// Get the item protoId from the component
|
||||
var spawnedProtoId = actionComp!.SpawnedPrototype;
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public sealed class GasArrayTest : GameTest
|
|||
var gasTank = prototypeManager.Index(GasTankTestDummyId);
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(gasTank.TryGetComponent<GasTankComponent>(out var gasTankComponent, compFactory));
|
||||
Assert.That(gasTank.TryComp<GasTankComponent>(out var gasTankComponent, compFactory));
|
||||
|
||||
Assert.That(gasTankComponent!.Air.GetMoles(Gas.Oxygen), Is.EqualTo(10));
|
||||
Assert.That(gasTankComponent!.Air.GetMoles(Gas.Frezon), Is.EqualTo(20));
|
||||
|
|
@ -67,7 +67,7 @@ public sealed class GasArrayTest : GameTest
|
|||
var legacyGasTank = prototypeManager.Index(GasTankLegacyTestDummyId);
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(legacyGasTank.TryGetComponent<GasTankComponent>(out var gasTankComponent, compFactory));
|
||||
Assert.That(legacyGasTank.TryComp<GasTankComponent>(out var gasTankComponent, compFactory));
|
||||
|
||||
Assert.That(gasTankComponent!.Air.GetMoles(3), Is.EqualTo(10));
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ public sealed class CargoTest : GameTest
|
|||
foreach (var (proto, staticPriceComp) in protoIds)
|
||||
{
|
||||
if (
|
||||
proto.TryGetComponent<StackPriceComponent>(out var stackPriceComp, _sCompFact)
|
||||
proto.TryComp<StackPriceComponent>(out var stackPriceComp, _sCompFact)
|
||||
&& stackPriceComp.Price > 0
|
||||
)
|
||||
{
|
||||
|
|
@ -243,7 +243,7 @@ public sealed class CargoTest : GameTest
|
|||
foreach (var (proto, comp) in Pair.GetPrototypesWithComponent<MobPriceComponent>())
|
||||
{
|
||||
Assert.That(
|
||||
proto.TryGetComponent<MobStateComponent>(out _, _sCompFact),
|
||||
proto.TryComp<MobStateComponent>(out _, _sCompFact),
|
||||
$"Found {nameof(MobPriceComponent)} on {proto.ID}, but no {nameof(MobStateComponent)}!"
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue