Skip to content

Commit

Permalink
Merge remote-tracking branch 'ee/master' into upstream-merge-02-07-25
Browse files Browse the repository at this point in the history
  • Loading branch information
angelofallars committed Feb 7, 2025
2 parents 4bad928 + bfed410 commit 4697d2e
Show file tree
Hide file tree
Showing 911 changed files with 61,623 additions and 31,744 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/rsi-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ jobs:

- name: Get changed files
id: files
uses: Ana06/get-changed-files@v1.2
uses: Ana06/get-changed-files@v2.3.0
with:
format: 'space-delimited'
filter: |
**.rsi
**.png
- name: Diff changed RSIs
id: diff
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Arcade/BlockGameMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ private Control SetupGameGrid(Texture panelTex)
{
PanelOverride = back,
HorizontalExpand = true,
SizeFlagsStretchRatio = 60
SizeFlagsStretchRatio = 34.25f
};
var backgroundPanel = new PanelContainer
{
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Arcade/UI/BlockGameBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ protected override void Open()
base.Open();

_menu = this.CreateWindow<BlockGameMenu>();
_menu.OnAction += SendAction;
}

protected override void ReceiveMessage(BoundUserInterfaceMessage message)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ protected override void Open()
base.Open();

_menu = this.CreateWindow<SpaceVillainArcadeMenu>();
_menu.OnPlayerAction += SendAction;
}

protected override void ReceiveMessage(BoundUserInterfaceMessage message)
Expand Down
23 changes: 20 additions & 3 deletions Content.Client/Changelog/ChangelogWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared;
using Robust.Shared.Configuration;
using Robust.Shared.Console;

