[add] New ghostrespawn system
This commit is contained in:
@@ -120,6 +120,8 @@ public sealed class GhostUIController : UIController, IOnSystemChanged<GhostSyst
|
||||
Gui.ReturnToBodyPressed += ReturnToBody;
|
||||
Gui.GhostRolesPressed += GhostRolesPressed;
|
||||
Gui.TargetWindow.WarpClicked += OnWarpClicked;
|
||||
Gui.ReturnToRoundPressed += ReturnToRound;
|
||||
|
||||
|
||||
UpdateGui();
|
||||
}
|
||||
@@ -133,6 +135,8 @@ public sealed class GhostUIController : UIController, IOnSystemChanged<GhostSyst
|
||||
Gui.ReturnToBodyPressed -= ReturnToBody;
|
||||
Gui.GhostRolesPressed -= GhostRolesPressed;
|
||||
Gui.TargetWindow.WarpClicked -= OnWarpClicked;
|
||||
Gui.ReturnToRoundPressed -= ReturnToRound;
|
||||
|
||||
|
||||
Gui.Hide();
|
||||
}
|
||||
@@ -142,6 +146,11 @@ public sealed class GhostUIController : UIController, IOnSystemChanged<GhostSyst
|
||||
_system?.ReturnToBody();
|
||||
}
|
||||
|
||||
private void ReturnToRound()
|
||||
{
|
||||
_system?.ReturnToRound();
|
||||
}
|
||||
|
||||
private void RequestWarps()
|
||||
{
|
||||
_system?.RequestWarps();
|
||||
|
||||
@@ -5,5 +5,6 @@
|
||||
<Button Name="ReturnToBodyButton" Text="{Loc ghost-gui-return-to-body-button}" />
|
||||
<Button Name="GhostWarpButton" Text="{Loc ghost-gui-ghost-warp-button}" />
|
||||
<Button Name="GhostRolesButton" />
|
||||
<Button Name="ReturnToRound" Text="{Loc ghost-gui-return-to-round-button}" />
|
||||
</BoxContainer>
|
||||
</widgets:GhostGui>
|
||||
|
||||
@@ -15,6 +15,9 @@ public sealed partial class GhostGui : UIWidget
|
||||
public event Action? ReturnToBodyPressed;
|
||||
public event Action? GhostRolesPressed;
|
||||
|
||||
public event Action? ReturnToRoundPressed;
|
||||
|
||||
|
||||
public GhostGui()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
@@ -26,6 +29,7 @@ public sealed partial class GhostGui : UIWidget
|
||||
GhostWarpButton.OnPressed += _ => RequestWarpsPressed?.Invoke();
|
||||
ReturnToBodyButton.OnPressed += _ => ReturnToBodyPressed?.Invoke();
|
||||
GhostRolesButton.OnPressed += _ => GhostRolesPressed?.Invoke();
|
||||
ReturnToRound.OnPressed += _ => ReturnToRoundPressed?.Invoke();
|
||||
}
|
||||
|
||||
public void Hide()
|
||||
|
||||
Reference in New Issue
Block a user