Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
noctyrnal committed May 25, 2024
2 parents 14da00b + 2ded8b5 commit e0b34c2
Show file tree
Hide file tree
Showing 809 changed files with 36,041 additions and 20,026 deletions.
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ tab_width = 4
#end_of_line = crlf
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 120

#### .NET Coding Conventions ####

Expand Down Expand Up @@ -336,7 +337,11 @@ dotnet_naming_symbols.type_parameters_symbols.applicable_kinds = type_parameter

# ReSharper properties
resharper_braces_for_ifelse = required_for_multiline
resharper_csharp_wrap_arguments_style = chop_if_long
resharper_csharp_wrap_parameters_style = chop_if_long
resharper_keep_existing_attribute_arrangement = true
resharper_wrap_chained_binary_patterns = chop_if_long
resharper_wrap_chained_method_calls = chop_if_long

[*.{csproj,xml,yml,yaml,dll.config,msbuildproj,targets,props}]
indent_size = 2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-map-renderer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: 8.0.100
dotnet-version: 8.0.x

- name: Install dependencies
run: dotnet restore
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 @@ -36,7 +36,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: 8.0.100
dotnet-version: 8.0.x

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: 8.0.100
dotnet-version: 8.0.x

- name: Get Engine Tag
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: 8.0.100
dotnet-version: 8.0.x

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yaml-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: 8.0.100
dotnet-version: 8.0.x
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Content.Shared.Access;
using Content.Shared.Access.Components;
using Content.Shared.Access;
using Content.Shared.Access.Systems;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.CrewManifest;
Expand Down
3 changes: 3 additions & 0 deletions Content.Client/Actions/ActionsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,10 @@ public void TriggerAction(EntityUid actionId, BaseActionComponent action)
if (action.ClientExclusive)
{
if (instantAction.Event != null)
{
instantAction.Event.Performer = user;
instantAction.Event.Action = actionId;
}

PerformAction(user, actions, actionId, instantAction, instantAction.Event, GameTiming.CurTime);
}
Expand Down
7 changes: 7 additions & 0 deletions Content.Client/Administration/Systems/AdminFrozenSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Content.Shared.Administration;

namespace Content.Client.Administration.Systems;

public sealed class AdminFrozenSystem : SharedAdminFrozenSystem
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
using Robust.Client.GameObjects;
using Robust.Client.Player;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
Expand All @@ -22,7 +23,7 @@ public sealed partial class SpawnExplosionWindow : DefaultWindow
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IEntityManager _entMan = default!;

private readonly SharedTransformSystem _transform = default!;

private readonly SpawnExplosionEui _eui;
private List<MapId> _mapData = new();
Expand All @@ -37,6 +38,7 @@ public SpawnExplosionWindow(SpawnExplosionEui eui)
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_transform = _entMan.System<TransformSystem>();
_eui = eui;

ExplosionOption.OnItemSelected += ExplosionSelected;
Expand Down Expand Up @@ -104,7 +106,7 @@ private void SetLocation()

_pausePreview = true;
MapOptions.Select(_mapData.IndexOf(transform.MapID));
(MapX.Value, MapY.Value) = transform.MapPosition.Position;
(MapX.Value, MapY.Value) = _transform.GetMapCoordinates(_playerManager.LocalEntity!.Value, xform: transform).Position;
_pausePreview = false;

UpdatePreview();
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Audio/Jukebox/JukeboxBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ namespace Content.Client.Audio.Jukebox;

public sealed class JukeboxBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IPrototypeManager _protoManager = default!;

[ViewVariables]
Expand Down
2 changes: 0 additions & 2 deletions Content.Client/Changelog/ChangelogWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,12 @@ private void TabsUpdated()
if (!tab.AdminOnly || isAdmin)
{
Tabs.SetTabVisible(i, true);
tab.Visible = true;
visibleTabs++;
firstVisible ??= i;
}
else
{
Tabs.SetTabVisible(i, false);
tab.Visible = false;
}
}

Expand Down
119 changes: 119 additions & 0 deletions Content.Client/Chemistry/UI/ButtonGrid.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
using System;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;

namespace Content.Client.Chemistry.UI;

