diff --git a/.envrc b/.envrc index 5def8fd66a2..7fd05db3e5e 100644 --- a/.envrc +++ b/.envrc @@ -1,4 +1,4 @@ -if ! has nix_direnv_version || ! nix_direnv_version 2.3.0; then - source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.3.0/direnvrc" "sha256-Dmd+j63L84wuzgyjITIfSxSD57Tx7v51DMxVZOsiUD8=" +if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4=" fi use flake diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index a17bc489d88..ae01b64c763 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,7 +3,7 @@ /Content.*/ @DebugOk /Content.*/SimpleStation14/ @DEATHB4DEFEAT -/Resources/ @DebugOk @Colin-Tel +/Resources/ @DebugOk /Resources/ConfigPresets/ @DebugOk /Resources/*.yml @DebugOk /Resources/*/SimpleStation14/ @DEATHB4DEFEAT @@ -14,3 +14,6 @@ /Resources/Prototypes/Maps/ @IamVelcroboy /Tools/ @DebugOk + +/* @DebugOk # Standalone files in root, shouldn't apply to subdirectories +/.github/ @DebugOk # Workflows, codeowners, templates, etc diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4ba70f3504c..74a975be5c6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -67,7 +67,7 @@ jobs: username: ${{ secrets.PUBLISH_USER }} key: ${{ secrets.PUBLISH_KEY }} port: ${{ secrets.PUBLISH_PORT }} - script: /home/${{ secrets.PUBLISH_USER }}/publish/push.ps1 ${{ github.sha }} + script: /home/deltav/publish/push.ps1 ${{ github.sha }} - name: Publish changelog (Discord) run: Tools/actions_changelogs_since_last_run.py diff --git a/Content.Benchmarks/ColorInterpolateBenchmark.cs b/Content.Benchmarks/ColorInterpolateBenchmark.cs index 2243bb4819e..eb182328d46 100644 --- a/Content.Benchmarks/ColorInterpolateBenchmark.cs +++ b/Content.Benchmarks/ColorInterpolateBenchmark.cs @@ -131,8 +131,8 @@ public static Color InterpolateSysVector4(Color a, Color b, public static Color InterpolateSysVector4In(in Color endPoint1, in Color endPoint2, float lambda) { - ref var sva = ref Unsafe.As(ref Unsafe.AsRef(endPoint1)); - ref var svb = ref Unsafe.As(ref Unsafe.AsRef(endPoint2)); + ref var sva = ref Unsafe.As(ref Unsafe.AsRef(in endPoint1)); + ref var svb = ref Unsafe.As(ref Unsafe.AsRef(in endPoint2)); var res = SysVector4.Lerp(svb, sva, lambda); @@ -156,8 +156,8 @@ public static Color InterpolateSimd(Color a, Color b, public static Color InterpolateSimdIn(in Color a, in Color b, float lambda) { - var vecA = Unsafe.As>(ref Unsafe.AsRef(a)); - var vecB = Unsafe.As>(ref Unsafe.AsRef(b)); + var vecA = Unsafe.As>(ref Unsafe.AsRef(in a)); + var vecB = Unsafe.As>(ref Unsafe.AsRef(in b)); vecB = Fma.MultiplyAdd(Sse.Subtract(vecB, vecA), Vector128.Create(lambda), vecA); diff --git a/Content.Benchmarks/DeviceNetworkingBenchmark.cs b/Content.Benchmarks/DeviceNetworkingBenchmark.cs index 16805c2684f..bb2a22312ea 100644 --- a/Content.Benchmarks/DeviceNetworkingBenchmark.cs +++ b/Content.Benchmarks/DeviceNetworkingBenchmark.cs @@ -4,8 +4,8 @@ using Content.IntegrationTests; using Content.IntegrationTests.Pair; using Content.IntegrationTests.Tests.DeviceNetwork; -using Content.Server.DeviceNetwork; using Content.Server.DeviceNetwork.Systems; +using Content.Shared.DeviceNetwork; using Robust.Shared; using Robust.Shared.Analyzers; using Robust.Shared.GameObjects; diff --git a/Content.Benchmarks/Program.cs b/Content.Benchmarks/Program.cs index 0beb0a613d5..42a436597d5 100644 --- a/Content.Benchmarks/Program.cs +++ b/Content.Benchmarks/Program.cs @@ -18,11 +18,6 @@ internal static class Program public static void Main(string[] args) { - MainAsync(args).GetAwaiter().GetResult(); - } - - public static async Task MainAsync(string[] args) - { #if DEBUG Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("\nWARNING: YOU ARE RUNNING A DEBUG BUILD, USE A RELEASE BUILD FOR AN ACCURATE BENCHMARK"); diff --git a/Content.Client/Actions/ActionsSystem.cs b/Content.Client/Actions/ActionsSystem.cs index 508f3404bac..31d092b25d1 100644 --- a/Content.Client/Actions/ActionsSystem.cs +++ b/Content.Client/Actions/ActionsSystem.cs @@ -1,6 +1,7 @@ using System.IO; using System.Linq; using Content.Shared.Actions; +using Content.Shared.Mapping; using JetBrains.Annotations; using Robust.Client.Player; using Robust.Shared.ContentPack; @@ -78,10 +79,12 @@ private void OnWorldTargetHandleState(EntityUid uid, WorldTargetActionComponent private void BaseHandleState(EntityUid uid, BaseActionComponent component, BaseActionComponentState state) where T : BaseActionComponent { + // TODO ACTIONS use auto comp states component.Icon = state.Icon; component.IconOn = state.IconOn; component.IconColor = state.IconColor; - component.Keywords = new HashSet(state.Keywords); + component.Keywords.Clear(); + component.Keywords.UnionWith(state.Keywords); component.Enabled = state.Enabled; component.Toggled = state.Toggled; component.Cooldown = state.Cooldown; @@ -101,8 +104,7 @@ private void BaseHandleState(EntityUid uid, BaseActionComponent component, Ba component.ItemIconStyle = state.ItemIconStyle; component.Sound = state.Sound; - if (_playerManager.LocalPlayer?.ControlledEntity == component.AttachedEntity) - ActionsUpdated?.Invoke(); + UpdateAction(uid, component); } protected override void UpdateAction(EntityUid? actionId, BaseActionComponent? action = null) @@ -111,7 +113,7 @@ protected override void UpdateAction(EntityUid? actionId, BaseActionComponent? a return; base.UpdateAction(actionId, action); - if (_playerManager.LocalPlayer?.ControlledEntity != action.AttachedEntity) + if (_playerManager.LocalEntity != action.AttachedEntity) return; ActionsUpdated?.Invoke(); @@ -144,7 +146,7 @@ private void HandleComponentState(EntityUid uid, ActionsComponent component, ref _added.Add((actionId, action)); } - if (_playerManager.LocalPlayer?.ControlledEntity != uid) + if (_playerManager.LocalEntity != uid) return; foreach (var action in _removed) @@ -177,7 +179,7 @@ public static int ActionComparer((EntityUid, BaseActionComponent?) a, (EntityUid protected override void ActionAdded(EntityUid performer, EntityUid actionId, ActionsComponent comp, BaseActionComponent action) { - if (_playerManager.LocalPlayer?.ControlledEntity != performer) + if (_playerManager.LocalEntity != performer) return; OnActionAdded?.Invoke(actionId); @@ -185,7 +187,7 @@ protected override void ActionAdded(EntityUid performer, EntityUid actionId, Act protected override void ActionRemoved(EntityUid performer, EntityUid actionId, ActionsComponent comp, BaseActionComponent action) { - if (_playerManager.LocalPlayer?.ControlledEntity != performer) + if (_playerManager.LocalEntity != performer) return; OnActionRemoved?.Invoke(actionId); @@ -193,7 +195,7 @@ protected override void ActionRemoved(EntityUid performer, EntityUid actionId, A public IEnumerable<(EntityUid Id, BaseActionComponent Comp)> GetClientActions() { - if (_playerManager.LocalPlayer?.ControlledEntity is not { } user) + if (_playerManager.LocalEntity is not { } user) return Enumerable.Empty<(EntityUid, BaseActionComponent)>(); return GetActions(user); @@ -216,7 +218,7 @@ public void UnlinkAllActions() public void LinkAllActions(ActionsComponent? actions = null) { - if (_playerManager.LocalPlayer?.ControlledEntity is not { } user || + if (_playerManager.LocalEntity is not { } user || !Resolve(user, ref actions, false)) { return; @@ -233,7 +235,7 @@ public override void Shutdown() public void TriggerAction(EntityUid actionId, BaseActionComponent action) { - if (_playerManager.LocalPlayer?.ControlledEntity is not { } user || + if (_playerManager.LocalEntity is not { } user || !TryComp(user, out ActionsComponent? actions)) { return; @@ -261,7 +263,7 @@ public void TriggerAction(EntityUid actionId, BaseActionComponent action) /// public void LoadActionAssignments(string path, bool userData) { - if (_playerManager.LocalPlayer?.ControlledEntity is not { } user) + if (_playerManager.LocalEntity is not { } user) return; var file = new ResPath(path).ToRootedPath(); @@ -310,6 +312,70 @@ public void LoadActionAssignments(string path, bool userData) AssignSlot?.Invoke(assignments); } + /// + /// Load actions and their toolbar assignments from a file. + /// DeltaV - Load from an existing yaml stream instead + /// + public void LoadActionAssignments(YamlStream stream) + { + if (_playerManager.LocalEntity is not { } user) + return; + + if (stream.Documents[0].RootNode.ToDataNode() is not SequenceDataNode sequence) + return; + + ClearAssignments?.Invoke(); + + var assignments = new List(); + var existingActions = GetClientActions(); + var existingActionsList = existingActions.ToList(); + + foreach (var entry in sequence.Sequence) + { + if (entry is not MappingDataNode map) + continue; + + if (!map.TryGet("action", out var actionNode)) + continue; + + if (!map.TryGet("name", out var nameNode)) + continue; + + var action = _serialization.Read(actionNode, notNullableOverride: true); + + // Prevent spawning actions multiple times + var existing = existingActionsList.FirstOrNull(a => + Name(a.Id) == nameNode.Value); + + EntityUid actionId; + if (existing == null) + { + actionId = Spawn(null); + AddComp(actionId, action); + _metaData.SetEntityName(actionId, nameNode.Value); + DirtyEntity(actionId); + AddActionDirect(user, actionId); + } + else + { + actionId = existing.Value.Id; + } + + if (!map.TryGet("assignments", out var assignmentNode)) + continue; + + var nodeAssignments = _serialization.Read>(assignmentNode, notNullableOverride: true); + + foreach (var index in nodeAssignments) + { + var assignment = new SlotAssignment(index.Hotbar, index.Slot, actionId); + assignments.Add(assignment); + } + } + + AssignSlot?.Invoke(assignments); + } + public record struct SlotAssignment(byte Hotbar, byte Slot, EntityUid ActionId); } } diff --git a/Content.Client/Administration/Managers/ClientAdminManager.cs b/Content.Client/Administration/Managers/ClientAdminManager.cs index 1a1366c6f2e..d33761be8f2 100644 --- a/Content.Client/Administration/Managers/ClientAdminManager.cs +++ b/Content.Client/Administration/Managers/ClientAdminManager.cs @@ -15,11 +15,13 @@ public sealed class ClientAdminManager : IClientAdminManager, IClientConGroupImp [Dependency] private readonly IClientNetManager _netMgr = default!; [Dependency] private readonly IClientConGroupController _conGroup = default!; [Dependency] private readonly IResourceManager _res = default!; + [Dependency] private readonly ILogManager _logManager = default!; private AdminData? _adminData; private readonly HashSet _availableCommands = new(); private readonly AdminCommandPermissions _localCommandPermissions = new(); + private ISawmill _sawmill = default!; public event Action? AdminStatusUpdated; @@ -92,17 +94,17 @@ private void UpdateMessageRx(MsgUpdateAdminStatus message) } _availableCommands.UnionWith(message.AvailableCommands); - Logger.DebugS("admin", $"Have {message.AvailableCommands.Length} commands available"); + _sawmill.Debug($"Have {message.AvailableCommands.Length} commands available"); _adminData = message.Admin; if (_adminData != null) { var flagsText = string.Join("|", AdminFlagsHelper.FlagsToNames(_adminData.Flags)); - Logger.InfoS("admin", $"Updated admin status: {_adminData.Active}/{_adminData.Title}/{flagsText}"); + _sawmill.Info($"Updated admin status: {_adminData.Active}/{_adminData.Title}/{flagsText}"); } else { - Logger.InfoS("admin", "Updated admin status: Not admin"); + _sawmill.Info("Updated admin status: Not admin"); } AdminStatusUpdated?.Invoke(); @@ -114,18 +116,17 @@ private void UpdateMessageRx(MsgUpdateAdminStatus message) void IPostInjectInit.PostInject() { _conGroup.Implementation = this; + _sawmill = _logManager.GetSawmill("admin"); } public AdminData? GetAdminData(EntityUid uid, bool includeDeAdmin = false) { - return uid == _player.LocalPlayer?.ControlledEntity - ? _adminData - : null; + return uid == _player.LocalEntity ? _adminData : null; } public AdminData? GetAdminData(ICommonSession session, bool includeDeAdmin = false) { - if (_player.LocalPlayer?.UserId == session.UserId) + if (_player.LocalUser == session.UserId) return _adminData; return null; @@ -133,7 +134,7 @@ void IPostInjectInit.PostInject() public AdminData? GetAdminData(bool includeDeAdmin = false) { - if (_player.LocalPlayer is { Session: { } session }) + if (_player.LocalSession is { } session) return GetAdminData(session, includeDeAdmin); return null; diff --git a/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml.cs b/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml.cs index 41c3ac76f98..fdf935d7c04 100644 --- a/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml.cs +++ b/Content.Client/Administration/UI/CustomControls/PlayerListControl.xaml.cs @@ -29,6 +29,8 @@ public sealed partial class PlayerListControl : BoxContainer private IEntityManager _entManager; private IUserInterfaceManager _uiManager; + private PlayerInfo? _selectedPlayer; + public PlayerListControl() { _entManager = IoCManager.Resolve(); @@ -50,10 +52,14 @@ private void PlayerListItemPressed(BaseButton.ButtonEventArgs? args, ListData? d if (args == null || data is not PlayerListData {Info: var selectedPlayer}) return; + if (selectedPlayer == _selectedPlayer) + return; + if (args.Event.Function != EngineKeyFunctions.UIClick) return; OnSelectionChanged?.Invoke(selectedPlayer); + _selectedPlayer = selectedPlayer; // update label text. Only required if there is some override (e.g. unread bwoink count). if (OverrideText != null && args.Button.Children.FirstOrDefault()?.Children?.FirstOrDefault() is Label label) @@ -95,6 +101,8 @@ private void FilterList() _sortedPlayerList.Sort((a, b) => Comparison(a, b)); PlayerListContainer.PopulateList(_sortedPlayerList.Select(info => new PlayerListData(info)).ToList()); + if (_selectedPlayer != null) + PlayerListContainer.Select(new PlayerListData(_selectedPlayer)); } public void PopulateList(IReadOnlyList? players = null) @@ -102,6 +110,9 @@ public void PopulateList(IReadOnlyList? players = null) players ??= _adminSystem.PlayerList; _playerList = players.ToList(); + if (_selectedPlayer != null && !_playerList.Contains(_selectedPlayer)) + _selectedPlayer = null; + FilterList(); } diff --git a/Content.Client/Administration/UI/Notes/AdminNotesLine.xaml.cs b/Content.Client/Administration/UI/Notes/AdminNotesLine.xaml.cs index e70248880b0..ead1d8b00e5 100644 --- a/Content.Client/Administration/UI/Notes/AdminNotesLine.xaml.cs +++ b/Content.Client/Administration/UI/Notes/AdminNotesLine.xaml.cs @@ -68,7 +68,7 @@ private void Refresh() SeverityRect.Texture = _sprites.Frame0(new SpriteSpecifier.Texture(new ResPath(iconPath))); } - TimeLabel.Text = Note.CreatedAt.ToString("yyyy-MM-dd HH:mm:ss"); + TimeLabel.Text = Note.CreatedAt.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"); ServerLabel.Text = Note.ServerName ?? "Unknown"; RoundLabel.Text = Note.Round == null ? "Unknown round" : "Round " + Note.Round; AdminLabel.Text = Note.CreatedByName; @@ -91,7 +91,7 @@ private void Refresh() if (Note.ExpiryTime.Value > DateTime.UtcNow) { ExpiresLabel.Text = Loc.GetString("admin-note-editor-expiry-label-params", - ("date", Note.ExpiryTime.Value.ToString("yyyy-MM-dd HH:mm:ss")), + ("date", Note.ExpiryTime.Value.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")), ("expiresIn", (Note.ExpiryTime.Value - DateTime.UtcNow).ToString("d'd 'hh':'mm"))); ExpiresLabel.Modulate = Color.FromHex("#86DC3D"); } @@ -104,7 +104,7 @@ private void Refresh() if (Note.LastEditedAt > Note.CreatedAt) { - EditedLabel.Text = Loc.GetString("admin-notes-edited", ("author", Note.EditedByName), ("date", Note.LastEditedAt)); + EditedLabel.Text = Loc.GetString("admin-notes-edited", ("author", Note.EditedByName), ("date", Note.LastEditedAt.Value.ToLocalTime())); EditedLabel.Visible = true; } diff --git a/Content.Client/Administration/UI/Notes/AdminNotesLinePopup.xaml.cs b/Content.Client/Administration/UI/Notes/AdminNotesLinePopup.xaml.cs index 5ef29513e24..18a50031582 100644 --- a/Content.Client/Administration/UI/Notes/AdminNotesLinePopup.xaml.cs +++ b/Content.Client/Administration/UI/Notes/AdminNotesLinePopup.xaml.cs @@ -36,12 +36,12 @@ public AdminNotesLinePopup(SharedAdminNote note, string playerName, bool showDel ? Loc.GetString("admin-notes-round-id-unknown") : Loc.GetString("admin-notes-round-id", ("id", note.Round)); CreatedByLabel.Text = Loc.GetString("admin-notes-created-by", ("author", note.CreatedByName)); - CreatedAtLabel.Text = Loc.GetString("admin-notes-created-at", ("date", note.CreatedAt.ToString("yyyy-MM-dd HH:mm:ss"))); + CreatedAtLabel.Text = Loc.GetString("admin-notes-created-at", ("date", note.CreatedAt.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"))); EditedByLabel.Text = Loc.GetString("admin-notes-last-edited-by", ("author", note.EditedByName)); - EditedAtLabel.Text = Loc.GetString("admin-notes-last-edited-at", ("date", note.LastEditedAt?.ToString("yyyy-MM-dd HH:mm:ss") ?? Loc.GetString("admin-notes-edited-never"))); + EditedAtLabel.Text = Loc.GetString("admin-notes-last-edited-at", ("date", note.LastEditedAt?.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss") ?? Loc.GetString("admin-notes-edited-never"))); ExpiryTimeLabel.Text = note.ExpiryTime == null ? Loc.GetString("admin-notes-expires-never") - : Loc.GetString("admin-notes-expires", ("expires", note.ExpiryTime.Value.ToString("yyyy-MM-dd HH:mm:ss"))); + : Loc.GetString("admin-notes-expires", ("expires", note.ExpiryTime.Value.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"))); NoteTextEdit.InsertAtCursor(note.Message); if (note.NoteType is NoteType.ServerBan or NoteType.RoleBan) diff --git a/Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs b/Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs index 77dde4688d2..6f314f79542 100644 --- a/Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs +++ b/Content.Client/Administration/UI/Notes/NoteEdit.xaml.cs @@ -81,7 +81,7 @@ public NoteEdit(SharedAdminNote? note, string playerName, bool canCreate, bool c { PermanentCheckBox.Pressed = false; UpdatePermanentCheckboxFields(); - ExpiryLineEdit.Text = ExpiryTime.Value.ToString("yyyy-MM-dd HH:mm:ss"); + ExpiryLineEdit.Text = ExpiryTime.Value.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss"); } } @@ -173,7 +173,7 @@ private void UpdatePermanentCheckboxFields() ExpiryLabel.Visible = !PermanentCheckBox.Pressed; ExpiryLineEdit.Visible = !PermanentCheckBox.Pressed; - ExpiryLineEdit.Text = !PermanentCheckBox.Pressed ? DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty; + ExpiryLineEdit.Text = !PermanentCheckBox.Pressed ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty; } private void OnSecretPressed(BaseButton.ButtonEventArgs _) @@ -269,7 +269,7 @@ private bool ParseExpiryTime() return false; } - ExpiryTime = result; + ExpiryTime = result.ToUniversalTime(); ExpiryLineEdit.ModulateSelfOverride = null; return true; } diff --git a/Content.Client/Administration/UI/SpawnExplosion/SpawnExplosionWindow.xaml.cs b/Content.Client/Administration/UI/SpawnExplosion/SpawnExplosionWindow.xaml.cs index 04219fe39b0..5f187cad794 100644 --- a/Content.Client/Administration/UI/SpawnExplosion/SpawnExplosionWindow.xaml.cs +++ b/Content.Client/Administration/UI/SpawnExplosion/SpawnExplosionWindow.xaml.cs @@ -99,7 +99,7 @@ private void SetLocation() { UpdateMapOptions(); - if (!_entMan.TryGetComponent(_playerManager.LocalPlayer?.ControlledEntity, out TransformComponent? transform)) + if (!_entMan.TryGetComponent(_playerManager.LocalEntity, out TransformComponent? transform)) return; _pausePreview = true; diff --git a/Content.Client/Administration/UI/Tabs/AdminbusTab/LoadBlueprintsWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AdminbusTab/LoadBlueprintsWindow.xaml.cs index 34611f51aff..97c84e5d2fc 100644 --- a/Content.Client/Administration/UI/Tabs/AdminbusTab/LoadBlueprintsWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AdminbusTab/LoadBlueprintsWindow.xaml.cs @@ -42,7 +42,7 @@ private void Reset() var entManager = IoCManager.Resolve(); var xformSystem = entManager.System(); var playerManager = IoCManager.Resolve(); - var player = playerManager.LocalPlayer?.ControlledEntity; + var player = playerManager.LocalEntity; var currentMap = MapId.Nullspace; var position = Vector2.Zero; diff --git a/Content.Client/Administration/UI/Tabs/AtmosTab/AddAtmosWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AtmosTab/AddAtmosWindow.xaml.cs index 7e2fdda3e25..03fd52f446a 100644 --- a/Content.Client/Administration/UI/Tabs/AtmosTab/AddAtmosWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AtmosTab/AddAtmosWindow.xaml.cs @@ -28,7 +28,7 @@ protected override void EnteredTree() { _data.Clear(); - var player = _players.LocalPlayer?.ControlledEntity; + var player = _players.LocalEntity; var playerGrid = _entities.GetComponentOrNull(player)?.GridUid; var query = IoCManager.Resolve().AllEntityQueryEnumerator(); diff --git a/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs index d273ea3e55a..c06d9161334 100644 --- a/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs @@ -31,7 +31,7 @@ protected override void EnteredTree() while (gridQuery.MoveNext(out var uid, out _)) { _gridData.Add(entManager.GetNetEntity(uid)); - var player = playerManager.LocalPlayer?.ControlledEntity; + var player = playerManager.LocalEntity; var playerGrid = entManager.GetComponentOrNull(player)?.GridUid; GridOptions.AddItem($"{uid} {(playerGrid == uid ? " (Current)" : "")}"); } diff --git a/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs index 276ec3d67df..3353d0873ef 100644 --- a/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs @@ -34,7 +34,7 @@ protected override void EnteredTree() while (gridQuery.MoveNext(out var uid, out _)) { - var player = playerManager.LocalPlayer?.ControlledEntity; + var player = playerManager.LocalEntity; var playerGrid = entManager.GetComponentOrNull(player)?.GridUid; GridOptions.AddItem($"{uid} {(playerGrid == uid ? " (Current)" : "")}"); _gridData.Add(entManager.GetNetEntity(uid)); diff --git a/Content.Client/Administration/UI/Tabs/AtmosTab/SetTemperatureWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/AtmosTab/SetTemperatureWindow.xaml.cs index 850e43e4188..1183efb9b5b 100644 --- a/Content.Client/Administration/UI/Tabs/AtmosTab/SetTemperatureWindow.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/AtmosTab/SetTemperatureWindow.xaml.cs @@ -30,7 +30,7 @@ protected override void EnteredTree() while (gridQuery.MoveNext(out var uid, out _)) { - var player = playerManager.LocalPlayer?.ControlledEntity; + var player = playerManager.LocalEntity; var playerGrid = entManager.GetComponentOrNull(player)?.GridUid; GridOptions.AddItem($"{uid} {(playerGrid == uid ? " (Current)" : "")}"); _data.Add(entManager.GetNetEntity(uid)); diff --git a/Content.Client/Alerts/ClientAlertsSystem.cs b/Content.Client/Alerts/ClientAlertsSystem.cs index 83327ad77b5..ab296a96195 100644 --- a/Content.Client/Alerts/ClientAlertsSystem.cs +++ b/Content.Client/Alerts/ClientAlertsSystem.cs @@ -40,7 +40,7 @@ public IReadOnlyDictionary? ActiveAlerts { get { - var ent = _playerManager.LocalPlayer?.ControlledEntity; + var ent = _playerManager.LocalEntity; return ent is not null ? GetActiveAlerts(ent.Value) : null; @@ -49,7 +49,7 @@ public IReadOnlyDictionary? ActiveAlerts protected override void AfterShowAlert(Entity alerts) { - if (_playerManager.LocalPlayer?.ControlledEntity != alerts.Owner) + if (_playerManager.LocalEntity != alerts.Owner) return; SyncAlerts?.Invoke(this, alerts.Comp.Alerts); @@ -57,7 +57,7 @@ protected override void AfterShowAlert(Entity alerts) protected override void AfterClearAlert(Entity alertsComponent) { - if (_playerManager.LocalPlayer?.ControlledEntity != alertsComponent.Owner) + if (_playerManager.LocalEntity != alertsComponent.Owner) return; SyncAlerts?.Invoke(this, alertsComponent.Comp.Alerts); @@ -65,13 +65,13 @@ protected override void AfterClearAlert(Entity alertsComponent) private void ClientAlertsHandleState(EntityUid uid, AlertsComponent component, ref AfterAutoHandleStateEvent args) { - if (_playerManager.LocalPlayer?.ControlledEntity == uid) + if (_playerManager.LocalEntity == uid) SyncAlerts?.Invoke(this, component.Alerts); } private void OnPlayerAttached(EntityUid uid, AlertsComponent component, LocalPlayerAttachedEvent args) { - if (_playerManager.LocalPlayer?.ControlledEntity != uid) + if (_playerManager.LocalEntity != uid) return; SyncAlerts?.Invoke(this, component.Alerts); @@ -81,7 +81,7 @@ protected override void HandleComponentShutdown(EntityUid uid, AlertsComponent c { base.HandleComponentShutdown(uid, component, args); - if (_playerManager.LocalPlayer?.ControlledEntity != uid) + if (_playerManager.LocalEntity != uid) return; ClearAlerts?.Invoke(this, EventArgs.Empty); diff --git a/Content.Client/Animations/EntityPickupAnimationSystem.cs b/Content.Client/Animations/EntityPickupAnimationSystem.cs index 2ac51e6eba0..abeac664c75 100644 --- a/Content.Client/Animations/EntityPickupAnimationSystem.cs +++ b/Content.Client/Animations/EntityPickupAnimationSystem.cs @@ -65,7 +65,7 @@ public void AnimateEntityPickup(EntityUid uid, EntityCoordinates initial, Vector despawn.Lifetime = 0.25f; _transform.SetLocalRotationNoLerp(animatableClone, initialAngle); - _animations.Play(animatableClone, animations, new Animation + _animations.Play(new Entity(animatableClone, animations), new Animation { Length = TimeSpan.FromMilliseconds(125), AnimationTracks = diff --git a/Content.Client/Anomaly/Ui/AnomalyGeneratorWindow.xaml.cs b/Content.Client/Anomaly/Ui/AnomalyGeneratorWindow.xaml.cs index ca8682e72d6..08438e2a1b2 100644 --- a/Content.Client/Anomaly/Ui/AnomalyGeneratorWindow.xaml.cs +++ b/Content.Client/Anomaly/Ui/AnomalyGeneratorWindow.xaml.cs @@ -11,7 +11,6 @@ namespace Content.Client.Anomaly.Ui; [GenerateTypedNameReferences] public sealed partial class AnomalyGeneratorWindow : FancyWindow { - [Dependency] private readonly IEntityManager _entityManager = default!; [Dependency] private readonly IGameTiming _timing = default!; private TimeSpan _cooldownEnd = TimeSpan.Zero; diff --git a/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs b/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs index de26eb5f195..43be67c9d6b 100644 --- a/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs +++ b/Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs @@ -22,7 +22,6 @@ public sealed partial class AirAlarmWindow : FancyWindow public event Action? AtmosAlarmThresholdChanged; public event Action? AirAlarmModeChanged; public event Action? AutoModeChanged; - public event Action? ResyncDeviceRequested; public event Action? ResyncAllRequested; public event Action? AirAlarmTabChange; diff --git a/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdBoundControl.xaml b/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdBoundControl.xaml index 38851273846..0d5e741d0f6 100644 --- a/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdBoundControl.xaml +++ b/Content.Client/Atmos/Monitor/UI/Widgets/ThresholdBoundControl.xaml @@ -2,6 +2,6 @@ HorizontalExpand="True" Orientation="Vertical" Margin = "20 0 0 0" MinSize="160 0" >