-
Notifications
You must be signed in to change notification settings - Fork 633
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2360 from space-syndicate/upstream-sync
Upstream sync
- Loading branch information
Showing
259 changed files
with
11,705 additions
and
7,766 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System.Linq; | ||
using Content.Shared.BarSign; | ||
using JetBrains.Annotations; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Client.BarSign.Ui; | ||
|
||
[UsedImplicitly] | ||
public sealed class BarSignBoundUserInterface(EntityUid owner, Enum uiKey) : BoundUserInterface(owner, uiKey) | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototype = default!; | ||
|
||
private BarSignMenu? _menu; | ||
|
||
protected override void Open() | ||
{ | ||
base.Open(); | ||
|
||
var sign = EntMan.GetComponentOrNull<BarSignComponent>(Owner)?.Current is { } current | ||
? _prototype.Index(current) | ||
: null; | ||
var allSigns = Shared.BarSign.BarSignSystem.GetAllBarSigns(_prototype) | ||
.OrderBy(p => Loc.GetString(p.Name)) | ||
.ToList(); | ||
_menu = new(sign, allSigns); | ||
|
||
_menu.OnSignSelected += id => | ||
{ | ||
SendMessage(new SetBarSignMessage(id)); | ||
}; | ||
|
||
_menu.OnClose += Close; | ||
_menu.OpenCentered(); | ||
} | ||
|
||
public void Update(ProtoId<BarSignPrototype>? sign) | ||
{ | ||
if (_prototype.TryIndex(sign, out var signPrototype)) | ||
_menu?.UpdateState(signPrototype); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
base.Dispose(disposing); | ||
if (!disposing) | ||
return; | ||
_menu?.Dispose(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<controls:FancyWindow | ||
xmlns="https://spacestation14.io" | ||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" | ||
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls" | ||
Title="{Loc 'barsign-ui-menu'}" | ||
MinSize="280 180" | ||
SetSize="280 180"> | ||
<BoxContainer VerticalExpand="True" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10 5 10 10"> | ||
<BoxContainer Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center"> | ||
<BoxContainer Orientation="Vertical" HorizontalAlignment="Center"> | ||
<Label Text="{Loc 'barsign-ui-set-label'}" HorizontalAlignment="Center" StyleClasses="LabelSubText" Margin="30 0"/> | ||
<customControls:HSeparator Margin="0 0 0 5"/> | ||
</BoxContainer> | ||
<OptionButton Name="SignOptions" HorizontalAlignment="Center" VerticalAlignment="Center" MinSize="175 60" Margin="0 0 0 20"/> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</controls:FancyWindow> | ||
|
||
|
Oops, something went wrong.