diff --git a/.editorconfig b/.editorconfig index 0409377f1dd..a8ce1d6b68b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -196,7 +196,7 @@ csharp_preserve_single_line_blocks = true #dotnet_naming_style.begins_with_i.word_separator = #dotnet_naming_style.begins_with_i.capitalization = pascal_case -dotnet_diagnostic.IDE0055.severity = warning +dotnet_diagnostic.ide0055.severity = warning dotnet_naming_rule.constants_rule.severity = warning dotnet_naming_rule.constants_rule.style = upper_camel_case_style @@ -336,6 +336,7 @@ dotnet_naming_symbols.type_parameters_symbols.applicable_kinds = type_parameter # ReSharper properties resharper_braces_for_ifelse = required_for_multiline +resharper_keep_existing_attribute_arrangement = true [*.{csproj,xml,yml,dll.config,msbuildproj,targets}] indent_size = 2 diff --git a/.github/workflows/build-map-renderer.yml b/.github/workflows/build-map-renderer.yml index 4aa4b29c85e..e921bd2558c 100644 --- a/.github/workflows/build-map-renderer.yml +++ b/.github/workflows/build-map-renderer.yml @@ -13,7 +13,7 @@ jobs: if: github.actor != 'PJBot' && github.event.pull_request.draft == false strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} diff --git a/.github/workflows/build-test-debug.yml b/.github/workflows/build-test-debug.yml index 12584c4da72..9abd4fbe17e 100644 --- a/.github/workflows/build-test-debug.yml +++ b/.github/workflows/build-test-debug.yml @@ -13,7 +13,7 @@ jobs: if: github.actor != 'PJBot' && github.event.pull_request.draft == false strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] runs-on: ${{ matrix.os }} diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml deleted file mode 100644 index d62bed3a5d1..00000000000 --- a/.github/workflows/build-test-release.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Build & Test Release - -on: - push: - branches: [ master, staging, trying ] - merge_group: - pull_request: - types: [ opened, reopened, synchronize, ready_for_review ] - branches: [ master ] - -jobs: - build: - if: github.actor != 'PJBot' && github.event.pull_request.draft == false - strategy: - matrix: - os: [ubuntu-latest, windows-latest] - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout Master - uses: actions/checkout@v3.6.0 - - - name: Setup Submodule - run: | - git submodule update --init --recursive - - - name: Pull engine updates - uses: space-wizards/submodule-dependency@v0.1.5 - - - name: Update Engine Submodules - run: | - cd RobustToolbox/ - git submodule update --init --recursive - - - name: Setup .NET Core - uses: actions/setup-dotnet@v3.2.0 - with: - dotnet-version: 7.0.x - - - name: Install dependencies - run: dotnet restore - - - name: Build Project - run: dotnet build --configuration Tools --no-restore /p:WarningsAsErrors=nullable /m - - - name: Run Content.Tests - run: dotnet test --configuration Tools --no-build Content.Tests/Content.Tests.csproj -- NUnit.ConsoleOut=0 - - - name: Run Content.IntegrationTests - shell: pwsh - run: | - $env:DOTNET_gcServer=1 - dotnet test --configuration Tools --no-build Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed - ci-success: - name: Build & Test Release - needs: - - build - runs-on: ubuntu-latest - steps: - - name: CI succeeded - run: exit 0 diff --git a/Content.Client/Access/UI/AccessOverriderBoundUserInterface.cs b/Content.Client/Access/UI/AccessOverriderBoundUserInterface.cs index cb431854845..0c23542f798 100644 --- a/Content.Client/Access/UI/AccessOverriderBoundUserInterface.cs +++ b/Content.Client/Access/UI/AccessOverriderBoundUserInterface.cs @@ -1,7 +1,7 @@ +using Content.Shared.Access; using Content.Shared.Access.Components; using Content.Shared.Access.Systems; using Content.Shared.Containers.ItemSlots; -using Robust.Client.GameObjects; using Robust.Shared.Prototypes; using static Content.Shared.Access.Components.AccessOverriderComponent; @@ -23,7 +23,7 @@ protected override void Open() { base.Open(); - List accessLevels; + List> accessLevels; if (EntMan.TryGetComponent(Owner, out var accessOverrider)) { @@ -33,7 +33,7 @@ protected override void Open() else { - accessLevels = new List(); + accessLevels = new List>(); _accessOverriderSystem.Log.Error($"No AccessOverrider component found for {EntMan.ToPrettyString(Owner)}!"); } diff --git a/Content.Client/Access/UI/AccessOverriderWindow.xaml.cs b/Content.Client/Access/UI/AccessOverriderWindow.xaml.cs index 6a4dcba3078..2fd00571215 100644 --- a/Content.Client/Access/UI/AccessOverriderWindow.xaml.cs +++ b/Content.Client/Access/UI/AccessOverriderWindow.xaml.cs @@ -21,7 +21,7 @@ public sealed partial class AccessOverriderWindow : DefaultWindow private readonly Dictionary _accessButtons = new(); public AccessOverriderWindow(AccessOverriderBoundUserInterface owner, IPrototypeManager prototypeManager, - List accessLevels) + List> accessLevels) { RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); @@ -31,7 +31,7 @@ public AccessOverriderWindow(AccessOverriderBoundUserInterface owner, IPrototype foreach (var access in accessLevels) { - if (!prototypeManager.TryIndex(access, out var accessLevel)) + if (!prototypeManager.TryIndex(access, out var accessLevel)) { _logMill.Error($"Unable to find accesslevel for {access}"); continue; diff --git a/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs b/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs index be45e57c8b1..898792aa030 100644 --- a/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs +++ b/Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs @@ -1,8 +1,8 @@ +using Content.Shared.Access; using Content.Shared.Access.Components; using Content.Shared.Access.Systems; using Content.Shared.Containers.ItemSlots; using Content.Shared.CrewManifest; -using Robust.Client.GameObjects; using Robust.Shared.Prototypes; using static Content.Shared.Access.Components.IdCardConsoleComponent; @@ -23,7 +23,7 @@ public IdCardConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner protected override void Open() { base.Open(); - List accessLevels; + List> accessLevels; if (EntMan.TryGetComponent(Owner, out var idCard)) { @@ -32,7 +32,7 @@ protected override void Open() } else { - accessLevels = new List(); + accessLevels = new List>(); _idCardConsoleSystem.Log.Error($"No IdCardConsole component found for {EntMan.ToPrettyString(Owner)}!"); } diff --git a/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs b/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs index f8450fe578f..670ba088713 100644 --- a/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs +++ b/Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs @@ -28,7 +28,7 @@ public sealed partial class IdCardConsoleWindow : DefaultWindow private string? _lastJobProto; public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeManager prototypeManager, - List accessLevels) + List> accessLevels) { RobustXamlLoader.Load(this); IoCManager.InjectDependencies(this); diff --git a/Content.Client/Administration/Systems/AdminVerbSystem.cs b/Content.Client/Administration/Systems/AdminVerbSystem.cs index d08ebc0fcef..e0f84bc4f03 100644 --- a/Content.Client/Administration/Systems/AdminVerbSystem.cs +++ b/Content.Client/Administration/Systems/AdminVerbSystem.cs @@ -24,10 +24,9 @@ private void AddAdminVerbs(GetVerbsEvent args) // View variables verbs if (_clientConGroupController.CanViewVar()) { - Verb verb = new() + var verb = new VvVerb() { - Category = VerbCategory.Debug, - Text = "View Variables", + Text = Loc.GetString("view-variables"), Icon = new SpriteSpecifier.Texture(new ("/Textures/Interface/VerbIcons/vv.svg.192dpi.png")), Act = () => _clientConsoleHost.ExecuteCommand($"vv {GetNetEntity(args.Target)}"), ClientExclusive = true // opening VV window is client-side. Don't ask server to run this verb. diff --git a/Content.Client/Administration/UI/AdminUIHelpers.cs b/Content.Client/Administration/UI/AdminUIHelpers.cs new file mode 100644 index 00000000000..89ab33e931d --- /dev/null +++ b/Content.Client/Administration/UI/AdminUIHelpers.cs @@ -0,0 +1,59 @@ +using System.Threading; +using Content.Client.Stylesheets; +using Robust.Client.UserInterface.Controls; +using Timer = Robust.Shared.Timing.Timer; + +namespace Content.Client.Administration.UI; + +public static class AdminUIHelpers +{ + private static void ResetButton(Button button, ConfirmationData data) + { + data.Cancellation.Cancel(); + button.ModulateSelfOverride = null; + button.Text = data.OriginalText; + } + + public static bool RemoveConfirm(Button button, Dictionary confirmations) + { + if (confirmations.Remove(button, out var data)) + { + ResetButton(button, data); + return true; + } + + return false; + } + + public static void RemoveAllConfirms(Dictionary confirmations) + { + foreach (var (button, confirmation) in confirmations) + { + ResetButton(button, confirmation); + } + + confirmations.Clear(); + } + + public static bool TryConfirm(Button button, Dictionary confirmations) + { + if (RemoveConfirm(button, confirmations)) + return true; + + var data = new ConfirmationData(new CancellationTokenSource(), button.Text); + confirmations[button] = data; + + Timer.Spawn(TimeSpan.FromSeconds(5), () => + { + confirmations.Remove(button); + button.ModulateSelfOverride = null; + button.Text = data.OriginalText; + }, data.Cancellation.Token); + + button.ModulateSelfOverride = StyleNano.ButtonColorCautionDefault; + button.Text = Loc.GetString("admin-player-actions-confirm"); + return false; + } +} + +public readonly record struct ConfirmationData(CancellationTokenSource Cancellation, string? OriginalText); diff --git a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml index 05c68615ebb..28b55f987f3 100644 --- a/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml +++ b/Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml @@ -6,14 +6,15 @@ - -