Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
9b06aac
Borg arms and limbs have silicon damage type
Anuraths Mar 1, 2025
7f1761a
can add borg arms and legs instead of normal limbs
Anuraths Mar 1, 2025
9dd97f4
modules groundwork
Doctor-Cpu May 3, 2025
f3c88c8
basic modules
Doctor-Cpu May 3, 2025
d63905c
module complexity
Doctor-Cpu May 3, 2025
da95c78
base power draw rate
Doctor-Cpu May 3, 2025
b38574b
toggleable armor
Doctor-Cpu May 4, 2025
322efe8
fix armor build errors
Doctor-Cpu May 4, 2025
f340c94
make toggleable armor add to the bodypartype hashset
Doctor-Cpu May 4, 2025
247066a
add toggle to toggleable armor
Doctor-Cpu May 4, 2025
bf2be1b
modsuit textures
Doctor-Cpu May 9, 2025
7146737
modsuit sealing
Doctor-Cpu May 9, 2025
989b1ab
ui start
Doctor-Cpu May 9, 2025
1664575
yml start
Doctor-Cpu May 9, 2025
359bb15
part deploying
Doctor-Cpu May 11, 2025
400ef24
check inventory for deployable
Doctor-Cpu May 11, 2025
27eb631
uniquip and delete when undeploying
Doctor-Cpu May 11, 2025
9a4ba33
deployable parts
Doctor-Cpu May 12, 2025
a346c5d
store any item already in a slot when deploying
Doctor-Cpu May 12, 2025
c11c556
make deployable parts not items
Doctor-Cpu May 12, 2025
b30a45d
refactor part deploying to not create new entities each time it is de…
Doctor-Cpu May 13, 2025
ad42659
remove usages of deployableparts
Doctor-Cpu May 13, 2025
ef078dd
refactor part deploying to not raise network events
Doctor-Cpu May 13, 2025
433c53b
move deployable inventory to shared
Doctor-Cpu May 13, 2025
8518e8f
Merge branch 'master' of https://github.com/Mira-Sector/space-station…
Doctor-Cpu May 15, 2025
1487e13
fix debug assert with deployed parts
Doctor-Cpu May 16, 2025
350e947
sealable ui groundwork
Doctor-Cpu May 17, 2025
49b0e19
action to open the ui
Doctor-Cpu May 17, 2025
71f83e4
sealable ui groundwork
Doctor-Cpu May 17, 2025
c8f8526
seal buttons
Doctor-Cpu May 18, 2025
0d17934
sort seal buttons
Doctor-Cpu May 18, 2025
7487729
allow recharging modsuits with cyborg rechargers
Doctor-Cpu May 18, 2025
7ce9d5e
predict sealing buttons
Doctor-Cpu May 18, 2025
5d5b314
Revert "predict sealing buttons"
Doctor-Cpu May 18, 2025
98a482a
properly predict the sealing buttons
Doctor-Cpu May 18, 2025
c39f11c
dont spam new buttons
Doctor-Cpu May 18, 2025
e5ec9c3
fix client sealable wrong file name
Doctor-Cpu May 18, 2025
a99b165
advanced yml
Doctor-Cpu May 18, 2025
17f9d04
fix deployable armor
Doctor-Cpu May 18, 2025
d672074
split modules into their own system
Doctor-Cpu May 18, 2025
a32be07
improved storage module
Doctor-Cpu May 19, 2025
c5426ef
flesh out storage module yml
Doctor-Cpu May 19, 2025
950f785
only allow 1 storage module
Doctor-Cpu May 19, 2025
8ba806f
add generic module system
Doctor-Cpu May 19, 2025
b08aa07
vision modules
Doctor-Cpu May 20, 2025
e66987b
refactor base toggle module action to a seperate component
Doctor-Cpu May 20, 2025
3b492c3
cloaking module
Doctor-Cpu May 21, 2025
780c89b
allow modules to have visuals on the suit
Doctor-Cpu May 27, 2025
a69ffdd
jetpack module
Doctor-Cpu May 27, 2025
5d0ca6d
progress on artificial limbs
Anuraths May 28, 2025
75569c2
error
Anuraths May 28, 2025
91feb15
Borg arms and limbs have silicon damage type
Anuraths Mar 1, 2025
3bca371
can add borg arms and legs instead of normal limbs
Anuraths Mar 1, 2025
27d9540
progress on artificial limbs
Doctor-Cpu May 28, 2025
9f26700
error
Anuraths May 28, 2025
d566b0f
move name to body proto
Doctor-Cpu May 28, 2025
4cc5aa1
Merge branch 'artficial-limbs' of https://github.com/Anuraths/space-s…
Doctor-Cpu May 28, 2025
6f6c22d
fix initial children
Doctor-Cpu May 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Content.Client.Modules.ModSuit.Events;