/// <summary>
/// Creates a grid of buttons given a comma-seperated list of Text
/// </summary>
public sealed class ButtonGrid : GridContainer
{
private string _buttonList = "";

/// <summary>
/// A comma-seperated list of text to use for each button. These will be inserted sequentially.
/// </summary>
public string ButtonList
{
get => _buttonList;
set
{
_buttonList = value;
Update();
}
}

public bool RadioGroup { get; set; } = false;

private string? _selected;

/// <summary>
/// Which button is currently selected. Only matters when <see cref="RadioGroup"/> is true.
/// </summary>
public string? Selected
{
get => _selected;
set
{
_selected = value;
Update();
}
}

public Action<string>? OnButtonPressed;

/// <summary>
/// <see cref="GridContainer.Columns"/>
/// </summary>
public new int Columns
{
get => base.Columns;
set
{
base.Columns = value;
Update();
}
}

/// <summary>
/// <see cref="GridContainer.Rows"/>
/// </summary>
public new int Rows
{
get => base.Rows;
set
{
base.Rows = value;
Update();
}
}

private void Update()
{
if (ButtonList == "")
return;

this.Children.Clear();
var i = 0;
var list = ButtonList.Split(",");

var group = new ButtonGroup();

foreach (var button in list)
{
var btn = new Button();
btn.Text = button;
btn.OnPressed += _ =>
{
if (RadioGroup)
btn.Pressed = true;
Selected = button;
OnButtonPressed?.Invoke(button);
};
if (button == Selected)
btn.Pressed = true;
var sep = HSeparationOverride ?? 0;
// ReSharper disable once PossibleLossOfFraction
// btn.SetWidth = (this.PixelWidth - sep * (Columns - 1)) / 3;
btn.Group = group;

var row = i / Columns;
var col = i % Columns;
var last = i == list.Length - 1;
var lastCol = i == Columns - 1;
var lastRow = row == list.Length / Columns - 1;

if (row == 0 && (lastCol || last))
btn.AddStyleClass("OpenLeft");
else if (col == 0 && lastRow)
btn.AddStyleClass("OpenRight");
else
btn.AddStyleClass("OpenBoth");

this.Children.Add(btn);

i++;
}
}
}
36 changes: 36 additions & 0 deletions Content.Client/Chemistry/UI/ReagentCardControl.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<Control xmlns="https://spacestation14.io" HorizontalExpand="True">
<BoxContainer Name="MainContainer"
Orientation="Horizontal"
HorizontalExpand="True">
<PanelContainer Name="ColorPanel"
VerticalExpand="True"
SetWidth="7"
Margin="0 1 0 0" />
<Button Name="MainButton"
HorizontalExpand="True"
VerticalExpand="True"
StyleClasses="ButtonSquare"
Margin="-1 0 0 0">
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<BoxContainer Orientation="Vertical"
VerticalExpand="True"
HorizontalExpand="True"
Margin="-5 0 0 0">
<Label Name="ReagentNameLabel" />
<Label Name="FillLabel"
StyleClasses="LabelSubText"
Margin="0 -5 0 0" />
</BoxContainer>
</BoxContainer>
</Button>
<Button Name="EjectButton"
StyleClasses="OpenLeft"
VerticalExpand="True"
SetWidth="20">
<Label Name="EjectButtonIcon"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Margin="-7 -4 0 0" />
</Button>
</BoxContainer>
</Control>
32 changes: 32 additions & 0 deletions Content.Client/Chemistry/UI/ReagentCardControl.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Content.Shared.Chemistry;
using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.Chemistry.UI;

