diff --git a/.editorconfig b/.editorconfig index 1583c600aa..8b92144453 100644 --- a/.editorconfig +++ b/.editorconfig @@ -344,6 +344,9 @@ resharper_keep_existing_attribute_arrangement = true resharper_wrap_chained_binary_patterns = chop_if_long resharper_wrap_chained_method_calls = chop_if_long resharper_csharp_trailing_comma_in_multiline_lists = true +resharper_csharp_qualified_using_at_nested_scope = false +resharper_csharp_prefer_qualified_reference = false +resharper_csharp_allow_alias = false [*.{csproj,xml,yml,yaml,dll.config,msbuildproj,targets,props}] indent_size = 2 diff --git a/.envrc b/.envrc index 7fd05db3e5..b1ad7237ed 100644 --- a/.envrc +++ b/.envrc @@ -1,4 +1,5 @@ -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=" +set -e +if ! has nix_direnv_version || ! nix_direnv_version 3.0.6; then + source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc" "sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM=" fi use flake diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4c5dd76940..35d6b39c06 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -2,49 +2,30 @@ # 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/ @Chief-Engineer -# Moony's Gargantuan List Of Things She Cares About, or MGLOTSCA for short. -# You need to add your name to these entries, not make a new one, if you care about them. -/Content.*/Toolshed/ @moonheart08 -**/Toolshed/** @moonheart08 -*Command.cs @moonheart08 -/Content.*/Administration/ @moonheart08 @DrSmugleaf @Chief-Engineer -/Content.*/Station/ @moonheart08 -/Content.*/Maps/ @moonheart08 -/Content.*/GameTicking/ @moonheart08 @EmoGarbage404 -/Resources/ServerInfo/ @moonheart08 @Chief-Engineer -/Resources/ServerInfo/Guidebook/ @moonheart08 @EmoGarbage404 -/Resources/ServerInfo/Guidebook/ServerRules/ @Chief-Engineer -/Resources/engineCommandPerms.yml @moonheart08 @Chief-Engineer -/Resources/clientCommandPerms.yml @moonheart08 @Chief-Engineer +/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 @Chief-Engineer +/Resources/Prototypes/Guidebook/rules.yml @nikthechampiongr @crazybrain23 /Content.*/Body/ @DrSmugleaf /Content.YAMLLinter @DrSmugleaf /Content.Shared/Damage/ @DrSmugleaf -/Content.*/Anomaly/ @EmoGarbage404 @TheShuEd -/Content.*/Lathe/ @EmoGarbage404 -/Content.*/Materials/ @EmoGarbage404 -/Content.*/Mech/ @EmoGarbage404 -/Content.*/Research/ @EmoGarbage404 -/Content.*/Stack/ @EmoGarbage404 -/Content.*/Xenoarchaeology/ @EmoGarbage404 -/Content.*/Zombies/ @EmoGarbage404 -/Resources/Prototypes/Entities/Structures/Specific/anomalies.yml @EmoGarbage404 @TheShuEd -/Resources/Prototypes/Research/ @EmoGarbage404 +/Content.*/Anomaly/ @TheShuEd +/Resources/Prototypes/Entities/Structures/Specific/anomalies.yml @TheShuEd /Content.*/Forensics/ @ficcialfaint # SKREEEE /Content.*.Database/ @PJB3005 @DrSmugleaf -/Content.Shared.Database/Log*.cs @PJB3005 @DrSmugleaf @Chief-Engineer +/Content.Shared.Database/Log*.cs @PJB3005 @DrSmugleaf @nikthechampiongr @crazybrain23 /Pow3r/ @PJB3005 /Content.Server/Power/Pow3r/ @PJB3005 @@ -52,7 +33,7 @@ /Content.*/Atmos/ @Partmedia /Content.*/Botany/ @Partmedia -#Jezi +# Jezi /Content.*/Medical @Jezithyr /Content.*/Body @Jezithyr diff --git a/.github/labeler.yml b/.github/labeler.yml index 69b2ca8774..ca5aeed1f3 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -16,6 +16,10 @@ - changed-files: - any-glob-to-any-file: '**/*.swsl' +"Changes: Audio": +- changed-files: + - any-glob-to-any-file: '**/*.ogg' + "Changes: No C#": - changed-files: # Equiv to any-glob-to-all as long as this has one matcher. If ALL changed files are not C# files, then apply label. diff --git a/.github/workflows/build-docfx.yml b/.github/workflows/build-docfx.yml index ca1a6f0af1..2842578abc 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 35aed1a7f7..57775a41cc 100644 --- a/.github/workflows/build-map-renderer.yml +++ b/.github/workflows/build-map-renderer.yml @@ -2,11 +2,11 @@ on: push: - branches: [ master, staging, trying ] + branches: [ master, staging, stable ] merge_group: pull_request: types: [ opened, reopened, synchronize, ready_for_review ] - branches: [ master ] + branches: [ master, staging, stable ] jobs: build: @@ -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 47f9fd1a51..f263c20027 100644 --- a/.github/workflows/build-test-debug.yml +++ b/.github/workflows/build-test-debug.yml @@ -2,11 +2,11 @@ name: Build & Test Debug on: push: - branches: [ master, staging, trying ] + branches: [ master, staging, stable ] merge_group: pull_request: types: [ opened, reopened, synchronize, ready_for_review ] - branches: [ master ] + branches: [ master, staging, stable ] jobs: build: @@ -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/labeler-size.yml b/.github/workflows/labeler-size.yml index ad6e35c829..50f89c9bc8 100644 --- a/.github/workflows/labeler-size.yml +++ b/.github/workflows/labeler-size.yml @@ -14,7 +14,7 @@ jobs: { "0": "XS", "10": "S", - "30": "M", - "100": "L", - "1000": "XL" + "100": "M", + "1000": "L", + "5000": "XL" } diff --git a/.github/workflows/publish-testing.yml b/.github/workflows/publish-testing.yml new file mode 100644 index 0000000000..aa3b35dea1 --- /dev/null +++ b/.github/workflows/publish-testing.yml @@ -0,0 +1,45 @@ +name: Publish Testing + +concurrency: + group: publish-testing + +on: + workflow_dispatch: + schedule: + - cron: '0 10 * * *' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3.6.0 + with: + submodules: 'recursive' + - name: Setup .NET Core + uses: actions/setup-dotnet@v3.2.0 + with: + dotnet-version: 9.0.x + + - name: Get Engine Tag + run: | + cd RobustToolbox + git fetch --depth=1 + + - name: Install dependencies + run: dotnet restore + + - name: Build Packaging + run: dotnet build Content.Packaging --configuration Release --no-restore /m + + - name: Package server + run: dotnet run --project Content.Packaging server --platform win-x64 --platform linux-x64 --platform osx-x64 --platform linux-arm64 + + - name: Package client + run: dotnet run --project Content.Packaging client --no-wipe-release + + - name: Publish version + run: Tools/publish_multi_request.py --fork-id wizards-testing + env: + PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }} + GITHUB_REPOSITORY: ${{ vars.GITHUB_REPOSITORY }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 77cf56a512..d035843a23 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 2d002f869a..05ca632de3 100644 --- a/.github/workflows/test-packaging.yml +++ b/.github/workflows/test-packaging.yml @@ -2,7 +2,7 @@ on: push: - branches: [ master, staging, trying ] + branches: [ master, staging, stable ] paths: - '**.cs' - '**.csproj' @@ -16,7 +16,7 @@ on: merge_group: pull_request: types: [ opened, reopened, synchronize, ready_for_review ] - branches: [ master ] + branches: [ master, staging, stable ] paths: - '**.cs' - '**.csproj' @@ -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/validate-rgas.yml b/.github/workflows/validate-rgas.yml index 2c4bb40fdf..25191958a8 100644 --- a/.github/workflows/validate-rgas.yml +++ b/.github/workflows/validate-rgas.yml @@ -1,7 +1,7 @@ name: RGA schema validator on: push: - branches: [ master, staging, trying ] + branches: [ master, staging, stable ] merge_group: pull_request: types: [ opened, reopened, synchronize, ready_for_review ] diff --git a/.github/workflows/validate-rsis.yml b/.github/workflows/validate-rsis.yml index b76df28e6a..5d30944c73 100644 --- a/.github/workflows/validate-rsis.yml +++ b/.github/workflows/validate-rsis.yml @@ -2,7 +2,7 @@ name: RSI Validator on: push: - branches: [ staging, trying ] + branches: [ master, staging, stable ] merge_group: pull_request: paths: diff --git a/.github/workflows/validate_mapfiles.yml b/.github/workflows/validate_mapfiles.yml index fb11e1a469..aaf1edcc28 100644 --- a/.github/workflows/validate_mapfiles.yml +++ b/.github/workflows/validate_mapfiles.yml @@ -1,7 +1,7 @@ name: Map file schema validator on: push: - branches: [ master, staging, trying ] + branches: [ master, staging, stable ] merge_group: pull_request: types: [ opened, reopened, synchronize, ready_for_review ] diff --git a/.github/workflows/yaml-linter.yml b/.github/workflows/yaml-linter.yml index 691eb29f1d..1053bb4a3a 100644 --- a/.github/workflows/yaml-linter.yml +++ b/.github/workflows/yaml-linter.yml @@ -2,7 +2,7 @@ name: YAML Linter on: push: - branches: [ master, staging, trying ] + branches: [ master, staging, stable ] merge_group: pull_request: types: [ opened, reopened, synchronize, ready_for_review ] @@ -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/BuildChecker/BuildChecker.csproj b/BuildChecker/BuildChecker.csproj index 63d16fa970..4bd7fcf78c 100644 --- a/BuildChecker/BuildChecker.csproj +++ b/BuildChecker/BuildChecker.csproj @@ -12,12 +12,12 @@ You want to handle the Build, Clean and Rebuild tasks to prevent missing task er If you want to learn more about these kinds of things, check out Microsoft's official documentation about MSBuild: https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild --> - + python3 py -3 {C899FCA4-7037-4E49-ABC2-44DE72487110} - .NETFramework, Version=v4.7.2 + net4.7.2 false diff --git a/Content.Benchmarks/ComponentQueryBenchmark.cs b/Content.Benchmarks/ComponentQueryBenchmark.cs index 11c7ab9d5f..49e9984c09 100644 --- a/Content.Benchmarks/ComponentQueryBenchmark.cs +++ b/Content.Benchmarks/ComponentQueryBenchmark.cs @@ -9,13 +9,14 @@ using Content.Shared.Clothing.Components; using Content.Shared.Doors.Components; using Content.Shared.Item; -using Robust.Server.GameObjects; using Robust.Shared; using Robust.Shared.Analyzers; +using Robust.Shared.EntitySerialization; +using Robust.Shared.EntitySerialization.Systems; using Robust.Shared.GameObjects; -using Robust.Shared.Map; using Robust.Shared.Map.Components; using Robust.Shared.Random; +using Robust.Shared.Utility; namespace Content.Benchmarks; @@ -32,7 +33,6 @@ public class ComponentQueryBenchmark private TestPair _pair = default!; private IEntityManager _entMan = default!; - private MapId _mapId = new(10); private EntityQuery _itemQuery; private EntityQuery _clothingQuery; private EntityQuery _mapQuery; @@ -54,10 +54,10 @@ public void Setup() _pair.Server.ResolveDependency().SetSeed(42); _pair.Server.WaitPost(() => { - var success = _entMan.System().TryLoad(_mapId, Map, out _); - if (!success) + var map = new ResPath(Map); + var opts = DeserializationOptions.Default with {InitializeMaps = true}; + if (!_entMan.System().TryLoadMap(map, out _, out _, opts)) throw new Exception("Map load failed"); - _pair.Server.MapMan.DoMapInitialize(_mapId); }).GetAwaiter().GetResult(); _items = new EntityUid[_entMan.Count()]; diff --git a/Content.Benchmarks/MapLoadBenchmark.cs b/Content.Benchmarks/MapLoadBenchmark.cs index 8c04d9a40d..2bb71bb59d 100644 --- a/Content.Benchmarks/MapLoadBenchmark.cs +++ b/Content.Benchmarks/MapLoadBenchmark.cs @@ -6,12 +6,13 @@ using Content.IntegrationTests; using Content.IntegrationTests.Pair; using Content.Server.Maps; -using Robust.Server.GameObjects; using Robust.Shared; using Robust.Shared.Analyzers; +using Robust.Shared.EntitySerialization.Systems; using Robust.Shared.GameObjects; using Robust.Shared.Map; using Robust.Shared.Prototypes; +using Robust.Shared.Utility; namespace Content.Benchmarks; @@ -20,7 +21,7 @@ public class MapLoadBenchmark { private TestPair _pair = default!; private MapLoaderSystem _mapLoader = default!; - private IMapManager _mapManager = default!; + private SharedMapSystem _mapSys = default!; [GlobalSetup] public void Setup() @@ -36,7 +37,7 @@ public void Setup() .ToDictionary(x => x.ID, x => x.MapPath.ToString()); _mapLoader = server.ResolveDependency().GetEntitySystem(); - _mapManager = server.ResolveDependency(); + _mapSys = server.ResolveDependency().GetEntitySystem(); } [GlobalCleanup] @@ -46,23 +47,25 @@ public async Task Cleanup() PoolManager.Shutdown(); } - public static readonly string[] MapsSource = { "Empty", "Satlern", "Box", "Bagel", "Dev", "CentComm", "Core", "TestTeg", "Packed", "Omega", "Reach", "Meta", "Marathon", "MeteorArena", "Fland", "Oasis", "Cog" }; + public static readonly string[] MapsSource = { "Empty", "Satlern", "Box", "Bagel", "Dev", "CentComm", "Core", "TestTeg", "Packed", "Omega", "Reach", "Meta", "Marathon", "MeteorArena", "Fland", "Oasis", "Convex"}; [ParamsSource(nameof(MapsSource))] public string Map; public Dictionary Paths; + private MapId _mapId; [Benchmark] public async Task LoadMap() { - var mapPath = Paths[Map]; + var mapPath = new ResPath(Paths[Map]); var server = _pair.Server; await server.WaitPost(() => { - var success = _mapLoader.TryLoad(new MapId(10), mapPath, out _); + var success = _mapLoader.TryLoadMap(mapPath, out var map, out _); if (!success) throw new Exception("Map load failed"); + _mapId = map.Value.Comp.MapId; }); } @@ -70,9 +73,7 @@ await server.WaitPost(() => public void IterationCleanup() { var server = _pair.Server; - server.WaitPost(() => - { - _mapManager.DeleteMap(new MapId(10)); - }).Wait(); + server.WaitPost(() => _mapSys.DeleteMap(_mapId)) + .Wait(); } } diff --git a/Content.Benchmarks/PvsBenchmark.cs b/Content.Benchmarks/PvsBenchmark.cs index fa7f9d4542..2f87545426 100644 --- a/Content.Benchmarks/PvsBenchmark.cs +++ b/Content.Benchmarks/PvsBenchmark.cs @@ -7,13 +7,15 @@ using Content.IntegrationTests.Pair; using Content.Server.Mind; using Content.Server.Warps; -using Robust.Server.GameObjects; using Robust.Shared; using Robust.Shared.Analyzers; +using Robust.Shared.EntitySerialization; +using Robust.Shared.EntitySerialization.Systems; using Robust.Shared.GameObjects; using Robust.Shared.Map; using Robust.Shared.Player; using Robust.Shared.Random; +using Robust.Shared.Utility; namespace Content.Benchmarks; @@ -34,7 +36,6 @@ public class PvsBenchmark private TestPair _pair = default!; private IEntityManager _entMan = default!; - private MapId _mapId = new(10); private ICommonSession[] _players = default!; private EntityCoordinates[] _spawns = default!; public int _cycleOffset = 0; @@ -65,10 +66,10 @@ private async Task SetupAsync() _pair.Server.ResolveDependency().SetSeed(42); await _pair.Server.WaitPost(() => { - var success = _entMan.System().TryLoad(_mapId, Map, out _); - if (!success) + var path = new ResPath(Map); + var opts = DeserializationOptions.Default with {InitializeMaps = true}; + if (!_entMan.System().TryLoadMap(path, out _, out _, opts)) throw new Exception("Map load failed"); - _pair.Server.MapMan.DoMapInitialize(_mapId); }); // Get list of ghost warp positions diff --git a/Content.Client/Access/UI/AccessOverriderWindow.xaml.cs b/Content.Client/Access/UI/AccessOverriderWindow.xaml.cs index ba08771858..092a0071fb 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/Actions/ActionsSystem.cs b/Content.Client/Actions/ActionsSystem.cs index b594817701..5f0a8e1f2f 100644 --- a/Content.Client/Actions/ActionsSystem.cs +++ b/Content.Client/Actions/ActionsSystem.cs @@ -88,6 +88,7 @@ private void OnEntityTargetHandleState(EntityUid uid, EntityTargetActionComponen return; component.Whitelist = state.Whitelist; + component.Blacklist = state.Blacklist; component.CanTargetSelf = state.CanTargetSelf; BaseHandleState(uid, component, state); } @@ -137,6 +138,7 @@ private void BaseHandleState(EntityUid uid, BaseActionComponent component, Ba component.Priority = state.Priority; component.AttachedEntity = EnsureEntity(state.AttachedEntity, uid); component.RaiseOnUser = state.RaiseOnUser; + component.RaiseOnAction = state.RaiseOnAction; component.AutoPopulate = state.AutoPopulate; component.Temporary = state.Temporary; component.ItemIconStyle = state.ItemIconStyle; diff --git a/Content.Client/Administration/AdminNameOverlay.cs b/Content.Client/Administration/AdminNameOverlay.cs index e2db7a8d6b..47d251910c 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 d3d3df02d9..311d67b826 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 d5c43e2a50..73fcb4f5e5 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 4cddf8887e..fe1237d4c9 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 b8034faf52..0000000000 --- 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 9e1d53818f..0000000000 --- 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 dd770c2be5..0000000000 --- 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 aa9d6ced95..0000000000 --- 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 043bf343ec..b7231869c9 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 e1371ec6f7..54e51747fb 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"/> +