Skip to content

Commit

Permalink
RCD Update (#2360)
Browse files Browse the repository at this point in the history
Co-authored-by: Kirus59 <[email protected]>
Co-authored-by: Stalen <[email protected]>
  • Loading branch information
3 people authored Jan 6, 2025
1 parent 176beca commit ffa8a23
Show file tree
Hide file tree
Showing 33 changed files with 268 additions and 43 deletions.
1 change: 1 addition & 0 deletions Content.Client/RCD/RCDConstructionGhostSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ public override void Update(float frameTime)

_placementManager.Clear();
_placementManager.BeginPlacing(newObjInfo);
_placementManager.Direction = rcd.ConstructionDirection; // SS220 fix rcd rotation
}
}
22 changes: 19 additions & 3 deletions Content.Client/RCD/RCDMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
VerticalExpand="True"
HorizontalExpand="True"
MinSize="450 450">

<!-- Note: The min size of the window just determine how close to the edge of the screen the center of the radial menu can be placed -->
<!-- The radial menu will try to open so that its center is located where the player's cursor is currently -->

Expand All @@ -16,7 +16,7 @@
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/Interface/Radial/RCD/walls_and_flooring.png"/>
</ui:RadialMenuTextureButton>
<ui:RadialMenuTextureButton StyleClasses="RadialMenuButton" SetSize="64 64" ToolTip="{Loc 'rcd-component-windows-and-grilles'}" TargetLayer="WindowsAndGrilles" Visible="False">
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/Interface/Radial/RCD/windows_and_grilles.png"/>
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/SS220/Interface/Radial/RCD/window_reinforced.png"/>
</ui:RadialMenuTextureButton>
<ui:RadialMenuTextureButton StyleClasses="RadialMenuButton" SetSize="64 64" ToolTip="{Loc 'rcd-component-airlocks'}" TargetLayer="Airlocks" Visible="False">
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/Interface/Radial/RCD/airlocks.png"/>
Expand All @@ -27,6 +27,14 @@
<ui:RadialMenuTextureButton StyleClasses="RadialMenuButton" SetSize="64 64" ToolTip="{Loc 'rcd-component-lighting'}" TargetLayer="Lighting" Visible="False">
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/Interface/Radial/RCD/lighting.png"/>
</ui:RadialMenuTextureButton>
<!-- SS220 rcd upd bgn -->
<ui:RadialMenuTextureButton StyleClasses="RadialMenuButton" SetSize="64 64" ToolTip="{Loc 'rcd-component-pipes'}" TargetLayer="Pipes" Visible="False">
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/SS220/Interface/Radial/RCD/pipes.png"/>
</ui:RadialMenuTextureButton>
<ui:RadialMenuTextureButton StyleClasses="RadialMenuButton" SetSize="64 64" ToolTip="{Loc 'rcd-component-disposals'}" TargetLayer="Disposals" Visible="False">
<TextureRect VerticalAlignment="Center" HorizontalAlignment="Center" TextureScale="2 2" TexturePath="/Textures/SS220/Interface/Radial/RCD/conpipe-tagger.png"/>
</ui:RadialMenuTextureButton>
<!-- SS220 rcd upd end -->
</ui:RadialContainer>

<!-- Walls and flooring -->
Expand All @@ -40,8 +48,16 @@

<!-- Computer and machine frames -->
<ui:RadialContainer Name="Electrical" VerticalExpand="True" HorizontalExpand="True" Radius="64"/>

<!-- Lighting -->
<ui:RadialContainer Name="Lighting" VerticalExpand="True" HorizontalExpand="True" Radius="64"/>

<!-- SS220 (rcd upd) bgn -->
<!-- Pipes -->
<ui:RadialContainer Name="Pipes" VerticalExpand="True" HorizontalExpand="True" Radius="64"/>

<!-- Disposals -->
<ui:RadialContainer Name="Disposals" VerticalExpand="True" HorizontalExpand="True" Radius="64"/>
<!-- SS220 (rcd upd) end -->

</ui:RadialMenu>
24 changes: 20 additions & 4 deletions Content.Shared/RCD/Systems/RCDSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class RCDSystem : EntitySystem
[Dependency] private readonly IPrototypeManager _protoManager = default!;
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
[Dependency] private readonly TagSystem _tags = default!;
[Dependency] private readonly SharedTransformSystem _xform = default!; // SS220 fix rcd rotation

