Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream merge #295

Merged
merged 41 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a123791
Fix bagel vox box (#32208)
lzk228 Sep 18, 2024
8322b1c
New publish workflow for Robust.Cdn (#32222)
PJB3005 Sep 18, 2024
b55366c
chmod +x publish_multi_request.py (#32274)
PJB3005 Sep 18, 2024
489938c
ghost-role-information-silicon-rules (#32275)
AsnDen Sep 18, 2024
ed83593
Fix guidebook cakebatter recipe (#32276)
Calecute Sep 18, 2024
697f4f5
Automatic changelog update
PJBot Sep 18, 2024
9fad1ab
Wires ui tooltip localization (#32284)
chavonadelal Sep 18, 2024
6d41775
Localization of the shuttle call sender (#32286)
chavonadelal Sep 18, 2024
55b7e3c
change jamjar glasses description (#32215)
Skarletto Sep 18, 2024
58119bc
Fix recycler eating materials (Salvage mains rejoice) (#32144)
beck-thompson Sep 18, 2024
64aab9e
Automatic changelog update
PJBot Sep 18, 2024
ba24ebf
Localization cooldown/remaining string in alerts (#32282)
chavonadelal Sep 18, 2024
8a924c8
add interaction success/failure events (#32216)
deltanedas Sep 18, 2024
2c9a302
make epinephrine adrenaline (#32076)
deltanedas Sep 18, 2024
a8686b3
Automatic changelog update
PJBot Sep 18, 2024
d4a5bc8
Fix unbuckling others when clicking on the strap entity (#29998)
ShadowCommander Sep 18, 2024
7ceb2d2
Add a method to get the first available ItemSlot (#29846)
ShadowCommander Sep 18, 2024
e6e1664
Automatic changelog update
PJBot Sep 18, 2024
84062da
let FlashArea be called from shared (#30343)
deltanedas Sep 18, 2024
1c839da
move TriggerExplosion to shared (#30227)
deltanedas Sep 19, 2024
4f77709
Add flip button to mapping state (#30636)
metalgearsloth Sep 19, 2024
6958789
Give prototype refactor (#29697)
ShadowCommander Sep 19, 2024
cc7e5e0
Allow containment field generators to be enabled on mapinit (#31158)
SlamBamActionman Sep 19, 2024
c2a201d
Make fire leave burnt decals on the tiles (#31939)
Winkarst-cpu Sep 19, 2024
0c5a053
Automatic changelog update
PJBot Sep 19, 2024
1c3cfee
Coordinates under IFF Label on Mass Scanners and Shuttle Consoles (#3…
ArchRBX Sep 19, 2024
c2f0626
Automatic changelog update
PJBot Sep 19, 2024
9c905cd
Fix TEG acting as infinite energy source on destruction (#29972)
luizwritescode Sep 19, 2024
b129629
Automatic changelog update
PJBot Sep 19, 2024
550c423
Clean up solution regen and drain comps (#29777)
IProduceWidgets Sep 19, 2024
bdd0561
Make status effect networking not use `TryAddStatusEffect` (#28766)
ElectroJr Sep 19, 2024
3fc9f96
Move PlaceableSurfaceComponent usages to PlaceableSurfaceSystem (#28384)
ShadowCommander Sep 19, 2024
3acf6b9
Padded ItemStatus Text (#29560)
Willhelm53 Sep 19, 2024
94ad76f
Fix Set Outfit command/verb (#29672)
Tayrtahn Sep 19, 2024
59a8f44
adds plasma and uranium arrows (#31241)
Boaz1111 Sep 19, 2024
75ff65d
Automatic changelog update
PJBot Sep 19, 2024
1468cbd
Wanted list cartridge (#31223)
Ertanic Sep 19, 2024
ccadcc9
Automatic changelog update
PJBot Sep 19, 2024
854bfd2
Crew Monitor filter (#31659)
Errant-4 Sep 19, 2024
eb90479
Automatic changelog update
PJBot Sep 19, 2024
e621474
Merge remote-tracking branch 'space-wizards/master' into upstream
irismessage Sep 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,10 @@ jobs:
- name: Package client
run: dotnet run --project Content.Packaging client --no-wipe-release

- name: Upload build artifact
id: artifact-upload-step
uses: actions/upload-artifact@v4
with:
name: build
path: release/*.zip
compression-level: 0
retention-days: 0

- name: Publish version
run: Tools/publish_github_artifact.py
run: Tools/publish_multi_request.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
ARTIFACT_ID: ${{ steps.artifact-upload-step.outputs.artifact-id }}
GITHUB_REPOSITORY: ${{ vars.GITHUB_REPOSITORY }}

- name: Publish changelog (Discord)
Expand All @@ -68,8 +57,3 @@ jobs:
run: Tools/actions_changelog_rss.py
env:
CHANGELOG_RSS_KEY: ${{ secrets.CHANGELOG_RSS_KEY }}

- uses: geekyeggo/delete-artifact@v5
if: always()
with:
name: build
2 changes: 1 addition & 1 deletion Content.Client/Actions/UI/ActionAlertTooltip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected override void FrameUpdate(FrameEventArgs args)
{
var duration = Cooldown.Value.End - Cooldown.Value.Start;

if (!FormattedMessage.TryFromMarkup($"[color=#a10505]{(int) duration.TotalSeconds} sec cooldown ({(int) timeLeft.TotalSeconds + 1} sec remaining)[/color]", out var markup))
if (!FormattedMessage.TryFromMarkup(Loc.GetString("ui-actionslot-duration", ("duration", (int)duration.TotalSeconds), ("timeLeft", (int)timeLeft.TotalSeconds + 1)), out var markup))
return;

_cooldownLabel.SetMessage(markup);
Expand Down
18 changes: 13 additions & 5 deletions Content.Client/Administration/UI/SetOutfit/SetOutfitMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
using System.Linq;
using System.Numerics;
using Content.Client.UserInterface.Controls;
using Content.Shared.Preferences.Loadouts;
using Content.Shared.Roles;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Prototypes;

namespace Content.Client.Administration.UI.SetOutfit
Expand Down Expand Up @@ -65,9 +64,18 @@ private void SearchBarOnOnTextChanged(LineEdit.LineEditEventArgs obj)
PopulateByFilter(SearchBar.Text);
}

private IEnumerable<StartingGearPrototype> GetPrototypes()
{
// Filter out any StartingGearPrototypes that belong to loadouts
var loadouts = _prototypeManager.EnumeratePrototypes<LoadoutPrototype>();
var loadoutGears = loadouts.Select(l => l.StartingGear);
return _prototypeManager.EnumeratePrototypes<StartingGearPrototype>()
.Where(p => !loadoutGears.Contains(p.ID));
}

private void PopulateList()
{
foreach (var gear in _prototypeManager.EnumeratePrototypes<StartingGearPrototype>())
foreach (var gear in GetPrototypes())
{
OutfitList.Add(GetItem(gear, OutfitList));
}
Expand All @@ -76,7 +84,7 @@ private void PopulateList()
private void PopulateByFilter(string filter)
{
OutfitList.Clear();
foreach (var gear in _prototypeManager.EnumeratePrototypes<StartingGearPrototype>())
foreach (var gear in GetPrototypes())
{
if (!string.IsNullOrEmpty(filter) &&
gear.ID.ToLowerInvariant().Contains(filter.Trim().ToLowerInvariant()))
Expand Down
30 changes: 30 additions & 0 deletions Content.Client/CartridgeLoader/Cartridges/WantedListUi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Content.Client.UserInterface.Fragments;
using Content.Shared.CartridgeLoader.Cartridges;
using Robust.Client.UserInterface;

namespace Content.Client.CartridgeLoader.Cartridges;

public sealed partial class WantedListUi : UIFragment
{
private WantedListUiFragment? _fragment;

public override Control GetUIFragmentRoot()
{
return _fragment!;
}

public override void Setup(BoundUserInterface userInterface, EntityUid? fragmentOwner)
{
_fragment = new WantedListUiFragment();
}

public override void UpdateState(BoundUserInterfaceState state)
{
switch (state)
{
case WantedListUiState cast:
_fragment?.UpdateState(cast.Records);
break;
}
}
}
240 changes: 240 additions & 0 deletions Content.Client/CartridgeLoader/Cartridges/WantedListUiFragment.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
using System.Linq;
using Content.Client.UserInterface.Controls;
using Content.Shared.CriminalRecords.Systems;
using Content.Shared.Security;
using Content.Shared.StatusIcon;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Input;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;

namespace Content.Client.CartridgeLoader.Cartridges;

[GenerateTypedNameReferences]
public sealed partial class WantedListUiFragment : BoxContainer
{
[Dependency] private readonly IEntitySystemManager _entitySystem = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
private readonly SpriteSystem _spriteSystem;

private string? _selectedTargetName;
private List<WantedRecord> _wantedRecords = new();

public WantedListUiFragment()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_spriteSystem = _entitySystem.GetEntitySystem<SpriteSystem>();

SearchBar.OnTextChanged += OnSearchBarTextChanged;
}

private void OnSearchBarTextChanged(LineEdit.LineEditEventArgs args)
{
var found = !String.IsNullOrWhiteSpace(args.Text)
? _wantedRecords.FindAll(r =>
r.TargetInfo.Name.Contains(args.Text) ||
r.Status.ToString().Contains(args.Text, StringComparison.OrdinalIgnoreCase))
: _wantedRecords;

UpdateState(found, false);
}

public void UpdateState(List<WantedRecord> records, bool refresh = true)
{
if (records.Count == 0)
{
NoRecords.Visible = true;
RecordsList.Visible = false;
RecordUnselected.Visible = false;
PersonContainer.Visible = false;

_selectedTargetName = null;
if (refresh)
_wantedRecords.Clear();

RecordsList.PopulateList(new List<ListData>());

return;
}

NoRecords.Visible = false;
RecordsList.Visible = true;
RecordUnselected.Visible = true;
PersonContainer.Visible = false;

var dataList = records.Select(r => new StatusListData(r)).ToList();

RecordsList.GenerateItem = GenerateItem;
RecordsList.ItemPressed = OnItemSelected;
RecordsList.PopulateList(dataList);

if (refresh)
_wantedRecords = records;
}

private void OnItemSelected(BaseButton.ButtonEventArgs args, ListData data)
{
if (data is not StatusListData(var record))
return;

FormattedMessage GetLoc(string fluentId, params (string,object)[] args)
{
var msg = new FormattedMessage();
var fluent = Loc.GetString(fluentId, args);
msg.AddMarkupPermissive(fluent);
return msg;
}

// Set personal info
PersonName.Text = record.TargetInfo.Name;
TargetAge.SetMessage(GetLoc(
"wanted-list-age-label",
("age", record.TargetInfo.Age)
));
TargetJob.SetMessage(GetLoc(
"wanted-list-job-label",
("job", record.TargetInfo.JobTitle.ToLower())
));
TargetSpecies.SetMessage(GetLoc(
"wanted-list-species-label",
("species", record.TargetInfo.Species.ToLower())
));
TargetGender.SetMessage(GetLoc(
"wanted-list-gender-label",
("gender", record.TargetInfo.Gender)
));

// Set reason
WantedReason.SetMessage(GetLoc(
"wanted-list-reason-label",
("reason", record.Reason ?? Loc.GetString("wanted-list-unknown-reason-label"))
));

// Set status
PersonState.SetMessage(GetLoc(
"wanted-list-status-label",
("status", record.Status.ToString().ToLower())
));

// Set initiator
InitiatorName.SetMessage(GetLoc(
"wanted-list-initiator-label",
("initiator", record.Initiator ?? Loc.GetString("wanted-list-unknown-initiator-label"))
));

// History table
// Clear table if it exists
HistoryTable.RemoveAllChildren();

HistoryTable.AddChild(new Label()
{
Text = Loc.GetString("wanted-list-history-table-time-col"),
StyleClasses = { "LabelSmall" },
HorizontalAlignment = HAlignment.Center,
});
HistoryTable.AddChild(new Label()
{
Text = Loc.GetString("wanted-list-history-table-reason-col"),
StyleClasses = { "LabelSmall" },
HorizontalAlignment = HAlignment.Center,
HorizontalExpand = true,
});

HistoryTable.AddChild(new Label()
{
Text = Loc.GetString("wanted-list-history-table-initiator-col"),
StyleClasses = { "LabelSmall" },
HorizontalAlignment = HAlignment.Center,
});

if (record.History.Count > 0)
{
HistoryTable.Visible = true;

foreach (var history in record.History.OrderByDescending(h => h.AddTime))
{
HistoryTable.AddChild(new Label()
{
Text = $"{history.AddTime.Hours:00}:{history.AddTime.Minutes:00}:{history.AddTime.Seconds:00}",
StyleClasses = { "LabelSmall" },
VerticalAlignment = VAlignment.Top,
});

HistoryTable.AddChild(new RichTextLabel()
{
Text = $"[color=white]{history.Crime}[/color]",
HorizontalExpand = true,
VerticalAlignment = VAlignment.Top,
StyleClasses = { "LabelSubText" },
Margin = new(10f, 0f),
});

HistoryTable.AddChild(new RichTextLabel()
{
Text = $"[color=white]{history.InitiatorName}[/color]",
StyleClasses = { "LabelSubText" },
VerticalAlignment = VAlignment.Top,
});
}
}

RecordUnselected.Visible = false;
PersonContainer.Visible = true;

// Save selected item
_selectedTargetName = record.TargetInfo.Name;
}

private void GenerateItem(ListData data, ListContainerButton button)
{
if (data is not StatusListData(var record))
return;

var box = new BoxContainer() { Orientation = LayoutOrientation.Horizontal, HorizontalExpand = true };
var label = new Label() { Text = record.TargetInfo.Name };
var rect = new TextureRect()
{
TextureScale = new(2.2f),
VerticalAlignment = VAlignment.Center,
HorizontalAlignment = HAlignment.Center,
Margin = new(0f, 0f, 6f, 0f),
};

if (record.Status is not SecurityStatus.None)
{
var proto = "SecurityIcon" + record.Status switch
{
SecurityStatus.Detained => "Incarcerated",
_ => record.Status.ToString(),
};

if (_prototypeManager.TryIndex<SecurityIconPrototype>(proto, out var prototype))
{
rect.Texture = _spriteSystem.Frame0(prototype.Icon);
}
}

box.AddChild(rect);
box.AddChild(label);
button.AddChild(box);
button.AddStyleClass(ListContainer.StyleClassListContainerButton);

if (record.TargetInfo.Name.Equals(_selectedTargetName))
{
button.Pressed = true;
// For some reason the event is not called when `Pressed` changed, call it manually.
OnItemSelected(
new(button, new(new(), BoundKeyState.Down, new(), false, new(), new())),
data);
}
}
}

internal record StatusListData(WantedRecord Record) : ListData;
Loading
Loading