public abstract partial class BaseModSuitSealedGetLayersEvent : EntityEventArgs
{
public List<PrototypeLayerData> Layers = [];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace Content.Client.Modules.ModSuit.Events;

public sealed partial class ModSuitSealedGetClothingLayersEvent : BaseModSuitSealedGetLayersEvent
{
public readonly string Slot;

public ModSuitSealedGetClothingLayersEvent(string slot)
{
Slot = slot;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
namespace Content.Client.Modules.ModSuit.Events;

public sealed partial class ModSuitSealedGetIconLayersEvent : BaseModSuitSealedGetLayersEvent;
40 changes: 40 additions & 0 deletions Content.Client/Modules/ModSuit/ModSuitBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Content.Shared.Modules.ModSuit.UI;
using Robust.Client.UserInterface;
using JetBrains.Annotations;

namespace Content.Client.Modules.ModSuit;

[UsedImplicitly]
public sealed partial class ModSuitBoundUserInterface : BoundUserInterface
{
private ModSuitWindow? _window;

public ModSuitBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

protected override void Open()
{
base.Open();

_window = this.CreateWindow<ModSuitWindow>();
_window.Refresh();
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);

switch (state)
{
case ModSuitSealableBoundUserInterfaceState sealable:
_window?.UpdateSealed(sealable);
break;
}

if (_window == null)
return;

_window.OnSealButtonPressed += (part, shouldSeal) => SendPredictedMessage(new ModSuitSealButtonMessage(part, shouldSeal));
}
}
12 changes: 12 additions & 0 deletions Content.Client/Modules/ModSuit/ModSuitSealableButton.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<PanelContainer xmlns="https://spacestation14.io">
<BoxContainer>
<Button
Name="ButtonButton"
Text="{Loc 'modsuit-interface-seal'}"
ToggleMode="True"
Access="Public"/>
<Label
Name="ButtonName"
Access="Public"/>
</BoxContainer>
</PanelContainer>
21 changes: 21 additions & 0 deletions Content.Client/Modules/ModSuit/ModSuitSealableButton.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.Modules.ModSuit;

[GenerateTypedNameReferences]
public sealed partial class ModSuitSealableButton : PanelContainer
{
[Dependency] private readonly IEntityManager _entity = default!;

public ModSuitSealableButton(NetEntity sealable, bool isSealed)
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);

var uid = _entity.GetEntity(sealable);
ButtonName.Text = _entity.GetComponent<MetaDataComponent>(uid).EntityName;
ButtonButton.Pressed = isSealed;
}
}
8 changes: 8 additions & 0 deletions Content.Client/Modules/ModSuit/ModSuitSealableSprite.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<PanelContainer xmlns="https://spacestation14.io">
<TextureRect
Name="PartSprite"
VerticalAlignment="Center"
HorizontalAlignment="Center"
TextureScale="4 4"
Access="Public"/>
</PanelContainer>
25 changes: 25 additions & 0 deletions Content.Client/Modules/ModSuit/ModSuitSealableSprite.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Graphics.RSI;
using Robust.Shared.Utility;

namespace Content.Client.Modules.ModSuit;

