Skip to content

Commit

Permalink
Merge branch 'master' into advanced-boots
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheackraze authored Oct 18, 2024
2 parents 37f7385 + f71965e commit 708f5a3
Show file tree
Hide file tree
Showing 640 changed files with 18,800 additions and 118,487 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-test-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ jobs:
run: dotnet test --no-build --configuration DebugOpt Content.Tests/Content.Tests.csproj -- NUnit.ConsoleOut=0

# - name: Run Content.IntegrationTests
# shell: pwsh
# run: |
# $env:DOTNET_gcServer=1
# dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed
# shell: pwsh
# run: |
# $env:DOTNET_gcServer=1
# dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj --filter FullyQualifiedName!~ShipyardTest -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed
ci-success:
name: Build & Test Debug
needs:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/nf-shipyard-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ jobs:
- 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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-credits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update Credits
commit_author: FrontierATC <zuuswa@gmail.com>
commit_author: FrontierATC <zuuswa@gmail.com>
44 changes: 38 additions & 6 deletions Content.Client/Administration/UI/CustomControls/HSeparator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,53 @@

namespace Content.Client.Administration.UI.CustomControls;

/**
* FRONTIER CHANGE: Added SeparatorColor so it can be set in the UI.
*/
public sealed class HSeparator : Control
{
private static readonly Color SeparatorColor = Color.FromHex("#3D4059");
private static readonly Color DefaultSeparatorColor = Color.FromHex("#3D4059");

private Color _separatorColor = DefaultSeparatorColor;
public Color SeparatorColor
{
get => _separatorColor;
set
{
_separatorColor = Color.FromHex(value.ToHex());
UpdateSeparatorColor();
}
}

private PanelContainer? _panelContainer = null;

public HSeparator(Color color)
{
AddChild(new PanelContainer
SeparatorColor = color;
Initialize();
}

public HSeparator() : this(DefaultSeparatorColor) { }

private void Initialize()
{
_panelContainer = new PanelContainer
{
PanelOverride = new StyleBoxFlat
{
BackgroundColor = color,
ContentMarginBottomOverride = 2, ContentMarginLeftOverride = 2
BackgroundColor = SeparatorColor,
ContentMarginBottomOverride = 2,
ContentMarginLeftOverride = 2
}
});
};
AddChild(_panelContainer);
}

public HSeparator() : this(SeparatorColor) { }
private void UpdateSeparatorColor()
{
if (_panelContainer?.PanelOverride is StyleBoxFlat styleBox)
{
styleBox.BackgroundColor = SeparatorColor;
}
}
}
2 changes: 2 additions & 0 deletions Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Replays;
using Robust.Shared.Timing;
using Content.Client._NF.Emp.Overlays; // Frontier

