-
Notifications
You must be signed in to change notification settings - Fork 473
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'new-frontiers-14:master' into bocadillo-ship
- Loading branch information
Showing
269 changed files
with
71,280 additions
and
9,755 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Content.Shared._NF.M_Emp; | ||
using JetBrains.Annotations; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client._NF.M_Emp.UI | ||
{ | ||
[UsedImplicitly] | ||
public sealed class M_EmpBoundUserInterface : BoundUserInterface | ||
{ | ||
private M_EmpWindow? _window; | ||
|
||
public M_EmpBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) | ||
{ | ||
} | ||
|
||
protected override void Open() | ||
{ | ||
base.Open(); | ||
|
||
_window = new M_EmpWindow(this); | ||
_window.OnClose += Close; | ||
_window.OpenCentered(); | ||
} | ||
|
||
/// <summary> | ||
/// Update the ui each time new state data is sent from the server. | ||
/// </summary> | ||
/// <param name="state"> | ||
/// Data of the <see cref="SharedReagentDispenserComponent"/> that this ui represents. | ||
/// Sent from the server. | ||
/// </param> | ||
protected override void UpdateState(BoundUserInterfaceState state) | ||
{ | ||
base.UpdateState(state); | ||
|
||
// var castState = (M_EmpBoundUserInterfaceState) state; | ||
// _window?.UpdateState(castState); //Update window state | ||
} | ||
|
||
public void ButtonPressed(UiButton button) | ||
{ | ||
SendMessage(new UiButtonPressedMessage(button)); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
base.Dispose(disposing); | ||
|
||
if (disposing) | ||
{ | ||
_window?.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,37 @@ | ||
<DefaultWindow | ||
xmlns="https://spacestation14.io" | ||
Title="{Loc 'm_emp-console-menu-title'}" | ||
SetSize="280 220" | ||
MinSize="280 220" | ||
HorizontalExpand="False" | ||
> | ||
<BoxContainer Orientation="Vertical" HorizontalExpand="False"> | ||
<BoxContainer HorizontalExpand="False"> | ||
<Label Text="{Loc 'm_emp-menu-note1'}" /> | ||
</BoxContainer> | ||
<BoxContainer HorizontalExpand="False"> | ||
<Button Name="RequestButton" | ||
Text="{Loc 'm_emp-request-button'}" | ||
StyleClasses="OpenBoth" | ||
Disabled="False" /> | ||
</BoxContainer> | ||
<BoxContainer HorizontalExpand="False"> | ||
<Label Text=" " /> | ||
</BoxContainer> | ||
<BoxContainer HorizontalExpand="False"> | ||
<Label Text="{Loc 'm_emp-menu-note2'}" /> | ||
</BoxContainer> | ||
<BoxContainer HorizontalExpand="False"> | ||
<Label Text="{Loc 'm_emp-menu-note3'}" /> | ||
</BoxContainer> | ||
<BoxContainer HorizontalExpand="False"> | ||
<Label Text="{Loc 'm_emp-menu-note4'}" /> | ||
</BoxContainer> | ||
<BoxContainer HorizontalExpand="False"> | ||
<Button Name="ActivateButton" | ||
Text="{Loc 'm_emp-activate-button'}" | ||
StyleClasses="OpenBoth" | ||
Disabled="False" /> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</DefaultWindow> |
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,39 @@ | ||
using Content.Client.UserInterface; | ||
using Content.Shared._NF.M_Emp; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface.CustomControls; | ||
using Robust.Client.UserInterface.XAML; | ||
|
||
namespace Content.Client._NF.M_Emp.UI | ||
{ | ||
[GenerateTypedNameReferences] | ||
public sealed partial class M_EmpWindow : DefaultWindow | ||
{ | ||
public M_EmpWindow(M_EmpBoundUserInterface ui) | ||
{ | ||
RobustXamlLoader.Load(this); | ||
IoCManager.InjectDependencies(this); | ||
|
||
RequestButton.OnPressed += _ => ui.ButtonPressed(UiButton.Request); | ||
ActivateButton.OnPressed += _ => ui.ButtonPressed(UiButton.Activate); | ||
} | ||
|
||
/// <summary> | ||
/// Update the UI state when new state data is received from the server. | ||
/// </summary> | ||
/// <param name="state">State data sent by the server.</param> | ||
public void UpdateState(BoundUserInterfaceState state) | ||
{ | ||
var castState = (M_EmpBoundUserInterfaceState) state; | ||
|
||
// Disable all buttons if not powered | ||
if (Contents.Children != null) | ||
{ | ||
ButtonHelpers.SetButtonDisabledRecursive(Contents, !castState.HasPower); | ||
} | ||
|
||
//CoreCount.Text = $"{castState.CoreCount}"; | ||
//InjectionAmount.Text = $"{castState.InjectionAmount}"; | ||
} | ||
} | ||
} |
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,13 @@ | ||
namespace Content.Shared.GameTicking; | ||
|
||
public sealed class RoundEndedEvent : EntityEventArgs | ||
{ | ||
public int RoundId { get; } | ||
public TimeSpan RoundDuration { get; } | ||
|
||
public RoundEndedEvent(int roundId, TimeSpan roundDuration) | ||
{ | ||
RoundId = roundId; | ||
RoundDuration = roundDuration; | ||
} | ||
} |
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
Oops, something went wrong.