Add the ability to spawn in as a vent critter at will (#6187)

* Add the ability to spawn in as a vent critter at will

* cooldown
This commit is contained in:
pathetic meowmeow
2026-07-05 14:29:38 -04:00
committed by GitHub
parent 6bd4603734
commit acc9361a34
12 changed files with 536 additions and 38 deletions
@@ -5,6 +5,7 @@
<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="VentCritterButton" Text="{Loc ghost-gui-spawn-vent-critter-button}" /> <!-- DeltaV: freeform ghosties -->
<Button Name="GhostRespawnButton" Text="{Loc ghost-gui-respawn}" /> <!-- Frontier -->
</BoxContainer>
</widgets:GhostGui>
@@ -1,8 +1,11 @@
using Content.Client._DV.Ghost; // DeltaV - freeform ghosties
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Systems.Ghost.Controls;
using Content.Shared._DV.Ghost.Roles; // DeltaV - freeform ghosties
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes; // DeltaV - freeform ghosties
using Robust.Shared.Timing; // Frontier
using Content.Client._NF.UserInterface.Systems.Ghost.Controls; // Frontier
@@ -17,10 +20,13 @@ public sealed partial class GhostGui : UIWidget
public GhostTargetWindow TargetWindow { get; }
public GhostRespawnRulesWindow RulesWindow { get; } // Frontier
public DVSpawnableGhostRoleWindow VentCritterWindow { get; } // DeltaV - freeform ghosties
public event Action? RequestWarpsPressed;
public event Action? ReturnToBodyPressed;
public event Action? GhostRolesPressed;
public event Action? VentCritterPressed; // DeltaV - freeform ghosties
public event Action<ProtoId<DVSpawnableGhostRolePrototype>>? VentCritterSelected; // DeltaV - freeform ghosties
public event Action? GhostRespawnPressed; // Frontier
private int _prevNumberRoles;
@@ -31,6 +37,8 @@ public sealed partial class GhostGui : UIWidget
TargetWindow = new GhostTargetWindow();
RulesWindow = new GhostRespawnRulesWindow(); // Frontier
RulesWindow.RespawnButton.OnPressed += _ => GhostRespawnPressed?.Invoke(); // Frontier
VentCritterWindow = new DVSpawnableGhostRoleWindow(); // DeltaV - freeform ghosties
VentCritterWindow.RoleSelected += role => VentCritterSelected?.Invoke(role); // DeltaV - freeform ghosties
MouseFilter = MouseFilterMode.Ignore;
@@ -38,12 +46,18 @@ public sealed partial class GhostGui : UIWidget
ReturnToBodyButton.OnPressed += _ => ReturnToBodyPressed?.Invoke();
GhostRolesButton.OnPressed += _ => GhostRolesPressed?.Invoke();
GhostRolesButton.OnPressed += _ => GhostRolesButton.StyleClasses.Remove(StyleClass.Negative);
VentCritterButton.OnPressed += _ =>
{
VentCritterPressed?.Invoke();
VentCritterWindow.OpenCentered();
}; // DeltaV - freeform ghosties
GhostRespawnButton.OnPressed += _ => RulesWindow.OpenCentered(); // Frontier
}
public void Hide()
{
TargetWindow.Close();
VentCritterWindow.Close(); // DeltaV - freeform ghosties
Visible = false;
}
@@ -97,6 +111,7 @@ public sealed partial class GhostGui : UIWidget
if (disposing)
{
TargetWindow.Dispose();
VentCritterWindow.Dispose(); // DeltaV - freeform ghosties
}
}
}