[GenerateTypedNameReferences]
public sealed partial class ModSuitSealableSprite : PanelContainer
{
[Dependency] private readonly IEntityManager _entity = default!;
private readonly SpriteSystem _sprite;

public ModSuitSealableSprite(SpriteSpecifier sprite)
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_sprite = _entity.System<SpriteSystem>();

var state = _sprite.RsiStateLike(sprite);
PartSprite.Texture = state.GetFrame(RsiDirection.South, 0);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Content.Client.Modules.ModSuit.Events;
using Content.Shared.Clothing;
using Content.Shared.Hands;
using Content.Shared.Modules.ModSuit.Components;
using Robust.Client.GameObjects;

namespace Content.Client.Modules.ModSuit;

public partial class ModSuitSystem
{
private void InitializeDeployableRelay()
{
SubscribeLocalEvent<ModSuitDeployedPartComponent, AppearanceChangeEvent>(RelayToSuit);
SubscribeLocalEvent<ModSuitDeployedPartComponent, GetEquipmentVisualsEvent>(RelayToSuit);
SubscribeLocalEvent<ModSuitDeployedPartComponent, GetInhandVisualsEvent>(RelayToSuit);

SubscribeLocalEvent<ModSuitDeployedPartComponent, ModSuitSealedGetIconLayersEvent>(RelayToSuit);
SubscribeLocalEvent<ModSuitDeployedPartComponent, ModSuitSealedGetClothingLayersEvent>(RelayToSuit);
}
}
21 changes: 21 additions & 0 deletions Content.Client/Modules/ModSuit/ModSuitSystem.Deployable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Content.Shared.Modules.ModSuit.Components;
using Robust.Shared.Containers;

namespace Content.Client.Modules.ModSuit;

public partial class ModSuitSystem
{
private void InitializeDeployable()
{
InitializeDeployableRelay();
}

protected override void OnDeployableInit(Entity<ModSuitPartDeployableComponent> ent, ref ComponentInit args)
{
foreach (var (slot, _) in ent.Comp.DeployablePartIds)
{
var container = Container.EnsureContainer<ContainerSlot>(ent.Owner, GetDeployableSlotId(slot));
ent.Comp.DeployableContainers.Add(slot, container);
}
}
}
89 changes: 89 additions & 0 deletions Content.Client/Modules/ModSuit/ModSuitSystem.Sealable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
using Content.Client.Modules.ModSuit.Events;
using Content.Shared.Clothing;
using Content.Shared.Modules.ModSuit;
using Content.Shared.Modules.ModSuit.Components;
using Robust.Client.GameObjects;
using Robust.Shared.Reflection;
using System.Linq;

namespace Content.Client.Modules.ModSuit;

public partial class ModSuitSystem
{
[Dependency] private readonly IReflectionManager _reflection = default!;

private string _layerPrefix = string.Empty;

private void InitializeSealable()
{
SubscribeLocalEvent<ModSuitSealableComponent, AppearanceChangeEvent>(OnSealableAppearanceChange);
SubscribeLocalEvent<ModSuitSealableComponent, GetEquipmentVisualsEvent>(OnSealableClothingVisuals);

_layerPrefix = _reflection.GetEnumReference(ModSuitSealedLayers.Layer);
}

private void OnSealableAppearanceChange(Entity<ModSuitSealableComponent> ent, ref AppearanceChangeEvent args)
{
if (!Appearance.TryGetData<bool>(ent.Owner, ModSuitSealedVisuals.Sealed, out var isSealed))
return;

if (args.Sprite is not { } sprite)
return;

foreach (var layer in ent.Comp.RevealedLayers)
sprite.RemoveLayer(layer);

ent.Comp.RevealedLayers.Clear();

if (!ent.Comp.IconLayers.TryGetValue(isSealed, out var layers))
return;

var ev = new ModSuitSealedGetIconLayersEvent();
RaiseLocalEvent(ent.Owner, ev);

layers.AddRange(ev.Layers);

foreach (var layer in layers)
{
layer.MapKeys ??= [];
layer.MapKeys.Add(_layerPrefix);

ent.Comp.RevealedLayers.Add(sprite.AddLayer(layer));
}
}

private void OnSealableClothingVisuals(Entity<ModSuitSealableComponent> ent, ref GetEquipmentVisualsEvent args)
{
if (!Appearance.TryGetData<bool>(ent.Owner, ModSuitSealedVisuals.Sealed, out var isSealed))
return;

if (!ent.Comp.ClothingLayers.TryGetValue(isSealed, out var clothingLayers))
return;

if (!clothingLayers.TryGetValue(args.Slot, out var layers))
return;

var ev = new ModSuitSealedGetClothingLayersEvent(args.Slot);
RaiseLocalEvent(ent.Owner, ev);

layers.AddRange(ev.Layers);

for (var i = 0; i < layers.Count; i++)
{
var layer = layers[i];

var key = layer.MapKeys?.FirstOrDefault();
if (key == null)
{
key = $"{_layerPrefix}-{args.Slot}-{i}";
}
else
{
key = $"{_layerPrefix}-{args.Slot}-{key}";
layer.MapKeys = [key];
}

args.Layers.Add((key, layer));
}
}
}
14 changes: 14 additions & 0 deletions Content.Client/Modules/ModSuit/ModSuitSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Content.Shared.Modules.ModSuit;

namespace Content.Client.Modules.ModSuit;

public sealed partial class ModSuitSystem : SharedModSuitSystem
{
public override void Initialize()
{
base.Initialize();

InitializeDeployable();
InitializeSealable();
}
}
27 changes: 27 additions & 0 deletions Content.Client/Modules/ModSuit/ModSuitWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<DefaultWindow xmlns="https://spacestation14.io"
Title="{Loc 'modsuit-interface-title'}"
MinSize="512 768">
<BoxContainer
Orientation="Vertical"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="4">
<BoxContainer
Name="SealContainer"
Visible="False"
Margin="4"
Access="Public">
<PanelContainer
Name="SealPanel"
Access="Public">
</PanelContainer>
<BoxContainer
Name="SealButtons"
Margin="2"
Orientation="Vertical"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Access="Public"/>
</BoxContainer>
</BoxContainer>
</DefaultWindow>
57 changes: 57 additions & 0 deletions Content.Client/Modules/ModSuit/ModSuitWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using Content.Shared.Modules.ModSuit.UI;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using System.Linq;

namespace Content.Client.Modules.ModSuit;

[GenerateTypedNameReferences]
public sealed partial class ModSuitWindow : DefaultWindow
{
private KeyValuePair<NetEntity, ModSuitSealableBuiEntry>[] _sealableParts = [];

public event Action<NetEntity, bool>? OnSealButtonPressed;

public ModSuitWindow()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
}

public void Refresh()
{
RefreshSealableIcons();
}

#region Sealable

public void UpdateSealed(ModSuitSealableBoundUserInterfaceState state)
{
if (_sealableParts == state.Parts)
return;

_sealableParts = state.Parts;
RefreshSealableIcons();
}

internal void RefreshSealableIcons()
{
SealContainer.Visible = _sealableParts.Any();
SealPanel.RemoveAllChildren();
SealButtons.RemoveAllChildren();

foreach (var (part, data) in _sealableParts)
{
var spriteView = new ModSuitSealableSprite(data.Sprite[data.IsSealed]);
SealPanel.AddChild(spriteView);

var button = new ModSuitSealableButton(part, data.IsSealed);
SealButtons.AddChild(button);

button.ButtonButton.OnPressed += _ => OnSealButtonPressed?.Invoke(part, !data.IsSealed);
}
}

#endregion
}
25 changes: 25 additions & 0 deletions Content.Client/Modules/ModuleSystem.Relay.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Content.Client.Modules.ModSuit.Events;
using Content.Shared.Clothing;
using Content.Shared.Hands;
using Content.Shared.Modules.Components;
using Content.Shared.Modules.ModSuit.Events;
using Robust.Client.GameObjects;

