Various UI warnings cleanup (#36169)

* Various UI warnings cleanup

* Revert unnecessary change

* Redoing SpriteSystem as it's non-injectable

* Missed one

* Better entity instantiation

* General cleanup of warnings changes

* Wrong class name!
This commit is contained in:
J
2025-04-10 10:47:05 +00:00
committed by GitHub
parent 48004bfad7
commit 3c307f3b36
21 changed files with 54 additions and 45 deletions

View File

@@ -8,8 +8,6 @@ using JetBrains.Annotations;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;
using Robust.Shared;
using Robust.Shared.Configuration;
using Robust.Shared.Console; using Robust.Shared.Console;
namespace Content.Client.Changelog namespace Content.Client.Changelog
@@ -19,7 +17,6 @@ namespace Content.Client.Changelog
{ {
[Dependency] private readonly ChangelogManager _changelog = default!; [Dependency] private readonly ChangelogManager _changelog = default!;
[Dependency] private readonly IClientAdminManager _adminManager = default!; [Dependency] private readonly IClientAdminManager _adminManager = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
public ChangelogWindow() public ChangelogWindow()
{ {

View File

@@ -1,4 +1,4 @@
using Content.Shared.Chasm; using Content.Shared.Chasm;
using Robust.Client.Animations; using Robust.Client.Animations;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
using Robust.Shared.Animations; using Robust.Shared.Animations;
@@ -32,7 +32,9 @@ public sealed class ChasmFallingVisualsSystem : EntitySystem
component.OriginalScale = sprite.Scale; component.OriginalScale = sprite.Scale;
var player = EnsureComp<AnimationPlayerComponent>(uid); if (!TryComp<AnimationPlayerComponent>(uid, out var player))
return;
if (_anim.HasRunningAnimation(player, _chasmFallAnimationKey)) if (_anim.HasRunningAnimation(player, _chasmFallAnimationKey))
return; return;
@@ -44,11 +46,13 @@ public sealed class ChasmFallingVisualsSystem : EntitySystem
if (!TryComp<SpriteComponent>(uid, out var sprite)) if (!TryComp<SpriteComponent>(uid, out var sprite))
return; return;
var player = EnsureComp<AnimationPlayerComponent>(uid);
if (_anim.HasRunningAnimation(player, _chasmFallAnimationKey))
_anim.Stop(player, _chasmFallAnimationKey);
sprite.Scale = component.OriginalScale; sprite.Scale = component.OriginalScale;
if (!TryComp<AnimationPlayerComponent>(uid, out var player))
return;
if (_anim.HasRunningAnimation(player, _chasmFallAnimationKey))
_anim.Stop((uid, player), _chasmFallAnimationKey);
} }
private Animation GetFallingAnimation(ChasmFallingComponent component) private Animation GetFallingAnimation(ChasmFallingComponent component)

View File

@@ -125,7 +125,7 @@ namespace Content.Client.Chat.UI
_verticalOffsetAchieved = MathHelper.Lerp(_verticalOffsetAchieved, VerticalOffset, 10 * args.DeltaSeconds); _verticalOffsetAchieved = MathHelper.Lerp(_verticalOffsetAchieved, VerticalOffset, 10 * args.DeltaSeconds);
} }
if (!_entityManager.TryGetComponent<TransformComponent>(_senderEntity, out var xform) || xform.MapID != _eyeManager.CurrentMap) if (!_entityManager.TryGetComponent<TransformComponent>(_senderEntity, out var xform) || xform.MapID != _eyeManager.CurrentEye.Position.MapId)
{ {
Modulate = Color.White.WithAlpha(0); Modulate = Color.White.WithAlpha(0);
return; return;

View File

@@ -1,4 +1,4 @@
using System.Globalization; using System.Globalization;
using Content.Client.UserInterface.Controls; using Content.Client.UserInterface.Controls;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
@@ -91,7 +91,7 @@ namespace Content.Client.Communications.UI
if (alerts == null) if (alerts == null)
{ {
var name = currentAlert; var name = currentAlert;
if (Loc.TryGetString($"alert-level-{currentAlert}", out var locName)) if (_loc.TryGetString($"alert-level-{currentAlert}", out var locName))
{ {
name = locName; name = locName;
} }
@@ -103,7 +103,7 @@ namespace Content.Client.Communications.UI
foreach (var alert in alerts) foreach (var alert in alerts)
{ {
var name = alert; var name = alert;
if (Loc.TryGetString($"alert-level-{alert}", out var locName)) if (_loc.TryGetString($"alert-level-{alert}", out var locName))
{ {
name = locName; name = locName;
} }

View File

@@ -111,7 +111,7 @@ public sealed class DecalPlacementSystem : EntitySystem
if (args.Handled) if (args.Handled)
return; return;
if (args.Target.GetGridUid(EntityManager) == null) if (_transform.GetGrid(args.Target) == null)
return; return;
args.Handled = true; args.Handled = true;

View File

@@ -2,6 +2,7 @@ using System.Linq;
using Content.Client.Stylesheets; using Content.Client.Stylesheets;
using Content.Shared.Decals; using Content.Shared.Decals;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.Graphics; using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.CustomControls;
@@ -19,6 +20,7 @@ public sealed partial class DecalPlacerWindow : DefaultWindow
[Dependency] private readonly IEntityManager _e = default!; [Dependency] private readonly IEntityManager _e = default!;
private readonly DecalPlacementSystem _decalPlacementSystem; private readonly DecalPlacementSystem _decalPlacementSystem;
private readonly SpriteSystem _sprite;
public FloatSpinBox RotationSpinBox; public FloatSpinBox RotationSpinBox;
@@ -41,6 +43,7 @@ public sealed partial class DecalPlacerWindow : DefaultWindow
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
_decalPlacementSystem = _e.System<DecalPlacementSystem>(); _decalPlacementSystem = _e.System<DecalPlacementSystem>();
_sprite = _e.System<SpriteSystem>();
// This needs to be done in C# so we can have custom stuff passed in the constructor // This needs to be done in C# so we can have custom stuff passed in the constructor
// and thus have a proper step size // and thus have a proper step size
@@ -204,7 +207,7 @@ public sealed partial class DecalPlacerWindow : DefaultWindow
foreach (var decalPrototype in prototypes) foreach (var decalPrototype in prototypes)
{ {
if (decalPrototype.ShowMenu) if (decalPrototype.ShowMenu)
_decals.Add(decalPrototype.ID, decalPrototype.Sprite.Frame0()); _decals.Add(decalPrototype.ID, _sprite.Frame0(decalPrototype.Sprite));
} }
RefreshList(); RefreshList();

View File

@@ -10,10 +10,7 @@ using Content.Shared.Tag;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using Robust.Client.GameObjects; using Robust.Client.GameObjects;
using Robust.Client.Player; using Robust.Client.Player;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Timing; using Robust.Shared.Timing;
using Robust.Shared.Utility; using Robust.Shared.Utility;
@@ -27,7 +24,6 @@ public sealed class GuidebookSystem : EntitySystem
{ {
[Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
[Dependency] private readonly VerbSystem _verbSystem = default!; [Dependency] private readonly VerbSystem _verbSystem = default!;
[Dependency] private readonly RgbLightControllerSystem _rgbLightControllerSystem = default!; [Dependency] private readonly RgbLightControllerSystem _rgbLightControllerSystem = default!;
[Dependency] private readonly SharedPointLightSystem _pointLightSystem = default!; [Dependency] private readonly SharedPointLightSystem _pointLightSystem = default!;

View File

@@ -1,6 +1,5 @@
using Content.Shared.Holopad; using Content.Shared.Holopad;
using Content.Shared.Silicons.StationAi; using Content.Shared.Silicons.StationAi;
using Robust.Client.Graphics;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Shared.Player; using Robust.Shared.Player;
using System.Numerics; using System.Numerics;
@@ -10,7 +9,6 @@ namespace Content.Client.Holopad;
public sealed class HolopadBoundUserInterface : BoundUserInterface public sealed class HolopadBoundUserInterface : BoundUserInterface
{ {
[Dependency] private readonly ISharedPlayerManager _playerManager = default!; [Dependency] private readonly ISharedPlayerManager _playerManager = default!;
[Dependency] private readonly IClyde _displayManager = default!;
[ViewVariables] [ViewVariables]
private HolopadWindow? _window; private HolopadWindow? _window;

View File

@@ -3,6 +3,7 @@ using Content.Shared.Humanoid;
using Content.Shared.Humanoid.Markings; using Content.Shared.Humanoid.Markings;
using Content.Shared.Humanoid.Prototypes; using Content.Shared.Humanoid.Prototypes;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;
@@ -18,6 +19,9 @@ public sealed partial class MarkingPicker : Control
{ {
[Dependency] private readonly MarkingManager _markingManager = default!; [Dependency] private readonly MarkingManager _markingManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
private readonly SpriteSystem _sprite;
public Action<MarkingSet>? OnMarkingAdded; public Action<MarkingSet>? OnMarkingAdded;
public Action<MarkingSet>? OnMarkingRemoved; public Action<MarkingSet>? OnMarkingRemoved;
@@ -124,6 +128,8 @@ public sealed partial class MarkingPicker : Control
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
_sprite = _entityManager.System<SpriteSystem>();
CMarkingCategoryButton.OnItemSelected += OnCategoryChange; CMarkingCategoryButton.OnItemSelected += OnCategoryChange;
CMarkingsUnused.OnItemSelected += item => CMarkingsUnused.OnItemSelected += item =>
_selectedUnusedMarking = CMarkingsUnused[item.ItemIndex]; _selectedUnusedMarking = CMarkingsUnused[item.ItemIndex];
@@ -222,7 +228,7 @@ public sealed partial class MarkingPicker : Control
continue; continue;
} }
var item = CMarkingsUnused.AddItem($"{GetMarkingName(marking)}", marking.Sprites[0].Frame0()); var item = CMarkingsUnused.AddItem($"{GetMarkingName(marking)}", _sprite.Frame0(marking.Sprites[0]));
item.Metadata = marking; item.Metadata = marking;
} }
@@ -256,7 +262,7 @@ public sealed partial class MarkingPicker : Control
var _item = new ItemList.Item(CMarkingsUsed) var _item = new ItemList.Item(CMarkingsUsed)
{ {
Text = text, Text = text,
Icon = newMarking.Sprites[0].Frame0(), Icon = _sprite.Frame0(newMarking.Sprites[0]),
Selectable = true, Selectable = true,
Metadata = newMarking, Metadata = newMarking,
IconModulate = marking.MarkingColors[0] IconModulate = marking.MarkingColors[0]
@@ -512,7 +518,7 @@ public sealed partial class MarkingPicker : Control
var item = new ItemList.Item(CMarkingsUsed) var item = new ItemList.Item(CMarkingsUsed)
{ {
Text = Loc.GetString("marking-used", ("marking-name", $"{GetMarkingName(marking)}"), ("marking-category", Loc.GetString($"markings-category-{marking.MarkingCategory}"))), Text = Loc.GetString("marking-used", ("marking-name", $"{GetMarkingName(marking)}"), ("marking-category", Loc.GetString($"markings-category-{marking.MarkingCategory}"))),
Icon = marking.Sprites[0].Frame0(), Icon = _sprite.Frame0(marking.Sprites[0]),
Selectable = true, Selectable = true,
Metadata = marking, Metadata = marking,
}; };
@@ -536,7 +542,7 @@ public sealed partial class MarkingPicker : Control
if (marking.MarkingCategory == _selectedMarkingCategory) if (marking.MarkingCategory == _selectedMarkingCategory)
{ {
var item = CMarkingsUnused.AddItem($"{GetMarkingName(marking)}", marking.Sprites[0].Frame0()); var item = CMarkingsUnused.AddItem($"{GetMarkingName(marking)}", _sprite.Frame0(marking.Sprites[0]));
item.Metadata = marking; item.Metadata = marking;
} }
_selectedMarking = null; _selectedMarking = null;

View File

@@ -1,6 +1,7 @@
using System.Linq; using System.Linq;
using Content.Shared.Humanoid.Markings; using Content.Shared.Humanoid.Markings;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;
using Robust.Client.Utility; using Robust.Client.Utility;
@@ -11,6 +12,9 @@ namespace Content.Client.Humanoid;
public sealed partial class SingleMarkingPicker : BoxContainer public sealed partial class SingleMarkingPicker : BoxContainer
{ {
[Dependency] private readonly MarkingManager _markingManager = default!; [Dependency] private readonly MarkingManager _markingManager = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
private readonly SpriteSystem _sprite;
/// <summary> /// <summary>
/// What happens if a marking is selected. /// What happens if a marking is selected.
@@ -123,6 +127,7 @@ public sealed partial class SingleMarkingPicker : BoxContainer
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
_sprite = _entityManager.System<SpriteSystem>();
MarkingList.OnItemSelected += SelectMarking; MarkingList.OnItemSelected += SelectMarking;
AddButton.OnPressed += _ => AddButton.OnPressed += _ =>
{ {
@@ -188,7 +193,7 @@ public sealed partial class SingleMarkingPicker : BoxContainer
foreach (var (id, marking) in sortedMarkings) foreach (var (id, marking) in sortedMarkings)
{ {
var item = MarkingList.AddItem(Loc.GetString($"marking-{id}"), marking.Sprites[0].Frame0()); var item = MarkingList.AddItem(Loc.GetString($"marking-{id}"), _sprite.Frame0(marking.Sprites[0]));
item.Metadata = marking.ID; item.Metadata = marking.ID;
if (_markings[Slot].MarkingId == id) if (_markings[Slot].MarkingId == id)

View File

@@ -1,13 +1,10 @@
using Content.Shared.Implants; using Content.Shared.Implants;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Shared.Prototypes;
namespace Content.Client.Implants.UI; namespace Content.Client.Implants.UI;
public sealed class DeimplantBoundUserInterface : BoundUserInterface public sealed class DeimplantBoundUserInterface : BoundUserInterface
{ {
[Dependency] private readonly IPrototypeManager _protomanager = default!;
[ViewVariables] [ViewVariables]
private DeimplantChoiceWindow? _window; private DeimplantChoiceWindow? _window;

View File

@@ -31,7 +31,7 @@ namespace Content.Client.Jittering
var animationPlayer = EnsureComp<AnimationPlayerComponent>(uid); var animationPlayer = EnsureComp<AnimationPlayerComponent>(uid);
jittering.StartOffset = sprite.Offset; jittering.StartOffset = sprite.Offset;
_animationPlayer.Play(uid, animationPlayer, GetAnimation(jittering, sprite), _jitterAnimationKey); _animationPlayer.Play((uid, animationPlayer), GetAnimation(jittering, sprite), _jitterAnimationKey);
} }
private void OnShutdown(EntityUid uid, JitteringComponent jittering, ComponentShutdown args) private void OnShutdown(EntityUid uid, JitteringComponent jittering, ComponentShutdown args)
@@ -53,7 +53,7 @@ namespace Content.Client.Jittering
if (TryComp(uid, out AnimationPlayerComponent? animationPlayer) if (TryComp(uid, out AnimationPlayerComponent? animationPlayer)
&& TryComp(uid, out SpriteComponent? sprite)) && TryComp(uid, out SpriteComponent? sprite))
_animationPlayer.Play(uid, animationPlayer, GetAnimation(jittering, sprite), _jitterAnimationKey); _animationPlayer.Play((uid, animationPlayer), GetAnimation(jittering, sprite), _jitterAnimationKey);
} }
private Animation GetAnimation(JitteringComponent jittering, SpriteComponent sprite) private Animation GetAnimation(JitteringComponent jittering, SpriteComponent sprite)

View File

@@ -21,6 +21,7 @@ using Content.Shared.Preferences.Loadouts;
using Content.Shared.Roles; using Content.Shared.Roles;
using Content.Shared.Traits; using Content.Shared.Traits;
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.Graphics; using Robust.Client.Graphics;
using Robust.Client.Player; using Robust.Client.Player;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
@@ -50,6 +51,8 @@ namespace Content.Client.Lobby.UI
private readonly JobRequirementsManager _requirements; private readonly JobRequirementsManager _requirements;
private readonly LobbyUIController _controller; private readonly LobbyUIController _controller;
private readonly SpriteSystem _sprite;
private FlavorText.FlavorText? _flavorText; private FlavorText.FlavorText? _flavorText;
private TextEdit? _flavorTextEdit; private TextEdit? _flavorTextEdit;
@@ -127,7 +130,7 @@ namespace Content.Client.Lobby.UI
_resManager = resManager; _resManager = resManager;
_requirements = requirements; _requirements = requirements;
_controller = UserInterfaceManager.GetUIController<LobbyUIController>(); _controller = UserInterfaceManager.GetUIController<LobbyUIController>();
_sprite = _entManager.System<SpriteSystem>();
ImportButton.OnPressed += args => ImportButton.OnPressed += args =>
{ {
ImportProfile(); ImportProfile();
@@ -906,7 +909,7 @@ namespace Content.Client.Lobby.UI
VerticalAlignment = VAlignment.Center VerticalAlignment = VAlignment.Center
}; };
var jobIcon = _prototypeManager.Index(job.Icon); var jobIcon = _prototypeManager.Index(job.Icon);
icon.Texture = jobIcon.Icon.Frame0(); icon.Texture = _sprite.Frame0(jobIcon.Icon);
selector.Setup(items, job.LocalizedName, 200, job.LocalizedDescription, icon, job.Guides); selector.Setup(items, job.LocalizedName, 200, job.LocalizedDescription, icon, job.Guides);
if (!_requirements.IsAllowed(job, (HumanoidCharacterProfile?)_preferencesManager.Preferences?.SelectedCharacter, out var reason)) if (!_requirements.IsAllowed(job, (HumanoidCharacterProfile?)_preferencesManager.Preferences?.SelectedCharacter, out var reason))

View File

@@ -132,7 +132,7 @@ public sealed class TargetOutlineSystem : EntitySystem
// TODO: Duplicated in SpriteSystem and DragDropSystem. Should probably be cached somewhere for a frame? // TODO: Duplicated in SpriteSystem and DragDropSystem. Should probably be cached somewhere for a frame?
var mousePos = _eyeManager.PixelToMap(_inputManager.MouseScreenPosition).Position; var mousePos = _eyeManager.PixelToMap(_inputManager.MouseScreenPosition).Position;
var bounds = new Box2(mousePos - LookupVector, mousePos + LookupVector); var bounds = new Box2(mousePos - LookupVector, mousePos + LookupVector);
var pvsEntities = _lookup.GetEntitiesIntersecting(_eyeManager.CurrentMap, bounds, LookupFlags.Approximate | LookupFlags.Static); var pvsEntities = _lookup.GetEntitiesIntersecting(_eyeManager.CurrentEye.Position.MapId, bounds, LookupFlags.Approximate | LookupFlags.Static);
var spriteQuery = GetEntityQuery<SpriteComponent>(); var spriteQuery = GetEntityQuery<SpriteComponent>();
foreach (var entity in pvsEntities) foreach (var entity in pvsEntities)

View File

@@ -1,4 +1,4 @@
using System; using System;
using System.Threading; using System.Threading;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;

View File

@@ -85,7 +85,7 @@ public sealed class PopupOverlay : Overlay
foreach (var popup in _popup.WorldLabels) foreach (var popup in _popup.WorldLabels)
{ {
var mapPos = popup.InitialPos.ToMap(_entManager, _transform); var mapPos = _transform.ToMapCoordinates(popup.InitialPos);
if (mapPos.MapId != args.MapId) if (mapPos.MapId != args.MapId)
continue; continue;

View File

@@ -56,10 +56,10 @@ public sealed class RadiationCollectorSystem : VisualizerSystem<RadiationCollect
switch (targetState) switch (targetState)
{ {
case RadiationCollectorVisualState.Activating: case RadiationCollectorVisualState.Activating:
AnimationSystem.Play(uid, animPlayer, comp.ActivateAnimation, RadiationCollectorComponent.AnimationKey); AnimationSystem.Play((uid, animPlayer), comp.ActivateAnimation, RadiationCollectorComponent.AnimationKey);
break; break;
case RadiationCollectorVisualState.Deactivating: case RadiationCollectorVisualState.Deactivating:
AnimationSystem.Play(uid, animPlayer, comp.DeactiveAnimation, RadiationCollectorComponent.AnimationKey); AnimationSystem.Play((uid, animPlayer), comp.DeactiveAnimation, RadiationCollectorComponent.AnimationKey);
break; break;
case RadiationCollectorVisualState.Active: case RadiationCollectorVisualState.Active:

View File

@@ -11,6 +11,8 @@ namespace Content.Client.SprayPainter.UI;
public sealed partial class SprayPainterWindow : DefaultWindow public sealed partial class SprayPainterWindow : DefaultWindow
{ {
[Dependency] private readonly IEntitySystemManager _sysMan = default!; [Dependency] private readonly IEntitySystemManager _sysMan = default!;
[Dependency] private readonly ILocalizationManager _loc = default!;
private readonly SpriteSystem _spriteSystem; private readonly SpriteSystem _spriteSystem;
public Action<ItemList.ItemListSelectedEventArgs>? OnSpritePicked; public Action<ItemList.ItemListSelectedEventArgs>? OnSpritePicked;
@@ -32,17 +34,17 @@ public sealed partial class SprayPainterWindow : DefaultWindow
_spriteSystem = _sysMan.GetEntitySystem<SpriteSystem>(); _spriteSystem = _sysMan.GetEntitySystem<SpriteSystem>();
} }
private static string GetColorLocString(string? colorKey) private string GetColorLocString(string? colorKey)
{ {
if (string.IsNullOrEmpty(colorKey)) if (string.IsNullOrEmpty(colorKey))
return Loc.GetString("pipe-painter-no-color-selected"); return Loc.GetString("pipe-painter-no-color-selected");
var locKey = colorLocKeyPrefix + colorKey; var locKey = colorLocKeyPrefix + colorKey;
if (!Loc.TryGetString(locKey, out var locString)) if (!_loc.TryGetString(locKey, out var locString))
locString = colorKey; locString = colorKey;
return locString; return locString;
} }
public string? IndexToColorKey(int index) public string? IndexToColorKey(int index)
{ {

View File

@@ -482,7 +482,7 @@ public sealed class ChatUIController : UIController
private void EnqueueSpeechBubble(EntityUid entity, ChatMessage message, SpeechBubble.SpeechType speechType) private void EnqueueSpeechBubble(EntityUid entity, ChatMessage message, SpeechBubble.SpeechType speechType)
{ {
// Don't enqueue speech bubbles for other maps. TODO: Support multiple viewports/maps? // Don't enqueue speech bubbles for other maps. TODO: Support multiple viewports/maps?
if (EntityManager.GetComponent<TransformComponent>(entity).MapID != _eye.CurrentMap) if (EntityManager.GetComponent<TransformComponent>(entity).MapID != _eye.CurrentEye.Position.MapId)
return; return;
if (!_queuedSpeechBubbles.TryGetValue(entity, out var queueData)) if (!_queuedSpeechBubbles.TryGetValue(entity, out var queueData))

View File

@@ -1,4 +1,4 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Linq; using System.Linq;
using System.Numerics; using System.Numerics;
using Content.Client.Hands.Systems; using Content.Client.Hands.Systems;

View File

@@ -3,7 +3,6 @@ using Content.Client.UserInterface.Systems.Gameplay;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Robust.Client.Graphics; using Robust.Client.Graphics;
using Robust.Client.Player; using Robust.Client.Player;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controllers; using Robust.Client.UserInterface.Controllers;
using Robust.Shared.Configuration; using Robust.Shared.Configuration;
using Robust.Shared.Map; using Robust.Shared.Map;
@@ -17,7 +16,6 @@ public sealed class ViewportUIController : UIController
[Dependency] private readonly IPlayerManager _playerMan = default!; [Dependency] private readonly IPlayerManager _playerMan = default!;
[Dependency] private readonly IEntityManager _entMan = default!; [Dependency] private readonly IEntityManager _entMan = default!;
[Dependency] private readonly IConfigurationManager _configurationManager = default!; [Dependency] private readonly IConfigurationManager _configurationManager = default!;
[UISystemDependency] private readonly SharedTransformSystem? _transformSystem = default!;
public static readonly Vector2i ViewportSize = (EyeManager.PixelsPerMeter * 21, EyeManager.PixelsPerMeter * 15); public static readonly Vector2i ViewportSize = (EyeManager.PixelsPerMeter * 21, EyeManager.PixelsPerMeter * 15);
public const int ViewportHeight = 15; public const int ViewportHeight = 15;
private MainViewport? Viewport => UIManager.ActiveScreen?.GetWidget<MainViewport>(); private MainViewport? Viewport => UIManager.ActiveScreen?.GetWidget<MainViewport>();