-
Notifications
You must be signed in to change notification settings - Fork 423
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
port better borgs from frontier (#3110)
* BetterBorgs: droppable, swappable cyborg item interactions (#2766) * WIP: droppable, swappable, insertable cyborg items * Half-baked borg HandPlaceholderComponent * cyborg: sprite representation for empty slots * nullable prototype --------- Co-authored-by: Dvir <[email protected]> * BorgSystem: check droppable items for duped mods (#2887) * BorgSystem: check droppable items for duped mods * Cache item comparer * BorgSystem: Unremoveable after equip (#2854) * raise interaction events to add fibers to things --------- Co-authored-by: Whatstone <[email protected]> Co-authored-by: Dvir <[email protected]> Co-authored-by: deltanedas <@deltanedas:kde.org>
- Loading branch information
1 parent
3238476
commit 0f3edc0
Showing
26 changed files
with
507 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Robust.Client.UserInterface; | ||
using Robust.Client.UserInterface.XAML; | ||
|
||
namespace Content.Client._NF.Hands.UI | ||
{ | ||
public sealed class HandPlaceholderStatus : Control | ||
{ | ||
public HandPlaceholderStatus() | ||
{ | ||
RobustXamlLoader.Load(this); | ||
} | ||
} | ||
} |
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,3 @@ | ||
<Control xmlns="https://spacestation14.io"> | ||
<Label StyleClasses="ItemStatus" Text="{Loc 'hand-placeholder-name'}" /> | ||
</Control> |
10 changes: 10 additions & 0 deletions
10
Content.Client/_NF/Interaction/Components/HandPlaceholderVisualsComponent.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,10 @@ | ||
namespace Content.Shared._NF.Interaction.Components; | ||
|
||
[RegisterComponent] | ||
// Client-side component of the HandPlaceholder. Creates and tracks a client-side entity for hand blocking visuals | ||
public sealed partial class HandPlaceholderVisualsComponent : Component | ||
{ | ||
[DataField] | ||
public EntityUid Dummy; | ||
} | ||
|
47 changes: 47 additions & 0 deletions
47
Content.Client/_NF/Interaction/Systems/HandPlaceholderVisualsSystem.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,47 @@ | ||
using Content.Client._NF.Hands.UI; | ||
using Content.Client.Items; | ||
using Content.Client.Items.Systems; | ||
using Content.Shared._NF.Interaction.Components; | ||
using JetBrains.Annotations; | ||
using Robust.Client.GameObjects; | ||
|
||
namespace Content.Client._NF.Interaction.Systems; | ||
|
||
/// <summary> | ||
/// Handles interactions with items that spawn HandPlaceholder items. | ||
/// </summary> | ||
[UsedImplicitly] | ||
public sealed partial class HandPlaceholderVisualsSystem : EntitySystem | ||
{ | ||
[Dependency] ContainerSystem _container = default!; | ||
[Dependency] ItemSystem _item = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<HandPlaceholderComponent, AfterAutoHandleStateEvent>(OnAfterAutoHandleState); | ||
|
||
SubscribeLocalEvent<HandPlaceholderVisualsComponent, ComponentRemove>(PlaceholderRemove); | ||
|
||
Subs.ItemStatus<HandPlaceholderVisualsComponent>(_ => new HandPlaceholderStatus()); | ||
} | ||
|
||
private void OnAfterAutoHandleState(Entity<HandPlaceholderComponent> ent, ref AfterAutoHandleStateEvent args) | ||
{ | ||
if (!TryComp(ent, out HandPlaceholderVisualsComponent? placeholder)) | ||
return; | ||
|
||
if (placeholder.Dummy != EntityUid.Invalid) | ||
QueueDel(placeholder.Dummy); | ||
placeholder.Dummy = Spawn(ent.Comp.Prototype); | ||
|
||
if (_container.IsEntityInContainer(ent)) | ||
_item.VisualsChanged(ent); | ||
} | ||
|
||
private void PlaceholderRemove(Entity<HandPlaceholderVisualsComponent> ent, ref ComponentRemove args) | ||
{ | ||
if (ent.Comp.Dummy != EntityUid.Invalid) | ||
QueueDel(ent.Comp.Dummy); | ||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
Content.Server/_NF/Whitelist/Components/NFBookBagComponent.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,7 @@ | ||
namespace Content.Server._NF.Whitelist.Components; | ||
|
||
/// <summary> | ||
/// Whitelist component for book bags to avoid tag redefinition and collisions | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class NFBookBagComponent : Component; |
7 changes: 7 additions & 0 deletions
7
Content.Server/_NF/Whitelist/Components/NFLighterComponent.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,7 @@ | ||
namespace Content.Server._NF.Whitelist.Components; | ||
|
||
/// <summary> | ||
/// Whitelist component for lighters to avoid tag redefinition and collisions | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class NFLighterComponent : Component; |
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,7 @@ | ||
namespace Content.Server._NF.Whitelist.Components; | ||
|
||
/// <summary> | ||
/// Whitelist component for ore bags to avoid tag redefinition and collisions | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class NFOreBagComponent : Component; |
7 changes: 7 additions & 0 deletions
7
Content.Server/_NF/Whitelist/Components/NFPlantBagComponent.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,7 @@ | ||
namespace Content.Server._NF.Whitelist.Components; | ||
|
||
/// <summary> | ||
/// Whitelist component for plant bags to avoid tag redefinition and collisions | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class NFPlantBagComponent : Component; |
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,7 @@ | ||
namespace Content.Server._NF.Whitelist.Components; | ||
|
||
/// <summary> | ||
/// Whitelist component for shakers to avoid tag redefinition and collisions | ||
/// </summary> | ||
[RegisterComponent] | ||
public sealed partial class NFShakerComponent : Component; |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
using Content.Shared.Whitelist; | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.Interaction.Components | ||
|
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.