namespace Content.Client.Changelog
{
[GenerateTypedNameReferences]
public sealed partial class ChangelogWindow : FancyWindow
{
[Dependency] private readonly IClientAdminManager _adminManager = default!;
[Dependency] private readonly ChangelogManager _changelog = default!;
[Dependency] private readonly IClientAdminManager _adminManager = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;

public ChangelogWindow()
{
Expand Down Expand Up @@ -67,8 +70,22 @@ private async void PopulateChangelog()
Tabs.SetTabTitle(i++, Loc.GetString($"changelog-tab-title-{changelog.Name}"));
}

var version = typeof(ChangelogWindow).Assembly.GetName().Version ?? new Version(1, 0);
VersionLabel.Text = Loc.GetString("changelog-version-tag", ("version", version.ToString()));
// Try to get the current version from the build.json file
var version = _cfg.GetCVar(CVars.BuildVersion);
var forkId = _cfg.GetCVar(CVars.BuildForkId);

var versionText = Loc.GetString("changelog-version-unknown");

// Make sure these aren't empty, like in a dev env
if (!string.IsNullOrEmpty(version) && !string.IsNullOrEmpty(forkId))
{
versionText = Loc.GetString("changelog-version-tag",
("fork", forkId),
("version", version[..7])); // Only show the first 7 characters
}

// if else statements are ugly, shut up
VersionLabel.Text = versionText;

TabsUpdated();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ protected override void Open()
_window.OnReagentButtonPressed += (_, button, amount, isOutput) => SendMessage(new ChemMasterReagentAmountButtonMessage(button.Id, amount, button.IsBuffer, isOutput));
_window.OnSortMethodChanged += sortMethod => SendMessage(new ChemMasterSortMethodUpdated(sortMethod));
_window.OnTransferAmountChanged += amount => SendMessage(new ChemMasterTransferringAmountUpdated(amount));
_window.OnUpdateAmounts += amounts => SendMessage(new ChemMasterAmountsUpdated(amounts));
}

/// <summary>
Expand Down
8 changes: 7 additions & 1 deletion Content.Client/Chemistry/UI/ChemMasterWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,18 @@
</PanelContainer>
<RichTextLabel Name="AmountLabel" Text="{Loc 'chem-master-window-transferring-default-label'}" Margin="0 0 7 0" />
<LineEdit MinSize="140 0" Name="AmountLineEdit" Access="Public" PlaceHolder="{Loc 'chem-master-window-amount-placeholder'}" />
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<Button Name="SetAmountButton" Text="{Loc 'chem-master-window-set-amount-label'}" HorizontalExpand="True" StyleClasses="OpenRight"/>
<Button Name="SaveAsFrequentButton" Text="{Loc 'chem-master-window-save-as-frequent-label'}" HorizontalExpand="True" StyleClasses="OpenLeft"/>
</BoxContainer>
<RichTextLabel Text="Both of the above buttons use the textbox" />
<Control MinSize="0 5" />
<GridContainer
Name="AmountButtons"
VerticalExpand="True"
HorizontalExpand="True"
Margin="2 2 2 2"
Columns="5" />
Columns="4" />
</BoxContainer>
</BoxContainer>
</controls:FancyWindow>
55 changes: 42 additions & 13 deletions Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ public sealed partial class ChemMasterWindow : FancyWindow
public event Action<int>? OnAmountButtonPressed;
public event Action<int>? OnSortMethodChanged;
public event Action<int>? OnTransferAmountChanged;
public event Action<List<int>>? OnUpdateAmounts;

public readonly Button[] PillTypeButtons;

private List<int> _amounts = new();

private const string TransferringAmountColor = "#ffffff";
private ReagentSortMethod _currentSortMethod = ReagentSortMethod.Alphabetical;
private ChemMasterBoundUserInterfaceState? _lastState;
Expand All @@ -48,7 +52,9 @@ public ChemMasterWindow()

AmountLabel.HorizontalAlignment = HAlignment.Center;
AmountLineEdit.OnTextEntered += SetAmount;
AmountLineEdit.OnFocusExit += SetAmount;

SetAmountButton.OnPressed += _ => SetAmountText(AmountLineEdit.Text);
SaveAsFrequentButton.OnPressed += HandleSaveAsFrequentPressed;

// Pill type selection buttons, in total there are 20 pills.
// Pill rsi file should have states named as pill1, pill2, and so on.
Expand Down Expand Up @@ -130,15 +136,19 @@ public ChemMasterWindow()
BufferTransferButton.OnPressed += HandleDiscardTransferPress;
BufferDiscardButton.OnPressed += HandleDiscardTransferPress;

var amounts = new List<int>()
{
1, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 125, 150, 175, 200, 225, 250, 275, 300, 500
};
CreateAmountButtons();

OnAmountButtonPressed += amount => SetAmountText(amount.ToString());
}

private void CreateAmountButtons()
{
AmountButtons.DisposeAllChildren();

for (int i = 0; i < amounts.Count; i++)
for (int i = 0; i < _amounts.Count; i++)
{
var styleClass = StyleBase.ButtonOpenBoth;
var amount = amounts[i];
var amount = _amounts[i];
var columns = AmountButtons.Columns;

if (i == 0 || i % columns == 0)
Expand All @@ -158,8 +168,17 @@ public ChemMasterWindow()
button.OnPressed += _ => OnAmountButtonPressed?.Invoke(amount);
AmountButtons.AddChild(button);
}
}

OnAmountButtonPressed += amount => SetAmountText(amount.ToString());
private void HandleSaveAsFrequentPressed(BaseButton.ButtonEventArgs args)
{
if (!int.TryParse(AmountLineEdit.Text, out var amount)
|| _amounts.Any(a => amount == a))
return;

_amounts.Add(amount);
_amounts.Sort();
CreateAmountButtons();
}

private void HandleDiscardTransferPress(BaseButton.ButtonEventArgs args)
Expand Down Expand Up @@ -201,7 +220,7 @@ private void SortUpdated()
UpdatePanelInfo(_lastState);
}

private bool ValidateAmount(string newText)
private bool ValidateAmount(string newText, bool invokeEvent = true)
{
if (string.IsNullOrWhiteSpace(newText) || !int.TryParse(newText, out int amount))
{
Expand All @@ -210,16 +229,19 @@ private bool ValidateAmount(string newText)
}

_transferAmount = amount;
OnTransferAmountChanged?.Invoke(amount);

if (invokeEvent)
OnTransferAmountChanged?.Invoke(amount);

return true;
}

