diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 179b7e45d89..35d6b39c060 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -3,17 +3,17 @@ # Sorting by path instead of by who added it one day :( # this isn't how codeowners rules work pls read the first comment instead of trying to force a sorting order -/Resources/ConfigPresets/WizardsDen/ @nikthechampiongr -/Content.*/Administration/ @DrSmugleaf @nikthechampiongr -/Resources/ServerInfo/ @nikthechampiongr -/Resources/ServerInfo/Guidebook/ServerRules/ @nikthechampiongr +/Resources/ConfigPresets/WizardsDen/ @nikthechampiongr @crazybrain23 +/Content.*/Administration/ @DrSmugleaf @nikthechampiongr @crazybrain23 +/Resources/ServerInfo/ @nikthechampiongr @crazybrain23 +/Resources/ServerInfo/Guidebook/ServerRules/ @nikthechampiongr @crazybrain23 /Resources/Prototypes/Maps/** @Emisse /Resources/Prototypes/Body/ @DrSmugleaf # suffering /Resources/Prototypes/Entities/Mobs/Player/ @DrSmugleaf /Resources/Prototypes/Entities/Mobs/Species/ @DrSmugleaf -/Resources/Prototypes/Guidebook/rules.yml @nikthechampiongr +/Resources/Prototypes/Guidebook/rules.yml @nikthechampiongr @crazybrain23 /Content.*/Body/ @DrSmugleaf /Content.YAMLLinter @DrSmugleaf /Content.Shared/Damage/ @DrSmugleaf @@ -25,7 +25,7 @@ # SKREEEE /Content.*.Database/ @PJB3005 @DrSmugleaf -/Content.Shared.Database/Log*.cs @PJB3005 @DrSmugleaf @nikthechampiongr +/Content.Shared.Database/Log*.cs @PJB3005 @DrSmugleaf @nikthechampiongr @crazybrain23 /Pow3r/ @PJB3005 /Content.Server/Power/Pow3r/ @PJB3005 diff --git a/.github/workflows/build-docfx.yml b/.github/workflows/build-docfx.yml index ca1a6f0af12..2842578abc8 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: 9.0.x - name: Install dependencies run: dotnet restore diff --git a/.github/workflows/build-map-renderer.yml b/.github/workflows/build-map-renderer.yml index 398baddd843..57775a41cca 100644 --- a/.github/workflows/build-map-renderer.yml +++ b/.github/workflows/build-map-renderer.yml @@ -36,7 +36,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v3.2.0 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Install dependencies run: dotnet restore diff --git a/.github/workflows/build-test-debug.yml b/.github/workflows/build-test-debug.yml index 8f50c621d82..f263c20027d 100644 --- a/.github/workflows/build-test-debug.yml +++ b/.github/workflows/build-test-debug.yml @@ -36,7 +36,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v3.2.0 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Install dependencies run: dotnet restore diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 77cf56a5123..d035843a235 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,7 +22,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v3.2.0 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Get Engine Tag run: | diff --git a/.github/workflows/test-packaging.yml b/.github/workflows/test-packaging.yml index bddacb9fa4e..05ca632de39 100644 --- a/.github/workflows/test-packaging.yml +++ b/.github/workflows/test-packaging.yml @@ -51,7 +51,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v3.2.0 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Install dependencies run: dotnet restore diff --git a/.github/workflows/yaml-linter.yml b/.github/workflows/yaml-linter.yml index 0b6e934cb59..1053bb4a3aa 100644 --- a/.github/workflows/yaml-linter.yml +++ b/.github/workflows/yaml-linter.yml @@ -26,7 +26,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v3.2.0 with: - dotnet-version: 8.0.x + dotnet-version: 9.0.x - name: Install dependencies run: dotnet restore - name: Build diff --git a/Content.Client/Access/UI/AccessOverriderWindow.xaml.cs b/Content.Client/Access/UI/AccessOverriderWindow.xaml.cs index ba087718583..092a0071fb7 100644 --- a/Content.Client/Access/UI/AccessOverriderWindow.xaml.cs +++ b/Content.Client/Access/UI/AccessOverriderWindow.xaml.cs @@ -88,8 +88,9 @@ public void UpdateState(IPrototypeManager protoManager, AccessOverriderBoundUser button.Disabled = !interfaceEnabled; if (interfaceEnabled) { - button.Pressed = state.TargetAccessReaderIdAccessList?.Contains(accessName) ?? false; - button.Disabled = (!state.AllowedModifyAccessList?.Contains(accessName)) ?? true; + // Explicit cast because Rider gives a false error otherwise. + button.Pressed = state.TargetAccessReaderIdAccessList?.Contains((ProtoId) accessName) ?? false; + button.Disabled = (!state.AllowedModifyAccessList?.Contains((ProtoId) accessName)) ?? true; } } } diff --git a/Content.Client/Administration/AdminNameOverlay.cs b/Content.Client/Administration/AdminNameOverlay.cs index e2db7a8d6b4..47d251910cb 100644 --- a/Content.Client/Administration/AdminNameOverlay.cs +++ b/Content.Client/Administration/AdminNameOverlay.cs @@ -1,16 +1,21 @@ +using System.Linq; using System.Numerics; using Content.Client.Administration.Systems; +using Content.Shared.CCVar; +using Content.Shared.Mind; using Robust.Client.Graphics; using Robust.Client.ResourceManagement; using Robust.Client.UserInterface; -using Robust.Shared; -using Robust.Shared.Enums; using Robust.Shared.Configuration; +using Robust.Shared.Enums; +using Robust.Shared.Prototypes; namespace Content.Client.Administration; internal sealed class AdminNameOverlay : Overlay { + [Dependency] private readonly IConfigurationManager _config = default!; + private readonly AdminSystem _system; private readonly IEntityManager _entityManager; private readonly IEyeManager _eyeManager; @@ -18,8 +23,16 @@ internal sealed class AdminNameOverlay : Overlay private readonly IUserInterfaceManager _userInterfaceManager; private readonly Font _font; + //TODO make this adjustable via GUI + private readonly ProtoId[] _filter = + ["SoloAntagonist", "TeamAntagonist", "SiliconAntagonist", "FreeAgent"]; + private readonly string _antagLabelClassic = Loc.GetString("admin-overlay-antag-classic"); + private readonly Color _antagColorClassic = Color.OrangeRed; + public AdminNameOverlay(AdminSystem system, IEntityManager entityManager, IEyeManager eyeManager, IResourceCache resourceCache, EntityLookupSystem entityLookup, IUserInterfaceManager userInterfaceManager) { + IoCManager.InjectDependencies(this); + _system = system; _entityManager = entityManager; _eyeManager = eyeManager; @@ -35,6 +48,9 @@ protected override void Draw(in OverlayDrawArgs args) { var viewport = args.WorldAABB; + //TODO make this adjustable via GUI + var classic = _config.GetCVar(CCVars.AdminOverlayClassic); + foreach (var playerInfo in _system.PlayerList) { var entity = _entityManager.GetEntity(playerInfo.NetEntity); @@ -64,12 +80,20 @@ protected override void Draw(in OverlayDrawArgs args) var screenCoordinates = _eyeManager.WorldToScreen(aabb.Center + new Angle(-_eyeManager.CurrentEye.Rotation).RotateVec( aabb.TopRight - aabb.Center)) + new Vector2(1f, 7f); - if (playerInfo.Antag) + + if (classic && playerInfo.Antag) { - args.ScreenHandle.DrawString(_font, screenCoordinates + (lineoffset * 2), "ANTAG", uiScale, Color.OrangeRed); -; + args.ScreenHandle.DrawString(_font, screenCoordinates + (lineoffset * 2), _antagLabelClassic, uiScale, _antagColorClassic); } - args.ScreenHandle.DrawString(_font, screenCoordinates+lineoffset, playerInfo.Username, uiScale, playerInfo.Connected ? Color.Yellow : Color.White); + else if (!classic && _filter.Contains(playerInfo.RoleProto.ID)) + { + var label = Loc.GetString(playerInfo.RoleProto.Name).ToUpper(); + var color = playerInfo.RoleProto.Color; + + args.ScreenHandle.DrawString(_font, screenCoordinates + (lineoffset * 2), label, uiScale, color); + } + + args.ScreenHandle.DrawString(_font, screenCoordinates + lineoffset, playerInfo.Username, uiScale, playerInfo.Connected ? Color.Yellow : Color.White); args.ScreenHandle.DrawString(_font, screenCoordinates, playerInfo.CharacterName, uiScale, playerInfo.Connected ? Color.Aquamarine : Color.White); } } diff --git a/Content.Client/Administration/UI/AdminMenuWindow.xaml b/Content.Client/Administration/UI/AdminMenuWindow.xaml index d3d3df02d93..311d67b826c 100644 --- a/Content.Client/Administration/UI/AdminMenuWindow.xaml +++ b/Content.Client/Administration/UI/AdminMenuWindow.xaml @@ -6,8 +6,7 @@ xmlns:tabs="clr-namespace:Content.Client.Administration.UI.Tabs" xmlns:playerTab="clr-namespace:Content.Client.Administration.UI.Tabs.PlayerTab" xmlns:objectsTab="clr-namespace:Content.Client.Administration.UI.Tabs.ObjectsTab" - xmlns:panic="clr-namespace:Content.Client.Administration.UI.Tabs.PanicBunkerTab" - xmlns:baby="clr-namespace:Content.Client.Administration.UI.Tabs.BabyJailTab"> + xmlns:panic="clr-namespace:Content.Client.Administration.UI.Tabs.PanicBunkerTab"> @@ -15,7 +14,6 @@ - diff --git a/Content.Client/Administration/UI/AdminMenuWindow.xaml.cs b/Content.Client/Administration/UI/AdminMenuWindow.xaml.cs index d5c43e2a500..73fcb4f5e50 100644 --- a/Content.Client/Administration/UI/AdminMenuWindow.xaml.cs +++ b/Content.Client/Administration/UI/AdminMenuWindow.xaml.cs @@ -21,10 +21,6 @@ public AdminMenuWindow() MasterTabContainer.SetTabTitle((int) TabIndex.Round, Loc.GetString("admin-menu-round-tab")); MasterTabContainer.SetTabTitle((int) TabIndex.Server, Loc.GetString("admin-menu-server-tab")); MasterTabContainer.SetTabTitle((int) TabIndex.PanicBunker, Loc.GetString("admin-menu-panic-bunker-tab")); - /* - * TODO: Remove baby jail code once a more mature gateway process is established. This code is only being issued as a stopgap to help with potential tiding in the immediate future. - */ - MasterTabContainer.SetTabTitle((int) TabIndex.BabyJail, Loc.GetString("admin-menu-baby-jail-tab")); MasterTabContainer.SetTabTitle((int) TabIndex.Players, Loc.GetString("admin-menu-players-tab")); MasterTabContainer.SetTabTitle((int) TabIndex.Objects, Loc.GetString("admin-menu-objects-tab")); MasterTabContainer.OnTabChanged += OnTabChanged; @@ -52,7 +48,6 @@ private enum TabIndex Round, Server, PanicBunker, - BabyJail, Players, Objects, } diff --git a/Content.Client/Administration/UI/PermissionsEui.cs b/Content.Client/Administration/UI/PermissionsEui.cs index 4cddf8887ee..fe1237d4c90 100644 --- a/Content.Client/Administration/UI/PermissionsEui.cs +++ b/Content.Client/Administration/UI/PermissionsEui.cs @@ -130,6 +130,7 @@ private void SaveAdminPressed(EditAdminWindow popup) } var title = string.IsNullOrWhiteSpace(popup.TitleEdit.Text) ? null : popup.TitleEdit.Text; + var suspended = popup.SuspendedCheckbox.Pressed; if (popup.SourceData is { } src) { @@ -139,7 +140,8 @@ private void SaveAdminPressed(EditAdminWindow popup) Title = title, PosFlags = pos, NegFlags = neg, - RankId = rank + RankId = rank, + Suspended = suspended, }); } else @@ -152,7 +154,8 @@ private void SaveAdminPressed(EditAdminWindow popup) Title = title, PosFlags = pos, NegFlags = neg, - RankId = rank + RankId = rank, + Suspended = suspended, }); } @@ -171,7 +174,7 @@ private void SaveAdminRankPressed(EditAdminRankWindow popup) { Id = src, Flags = flags, - Name = name + Name = name, }); } else @@ -351,6 +354,7 @@ private sealed class EditAdminWindow : DefaultWindow public readonly OptionButton RankButton; public readonly Button SaveButton; public readonly Button? RemoveButton; + public readonly CheckBox SuspendedCheckbox; public readonly Dictionary FlagButtons = new(); @@ -381,6 +385,12 @@ public EditAdminWindow(PermissionsEui ui, PermissionsEuiState.AdminData? data) RankButton = new OptionButton(); SaveButton = new Button { Text = Loc.GetString("permissions-eui-edit-admin-window-save-button"), HorizontalAlignment = HAlignment.Right }; + SuspendedCheckbox = new CheckBox + { + Text = Loc.GetString("permissions-eui-edit-admin-window-suspended"), + Pressed = data?.Suspended ?? false, + }; + RankButton.AddItem(Loc.GetString("permissions-eui-edit-admin-window-no-rank-button"), NoRank); foreach (var (rId, rank) in ui._ranks) { @@ -488,7 +498,8 @@ public EditAdminWindow(PermissionsEui ui, PermissionsEuiState.AdminData? data) { nameControl, TitleEdit, - RankButton + RankButton, + SuspendedCheckbox, } }, permGrid diff --git a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailStatusWindow.xaml b/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailStatusWindow.xaml deleted file mode 100644 index b8034faf52a..00000000000 --- a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailStatusWindow.xaml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailStatusWindow.xaml.cs b/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailStatusWindow.xaml.cs deleted file mode 100644 index 9e1d53818f2..00000000000 --- a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailStatusWindow.xaml.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Content.Client.Message; -using Content.Client.UserInterface.Controls; -using Robust.Client.AutoGenerated; -using Robust.Client.UserInterface.CustomControls; -using Robust.Client.UserInterface.XAML; - -namespace Content.Client.Administration.UI.Tabs.BabyJailTab; - -/* - * TODO: Remove me once a more mature gateway process is established. This code is only being issued as a stopgap to help with potential tiding in the immediate future. - */ - -[GenerateTypedNameReferences] -public sealed partial class BabyJailStatusWindow : FancyWindow -{ - public BabyJailStatusWindow() - { - RobustXamlLoader.Load(this); - MessageLabel.SetMarkup(Loc.GetString("admin-ui-baby-jail-is-enabled")); - } -} diff --git a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailTab.xaml b/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailTab.xaml deleted file mode 100644 index dd770c2be53..00000000000 --- a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailTab.xaml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - diff --git a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailTab.xaml.cs b/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailTab.xaml.cs deleted file mode 100644 index aa9d6ced951..00000000000 --- a/Content.Client/Administration/UI/Tabs/BabyJailTab/BabyJailTab.xaml.cs +++ /dev/null @@ -1,75 +0,0 @@ -using Content.Shared.Administration.Events; -using Robust.Client.AutoGenerated; -using Robust.Client.UserInterface; -using Robust.Client.UserInterface.XAML; -using Robust.Shared.Console; - -/* - * TODO: Remove me once a more mature gateway process is established. This code is only being issued as a stopgap to help with potential tiding in the immediate future. - */ - -namespace Content.Client.Administration.UI.Tabs.BabyJailTab; - -[GenerateTypedNameReferences] -public sealed partial class BabyJailTab : Control -{ - [Dependency] private readonly IConsoleHost _console = default!; - - private string _maxAccountAge; - private string _maxOverallMinutes; - - public BabyJailTab() - { - RobustXamlLoader.Load(this); - IoCManager.InjectDependencies(this); - - MaxAccountAge.OnTextEntered += args => SendMaxAccountAge(args.Text); - MaxAccountAge.OnFocusExit += args => SendMaxAccountAge(args.Text); - _maxAccountAge = MaxAccountAge.Text; - - MaxOverallMinutes.OnTextEntered += args => SendMaxOverallMinutes(args.Text); - MaxOverallMinutes.OnFocusExit += args => SendMaxOverallMinutes(args.Text); - _maxOverallMinutes = MaxOverallMinutes.Text; - } - - private void SendMaxAccountAge(string text) - { - if (string.IsNullOrWhiteSpace(text) || - text == _maxAccountAge || - !int.TryParse(text, out var minutes)) - { - return; - } - - _console.ExecuteCommand($"babyjail_max_account_age {minutes}"); - } - - private void SendMaxOverallMinutes(string text) - { - if (string.IsNullOrWhiteSpace(text) || - text == _maxOverallMinutes || - !int.TryParse(text, out var minutes)) - { - return; - } - - _console.ExecuteCommand($"babyjail_max_overall_minutes {minutes}"); - } - - public void UpdateStatus(BabyJailStatus status) - { - EnabledButton.Pressed = status.Enabled; - EnabledButton.Text = Loc.GetString(status.Enabled - ? "admin-ui-baby-jail-enabled" - : "admin-ui-baby-jail-disabled" - ); - EnabledButton.ModulateSelfOverride = status.Enabled ? Color.Red : null; - ShowReasonButton.Pressed = status.ShowReason; - - MaxAccountAge.Text = status.MaxAccountAgeMinutes.ToString(); - _maxAccountAge = MaxAccountAge.Text; - - MaxOverallMinutes.Text = status.MaxOverallMinutes.ToString(); - _maxOverallMinutes = MaxOverallMinutes.Text; - } -} diff --git a/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs b/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs index 043bf343ecf..b7231869c9e 100644 --- a/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs +++ b/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTab.xaml.cs @@ -197,6 +197,7 @@ private int Compare(PlayerInfo x, PlayerInfo y) Header.Character => Compare(x.CharacterName, y.CharacterName), Header.Job => Compare(x.StartingJob, y.StartingJob), Header.Antagonist => x.Antag.CompareTo(y.Antag), + Header.RoleType => Compare(x.RoleProto.Name , y.RoleProto.Name), Header.Playtime => TimeSpan.Compare(x.OverallPlaytime ?? default, y.OverallPlaytime ?? default), _ => 1 }; diff --git a/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabEntry.xaml b/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabEntry.xaml index e1371ec6f73..54e51747fb9 100644 --- a/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabEntry.xaml +++ b/Content.Client/Administration/UI/Tabs/PlayerTab/PlayerTabEntry.xaml @@ -24,6 +24,11 @@ HorizontalExpand="True" ClipText="True"/> +