diff --git a/Content.Server/Wires/WiresSystem.cs b/Content.Server/Wires/WiresSystem.cs index e878a185bd..8c99852971 100644 --- a/Content.Server/Wires/WiresSystem.cs +++ b/Content.Server/Wires/WiresSystem.cs @@ -237,10 +237,7 @@ public sealed class WiresSystem : SharedWiresSystem private void OnWiresStartup(EntityUid uid, WiresComponent component, ComponentStartup args) { - if (!String.IsNullOrEmpty(component.LayoutId)) - SetOrCreateWireLayout(uid, component); - - UpdateUserInterface(uid); + EnsureComp(uid); } #endregion @@ -498,17 +495,16 @@ public sealed class WiresSystem : SharedWiresSystem private void OnMapInit(EntityUid uid, WiresComponent component, MapInitEvent args) { - EnsureComp(uid); + if (!string.IsNullOrEmpty(component.LayoutId)) + SetOrCreateWireLayout(uid, component); + if (component.SerialNumber == null) - { GenerateSerialNumber(uid, component); - } if (component.WireSeed == 0) - { component.WireSeed = _random.Next(1, int.MaxValue); - UpdateUserInterface(uid); - } + + UpdateUserInterface(uid); } #endregion diff --git a/Resources/Prototypes/Entities/Objects/Fun/Instruments/instruments_structures.yml b/Resources/Prototypes/Entities/Objects/Fun/Instruments/instruments_structures.yml index 3f36b0cc18..d26e551f6e 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/Instruments/instruments_structures.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/Instruments/instruments_structures.yml @@ -162,6 +162,7 @@ map: ["enum.WiresVisualLayers.MaintenancePanel"] - type: Appearance - type: WiresVisuals + - type: WiresPanel - type: Wires BoardName: "DawInstrument" LayoutId: DawInstrument diff --git a/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml b/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml index 46c0a50be2..ce6a9d6395 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml @@ -36,6 +36,7 @@ - type: Physics bodyType: KinematicController - type: Clickable + - type: WiresPanel - type: Wires #we just want the panel BoardName: Mech LayoutId: Mech diff --git a/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml b/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml index 58eff7518e..e170ce8255 100644 --- a/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml +++ b/Resources/Prototypes/Entities/Structures/Dispensers/base_structuredispensers.yml @@ -69,3 +69,5 @@ beakerSlot: !type:ContainerSlot - type: StaticPrice price: 1000 + - type: Wires + - type: WiresPanel diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml index d2c2279b2d..c2d3d33df8 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/base_structureairlocks.yml @@ -74,6 +74,7 @@ - type: Electrified enabled: false usesApcPower: true + - type: WiresPanel - type: Wires BoardName: "Airlock Control" LayoutId: Airlock diff --git a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml index d8b5c6ce74..cf25be34c6 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Airlocks/highsec.yml @@ -3,6 +3,8 @@ parent: BaseStructure name: high security door description: Keeps the bad out and keeps the good in. + placement: + mode: SnapgridCenter components: - type: InteractionOutline - type: Sprite @@ -65,6 +67,7 @@ - type: Electrified enabled: false usesApcPower: true + - type: WiresPanel - type: Wires BoardName: "HighSec Control" LayoutId: HighSec @@ -90,5 +93,3 @@ - type: IconSmooth key: walls mode: NoSprite - placement: - mode: SnapgridCenter diff --git a/Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml b/Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml index 5835281d32..c2dc2859fd 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Firelocks/firelock.yml @@ -84,6 +84,7 @@ - type: Firelock - type: Appearance - type: WiresVisuals + - type: WiresPanel - type: Wires BoardName: "Firelock Control" LayoutId: Firelock diff --git a/Resources/Prototypes/Entities/Structures/Doors/Windoors/base_structurewindoors.yml b/Resources/Prototypes/Entities/Structures/Doors/Windoors/base_structurewindoors.yml index 2f6bed7e35..2f8353badd 100644 --- a/Resources/Prototypes/Entities/Structures/Doors/Windoors/base_structurewindoors.yml +++ b/Resources/Prototypes/Entities/Structures/Doors/Windoors/base_structurewindoors.yml @@ -115,6 +115,7 @@ - type: Electrified enabled: false usesApcPower: true + - type: WiresPanel - type: Wires BoardName: "Windoor Control" LayoutId: Airlock diff --git a/Resources/Prototypes/Entities/Structures/Machines/Computers/arcades.yml b/Resources/Prototypes/Entities/Structures/Machines/Computers/arcades.yml index 7161e3d1c6..95ad1c02f9 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/Computers/arcades.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/Computers/arcades.yml @@ -35,6 +35,7 @@ components: - type: SpaceVillainArcade rewardAmount: 0 + - type: WiresPanel - type: Wires LayoutId: Arcade BoardName: "Arcade" @@ -76,6 +77,7 @@ - type: ActivatableUI key: enum.BlockGameUiKey.Key - type: ActivatableUIRequiresPower + - type: WiresPanel - type: Wires LayoutId: Arcade BoardName: "Arcade" diff --git a/Resources/Prototypes/Entities/Structures/Machines/Medical/cryo_pod.yml b/Resources/Prototypes/Entities/Structures/Machines/Medical/cryo_pod.yml index b3123ec012..7587373948 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/Medical/cryo_pod.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/Medical/cryo_pod.yml @@ -50,6 +50,7 @@ - type: Machine board: CryoPodMachineCircuitboard - type: WiresVisuals + - type: WiresPanel - type: Wires BoardName: "Cryo pod" LayoutId: CryoPod diff --git a/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml b/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml index 5b588f11eb..eafa82d1ea 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/anomaly_equipment.yml @@ -36,6 +36,7 @@ energy: 2 color: "#fca3c0" - type: Appearance + - type: WiresPanel - type: Wires BoardName: "Vessel" LayoutId: Vessel @@ -167,6 +168,7 @@ soundGunshot: path: /Audio/Weapons/Guns/Gunshots/taser2.ogg - type: Appearance + - type: WiresPanel - type: WiresVisuals - type: Wires BoardName: "Ape" @@ -244,6 +246,7 @@ - type: Repairable fuelCost: 10 doAfterDelay: 5 + - type: WiresPanel - type: Wires BoardName: "AnomalyGenerator" LayoutId: AnomalyGenerator diff --git a/Resources/Prototypes/Entities/Structures/Machines/chem_master.yml b/Resources/Prototypes/Entities/Structures/Machines/chem_master.yml index 87cbdce80d..3957ac2cdc 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/chem_master.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/chem_master.yml @@ -60,6 +60,7 @@ True: { visible: true } False: { visible: false } # Machine / Construction stuff + - type: WiresPanel - type: Wires BoardName: "chem_master" LayoutId: chem_master diff --git a/Resources/Prototypes/Entities/Structures/Machines/cloning_machine.yml b/Resources/Prototypes/Entities/Structures/Machines/cloning_machine.yml index 9db97829dc..15ce16a6f5 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/cloning_machine.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/cloning_machine.yml @@ -60,6 +60,7 @@ - type: MaterialStorage materialWhiteList: - Biomass + - type: WiresPanel - type: Wires BoardName: "CloningPod" LayoutId: CloningPod diff --git a/Resources/Prototypes/Entities/Structures/Machines/fatextractor.yml b/Resources/Prototypes/Entities/Structures/Machines/fatextractor.yml index aeaedb0f6b..2db9931ea7 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/fatextractor.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/fatextractor.yml @@ -95,6 +95,7 @@ acts: ["Destruction"] - type: Machine board: FatExtractorMachineCircuitboard + - type: WiresPanel - type: Wires BoardName: FatExtractor LayoutId: FatExtractor diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index f27b88b2cb..5641613d26 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -51,6 +51,7 @@ - Sheet - RawMaterial - Ingot + - type: WiresPanel - type: Wires BoardName: "Autolathe" LayoutId: Autolathe @@ -158,6 +159,7 @@ acts: ["Destruction"] - type: Machine board: ProtolatheMachineCircuitboard + - type: WiresPanel - type: Wires BoardName: "Protolathe" LayoutId: Protolathe diff --git a/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml b/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml index a7d637af72..505426f913 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/material_reclaimer.yml @@ -58,6 +58,7 @@ acts: ["Destruction"] - type: Machine board: MaterialReclaimerMachineCircuitboard + - type: WiresPanel - type: Wires BoardName: "reclaimer" LayoutId: Reclaimer diff --git a/Resources/Prototypes/Entities/Structures/Machines/medical_scanner.yml b/Resources/Prototypes/Entities/Structures/Machines/medical_scanner.yml index ec6f631188..80a0cb0d95 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/medical_scanner.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/medical_scanner.yml @@ -77,6 +77,7 @@ acts: ["Destruction"] - type: Machine board: MedicalScannerMachineCircuitboard + - type: WiresPanel - type: Wires BoardName: "MedicalScanner" LayoutId: MedicalScanner diff --git a/Resources/Prototypes/Entities/Structures/Machines/telecomms.yml b/Resources/Prototypes/Entities/Structures/Machines/telecomms.yml index a1a3d12659..c07a092906 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/telecomms.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/telecomms.yml @@ -48,6 +48,7 @@ acts: ["Destruction"] - type: Machine board: TelecomServerCircuitboard + - type: WiresPanel - type: Wires BoardName: "TelecomServer" LayoutId: TelecomServer diff --git a/Resources/Prototypes/Entities/Structures/Machines/vending_machines.yml b/Resources/Prototypes/Entities/Structures/Machines/vending_machines.yml index b213383162..5c9e3dcfc4 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/vending_machines.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/vending_machines.yml @@ -63,6 +63,7 @@ type: VendingMachineBoundUserInterface - key: enum.WiresUiKey.Key type: WiresBoundUserInterface + - type: WiresPanel - type: Wires BoardName: "Vending Machine" LayoutId: Vending diff --git a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml index b6150902b5..39bc082038 100644 --- a/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml +++ b/Resources/Prototypes/Entities/Structures/Piping/Atmospherics/unary.yml @@ -242,6 +242,7 @@ - type: ActivatableUI inHandsOnly: false key: enum.ThermomachineUiKey.Key + - type: WiresPanel - type: Wires BoardName: "Thermomachine" LayoutId: Thermomachine diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/PA/control_box.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/PA/control_box.yml index e1f62631f0..12e46a7baa 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/PA/control_box.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/PA/control_box.yml @@ -32,6 +32,7 @@ type: ParticleAcceleratorBoundUserInterface - key: enum.WiresUiKey.Key type: WiresBoundUserInterface + - type: WiresPanel - type: Wires BoardName: "Mk2 Particle Accelerator" LayoutId: ParticleAccelerator diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/generators.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/generators.yml index 3c3861f9d2..139c509cef 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/generators.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/generators.yml @@ -180,6 +180,7 @@ - type: Sprite sprite: Structures/Power/Generation/portable_generator.rsi state: portgen0_1 + - type: WiresPanel - type: Wires BoardName: "GeneratorPlasma" LayoutId: GeneratorPlasma @@ -199,6 +200,7 @@ - type: Sprite sprite: Structures/Power/Generation/portable_generator.rsi state: portgen1_1 + - type: WiresPanel - type: Wires BoardName: "GeneratorUranium" LayoutId: GeneratorUranium diff --git a/Resources/Prototypes/Entities/Structures/Power/apc.yml b/Resources/Prototypes/Entities/Structures/Power/apc.yml index fce3dd5547..45d08af354 100644 --- a/Resources/Prototypes/Entities/Structures/Power/apc.yml +++ b/Resources/Prototypes/Entities/Structures/Power/apc.yml @@ -90,6 +90,7 @@ supplyRampTolerance: 1000 supplyRampRate: 500 - type: WallMount + - type: WiresPanel - type: Wires BoardName: "APC" LayoutId: APC diff --git a/Resources/Prototypes/Entities/Structures/Power/smes.yml b/Resources/Prototypes/Entities/Structures/Power/smes.yml index 249a39cf64..b7b5e962d3 100644 --- a/Resources/Prototypes/Entities/Structures/Power/smes.yml +++ b/Resources/Prototypes/Entities/Structures/Power/smes.yml @@ -62,6 +62,7 @@ energy: 1.6 color: "#c9c042" castShadows: false + - type: WiresPanel - type: Wires BoardName: "SMES" LayoutId: SMES diff --git a/Resources/Prototypes/Entities/Structures/Power/substation.yml b/Resources/Prototypes/Entities/Structures/Power/substation.yml index 72ff3a82fa..2d5547e58d 100644 --- a/Resources/Prototypes/Entities/Structures/Power/substation.yml +++ b/Resources/Prototypes/Entities/Structures/Power/substation.yml @@ -77,6 +77,7 @@ maxIntensity: 100 intensitySlope: 2 totalIntensity: 200 + - type: WiresPanel - type: Wires BoardName: "Substation" LayoutId: Substation diff --git a/Resources/Prototypes/Entities/Structures/Wallmounts/air_alarm.yml b/Resources/Prototypes/Entities/Structures/Wallmounts/air_alarm.yml index 6c9bf80eff..cd6a438ce6 100644 --- a/Resources/Prototypes/Entities/Structures/Wallmounts/air_alarm.yml +++ b/Resources/Prototypes/Entities/Structures/Wallmounts/air_alarm.yml @@ -45,6 +45,7 @@ type: AirAlarmBoundUserInterface - key: enum.WiresUiKey.Key type: WiresBoundUserInterface + - type: WiresPanel - type: Wires BoardName: "Air Alarm" LayoutId: AirAlarm diff --git a/Resources/Prototypes/Entities/Structures/Wallmounts/fire_alarm.yml b/Resources/Prototypes/Entities/Structures/Wallmounts/fire_alarm.yml index 03c4d7264c..d0e9cfdb0f 100644 --- a/Resources/Prototypes/Entities/Structures/Wallmounts/fire_alarm.yml +++ b/Resources/Prototypes/Entities/Structures/Wallmounts/fire_alarm.yml @@ -58,6 +58,7 @@ interfaces: - key: enum.WiresUiKey.Key type: WiresBoundUserInterface + - type: WiresPanel - type: Wires BoardName: "Fire Alarm" LayoutId: FireAlarm diff --git a/Resources/Prototypes/Entities/Structures/Wallmounts/intercom.yml b/Resources/Prototypes/Entities/Structures/Wallmounts/intercom.yml index d4010ab518..12204bede9 100644 --- a/Resources/Prototypes/Entities/Structures/Wallmounts/intercom.yml +++ b/Resources/Prototypes/Entities/Structures/Wallmounts/intercom.yml @@ -30,6 +30,7 @@ - type: Transform noRot: false anchored: true + - type: WiresPanel - type: Wires BoardName: "Intercom" LayoutId: Intercom diff --git a/Resources/Prototypes/Entities/Structures/Wallmounts/surveillance_camera.yml b/Resources/Prototypes/Entities/Structures/Wallmounts/surveillance_camera.yml index eacc63ac62..fcdf92dab5 100644 --- a/Resources/Prototypes/Entities/Structures/Wallmounts/surveillance_camera.yml +++ b/Resources/Prototypes/Entities/Structures/Wallmounts/surveillance_camera.yml @@ -20,6 +20,7 @@ - type: DeviceNetworkRequiresPower - type: Transform anchored: true + - type: WiresPanel - type: Wires alwaysRandomize: true LayoutId: SurveillanceCamera diff --git a/Resources/Prototypes/Entities/Structures/hydro_tray.yml b/Resources/Prototypes/Entities/Structures/hydro_tray.yml index 51395eeafc..8acaaaac1f 100644 --- a/Resources/Prototypes/Entities/Structures/hydro_tray.yml +++ b/Resources/Prototypes/Entities/Structures/hydro_tray.yml @@ -77,6 +77,7 @@ acts: ["Destruction"] - type: Machine board: HydroponicsTrayMachineCircuitboard + - type: WiresPanel - type: Wires BoardName: "HydroponicsTray" LayoutId: HydroponicsTray