private void SetAmount(LineEdit.LineEditEventArgs args) =>
SetAmountText(args.Text);

private void SetAmountText(string newText)
private void SetAmountText(string newText, bool invokeEvent = true)
{
if (newText == _transferAmount.ToString() || !ValidateAmount(newText))
if (newText == _transferAmount.ToString() || !ValidateAmount(newText, invokeEvent))
return;

var localizedAmount = Loc.GetString(
Expand Down Expand Up @@ -274,7 +296,14 @@ public void UpdateState(BoundUserInterfaceState state)
// Ensure the Panel Info is updated, including UI elements for Buffer Volume, Output Container and so on
UpdatePanelInfo(castState);
HandleSortMethodChange(castState.SortMethod);
SetAmountText(castState.TransferringAmount.ToString());
SetAmountText(castState.TransferringAmount.ToString(), false);

if (_amounts != castState.Amounts)
{
_amounts = castState.Amounts;
_amounts.Sort();
CreateAmountButtons();
}

BufferCurrentVolume.Text = $" {castState.PillBufferCurrentVolume?.Int() ?? 0}u";

Expand Down
5 changes: 5 additions & 0 deletions Content.Client/Clothing/ClientClothingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ private void OnGetVisuals(EntityUid uid, ClothingComponent item, GetEquipmentVis
i++;
}

if (inventory.SpeciesId != null && item.Sprite != null
&& _cache.TryGetResource<RSIResource>(SpriteSpecifierSerializer.TextureRoot / item.Sprite, out var rsi)
&& rsi.RSI.TryGetState($"{layer.State}-{inventory.SpeciesId}", out _))
layer.State = $"{layer.State}-{inventory.SpeciesId}";

args.Layers.Add((key, layer));
}
}
Expand Down
11 changes: 11 additions & 0 deletions Content.Client/Crayon/CrayonSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,17 @@ protected override void FrameUpdate(FrameEventArgs args)
}

_parent.UIUpdateNeeded = false;

// Frontier: unlimited crayon, Delta V Port
if (_parent.Capacity == int.MaxValue)
{
_label.SetMarkup(Robust.Shared.Localization.Loc.GetString("crayon-drawing-label-unlimited",
("color", _parent.Color),
("state", _parent.SelectedState)));
return;
}
// End Frontier, Delta V Port

_label.SetMarkup(Robust.Shared.Localization.Loc.GetString("crayon-drawing-label",
("color",_parent.Color),
("state",_parent.SelectedState),
Expand Down
37 changes: 37 additions & 0 deletions Content.Client/DeltaV/AACTablet/UI/AACBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using Content.Shared.DeltaV.AACTablet;
using Content.Shared.DeltaV.QuickPhrase;
using Robust.Shared.Prototypes;

namespace Content.Client.DeltaV.AACTablet.UI;

public sealed class AACBoundUserInterface : BoundUserInterface
{
[ViewVariables]
private AACWindow? _window;

public AACBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

protected override void Open()
{
base.Open();
_window?.Close();
_window = new AACWindow();
_window.OpenCentered();

_window.PhraseButtonPressed += OnPhraseButtonPressed;
_window.OnClose += Close;
}

private void OnPhraseButtonPressed(ProtoId<QuickPhrasePrototype> phraseId)
{
SendMessage(new AACTabletSendPhraseMessage(phraseId));
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
_window?.Orphan();
}
}
9 changes: 9 additions & 0 deletions Content.Client/DeltaV/AACTablet/UI/AACWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="AAC Tablet"
Resizable="False"
SetSize="540 300"
MinSize="540 300">
<ScrollContainer HScrollEnabled="False" Name="WindowBody">
</ScrollContainer>
</controls:FancyWindow>
Loading

0 comments on commit 4697d2e

Please sign in to comment.