-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPC Refactor #771
Merged
VMSolidus
merged 7 commits into
Simple-Station:master
from
VMSolidus:More-IPC-Code-Cleanup
Sep 17, 2024
Merged
IPC Refactor #771
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ccdb5c3
IPC Refactor
VMSolidus 7245e0a
More
VMSolidus d777715
Update SharedDeadStartupButtonSystem.cs
VMSolidus 8713534
More fixes
VMSolidus 4c6c2a1
Update SiliconChargeSystem.cs
VMSolidus 2b4fa5b
aaaaaaaaaaaaaa
VMSolidus e1aaecb
Update BatteryDrinkerSystem.cs
VMSolidus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 0 additions & 2 deletions
2
Content.Server/Power/Components/SiliconEmitSoundOnDrainedComponent.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
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 |
---|---|---|
|
@@ -2,27 +2,26 @@ | |
using Content.Shared.Lock; | ||
using Content.Shared.Popups; | ||
using Content.Shared.Silicon.Components; | ||
using Content.Shared.IdentityManagement; | ||
using Content.Shared.IdentityManagement; | ||
|
||
namespace Content.Server.Silicon.BatteryLocking; | ||
|
||
public sealed class BatterySlotRequiresLockSystem : EntitySystem | ||
|
||
{ | ||
[Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!; | ||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!; | ||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!; | ||
|
||
/// <inheritdoc/> | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<BatterySlotRequiresLockComponent, LockToggledEvent>(LockToggled); | ||
SubscribeLocalEvent<BatterySlotRequiresLockComponent, LockToggleAttemptEvent>(LockToggleAttempted); | ||
|
||
SubscribeLocalEvent<BatterySlotRequiresLockComponent, LockToggleAttemptEvent>(LockToggleAttempted); | ||
} | ||
|
||
private void LockToggled(EntityUid uid, BatterySlotRequiresLockComponent component, LockToggledEvent args) | ||
{ | ||
if (!TryComp<LockComponent>(uid, out var lockComp) | ||
if (!TryComp<LockComponent>(uid, out var lockComp) | ||
|| !TryComp<ItemSlotsComponent>(uid, out var itemslots) | ||
|| !_itemSlotsSystem.TryGetSlot(uid, component.ItemSlot, out var slot, itemslots)) | ||
return; | ||
|
@@ -33,9 +32,9 @@ private void LockToggled(EntityUid uid, BatterySlotRequiresLockComponent compone | |
private void LockToggleAttempted(EntityUid uid, BatterySlotRequiresLockComponent component, LockToggleAttemptEvent args) | ||
{ | ||
if (args.User == uid | ||
|| !TryComp<SiliconComponent>(uid, out var siliconComp)) | ||
|| !HasComp<SiliconComponent>(uid)) | ||
Comment on lines
34
to
+35
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just for the style - it should be on the same line since it's not that long. |
||
return; | ||
|
||
_popupSystem.PopupEntity(Loc.GetString("batteryslotrequireslock-component-alert-owner", ("user", Identity.Entity(args.User, EntityManager))), uid, uid, PopupType.Large); | ||
} | ||
|
||
|
39 changes: 17 additions & 22 deletions
39
Content.Server/Silicon/BlindHealing/BlindHealingComponent.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 |
---|---|---|
@@ -1,28 +1,23 @@ | ||
using Content.Shared.Damage; | ||
using Content.Shared.Tools; | ||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; | ||
namespace Content.Server.Silicon.BlindHealing; | ||
|
||
namespace Content.Server.Silicon.BlindHealing | ||
[RegisterComponent] | ||
public sealed partial class BlindHealingComponent : Component | ||
{ | ||
[RegisterComponent] | ||
public sealed partial class BlindHealingComponent : Component | ||
{ | ||
[DataField] | ||
public int DoAfterDelay = 3; | ||
[DataField] | ||
public int DoAfterDelay = 3; | ||
|
||
/// <summary> | ||
/// A multiplier that will be applied to the above if an entity is repairing themselves. | ||
/// </summary> | ||
[DataField] | ||
public float SelfHealPenalty = 3f; | ||
/// <summary> | ||
/// A multiplier that will be applied to the above if an entity is repairing themselves. | ||
/// </summary> | ||
[DataField] | ||
public float SelfHealPenalty = 3f; | ||
|
||
/// <summary> | ||
/// Whether or not an entity is allowed to repair itself. | ||
/// </summary> | ||
[DataField] | ||
public bool AllowSelfHeal = true; | ||
/// <summary> | ||
/// Whether or not an entity is allowed to repair itself. | ||
/// </summary> | ||
[DataField] | ||
public bool AllowSelfHeal = true; | ||
|
||
[DataField(required: true)] | ||
public List<string> DamageContainers; | ||
} | ||
[DataField(required: true)] | ||
public List<string> DamageContainers; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really a good approach to make a new instance of EntitySystem? You should use
IoC
instead.