namespace Content.Client.Modules;

public partial class ModuleSystem
{
private void InitializeRelay()
{
SubscribeLocalEvent<ModuleContainerComponent, AppearanceChangeEvent>(RelayToModules);
SubscribeLocalEvent<ModuleContainerComponent, GetEquipmentVisualsEvent>(RelayToModules);
SubscribeLocalEvent<ModuleContainerComponent, GetInhandVisualsEvent>(RelayToModules);

SubscribeLocalEvent<ModuleContainerComponent, ModSuitDeployedPartRelayedEvent<AppearanceChangeEvent>>(RelayToModules);
SubscribeLocalEvent<ModuleContainerComponent, ModSuitDeployedPartRelayedEvent<GetEquipmentVisualsEvent>>(RelayToModules);
SubscribeLocalEvent<ModuleContainerComponent, ModSuitDeployedPartRelayedEvent<GetInhandVisualsEvent>>(RelayToModules);

SubscribeLocalEvent<ModuleContainerComponent, ModSuitDeployedPartRelayedEvent<ModSuitSealedGetClothingLayersEvent>>(RelayToModules);
SubscribeLocalEvent<ModuleContainerComponent, ModSuitDeployedPartRelayedEvent<ModSuitSealedGetIconLayersEvent>>(RelayToModules);
}
}
Loading
Loading