namespace Content.Client.Entry
{
Expand Down Expand Up @@ -154,6 +155,7 @@ public override void PostInit()

_overlayManager.AddOverlay(new SingularityOverlay());
_overlayManager.AddOverlay(new RadiationPulseOverlay());
_overlayManager.AddOverlay(new EmpBlastOverlay()); // Frontier
_chatManager.Initialize();
_clientPreferencesManager.Initialize();
_euiManager.Initialize();
Expand Down
37 changes: 16 additions & 21 deletions Content.Client/GameTicking/Managers/ClientGameTicker.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
using System.Linq;
using Content.Client.Administration.Managers;
using Content.Client.Gameplay;
using Content.Client.Lobby;
using Content.Client.RoundEnd;
using Content.Shared.GameTicking;
using Content.Shared.GameWindow;
using Content.Shared.Roles;
using JetBrains.Annotations;
using Robust.Client.Graphics;
using Robust.Client.State;
using Robust.Client.UserInterface;
using Robust.Shared.Prototypes;

namespace Content.Client.GameTicking.Managers
{
Expand All @@ -21,8 +20,7 @@ public sealed class ClientGameTicker : SharedGameTicker
[Dependency] private readonly IClyde _clyde = default!;
[Dependency] private readonly IUserInterfaceManager _userInterfaceManager = default!;

private Dictionary<NetEntity, Dictionary<ProtoId<JobPrototype>, int?>> _jobsAvailable = new();
private Dictionary<NetEntity, string> _stationNames = new();
private Dictionary<NetEntity, StationJobInformation> _stationJobInformationList = new();

[ViewVariables] public bool AreWeReady { get; private set; }
[ViewVariables] public bool IsGameStarted { get; private set; }
Expand All @@ -33,13 +31,21 @@ public sealed class ClientGameTicker : SharedGameTicker
[ViewVariables] public TimeSpan StartTime { get; private set; }
[ViewVariables] public new bool Paused { get; private set; }

[ViewVariables] public IReadOnlyDictionary<NetEntity, Dictionary<ProtoId<JobPrototype>, int?>> JobsAvailable => _jobsAvailable;
[ViewVariables] public IReadOnlyDictionary<NetEntity, string> StationNames => _stationNames;
[ViewVariables] public IReadOnlyDictionary<NetEntity, StationJobInformation> StationJobInformationList => _stationJobInformationList;

// Frontier addition
// Replaced StationNames with a getter that uses _stationJobInformationList
[ViewVariables]
public IReadOnlyDictionary<NetEntity, string> StationNames =>
_stationJobInformationList.ToDictionary(
kvp => kvp.Key,
kvp => kvp.Value.StationName
);

public event Action? InfoBlobUpdated;
public event Action? LobbyStatusUpdated;
public event Action? LobbyLateJoinStatusUpdated;
public event Action<IReadOnlyDictionary<NetEntity, Dictionary<ProtoId<JobPrototype>, int?>>>? LobbyJobsAvailableUpdated;
public event Action<IReadOnlyDictionary<NetEntity, StationJobInformation>>? LobbyJobsAvailableUpdated;

public override void Initialize()
{
Expand Down Expand Up @@ -87,20 +93,9 @@ private void LateJoinStatus(TickerLateJoinStatusEvent message)

private void UpdateJobsAvailable(TickerJobsAvailableEvent message)
{
_jobsAvailable.Clear();

foreach (var (job, data) in message.JobsAvailableByStation)
{
_jobsAvailable[job] = data;
}

_stationNames.Clear();
foreach (var weh in message.StationNames)
{
_stationNames[weh.Key] = weh.Value;
}

LobbyJobsAvailableUpdated?.Invoke(JobsAvailable);
_stationJobInformationList.Clear();
_stationJobInformationList = message.StationJobList;
LobbyJobsAvailableUpdated?.Invoke(StationJobInformationList);
}

private void JoinLobby(TickerJoinLobbyEvent message)
Expand Down
21 changes: 21 additions & 0 deletions Content.Client/Kitchen/UI/MicrowaveBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,24 @@ public sealed class MicrowaveBoundUserInterface : BoundUserInterface
[ViewVariables]
private readonly Dictionary<int, ReagentQuantity> _reagents = new();

// Frontier: UI parameters
private readonly string _menuTitle;
private readonly string _leftFlavorText;

public MicrowaveBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
// Frontier: switch UI params based on key
if ((MicrowaveUiKey)uiKey == MicrowaveUiKey.ElectricRangeKey)
{
_menuTitle = "microwave-menu-range-title";
_leftFlavorText = "microwave-menu-range-footer-flavor-left";
}
else
{
_menuTitle = "microwave-menu-title";
_leftFlavorText = "microwave-menu-footer-flavor-left";
}
// End Frontier
}

protected override void Open()
Expand Down Expand Up @@ -60,6 +76,11 @@ protected override void Open()
("time", Loc.GetString("microwave-menu-instant-button")));
}
};

// Frontier: UI customization
_menu.Title = Loc.GetString(_menuTitle);
_menu.LeftFooter.Text = Loc.GetString(_leftFlavorText);
// End Frontier
}

