diff --git a/.editorconfig b/.editorconfig index 1583c600aa56..8b9214445391 100644 --- a/.editorconfig +++ b/.editorconfig @@ -344,6 +344,9 @@ resharper_keep_existing_attribute_arrangement = true resharper_wrap_chained_binary_patterns = chop_if_long resharper_wrap_chained_method_calls = chop_if_long resharper_csharp_trailing_comma_in_multiline_lists = true +resharper_csharp_qualified_using_at_nested_scope = false +resharper_csharp_prefer_qualified_reference = false +resharper_csharp_allow_alias = false [*.{csproj,xml,yml,yaml,dll.config,msbuildproj,targets,props}] indent_size = 2 diff --git a/Content.Benchmarks/MapLoadBenchmark.cs b/Content.Benchmarks/MapLoadBenchmark.cs index e8a104df2738..828e5ad9ac9a 100644 --- a/Content.Benchmarks/MapLoadBenchmark.cs +++ b/Content.Benchmarks/MapLoadBenchmark.cs @@ -46,7 +46,7 @@ public async Task Cleanup() PoolManager.Shutdown(); } - public static readonly string[] MapsSource = { "Empty", "Satlern", "Box", "Bagel", "Dev", "CentComm", "Core", "TestTeg", "Packed", "Omega", "Reach", "Meta", "Marathon", "MeteorArena", "Fland", "Oasis", "Cog", "Saltern2", "Cluster2", "Atlas2"}; + public static readonly string[] MapsSource = { "Empty", "Satlern", "Box", "Bagel", "Dev", "CentComm", "Core", "TestTeg", "Packed", "Omega", "Reach", "Meta", "Marathon", "MeteorArena", "Fland", "Oasis", "Cog", "Convex", "Saltern2", "Cluster2", "Atlas2"}; [ParamsSource(nameof(MapsSource))] public string Map; diff --git a/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs b/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs index 44c40143d830..04075000f5b9 100644 --- a/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs +++ b/Content.Client/Cargo/BUI/CargoBountyConsoleBoundUserInterface.cs @@ -39,6 +39,6 @@ protected override void UpdateState(BoundUserInterfaceState message) if (message is not CargoBountyConsoleState state) return; - _menu?.UpdateEntries(state.Bounties, state.UntilNextSkip); + _menu?.UpdateEntries(state.Bounties, state.History, state.UntilNextSkip); } } diff --git a/Content.Client/Cargo/UI/BountyHistoryEntry.xaml b/Content.Client/Cargo/UI/BountyHistoryEntry.xaml new file mode 100644 index 000000000000..905cf020ed1c --- /dev/null +++ b/Content.Client/Cargo/UI/BountyHistoryEntry.xaml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + diff --git a/Content.Client/Cargo/UI/BountyHistoryEntry.xaml.cs b/Content.Client/Cargo/UI/BountyHistoryEntry.xaml.cs new file mode 100644 index 000000000000..54804be641c3 --- /dev/null +++ b/Content.Client/Cargo/UI/BountyHistoryEntry.xaml.cs @@ -0,0 +1,49 @@ +using Content.Client.Message; +using Content.Shared.Cargo; +using Content.Shared.Cargo.Prototypes; +using Robust.Client.AutoGenerated; +using Robust.Client.UserInterface.Controls; +using Robust.Client.UserInterface.XAML; +using Robust.Shared.Prototypes; +using Robust.Shared.Timing; + +namespace Content.Client.Cargo.UI; + +[GenerateTypedNameReferences] +public sealed partial class BountyHistoryEntry : BoxContainer +{ + [Dependency] private readonly IPrototypeManager _prototype = default!; + + public BountyHistoryEntry(CargoBountyHistoryData bounty) + { + RobustXamlLoader.Load(this); + IoCManager.InjectDependencies(this); + + if (!_prototype.TryIndex(bounty.Bounty, out var bountyPrototype)) + return; + + var items = new List(); + foreach (var entry in bountyPrototype.Entries) + { + items.Add(Loc.GetString("bounty-console-manifest-entry", + ("amount", entry.Amount), + ("item", Loc.GetString(entry.Name)))); + } + + ManifestLabel.SetMarkup(Loc.GetString("bounty-console-manifest-label", ("item", string.Join(", ", items)))); + RewardLabel.SetMarkup(Loc.GetString("bounty-console-reward-label", ("reward", bountyPrototype.Reward))); + IdLabel.SetMarkup(Loc.GetString("bounty-console-id-label", ("id", bounty.Id))); + + TimestampLabel.SetMarkup(bounty.Timestamp.ToString(@"hh\:mm\:ss")); + + if (bounty.Result == CargoBountyHistoryData.BountyResult.Completed) + { + NoticeLabel.SetMarkup(Loc.GetString("bounty-console-history-notice-completed-label")); + } + else + { + NoticeLabel.SetMarkup(Loc.GetString("bounty-console-history-notice-skipped-label", + ("id", bounty.ActorName ?? ""))); + } + } +} diff --git a/Content.Client/Cargo/UI/CargoBountyMenu.xaml b/Content.Client/Cargo/UI/CargoBountyMenu.xaml index bb263ff6c4ab..526ba69129bb 100644 --- a/Content.Client/Cargo/UI/CargoBountyMenu.xaml +++ b/Content.Client/Cargo/UI/CargoBountyMenu.xaml @@ -11,15 +11,28 @@ - - - - + + + + + + + diff --git a/Content.Client/Cargo/UI/CargoBountyMenu.xaml.cs b/Content.Client/Cargo/UI/CargoBountyMenu.xaml.cs index 3767b45e4bed..c289fb6ed83c 100644 --- a/Content.Client/Cargo/UI/CargoBountyMenu.xaml.cs +++ b/Content.Client/Cargo/UI/CargoBountyMenu.xaml.cs @@ -15,9 +15,12 @@ public sealed partial class CargoBountyMenu : FancyWindow public CargoBountyMenu() { RobustXamlLoader.Load(this); + + MasterTabContainer.SetTabTitle(0, Loc.GetString("bounty-console-tab-available-label")); + MasterTabContainer.SetTabTitle(1, Loc.GetString("bounty-console-tab-history-label")); } - public void UpdateEntries(List bounties, TimeSpan untilNextSkip) + public void UpdateEntries(List bounties, List history, TimeSpan untilNextSkip) { BountyEntriesContainer.Children.Clear(); foreach (var b in bounties) @@ -32,5 +35,21 @@ public void UpdateEntries(List bounties, TimeSpan untilNextSkip { MinHeight = 10 }); + + BountyHistoryContainer.Children.Clear(); + if (history.Count == 0) + { + NoHistoryLabel.Visible = true; + } + else + { + NoHistoryLabel.Visible = false; + + // Show the history in reverse, so last entry is first in the list + for (var i = history.Count - 1; i >= 0; i--) + { + BountyHistoryContainer.AddChild(new BountyHistoryEntry(history[i])); + } + } } } diff --git a/Content.Client/Changelog/ChangelogWindow.xaml.cs b/Content.Client/Changelog/ChangelogWindow.xaml.cs index 9b7fd7543692..cb07e16a9c28 100644 --- a/Content.Client/Changelog/ChangelogWindow.xaml.cs +++ b/Content.Client/Changelog/ChangelogWindow.xaml.cs @@ -8,6 +8,8 @@ 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 @@ -15,8 +17,9 @@ 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() { @@ -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(); } diff --git a/Content.Client/CriminalRecords/CriminalRecordsConsoleBoundUserInterface.cs b/Content.Client/CriminalRecords/CriminalRecordsConsoleBoundUserInterface.cs index 9047624f49be..d5cc4ecfa9a0 100644 --- a/Content.Client/CriminalRecords/CriminalRecordsConsoleBoundUserInterface.cs +++ b/Content.Client/CriminalRecords/CriminalRecordsConsoleBoundUserInterface.cs @@ -39,6 +39,8 @@ protected override void Open() SendMessage(new CriminalRecordChangeStatus(status, null)); _window.OnDialogConfirmed += (status, reason) => SendMessage(new CriminalRecordChangeStatus(status, reason)); + _window.OnStatusFilterPressed += (statusFilter) => + SendMessage(new CriminalRecordSetStatusFilter(statusFilter)); _window.OnHistoryUpdated += UpdateHistory; _window.OnHistoryClosed += () => _historyWindow?.Close(); _window.OnClose += Close; diff --git a/Content.Client/CriminalRecords/CriminalRecordsConsoleWindow.xaml b/Content.Client/CriminalRecords/CriminalRecordsConsoleWindow.xaml index 77da0ba1b065..d36718cf08ba 100644 --- a/Content.Client/CriminalRecords/CriminalRecordsConsoleWindow.xaml +++ b/Content.Client/CriminalRecords/CriminalRecordsConsoleWindow.xaml @@ -1,36 +1,142 @@ + xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" + Title="{Loc 'criminal-records-console-window-title'}" + MinSize="695 440"> - - - - - - - - -