RPD port from Goob-Station and add support pipe layers#608
RPD port from Goob-Station and add support pipe layers#608JrInventor05 wants to merge 14 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughThis PR integrates a Rapid Piping Device (RPD) variant into the RCD system, adding configurable ranges, mirror/cross-direction prototypes, override prototype IDs, ignition support, and dynamic prototype grouping. Changes span server-side validity/finalization logic, client-side UI dehardcoding and pipe-layer alignment, and new configuration data. ChangesRPD System Integration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
RSI Diff Bot; head commit 624f4de merging into c05ea9e Resources/Textures/_Goobstation/Objects/Tools/rpd.rsi
Resources/Textures/_WL/Objects/Tools/brpd.rsi
Resources/Textures/_WL/Objects/Tools/cercd.rsi
|
|
не забудь потом коменты распихать на все не наши изменения |
КНШН |
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (3)
Content.Client/RCD/RCDConstructionGhostSystem.cs (1)
127-141: ⚡ Quick winRemove the commented-out "moved into another method" block.
The original placer setup is fully replaced by
CreatePlacer; keeping the old code as a multi-line comment just adds noise.🔧 Proposed cleanup
- /* moved into another method - // Create a new placer - var newObjInfo = new PlacementInformation - { - MobUid = heldEntity.Value, - PlacementOption = PlacementMode, - EntityType = prototype.Prototype, - Range = (int)Math.Ceiling(SharedInteractionSystem.InteractionRange), - IsTile = prototype.Mode == RcdMode.ConstructTile, - UseEditorContext = false, - }; - - _placementManager.Clear(); - _placementManager.BeginPlacing(newObjInfo); - */ }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Content.Client/RCD/RCDConstructionGhostSystem.cs` around lines 127 - 141, Remove the obsolete commented block that initializes a placer (the multi-line comment that creates a PlacementInformation instance and calls _placementManager.Clear() / _placementManager.BeginPlacing(...)); the logic has been replaced by CreatePlacer, so delete that commented-out code to reduce noise and keep RCDConstructionGhostSystem.cs clean while ensuring no functional changes to CreatePlacer or other placement logic.Content.Client/Atmos/AlignAtmosPipeLayers.cs (1)
192-197: 💤 Low valueUse the already-pattern-matched
rcdEntinstead of re-indexingrcd.Value.
rcd is { } rcdEntalready gives you a non-null value; readingrcd.Value.Ownerafterwards just rehashes the optional. Minor cleanup:🔧 Proposed cleanup
if (!_pipeLayersSystem.TryGetAlternativePrototype(atmosPipeLayers, layer, out var newProtoId)) { if (rcd is { } rcdEnt && rcdEnt.Comp.OverrideProtoId != null) // don't dirty if it already null - _entityManager.RaisePredictiveEvent(new RCDOverrideProtoIdEvent(_entityManager.GetNetEntity(rcd.Value.Owner), null)); + _entityManager.RaisePredictiveEvent(new RCDOverrideProtoIdEvent(_entityManager.GetNetEntity(rcdEnt.Owner), null)); return; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Content.Client/Atmos/AlignAtmosPipeLayers.cs` around lines 192 - 197, The code pattern-matched a non-null variable `rcdEnt` but then re-indexes the original optional via `rcd.Value.Owner`; update the call that constructs the event in AlignAtmosPipeLayers (the _entityManager.RaisePredictiveEvent(new RCDOverrideProtoIdEvent(...))) to use the already-pattern-matched `rcdEnt` for the owner (e.g., use `rcdEnt.Owner`) instead of `rcd.Value.Owner`, leaving the rest of the RCDOverrideProtoIdEvent invocation and null payload unchanged.Content.Client/RCD/RCDMenuBoundUserInterface.cs (1)
21-30: ⚡ Quick winDrop the commented-out
PrototypesGroupingInfodictionary now that grouping is sourced fromRCDSystem.The static dictionary is fully replaced by
_rcd.PrototypesGroupingInfo; retaining the old definition as a multi-line comment just adds noise to the file.🔧 Proposed cleanup
- // WL-Change: dehardcode // commented - // private static readonly Dictionary<string, (string Tooltip, SpriteSpecifier Sprite)> PrototypesGroupingInfo - // = new Dictionary<string, (string Tooltip, SpriteSpecifier Sprite)> - // { - // ["WallsAndFlooring"] = ("rcd-component-walls-and-flooring", new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/Radial/RCD/walls_and_flooring.png"))), - // ["WindowsAndGrilles"] = ("rcd-component-windows-and-grilles", new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/Radial/RCD/windows_and_grilles.png"))), - // ["Airlocks"] = ("rcd-component-airlocks", new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/Radial/RCD/airlocks.png"))), - // ["Electrical"] = ("rcd-component-electrical", new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/Radial/RCD/multicoil.png"))), - // ["Lighting"] = ("rcd-component-lighting", new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/Radial/RCD/lighting.png"))), - // };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Content.Client/RCD/RCDMenuBoundUserInterface.cs` around lines 21 - 30, Remove the commented-out static dictionary PrototypesGroupingInfo from RCDMenuBoundUserInterface: locate the commented block that defines PrototypesGroupingInfo (the multi-line comment starting with "private static readonly Dictionary<string, (string Tooltip, SpriteSpecifier Sprite)> PrototypesGroupingInfo") and delete it so only the runtime source _rcd.PrototypesGroupingInfo is used; ensure no other references in the file rely on the removed comment and keep usages pointed to _rcd.PrototypesGroupingInfo.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Content.Client/RCD/RCDConstructionGhostSystem.cs`:
- Line 32: The _useMirrorPrototype system field can go stale across heldEntity
swaps; stop using it and always read the component value on the RCD component at
runtime: update RCDConstructionGhostSystem.Update() to query
rcd.UseMirrorPrototype (or its inverted form) directly when deciding which
prototype to ghost, and change HandleFlip to only send the network flip event
rather than mutating _useMirrorPrototype; ensure any other places that currently
read _useMirrorPrototype (e.g., the ghost selection logic formerly around lines
121-125 and the check at the top of Update) are switched to read the RCD
component on the current heldEntity so client ghost state always reflects the
component, not a system-lifetime field.
- Line 33: FlipConstructionPrototype is declared but never raised; either remove
it or fire it when a flip occurs—update HandleFlip to invoke
FlipConstructionPrototype after performing the local state update (e.g., after
the flip logic and any UI/state refresh) so subscribers get notified, ensuring
you null-check the event (FlipConstructionPrototype?) before invoking; if no
subscribers are intended, delete the FlipConstructionPrototype event declaration
instead.
In `@Content.Shared/RCD/Systems/RCDSystem.cs`:
- Around line 733-737: The current early return on protoMiddle being null (var
protoMiddle = component.OverrideProtoId ?? prototype.Prototype; if (protoMiddle
== null) return;) short-circuits mode-specific deconstruction; move the
null-check into each construct branch that needs protoMiddle so that
prototype.Prototype is evaluated only when that branch runs (i.e., inside the
switch/case or if blocks handling different construct modes), and apply the same
change for the other similar blocks around the code handling the ranges noted
(the deconstruction branches at ~741-755 and ~795-810) to ensure deconstruction
occurs per-branch and you only return/skip when the specific branch requires a
missing protoMiddle.
- Around line 107-125: The handlers OverrideChanged and OnModeChanged apply
client-supplied NetEntity/rcd state without authenticating the sender; update
both to verify the event sender has authority over the target RCD before
mutating state: in OverrideChanged (handling RCDOverrideProtoIdEvent) and
OnModeChanged (handling RCDChangeModeEvent) obtain the sender/session from the
event, confirm the session is associated with a player entity that either owns
or is holding the RCD (e.g., check ownership/hand/component that references the
RCD) and only then call GetEntity/TryComp, set comp.OverrideProtoId, Dirty(...)
or call _source.SetIgnited; if authorization fails, return early and do not
apply changes. Ensure you reference the event types RCDOverrideProtoIdEvent and
RCDChangeModeEvent and protect calls to GetEntity, TryComp<RCDComponent>, Dirty,
and _source.SetIgnited behind this authorization check.
In `@Resources/Locale/ru-RU/_WL/entities/objects/tools/tools.ftl`:
- Around line 6-7: The Russian strings for the tool entity contain typos: update
the translation key ent-RPDExperimental and its description (.desc) to correct
spellings — change "эксперементальный" to "экспериментальный" in the entity name
and "Усовершенствовванное" to "Усовершенствованное" in ent-RPDExperimental.desc
(leave other wording intact unless you spot additional orthography issues).
In `@Resources/Locale/ru-RU/rcd/components/rcd-component.ftl`:
- Line 52: The locale entry for the key rcd-component-atmosphericutility has an
unintended leading space before "Атмос"; remove the extra leading whitespace so
the value becomes "Атмос" (no leading spaces) to prevent misaligned UI text.
In `@Resources/Prototypes/_Goobstation/Entities/Objects/Tools/tools.yml`:
- Around line 9-28: The RPD's availablePrototypes list in tools.yml is missing
the RadiatorBend entry referenced by rpd.yml; add "RadiatorBend" to the
availablePrototypes array (alongside other entries like Radiator, PipeBend,
etc.) so the RPD entity can spawn that prototype at runtime.
---
Nitpick comments:
In `@Content.Client/Atmos/AlignAtmosPipeLayers.cs`:
- Around line 192-197: The code pattern-matched a non-null variable `rcdEnt` but
then re-indexes the original optional via `rcd.Value.Owner`; update the call
that constructs the event in AlignAtmosPipeLayers (the
_entityManager.RaisePredictiveEvent(new RCDOverrideProtoIdEvent(...))) to use
the already-pattern-matched `rcdEnt` for the owner (e.g., use `rcdEnt.Owner`)
instead of `rcd.Value.Owner`, leaving the rest of the RCDOverrideProtoIdEvent
invocation and null payload unchanged.
In `@Content.Client/RCD/RCDConstructionGhostSystem.cs`:
- Around line 127-141: Remove the obsolete commented block that initializes a
placer (the multi-line comment that creates a PlacementInformation instance and
calls _placementManager.Clear() / _placementManager.BeginPlacing(...)); the
logic has been replaced by CreatePlacer, so delete that commented-out code to
reduce noise and keep RCDConstructionGhostSystem.cs clean while ensuring no
functional changes to CreatePlacer or other placement logic.
In `@Content.Client/RCD/RCDMenuBoundUserInterface.cs`:
- Around line 21-30: Remove the commented-out static dictionary
PrototypesGroupingInfo from RCDMenuBoundUserInterface: locate the commented
block that defines PrototypesGroupingInfo (the multi-line comment starting with
"private static readonly Dictionary<string, (string Tooltip, SpriteSpecifier
Sprite)> PrototypesGroupingInfo") and delete it so only the runtime source
_rcd.PrototypesGroupingInfo is used; ensure no other references in the file rely
on the removed comment and keep usages pointed to _rcd.PrototypesGroupingInfo.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a844aad0-48db-47fa-86cb-0309fc22c433
⛔ Files ignored due to path filters (30)
Resources/Audio/_WL/Items/handling/rpd_drop.oggis excluded by!**/*.oggResources/Audio/_WL/Items/handling/rpd_pickup.oggis excluded by!**/*.oggResources/Textures/_Goobstation/Interface/Radial/RPD/bend.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/dual_port.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/fourway.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/gas_filter.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/gas_mixer.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/injector.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/pneumatic_valve.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/port.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/pump_manual_valve.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/pump_pressure.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/pump_signal_valve.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/pump_volume.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/radiator.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/radiator_bend.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/scrub_off.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/straight.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/tjunction.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/vent_off.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Interface/Radial/RPD/vent_passive.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Objects/Tools/rpd.rsi/icon.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Objects/Tools/rpd.rsi/inhand-left.pngis excluded by!**/*.pngResources/Textures/_Goobstation/Objects/Tools/rpd.rsi/inhand-right.pngis excluded by!**/*.pngResources/Textures/_WL/Objects/Tools/brpd.rsi/icon.pngis excluded by!**/*.pngResources/Textures/_WL/Objects/Tools/brpd.rsi/inhand-left.pngis excluded by!**/*.pngResources/Textures/_WL/Objects/Tools/brpd.rsi/inhand-right.pngis excluded by!**/*.pngResources/Textures/_WL/Objects/Tools/cercd.rsi/icon.pngis excluded by!**/*.pngResources/Textures/_WL/Objects/Tools/cercd.rsi/inhand-left.pngis excluded by!**/*.pngResources/Textures/_WL/Objects/Tools/cercd.rsi/inhand-right.pngis excluded by!**/*.png
📒 Files selected for processing (24)
.vscode/launch.jsonContent.Client/Atmos/AlignAtmosPipeLayers.csContent.Client/RCD/AlignRCDConstruction.csContent.Client/RCD/RCDConstructionGhostSystem.csContent.Client/RCD/RCDMenuBoundUserInterface.csContent.Shared/Charges/Components/LimitedChargesComponent.csContent.Shared/RCD/Components/RCDComponent.csContent.Shared/RCD/Components/RCDDeconstructableComponent.csContent.Shared/RCD/RCDEvents.csContent.Shared/RCD/RCDGroupPrototype.csContent.Shared/RCD/RCDPrototype.csContent.Shared/RCD/Systems/RCDSystem.csResources/Locale/ru-RU/_WL/entities/objects/tools/tools.ftlResources/Locale/ru-RU/rcd/components/rcd-component.ftlResources/Locale/ru-RU/ss14-ru/prototypes/_Goobstation/entities/objects/tools/tools.ftlResources/Prototypes/Entities/Objects/Tools/tools.ymlResources/Prototypes/Entities/Structures/Piping/Atmospherics/pipes.ymlResources/Prototypes/_Goobstation/Entities/Objects/Tools/tools.ymlResources/Prototypes/_Goobstation/RPD/rpd.ymlResources/Prototypes/_WL/Entities/Objects/Tools/tools.ymlResources/Prototypes/_WL/RD/rcd.ymlResources/Textures/_Goobstation/Objects/Tools/rpd.rsi/meta.jsonResources/Textures/_WL/Objects/Tools/brpd.rsi/meta.jsonResources/Textures/_WL/Objects/Tools/cercd.rsi/meta.json
|
линтер не оценил твой ивент |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Litogin
left a comment
There was a problem hiding this comment.
Добавить комментарии на using
|
@coderabbitai review |
✅ Action performedReview finished.
|






Описание PR
Портирован РПД с губов, добавлена поддержка разных слоёв труб у РПД.
Почему / Баланс
Таск PRT-252 по предложке https://discord.com/channels/1066727245806325872/1494022529856311477
Технические детали
Медиа
Требования
Согласие с условиями
Критические изменения
Список изменений
Summary by CodeRabbit