forked from space-wizards/space-station-14
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master-ru' of https://gitlab.workbench.network/Workbenc…
…h-Team/space-station-14 into arumoon-server # Conflicts: # Resources/Prototypes/Entities/Mobs/Player/silicon.yml # Resources/migration.yml
- Loading branch information
Showing
67 changed files
with
1,451 additions
and
1,661 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,6 @@ jobs: | |
- name: Check for Merge Conflicts | ||
uses: eps1lon/[email protected] | ||
with: | ||
dirtyLabel: "Merge Conflict" | ||
dirtyLabel: "S: Merge Conflict" | ||
repoToken: "${{ secrets.GITHUB_TOKEN }}" | ||
commentOnDirty: "This pull request has conflicts, please resolve those before we can evaluate the pull request." |
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,20 @@ | ||
name: "Labels: Size" | ||
on: pull_request_target | ||
jobs: | ||
size-label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: size-label | ||
uses: "pascalgn/[email protected]" | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
with: | ||
# Custom size configuration | ||
sizes: > | ||
{ | ||
"0": "XS", | ||
"10": "S", | ||
"30": "M", | ||
"100": "L", | ||
"1000": "XL" | ||
} |
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
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
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,43 @@ | ||
<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 'borg-select-type-menu-title'}" | ||
SetSize="550 300"> | ||
<BoxContainer Orientation="Vertical"> | ||
<BoxContainer Orientation="Horizontal" VerticalExpand="True"> | ||
<!-- Left pane: selection of borg type --> | ||
<BoxContainer Orientation="Vertical" MinWidth="200" Margin="2 0"> | ||
<Label Text="{Loc 'borg-select-type-menu-available'}" StyleClasses="LabelHeading" /> | ||
<ScrollContainer HScrollEnabled="False" VerticalExpand="True"> | ||
<BoxContainer Name="SelectionsContainer" Orientation="Vertical" /> | ||
</ScrollContainer> | ||
</BoxContainer> | ||
|
||
<customControls:VSeparator /> | ||
|
||
<!-- Right pane: information about selected borg module, confirm button. --> | ||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" Margin="2 0"> | ||
<Label Text="{Loc 'borg-select-type-menu-information'}" StyleClasses="LabelHeading" /> | ||
<Control VerticalExpand="True"> | ||
<controls:Placeholder Name="InfoPlaceholder" PlaceholderText="{Loc 'borg-select-type-menu-select-type'}" /> | ||
<BoxContainer Name="InfoContents" Orientation="Vertical" Visible="False"> | ||
<BoxContainer Orientation="Horizontal" Margin="0 0 0 4"> | ||
<EntityPrototypeView Name="ChassisView" Scale="2,2" /> | ||
<Label Name="NameLabel" HorizontalExpand="True" /> | ||
</BoxContainer> | ||
|
||
<RichTextLabel Name="DescriptionLabel" VerticalExpand="True" VerticalAlignment="Top" /> | ||
</BoxContainer> | ||
</Control> | ||
<controls:ConfirmButton Name="ConfirmTypeButton" Text="{Loc 'borg-select-type-menu-confirm'}" | ||
Disabled="True" HorizontalAlignment="Right" | ||
MinWidth="200" /> | ||
</BoxContainer> | ||
</BoxContainer> | ||
|
||
<controls:StripeBack Margin="0 0 0 4"> | ||
<Label Text="{Loc 'borg-select-type-menu-bottom-text'}" HorizontalAlignment="Center" StyleClasses="LabelSubText" Margin="4 4 0 4"/> | ||
</controls:StripeBack> | ||
</BoxContainer> | ||
|
||
</controls:FancyWindow> |
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,81 @@ | ||
using System.Linq; | ||
using Content.Client.UserInterface.Controls; | ||
using Content.Client.UserInterface.Systems.Guidebook; | ||
using Content.Shared.Guidebook; | ||
using Content.Shared.Silicons.Borgs; | ||
using Content.Shared.Silicons.Borgs.Components; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface.XAML; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Client.Silicons.Borgs; | ||
|
||
/// <summary> | ||
/// Menu used by borgs to select their type. | ||
/// </summary> | ||
/// <seealso cref="BorgSelectTypeUserInterface"/> | ||
/// <seealso cref="BorgSwitchableTypeComponent"/> | ||
[GenerateTypedNameReferences] | ||
public sealed partial class BorgSelectTypeMenu : FancyWindow | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; | ||
|
||
private BorgTypePrototype? _selectedBorgType; | ||
|
||
public event Action<ProtoId<BorgTypePrototype>>? ConfirmedBorgType; | ||
|
||
[ValidatePrototypeId<GuideEntryPrototype>] | ||
private static readonly List<ProtoId<GuideEntryPrototype>> GuidebookEntries = new() { "Cyborgs", "Robotics" }; | ||
|
||
public BorgSelectTypeMenu() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
IoCManager.InjectDependencies(this); | ||
|
||
var group = new ButtonGroup(); | ||
foreach (var borgType in _prototypeManager.EnumeratePrototypes<BorgTypePrototype>().OrderBy(PrototypeName)) | ||
{ | ||
var button = new Button | ||
{ | ||
Text = PrototypeName(borgType), | ||
Group = group, | ||
}; | ||
button.OnPressed += _ => | ||
{ | ||
_selectedBorgType = borgType; | ||
UpdateInformation(borgType); | ||
}; | ||
SelectionsContainer.AddChild(button); | ||
} | ||
|
||
ConfirmTypeButton.OnPressed += ConfirmButtonPressed; | ||
HelpGuidebookIds = GuidebookEntries; | ||
} | ||
|
||
private void UpdateInformation(BorgTypePrototype prototype) | ||
{ | ||
_selectedBorgType = prototype; | ||
|
||
InfoContents.Visible = true; | ||
InfoPlaceholder.Visible = false; | ||
ConfirmTypeButton.Disabled = false; | ||
|
||
NameLabel.Text = PrototypeName(prototype); | ||
DescriptionLabel.Text = Loc.GetString($"borg-type-{prototype.ID}-desc"); | ||
ChassisView.SetPrototype(prototype.DummyPrototype); | ||
} | ||
|
||
private void ConfirmButtonPressed(BaseButton.ButtonEventArgs obj) | ||
{ | ||
if (_selectedBorgType == null) | ||
return; | ||
|
||
ConfirmedBorgType?.Invoke(_selectedBorgType); | ||
} | ||
|
||
private static string PrototypeName(BorgTypePrototype prototype) | ||
{ | ||
return Loc.GetString($"borg-type-{prototype.ID}-name"); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
Content.Client/Silicons/Borgs/BorgSelectTypeUserInterface.cs
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,30 @@ | ||
using Content.Shared.Silicons.Borgs.Components; | ||
using JetBrains.Annotations; | ||
using Robust.Client.UserInterface; | ||
|
||
namespace Content.Client.Silicons.Borgs; | ||
|
||
/// <summary> | ||
/// User interface used by borgs to select their type. | ||
/// </summary> | ||
/// <seealso cref="BorgSelectTypeMenu"/> | ||
/// <seealso cref="BorgSwitchableTypeComponent"/> | ||
/// <seealso cref="BorgSwitchableTypeUiKey"/> | ||
[UsedImplicitly] | ||
public sealed class BorgSelectTypeUserInterface : BoundUserInterface | ||
{ | ||
[ViewVariables] | ||
private BorgSelectTypeMenu? _menu; | ||
|
||
public BorgSelectTypeUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) | ||
{ | ||
} | ||
|
||
protected override void Open() | ||
{ | ||
base.Open(); | ||
|
||
_menu = this.CreateWindow<BorgSelectTypeMenu>(); | ||
_menu.ConfirmedBorgType += prototype => SendMessage(new BorgSelectTypeMessage(prototype)); | ||
} | ||
} |
Oops, something went wrong.