diff --git a/.envrc b/.envrc index 5def8fd66a..7fd05db3e5 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 6a40012b4c..a50306f179 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -4,19 +4,19 @@ /Content.*/ @DEATHB4DEFEAT -/Content.*/SimpleStation14/ @Pspritechologist @DEATHB4DEFEAT +/Content.*/Parkstation/ @Pspritechologist @DEATHB4DEFEAT /Resources/ @DEATHB4DEFEAT -/Resources/Audio/SimpleStation14 @Pspritechologist @DEATHB4DEFEAT +/Resources/Audio/Parkstation @Pspritechologist @DEATHB4DEFEAT /Resources/Maps/ @Pspritechologist @DEATHB4DEFEAT /Resources/Prototypes/Maps @Pspritechologist @DEATHB4DEFEAT -/Resources/Prototypes/SimpleStation14/ @Pspritechologist @DEATHB4DEFEAT +/Resources/Prototypes/Parkstation/ @Pspritechologist @DEATHB4DEFEAT -/Resources/Textures/SimpleStation14/ @Pspritechologist @DEATHB4DEFEAT +/Resources/Textures/Parkstation/ @Pspritechologist @DEATHB4DEFEAT *.ftl @Pspritechologist @DEATHB4DEFEAT diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..aba549332f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,27 @@ +--- +name: Request a Feature +about: "Template for noting future planned features. Please ask for approval in the Discord if you aren't an organization Member before posting a feature request" +title: '' +labels: '' +assignees: '' + +--- + + + +# Description + + +I want Goldfish crackers + +# Media + + +![Example Screenshot](https://example.com/thisimageisntreal.png) diff --git a/.github/labeler.yml b/.github/labeler.yml index 694c83b602..eb01eeecc4 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,4 +1,7 @@ -"Changes: C#": +"Changes: Audio": + - "**/*.ogg" + +"Changes: C#": - "**/*.cs" "Changes: Config": diff --git a/.github/workflows/build-docfx.yml b/.github/workflows/build-docfx.yml index ca1a6f0af1..d37e37026d 100644 --- a/.github/workflows/build-docfx.yml +++ b/.github/workflows/build-docfx.yml @@ -21,7 +21,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v3.2.0 with: - dotnet-version: 8.0.x + dotnet-version: 8.0.100 - name: Install dependencies run: dotnet restore diff --git a/.github/workflows/build-map-renderer.yml b/.github/workflows/build-map-renderer.yml index 01575f64b9..c1790feadb 100644 --- a/.github/workflows/build-map-renderer.yml +++ b/.github/workflows/build-map-renderer.yml @@ -10,7 +10,7 @@ on: jobs: build: - if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot' + if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot' && github.actor != 'SimpleStation14' strategy: matrix: os: [ubuntu-latest] @@ -36,7 +36,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v3.2.0 with: - dotnet-version: 8.0.x + dotnet-version: 8.0.100 - name: Install dependencies run: dotnet restore diff --git a/.github/workflows/build-test-debug.yml b/.github/workflows/build-test-debug.yml index 519f5af6f4..bb0624e3ba 100644 --- a/.github/workflows/build-test-debug.yml +++ b/.github/workflows/build-test-debug.yml @@ -10,7 +10,7 @@ on: jobs: build: - if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot' + if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot' && github.actor != 'SimpleStation14' strategy: matrix: os: [ubuntu-latest] @@ -36,7 +36,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v3.2.0 with: - dotnet-version: 8.0.x + dotnet-version: 8.0.100 - name: Install dependencies run: dotnet restore diff --git a/.github/workflows/close-master-pr.yml b/.github/workflows/close-master-pr.yml index 66843d35dd..a74e838099 100644 --- a/.github/workflows/close-master-pr.yml +++ b/.github/workflows/close-master-pr.yml @@ -1,4 +1,4 @@ -name: Close PR's on master +name: Close PRs on master on: pull_request_target: @@ -12,7 +12,7 @@ jobs: steps: - uses: superbrothers/close-pull-request@v3 with: - comment: "Thank you for contributing to the Space Station 14 repository. Unfortunately, it looks like you submitted your pull request from the master branch. We suggest you follow [our git usage documentation](https://docs.spacestation14.com/en/general-development/setup/git-for-the-ss14-developer.html) \n\n You can move your current work from the master branch to another branch by doing `git branch + body: This is an automated Pull Request. This PR updates the GitHub contributors in the credits section. + author: ${{ vars.CHANGELOG_USER }} <${{ vars.CHANGELOG_EMAIL }}> branch: automated/credits-${{env.NOW}} diff --git a/.github/workflows/validate-rgas.yml b/.github/workflows/validate-rgas.yml index 0ed04021eb..72ce39ceff 100644 --- a/.github/workflows/validate-rgas.yml +++ b/.github/workflows/validate-rgas.yml @@ -9,7 +9,7 @@ on: jobs: yaml-schema-validation: name: YAML RGA schema validator - if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot' + if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot' && github.actor != 'SimpleStation14' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3.6.0 diff --git a/.github/workflows/validate_mapfiles.yml b/.github/workflows/validate_mapfiles.yml index 43d77841a8..190ee97d8f 100644 --- a/.github/workflows/validate_mapfiles.yml +++ b/.github/workflows/validate_mapfiles.yml @@ -9,7 +9,7 @@ on: jobs: yaml-schema-validation: name: YAML map schema validator - if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot' + if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot' && github.actor != 'SimpleStation14' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3.6.0 diff --git a/.github/workflows/yaml-linter.yml b/.github/workflows/yaml-linter.yml index 796795b234..8660ccc040 100644 --- a/.github/workflows/yaml-linter.yml +++ b/.github/workflows/yaml-linter.yml @@ -10,7 +10,7 @@ on: jobs: build: name: YAML Linter - if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot' + if: github.actor != 'PJBot' && github.event.pull_request.draft == false && github.actor != 'DeltaV-Bot' && github.actor != 'SimpleStation14' runs-on: ubuntu-latest steps: - uses: actions/checkout@v3.6.0 @@ -26,7 +26,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v3.2.0 with: - dotnet-version: 8.0.x + dotnet-version: 8.0.100 - name: Install dependencies run: dotnet restore - name: Build diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 83bca6f97b..737b90563e 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,12 @@ { "recommendations": [ "ms-dotnettools.csharp", - "editorconfig.editorconfig" + "editorconfig.editorconfig", + "aaron-bond.better-comments", + "tamasfe.even-better-toml", + "slava0135.robust-yaml", + "slevesque.shader", + "macabeus.vscode-fluent", + "redhat.vscode-yaml" ] } diff --git a/Content.Benchmarks/ColorInterpolateBenchmark.cs b/Content.Benchmarks/ColorInterpolateBenchmark.cs index 2243bb4819..eb182328d4 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 16805c2684..bb2a22312e 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 0beb0a613d..42a436597d 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 508f3404ba..b992e77256 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; @@ -92,6 +95,7 @@ private void BaseHandleState(EntityUid uid, BaseActionComponent component, Ba component.Container = EnsureEntity(state.Container, uid); component.EntityIcon = EnsureEntity(state.EntityIcon, uid); component.CheckCanInteract = state.CheckCanInteract; + component.CheckConsciousness = state.CheckConsciousness; component.ClientExclusive = state.ClientExclusive; component.Priority = state.Priority; component.AttachedEntity = EnsureEntity(state.AttachedEntity, uid); @@ -101,8 +105,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 +114,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 +147,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 +180,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 +188,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 +196,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 +219,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 +236,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 +264,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 +313,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 1a1366c6f2..fdd62fb6a2 100644 --- a/Content.Client/Administration/Managers/ClientAdminManager.cs +++ b/Content.Client/Administration/Managers/ClientAdminManager.cs @@ -2,6 +2,7 @@ using Content.Shared.Administration.Managers; using Robust.Client.Console; using Robust.Client.Player; +using Robust.Client.UserInterface; using Robust.Shared.ContentPack; using Robust.Shared.Network; using Robust.Shared.Player; @@ -15,11 +16,14 @@ 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!; + [Dependency] private readonly IUserInterfaceManager _userInterface = default!; private AdminData? _adminData; private readonly HashSet _availableCommands = new(); private readonly AdminCommandPermissions _localCommandPermissions = new(); + private ISawmill _sawmill = default!; public event Action? AdminStatusUpdated; @@ -92,17 +96,20 @@ 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}"); + + if (_adminData.Active) + _userInterface.DebugMonitors.SetMonitor(DebugMonitor.Coords, true); } else { - Logger.InfoS("admin", "Updated admin status: Not admin"); + _sawmill.Info("Updated admin status: Not admin"); } AdminStatusUpdated?.Invoke(); @@ -114,18 +121,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 +139,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/Systems/BwoinkSystem.cs b/Content.Client/Administration/Systems/BwoinkSystem.cs index eafd40cc9c..5166dc8416 100644 --- a/Content.Client/Administration/Systems/BwoinkSystem.cs +++ b/Content.Client/Administration/Systems/BwoinkSystem.cs @@ -19,11 +19,11 @@ protected override void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySes OnBwoinkTextMessageRecieved?.Invoke(this, message); } - public void Send(NetUserId channelId, string text) + public void Send(NetUserId channelId, string text, bool playSound) { // Reuse the channel ID as the 'true sender'. // Server will ignore this and if someone makes it not ignore this (which is bad, allows impersonation!!!), that will help. - RaiseNetworkEvent(new BwoinkTextMessage(channelId, channelId, text)); + RaiseNetworkEvent(new BwoinkTextMessage(channelId, channelId, text, playSound: playSound)); SendInputTextUpdated(channelId, false); } diff --git a/Content.Client/Administration/UI/AdminRemarks/AdminMessageEui.cs b/Content.Client/Administration/UI/AdminRemarks/AdminMessageEui.cs index 06eace118d..502c56a5a6 100644 --- a/Content.Client/Administration/UI/AdminRemarks/AdminMessageEui.cs +++ b/Content.Client/Administration/UI/AdminRemarks/AdminMessageEui.cs @@ -2,6 +2,7 @@ using Content.Shared.Administration.Notes; using Content.Shared.Eui; using JetBrains.Annotations; +using Robust.Client.UserInterface.Controls; using static Content.Shared.Administration.Notes.AdminMessageEuiMsg; namespace Content.Client.Administration.UI.AdminRemarks; @@ -14,9 +15,8 @@ public sealed class AdminMessageEui : BaseEui public AdminMessageEui() { _popup = new AdminMessagePopupWindow(); - _popup.OnAcceptPressed += () => SendMessage(new Accept()); - _popup.OnDismissPressed += () => SendMessage(new Dismiss()); - _popup.OnClose += () => SendMessage(new CloseEuiMessage()); + _popup.OnAcceptPressed += () => SendMessage(new Dismiss(true)); + _popup.OnDismissPressed += () => SendMessage(new Dismiss(false)); } public override void HandleState(EuiStateBase state) @@ -26,13 +26,17 @@ public override void HandleState(EuiStateBase state) return; } - _popup.SetMessage(s.Message); - _popup.SetDetails(s.AdminName, s.AddedOn); - _popup.Timer = s.Time; + _popup.SetState(s); } public override void Opened() { - _popup.OpenCentered(); + _popup.UserInterfaceManager.WindowRoot.AddChild(_popup); + LayoutContainer.SetAnchorPreset(_popup, LayoutContainer.LayoutPreset.Wide); + } + + public override void Closed() + { + _popup.Orphan(); } } diff --git a/Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupMessage.xaml b/Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupMessage.xaml new file mode 100644 index 0000000000..9a60a6f72a --- /dev/null +++ b/Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupMessage.xaml @@ -0,0 +1,6 @@ + + + + + + diff --git a/Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupMessage.xaml.cs b/Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupMessage.xaml.cs new file mode 100644 index 0000000000..7bb425f618 --- /dev/null +++ b/Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupMessage.xaml.cs @@ -0,0 +1,23 @@ +using Content.Shared.Administration.Notes; +using Robust.Client.AutoGenerated; +using Robust.Client.UserInterface; +using Robust.Client.UserInterface.XAML; +using Robust.Shared.Utility; + +namespace Content.Client.Administration.UI.AdminRemarks; + +[GenerateTypedNameReferences] +public sealed partial class AdminMessagePopupMessage : Control +{ + public AdminMessagePopupMessage(AdminMessageEuiState.Message message) + { + RobustXamlLoader.Load(this); + + Admin.SetMessage(FormattedMessage.FromMarkup(Loc.GetString( + "admin-notes-message-admin", + ("admin", message.AdminName), + ("date", message.AddedOn.ToLocalTime())))); + + Message.SetMessage(message.Text); + } +} diff --git a/Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupWindow.xaml b/Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupWindow.xaml index 311829e8b2..cc5207bb3a 100644 --- a/Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupWindow.xaml +++ b/Content.Client/Administration/UI/AdminRemarks/AdminMessagePopupWindow.xaml @@ -1,22 +1,36 @@ - - - - -