protected override void UpdateState(BoundUserInterfaceState state)
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Kitchen/UI/MicrowaveMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<BoxContainer Orientation="Vertical">
<PanelContainer StyleClasses="LowDivider" />
<BoxContainer Orientation="Horizontal" Margin="10 2 5 0" VerticalAlignment="Bottom">
<Label Text="{Loc 'microwave-menu-footer-flavor-left'}" StyleClasses="WindowFooterText" />
<Label Text="{Loc 'microwave-menu-footer-flavor-left'}" StyleClasses="WindowFooterText" Name="LeftFooter" Access="Public"/> <!-- Frontier: add Name, Access -->
<Label Text="{Loc 'microwave-menu-footer-flavor-right'}" StyleClasses="WindowFooterText"
HorizontalAlignment="Right" HorizontalExpand="True" Margin="0 0 5 0" />
<TextureRect StyleClasses="NTLogoDark" Stretch="KeepAspectCentered" VerticalAlignment="Center" HorizontalAlignment="Right" SetSize="19 19"/>
Expand Down
42 changes: 20 additions & 22 deletions Content.Client/LateJoin/LateJoinGui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Content.Client.UserInterface.Controls;
using Content.Client.Players.PlayTimeTracking;
using Content.Shared.CCVar;
using Content.Shared.GameTicking;
using Content.Shared.Preferences;
using Content.Shared.Roles;
using Content.Shared.StatusIcon;
Expand Down Expand Up @@ -171,12 +172,12 @@ private void RebuildUI()
{
var departmentName = Loc.GetString($"department-{department.ID}");
_jobCategories[id] = new Dictionary<string, BoxContainer>();
var stationAvailable = _gameTicker.JobsAvailable[id];
var stationAvailable = _gameTicker.StationJobInformationList[id];
var jobsAvailable = new List<JobPrototype>();

foreach (var jobId in department.Roles)
{
if (!stationAvailable.ContainsKey(jobId))
if (!stationAvailable.JobsAvailable.ContainsKey(jobId))
continue;

jobsAvailable.Add(_prototypeManager.Index<JobPrototype>(jobId));
Expand Down Expand Up @@ -225,7 +226,8 @@ private void RebuildUI()

foreach (var prototype in jobsAvailable)
{
var value = stationAvailable[prototype.ID];
// Frontier: stationAvailable[prototype.ID]; -> stationAvailable.JobsAvailable[prototype.ID];
var value = stationAvailable.JobsAvailable[prototype.ID];

var jobLabel = new Label
{
Expand Down Expand Up @@ -292,29 +294,25 @@ private void RebuildUI()
}
}

private void JobsAvailableUpdated(IReadOnlyDictionary<NetEntity, Dictionary<ProtoId<JobPrototype>, int?>> updatedJobs)
private void JobsAvailableUpdated(IReadOnlyDictionary<NetEntity, StationJobInformation> updatedJobs)
{
foreach (var stationEntries in updatedJobs)
// Frontier: Made this more readable with simplified comparisons and LINQ expressions.
// Feel free to replace this with upstream code whenever, just mind that
// updatedJobs is now a dictionary of NetEntity to StationJobInformation.
// I changed this: jobInformation.TryGetValue to this: jobInformation.JobsAvailable.TryGetValue
// Godspeed.
foreach (var (stationNetEntity, jobInformation) in updatedJobs)
{
if (_jobButtons.ContainsKey(stationEntries.Key))
if (!_jobButtons.TryGetValue(stationNetEntity, out var existingJobEntries))
continue;
foreach (var existingJobEntry in existingJobEntries)
{
var jobsAvailable = stationEntries.Value;

var existingJobEntries = _jobButtons[stationEntries.Key];
foreach (var existingJobEntry in existingJobEntries)
if (!jobInformation.JobsAvailable.TryGetValue(existingJobEntry.Key, out var updatedJobValue))
continue;
foreach (var matchingJobButton in existingJobEntry.Value.Where(matchingJobButton => matchingJobButton.Amount != updatedJobValue))
{
if (jobsAvailable.ContainsKey(existingJobEntry.Key))
{
var updatedJobValue = jobsAvailable[existingJobEntry.Key];
foreach (var matchingJobButton in existingJobEntry.Value)
{
if (matchingJobButton.Amount != updatedJobValue)
{
matchingJobButton.RefreshLabel(updatedJobValue);
matchingJobButton.Disabled |= matchingJobButton.Amount == 0;
}
}
}
matchingJobButton.RefreshLabel(updatedJobValue);
matchingJobButton.Disabled |= matchingJobButton.Amount == 0;
}
}
}
Expand Down
15 changes: 10 additions & 5 deletions Content.Client/Lobby/LobbyState.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using Content.Client._NF.Latejoin;
using Content.Client.Chat.Managers;
using Content.Client._NF.LateJoin;
using Content.Client.Audio;
using Content.Client.Eui;
using Content.Client.GameTicking.Managers;
using Content.Client.LateJoin;
using Content.Client.Lobby.UI;
using Content.Client.Message;
using Content.Client.UserInterface.Systems.Chat;
Expand All @@ -13,6 +12,7 @@
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Timing;
using PickerWindow = Content.Client._NF.LateJoin.Windows.PickerWindow;


namespace Content.Client.Lobby
Expand All @@ -33,6 +33,9 @@ public sealed class LobbyState : Robust.Client.State.State
protected override Type? LinkedScreenType { get; } = typeof(LobbyGui);
public LobbyGui? Lobby;

// Frontier - save pickerwindow so it opens only once
private PickerWindow? _pickerWindow = null;

protected override void Startup()
{
if (_userInterfaceManager.ActiveScreen == null)
Expand Down Expand Up @@ -99,8 +102,10 @@ private void OnReadyPressed(BaseButton.ButtonEventArgs args)
{
return;
}

new NFLateJoinGui().OpenCentered();
// Frontier to downstream: if you want to skip the first window and go straight to station picker,
// simply change the enum to station or crew in the PickerWindow constructor.
_pickerWindow ??= new PickerWindow();
_pickerWindow.OpenCentered();
}

private void OnReadyToggled(BaseButton.ButtonToggledEventArgs args)
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Nyanotrasen/Mail/MailSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected override void OnAppearanceChange(EntityUid uid, MailComponent componen
if (args.Sprite == null)
return;

if (_appearance.TryGetData(uid, MailVisuals.JobIcon, out string job) ||
if (!_appearance.TryGetData(uid, MailVisuals.JobIcon, out string job) ||
!_prototypeManager.TryIndex<JobIconPrototype>(job, out var icon))
return;

Expand Down
5 changes: 2 additions & 3 deletions Content.Client/_EE/Guidebook/Controls/GuideFoodSource.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
Margin="2 0 0 0"/> <!-- Frontier: Label<RichTextLabel -->
</BoxContainer>
<BoxContainer Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center"> <!-- Frontier: remove HorizontalExpand -->
<TextureRect HorizontalAlignment="Center"
Name="ProcessingTexture"
Access="Public"/>
<BoxContainer Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" VerticalExpand="True" Name="ProcessingTextures"> <!-- Frontier: support for multiple machines -->
</BoxContainer>
<RichTextLabel Name="ProcessingLabel"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Expand Down
Loading

0 comments on commit 708f5a3

Please sign in to comment.