private readonly int _instantConstructionDelay = 0;
private readonly EntProtoId _instantConstructionFx = "EffectRCDConstruct0";
Expand Down Expand Up @@ -515,21 +516,36 @@ private void FinalizeRCDOperation(EntityUid uid, RCDComponent component, MapGrid
break;

case RcdMode.ConstructObject:
var ent = Spawn(component.CachedPrototype.Prototype, _mapSystem.GridTileToLocal(mapGridData.GridUid, mapGridData.Component, mapGridData.Position));
//var ent = Spawn(component.CachedPrototype.Prototype, _mapSystem.GridTileToLocal(mapGridData.GridUid, mapGridData.Component, mapGridData.Position)); // SS220 fix rcd rotation

Angle rotation = 0; // SS220 fix rcd rotation
switch (component.CachedPrototype.Rotation)
{
case RcdRotation.Fixed:
Transform(ent).LocalRotation = Angle.Zero;
// SS220 fix rcd rotation begin
//Transform(ent).LocalRotation = Angle.Zero;
rotation = Angle.Zero;
// SS220 fix rcd rotation end
break;
case RcdRotation.Camera:
Transform(ent).LocalRotation = Transform(uid).LocalRotation;
// SS220 fix rcd rotation begin
//Transform(ent).LocalRotation = Transform(uid).LocalRotation;
rotation = Transform(uid).LocalRotation;
// SS220 fix rcd rotation end
break;
case RcdRotation.User:
Transform(ent).LocalRotation = direction.ToAngle();
// SS220 fix rcd rotation begin
//Transform(ent).LocalRotation = direction.ToAngle();
rotation = direction.ToAngle();
// SS220 fix rcd rotation end
break;
}

// SS220 fix rcd rotation begin
var mapcords = _xform.ToMapCoordinates(_mapSystem.GridTileToLocal(mapGridData.GridUid, mapGridData.Component, mapGridData.Position));
var ent = Spawn(component.CachedPrototype.Prototype, mapcords, rotation: rotation);
// SS220 fix rcd rotation end

_adminLogger.Add(LogType.RCD, LogImpact.High, $"{ToPrettyString(user):user} used RCD to spawn {ToPrettyString(ent)} at {mapGridData.Position} on grid {mapGridData.GridUid}");
break;

Expand Down
2 changes: 2 additions & 0 deletions Resources/Locale/ru-RU/ss220/rcd/components/rcd-component.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rcd-component-pipes = Газовые трубы
rcd-component-disposals = Утилизационные трубы
22 changes: 19 additions & 3 deletions Resources/Prototypes/Entities/Objects/Tools/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@
- type: RCD
availablePrototypes:
- WallSolid
- WallReinforced # ss220 rcd upd
- FloorSteel
- Plating
- Catwalk
Expand All @@ -311,6 +312,21 @@
- HVCable
- CableTerminal
- Deconstruct
# ss220 rcd upd bgn
- StraightPipe
- PipeFourway
- PipeTjunction
- PipeBend
- PassiveVent
- AirVent
- Scrubber
- DisposalPipe
- DisposalTrunk
- DisposalJunction
- DisposalJunctionFlipped
- DisposalYJunction
- DisposalBend
# ss220 rcd upd end
- type: LimitedCharges
maxCharges: 30
charges: 30
Expand Down Expand Up @@ -355,10 +371,10 @@
suffix: AutoRecharge
components:
- type: LimitedCharges
maxCharges: 20
charges: 20
maxCharges: 30 # rcd upd
charges: 30 # rcd upd
- type: AutoRecharge
rechargeDuration: 10
rechargeDuration: 5 # rcd upd

- type: entity
id: RCDExperimental
Expand Down
16 changes: 10 additions & 6 deletions Resources/Prototypes/Entities/Structures/Windows/reinforced.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
- type: Damageable
damageContainer: StructuralInorganic
damageModifierSet: RGlass
# ss220 rcd upd bgn
- type: RCDDeconstructable
cost: 6
delay: 6
fx: EffectRCDDeconstruct6
deconstructable: false
# ss220 rcd upd end
- type: Destructible
thresholds:
- trigger:
Expand Down Expand Up @@ -84,10 +84,10 @@
sprite: Structures/Windows/cracks_directional.rsi
- type: Damageable
damageModifierSet: RGlass
# ss220 rcd upd bgn
- type: RCDDeconstructable
cost: 4
delay: 4
fx: EffectRCDDeconstruct4
deconstructable: false
# ss220 rcd upd end
- type: Destructible
thresholds:
- trigger:
Expand Down Expand Up @@ -129,6 +129,10 @@
drawdepth: WallTops
sprite: Structures/Windows/reinforced_window_diagonal.rsi
state: state0
# ss220 rcd upd bgn
- type: RCDDeconstructable
deconstructable: false
# ss220 rcd upd end
- type: IconSmooth
mode: Diagonal
key: walls # Corvax-Resprite
Expand Down
54 changes: 27 additions & 27 deletions Resources/Prototypes/RCD/rcd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- type: rcd
id: Invalid # Hidden prototype - do not add to RCDs
mode: Invalid

- type: rcd
id: Deconstruct
name: rcd-component-deconstruct
Expand All @@ -13,14 +13,14 @@
rotation: Camera

- type: rcd
id: DeconstructLattice # Hidden prototype - do not add to RCDs
id: DeconstructLattice # Hidden prototype - do not add to RCDs
name: rcd-component-deconstruct
mode: Deconstruct
cost: 2
delay: 0
rotation: Camera
fx: EffectRCDConstruct0

- type: rcd
id: DeconstructTile # Hidden prototype - do not add to RCDs
name: rcd-component-deconstruct
Expand All @@ -30,7 +30,7 @@
rotation: Camera
fx: EffectRCDDeconstruct4

# Flooring
# Flooring
- type: rcd
id: Plating
name: rcd-component-plating
Expand All @@ -44,7 +44,7 @@
rules:
- CanBuildOnEmptyTile
fx: EffectRCDConstruct1

- type: rcd
id: FloorSteel
name: rcd-component-floor-steel
Expand All @@ -62,7 +62,7 @@
- type: rcd
id: Catwalk
category: WallsAndFlooring
sprite: /Textures/Interface/Radial/RCD/catwalk.png
sprite: /Textures/SS220/Interface/Radial/RCD/catwalk.png # ss220 rcd upd
mode: ConstructObject
prototype: Catwalk
cost: 1
Expand All @@ -78,9 +78,9 @@
- type: rcd
id: WallSolid
category: WallsAndFlooring
sprite: /Textures/Interface/Radial/RCD/solid_wall.png
sprite: /Textures/SS220/Interface/Radial/RCD/solid_wall.png # ss220 rcd upd
mode: ConstructObject
prototype: WallSolid
prototype: WallSolid
cost: 4
delay: 2
collisionMask: FullTileMask
Expand All @@ -103,7 +103,7 @@
- type: rcd
id: Window
category: WindowsAndGrilles
sprite: /Textures/Interface/Radial/RCD/window.png
sprite: /Textures/SS220/Interface/Radial/RCD/window.png # ss220 rcd upd
mode: ConstructObject
prototype: Window
cost: 3
Expand All @@ -113,11 +113,11 @@
- IsWindow
rotation: Fixed
fx: EffectRCDConstruct2

- type: rcd
id: WindowDirectional
category: WindowsAndGrilles
sprite: /Textures/Interface/Radial/RCD/directional.png
sprite: /Textures/SS220/Interface/Radial/RCD/directional.png # ss220 rcd upd
mode: ConstructObject
prototype: WindowDirectional
cost: 2
Expand All @@ -128,11 +128,11 @@
- IsWindow
rotation: User
fx: EffectRCDConstruct1

- type: rcd
id: ReinforcedWindow
category: WindowsAndGrilles
sprite: /Textures/Interface/Radial/RCD/window_reinforced.png
sprite: /Textures/SS220/Interface/Radial/RCD/window_reinforced.png # ss220 rcd upd
mode: ConstructObject
prototype: ReinforcedWindow
cost: 4
Expand All @@ -142,11 +142,11 @@
- IsWindow
rotation: User
fx: EffectRCDConstruct3

- type: rcd
id: WindowReinforcedDirectional
category: WindowsAndGrilles
sprite: /Textures/Interface/Radial/RCD/directional_reinforced.png
sprite: /Textures/SS220/Interface/Radial/RCD/directional_reinforced.png # ss220 rcd upd
mode: ConstructObject
prototype: WindowReinforcedDirectional
cost: 3
Expand All @@ -162,37 +162,37 @@
- type: rcd
id: Airlock
category: Airlocks
sprite: /Textures/Interface/Radial/RCD/airlock.png
sprite: /Textures/SS220/Interface/Radial/RCD/airlock.png # ss220 rcd upd
mode: ConstructObject
prototype: Airlock
cost: 4
delay: 4
collisionMask: FullTileMask
rotation: Camera
rotation: User # ss220 rcd upd (fix rot)
fx: EffectRCDConstruct4

- type: rcd
id: AirlockGlass
category: Airlocks
sprite: /Textures/Interface/Radial/RCD/glass_airlock.png
sprite: /Textures/SS220/Interface/Radial/RCD/glass_airlock.png # ss220 rcd upd
mode: ConstructObject
prototype: AirlockGlass
cost: 4
delay: 4
collisionMask: FullTileMask
rotation: Camera
rotation: User # ss220 rcd upd (fix rot)
fx: EffectRCDConstruct4

- type: rcd
id: Firelock
category: Airlocks
sprite: /Textures/Interface/Radial/RCD/firelock.png
sprite: /Textures/SS220/Interface/Radial/RCD/firelock.png # ss220 rcd upd
mode: ConstructObject
prototype: Firelock
cost: 4
delay: 3
collisionMask: FullTileMask
rotation: Camera
rotation: User # ss220 rcd upd (fix rot)
fx: EffectRCDConstruct3

# Lighting
Expand All @@ -208,7 +208,7 @@
collisionBounds: "-0.23,-0.49,0.23,-0.36"
rotation: User
fx: EffectRCDConstruct1

- type: rcd
id: BulbLight
category: Lighting
Expand All @@ -235,7 +235,7 @@
- MustBuildOnSubfloor
rotation: Fixed
fx: EffectRCDConstruct0

- type: rcd
id: MVCable
category: Electrical
Expand All @@ -248,7 +248,7 @@
- MustBuildOnSubfloor
rotation: Fixed
fx: EffectRCDConstruct0

- type: rcd
id: HVCable
category: Electrical
Expand All @@ -261,7 +261,7 @@
- MustBuildOnSubfloor
rotation: Fixed
fx: EffectRCDConstruct0

- type: rcd
id: CableTerminal
category: Electrical
Expand Down
Loading

0 comments on commit ffa8a23

Please sign in to comment.