[GenerateTypedNameReferences]
public sealed partial class ReagentCardControl : Control
{
public string StorageSlotId { get; }
public Action<string>? OnPressed;
public Action<string>? OnEjectButtonPressed;

public ReagentCardControl(ReagentInventoryItem item)
{
RobustXamlLoader.Load(this);

StorageSlotId = item.StorageSlotId;
ColorPanel.PanelOverride = new StyleBoxFlat { BackgroundColor = item.ReagentColor };
ReagentNameLabel.Text = item.ReagentLabel;
FillLabel.Text = Loc.GetString("reagent-dispenser-window-quantity-label-text", ("quantity", item.Quantity));;
EjectButtonIcon.Text = Loc.GetString("reagent-dispenser-window-eject-container-button");

if (item.Quantity == 0.0)
MainButton.Disabled = true;

MainButton.OnPressed += args => OnPressed?.Invoke(StorageSlotId);
EjectButton.OnPressed += args => OnEjectButtonPressed?.Invoke(StorageSlotId);
}
}
35 changes: 5 additions & 30 deletions Content.Client/Chemistry/UI/ReagentDispenserBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Content.Client.Guidebook.Components;
using Content.Shared.Chemistry;
using Content.Shared.Containers.ItemSlots;
using JetBrains.Annotations;
Expand Down Expand Up @@ -34,6 +35,7 @@ protected override void Open()
_window = new()
{
Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName,
HelpGuidebookIds = EntMan.GetComponent<GuideHelpComponent>(Owner).Guides
};

_window.OpenCentered();
Expand All @@ -42,38 +44,11 @@ protected override void Open()
// Setup static button actions.
_window.EjectButton.OnPressed += _ => SendMessage(new ItemSlotButtonPressedEvent(SharedReagentDispenser.OutputSlotName));
_window.ClearButton.OnPressed += _ => SendMessage(new ReagentDispenserClearContainerSolutionMessage());
_window.DispenseButton1.OnPressed += _ => SendMessage(new ReagentDispenserSetDispenseAmountMessage(ReagentDispenserDispenseAmount.U1));
_window.DispenseButton5.OnPressed += _ => SendMessage(new ReagentDispenserSetDispenseAmountMessage(ReagentDispenserDispenseAmount.U5));
_window.DispenseButton10.OnPressed += _ => SendMessage(new ReagentDispenserSetDispenseAmountMessage(ReagentDispenserDispenseAmount.U10));
_window.DispenseButton15.OnPressed += _ => SendMessage(new ReagentDispenserSetDispenseAmountMessage(ReagentDispenserDispenseAmount.U15));
_window.DispenseButton20.OnPressed += _ => SendMessage(new ReagentDispenserSetDispenseAmountMessage(ReagentDispenserDispenseAmount.U20));
_window.DispenseButton25.OnPressed += _ => SendMessage(new ReagentDispenserSetDispenseAmountMessage(ReagentDispenserDispenseAmount.U25));
_window.DispenseButton30.OnPressed += _ => SendMessage(new ReagentDispenserSetDispenseAmountMessage(ReagentDispenserDispenseAmount.U30));
_window.DispenseButton50.OnPressed += _ => SendMessage(new ReagentDispenserSetDispenseAmountMessage(ReagentDispenserDispenseAmount.U50));
_window.DispenseButton100.OnPressed += _ => SendMessage(new ReagentDispenserSetDispenseAmountMessage(ReagentDispenserDispenseAmount.U100));

// Setup reagent button actions.
_window.OnDispenseReagentButtonPressed += (args, button) => SendMessage(new ReagentDispenserDispenseReagentMessage(button.ReagentId));
_window.OnDispenseReagentButtonMouseEntered += (args, button) =>
{
if (_lastState is not null)
_window.UpdateContainerInfo(_lastState);
};
_window.OnDispenseReagentButtonMouseExited += (args, button) =>
{
if (_lastState is not null)
_window.UpdateContainerInfo(_lastState);
};
_window.AmountGrid.OnButtonPressed += s => SendMessage(new ReagentDispenserSetDispenseAmountMessage(s));

_window.OnEjectJugButtonPressed += (args, button) => SendMessage(new ItemSlotButtonPressedEvent(button.ReagentId));
_window.OnEjectJugButtonMouseEntered += (args, button) => {
if (_lastState is not null)
_window.UpdateContainerInfo(_lastState);
};
_window.OnEjectJugButtonMouseExited += (args, button) => {
if (_lastState is not null)
_window.UpdateContainerInfo(_lastState);
};
_window.OnDispenseReagentButtonPressed += (id) => SendMessage(new ReagentDispenserDispenseReagentMessage(id));
_window.OnEjectJugButtonPressed += (id) => SendMessage(new ItemSlotButtonPressedEvent(id));
}

/// <summary>
Expand Down
Loading

0 comments on commit e0b34c2

Please sign in to comment.