Skip to content

Commit

Permalink
Merge branch 'master' into medical
Browse files Browse the repository at this point in the history
Signed-off-by: Colin-Tel <113523727+Colin-Tel@users.noreply.github.com>
  • Loading branch information
Colin-Tel authored Oct 3, 2023
2 parents 1b085ae + 6018cb6 commit f035b63
Show file tree
Hide file tree
Showing 884 changed files with 19,565 additions and 10,967 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/build-map-renderer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
62 changes: 0 additions & 62 deletions .github/workflows/build-test-release.yml

This file was deleted.

6 changes: 3 additions & 3 deletions Content.Client/Access/UI/AccessOverriderBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -23,7 +23,7 @@ protected override void Open()
{
base.Open();

List<string> accessLevels;
List<ProtoId<AccessLevelPrototype>> accessLevels;

if (EntMan.TryGetComponent<AccessOverriderComponent>(Owner, out var accessOverrider))
{
Expand All @@ -33,7 +33,7 @@ protected override void Open()

else
{
accessLevels = new List<string>();
accessLevels = new List<ProtoId<AccessLevelPrototype>>();
_accessOverriderSystem.Log.Error($"No AccessOverrider component found for {EntMan.ToPrettyString(Owner)}!");
}

Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Access/UI/AccessOverriderWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public sealed partial class AccessOverriderWindow : DefaultWindow
private readonly Dictionary<string, Button> _accessButtons = new();

public AccessOverriderWindow(AccessOverriderBoundUserInterface owner, IPrototypeManager prototypeManager,
List<string> accessLevels)
List<ProtoId<AccessLevelPrototype>> accessLevels)
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
Expand All @@ -31,7 +31,7 @@ public AccessOverriderWindow(AccessOverriderBoundUserInterface owner, IPrototype

foreach (var access in accessLevels)
{
if (!prototypeManager.TryIndex<AccessLevelPrototype>(access, out var accessLevel))
if (!prototypeManager.TryIndex(access, out var accessLevel))
{
_logMill.Error($"Unable to find accesslevel for {access}");
continue;
Expand Down
6 changes: 3 additions & 3 deletions Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -23,7 +23,7 @@ public IdCardConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner
protected override void Open()
{
base.Open();
List<string> accessLevels;
List<ProtoId<AccessLevelPrototype>> accessLevels;

if (EntMan.TryGetComponent<IdCardConsoleComponent>(Owner, out var idCard))
{
Expand All @@ -32,7 +32,7 @@ protected override void Open()
}
else
{
accessLevels = new List<string>();
accessLevels = new List<ProtoId<AccessLevelPrototype>>();
_idCardConsoleSystem.Log.Error($"No IdCardConsole component found for {EntMan.ToPrettyString(Owner)}!");
}

Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public sealed partial class IdCardConsoleWindow : DefaultWindow
private string? _lastJobProto;

public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeManager prototypeManager,
List<string> accessLevels)
List<ProtoId<AccessLevelPrototype>> accessLevels)
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
Expand Down
5 changes: 2 additions & 3 deletions Content.Client/Administration/Systems/AdminVerbSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ private void AddAdminVerbs(GetVerbsEvent<Verb> 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.
Expand Down
59 changes: 59 additions & 0 deletions Content.Client/Administration/UI/AdminUIHelpers.cs
Original file line number Diff line number Diff line change
@@ -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<Button, ConfirmationData> confirmations)
{
if (confirmations.Remove(button, out var data))
{
ResetButton(button, data);
return true;
}

return false;
}

public static void RemoveAllConfirms(Dictionary<Button, ConfirmationData> confirmations)
{
foreach (var (button, confirmation) in confirmations)
{
ResetButton(button, confirmation);
}

confirmations.Clear();
}

public static bool TryConfirm(Button button, Dictionary<Button, ConfirmationData> 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);
17 changes: 9 additions & 8 deletions Content.Client/Administration/UI/Bwoink/BwoinkControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
<cc:PlayerListControl Access="Public" Name="ChannelSelector" HorizontalExpand="True" SizeFlagsStretchRatio="1" />
<BoxContainer Orientation="Vertical" HorizontalExpand="True" SizeFlagsStretchRatio="2">
<BoxContainer Access="Public" Name="BwoinkArea" VerticalExpand="True" />
<BoxContainer Orientation="Horizontal" HorizontalAlignment="Right">
<Button Margin="0 0 10 0" Visible="True" Name="PopOut" Access="Public" Text="{Loc 'admin-logs-pop-out'}"/>
<Button Visible="False" Name="Bans" Text="{Loc 'admin-player-actions-bans'}" />
<Button Visible="False" Name="Notes" Text="{Loc 'admin-player-actions-notes'}" />
<Button Visible="False" Name="Kick" Text="{Loc 'admin-player-actions-kick'}" />
<Button Visible="False" Name="Ban" Text="{Loc 'admin-player-actions-ban'}" />
<Button Visible="False" Name="Respawn" Text="{Loc 'admin-player-actions-respawn'}" />
<Button Visible="False" Name="Teleport" Text="{Loc 'admin-player-actions-teleport'}" />
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Button Visible="True" Name="PopOut" Access="Public" Text="{Loc 'admin-logs-pop-out'}" StyleClasses="OpenBoth" HorizontalAlignment="Left" />
<Control HorizontalExpand="True" />
<Button Visible="False" Name="Bans" Text="{Loc 'admin-player-actions-bans'}" StyleClasses="OpenRight" />
<Button Visible="False" Name="Notes" Text="{Loc 'admin-player-actions-notes'}" StyleClasses="OpenBoth" />
<Button Visible="False" Name="Kick" Text="{Loc 'admin-player-actions-kick'}" StyleClasses="OpenBoth" />
<Button Visible="False" Name="Ban" Text="{Loc 'admin-player-actions-ban'}" StyleClasses="OpenBoth" />
<Button Visible="False" Name="Respawn" Text="{Loc 'admin-player-actions-respawn'}" StyleClasses="OpenBoth" />
<Button Visible="False" Name="Teleport" Text="{Loc 'admin-player-actions-teleport'}" StyleClasses="OpenLeft" />
</BoxContainer>
</BoxContainer>
</SplitContainer>
Expand Down
Loading

0 comments on commit f035b63

Please sign in to comment.