-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port respawning from Frontierstation/Corvax
- Loading branch information
1 parent
4f1d717
commit 783fc5b
Showing
11 changed files
with
435 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Content.Shared._Corvax.Respawn; | ||
|
||
namespace Content.Client._Corvax.Respawn; | ||
|
||
public sealed class RespawnSystem : EntitySystem | ||
{ | ||
public TimeSpan? RespawnResetTime { get; private set; } | ||
|
||
public event Action? RespawnReseted; | ||
|
||
public override void Initialize() | ||
{ | ||
SubscribeNetworkEvent<RespawnResetEvent>(OnRespawnReset); | ||
} | ||
|
||
private void OnRespawnReset(RespawnResetEvent e) | ||
{ | ||
RespawnResetTime = e.Time; | ||
|
||
RespawnReseted?.Invoke(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
Content.Client/_NF/UserInterface/Systems/Ghost/Controls/GhostRespawnRulesWindow.xaml
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,25 @@ | ||
<controls:FancyWindow xmlns="https://spacestation14.io" | ||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" | ||
xmlns:graphics="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client" | ||
Title="{Loc 'ghost-respawn-rules-window-title'}" | ||
MinSize="500 350"> | ||
<ScrollContainer VerticalExpand="True" HorizontalExpand="True" HScrollEnabled="False" Margin="5"> | ||
<PanelContainer StyleClasses="Inset"> | ||
<PanelContainer.PanelOverride> | ||
<graphics:StyleBoxFlat BackgroundColor="#303133"/> | ||
</PanelContainer.PanelOverride> | ||
|
||
<BoxContainer Orientation="Vertical" VerticalExpand="True" SeparationOverride="5"> | ||
<PanelContainer Name="TextContainer" StyleClasses="Inset" Margin="5"> | ||
<PanelContainer.PanelOverride> | ||
<!-- <graphics:StyleBoxFlat BackgroundColor="#464950"/> --> | ||
<graphics:StyleBoxFlat BackgroundColor="#303133"/> | ||
</PanelContainer.PanelOverride> | ||
</PanelContainer> | ||
|
||
<Control VerticalExpand="True" VerticalAlignment="Stretch" /> | ||
<Button Name="ConfirmRespawnButton" Text="{Loc 'ghost-respawn-rules-window-confirm-button'}" Margin="5" /> | ||
</BoxContainer> | ||
</PanelContainer> | ||
</ScrollContainer> | ||
</controls:FancyWindow> |
29 changes: 29 additions & 0 deletions
29
Content.Client/_NF/UserInterface/Systems/Ghost/Controls/GhostRespawnRulesWindow.xaml.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,29 @@ | ||
using Content.Client.UserInterface.Controls; | ||
using Robust.Client.AutoGenerated; | ||
using Robust.Client.UserInterface.Controls; | ||
using Robust.Client.UserInterface.XAML; | ||
using Robust.Shared.Utility; | ||
|
||
namespace Content.Client._NF.UserInterface.Systems.Ghost.Controls | ||
{ | ||
[GenerateTypedNameReferences] | ||
public sealed partial class GhostRespawnRulesWindow : FancyWindow | ||
{ | ||
public PanelContainer RulesContainer => TextContainer; | ||
public RichTextLabel RulesLabel = new() { Margin = new Thickness(5, 5, 5, 5) }; | ||
public Button RespawnButton => ConfirmRespawnButton; | ||
|
||
public GhostRespawnRulesWindow() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
|
||
var message = new FormattedMessage(); | ||
message.AddMarkup(Loc.GetString("ghost-respawn-rules-window-rules")); | ||
RulesLabel.SetMessage(message); | ||
RulesContainer.AddChild(RulesLabel); | ||
RulesLabel.SetPositionFirst(); | ||
|
||
RespawnButton.OnPressed += _ => Close(); | ||
} | ||
} | ||
} |
Oops, something went wrong.