From 3333acee44f27a96301029ecf66313048a52136a Mon Sep 17 00:00:00 2001 From: Clyybber Date: Fri, 5 Jun 2020 22:40:27 +0200 Subject: [PATCH 1/8] Construction UI improvements --- .../Construction/ConstructionMenu.cs | 77 +++++++++++-------- 1 file changed, 46 insertions(+), 31 deletions(-) diff --git a/Content.Client/Construction/ConstructionMenu.cs b/Content.Client/Construction/ConstructionMenu.cs index d8c6a87b91..8ab81a99f2 100644 --- a/Content.Client/Construction/ConstructionMenu.cs +++ b/Content.Client/Construction/ConstructionMenu.cs @@ -48,7 +48,7 @@ namespace Content.Client.Construction { IoCManager.InjectDependencies(this); Placement = (PlacementManager) IoCManager.Resolve(); - Placement.PlacementCanceled += OnPlacementCanceled; + Placement.PlacementChanged += OnPlacementChanged; Title = "Construction"; @@ -95,7 +95,7 @@ namespace Content.Client.Construction TextAlign = Label.AlignMode.Center, Text = "Build!", Disabled = true, - ToggleMode = false + ToggleMode = true }; EraseButton = new Button { @@ -108,7 +108,7 @@ namespace Content.Client.Construction hSplitContainer.AddChild(guide); Contents.AddChild(hSplitContainer); - BuildButton.OnPressed += OnBuildPressed; + BuildButton.OnToggled += OnBuildToggled; EraseButton.OnToggled += OnEraseToggled; SearchBar.OnTextChanged += OnTextEntered; RecipeList.OnItemSelected += OnItemSelected; @@ -123,7 +123,7 @@ namespace Content.Client.Construction if (disposing) { - Placement.PlacementCanceled -= OnPlacementCanceled; + Placement.PlacementChanged -= OnPlacementChanged; } } @@ -226,37 +226,57 @@ namespace Content.Client.Construction PopulateTree(string.IsNullOrWhiteSpace(str) ? null : str.ToLowerInvariant()); } - void OnBuildPressed(BaseButton.ButtonEventArgs args) + void OnBuildToggled(BaseButton.ButtonToggledEventArgs args) { - var prototype = (ConstructionPrototype) RecipeList.Selected.Metadata; - if (prototype == null) + if (args.Pressed) { - return; + var prototype = (ConstructionPrototype) RecipeList.Selected.Metadata; + if (prototype == null) + { + return; + } + + if (prototype.Type != ConstructionType.Structure) + { + // In-hand attackby doesn't exist so this is the best alternative. + var loc = Owner.Owner.GetComponent().GridPosition; + Owner.SpawnGhost(prototype, loc, Direction.North); + return; + } + + Placement.BeginHijackedPlacing( + new PlacementInformation + { + IsTile = false, + PlacementOption = prototype.PlacementMode + }, + new ConstructionPlacementHijack(prototype, Owner)); } - - if (prototype.Type != ConstructionType.Structure) + else { - // In-hand attackby doesn't exist so this is the best alternative. - var loc = Owner.Owner.GetComponent().GridPosition; - Owner.SpawnGhost(prototype, loc, Direction.North); - return; + Placement.Clear(); } - - var hijack = new ConstructionPlacementHijack(prototype, Owner); - var info = new PlacementInformation - { - IsTile = false, - PlacementOption = prototype.PlacementMode, - }; - - - Placement.BeginHijackedPlacing(info, hijack); + BuildButton.Pressed = args.Pressed; } private void OnEraseToggled(BaseButton.ButtonToggledEventArgs args) { - var hijack = new ConstructionPlacementHijack(null, Owner); - Placement.ToggleEraserHijacked(hijack); + if (args.Pressed) + { + Placement.Clear(); + Placement.ToggleEraserHijacked(new ConstructionPlacementHijack(null, Owner)); + } + else + { + Placement.ToggleEraserHijacked(new ConstructionPlacementHijack(null, Owner)); + } + EraseButton.Pressed = args.Pressed; + } + + private void OnPlacementChanged(object sender, EventArgs e) + { + BuildButton.Pressed = false; + EraseButton.Pressed = false; } void PopulatePrototypeList() @@ -363,11 +383,6 @@ namespace Content.Client.Construction } } - private void OnPlacementCanceled(object sender, EventArgs e) - { - EraseButton.Pressed = false; - } - private static int ComparePrototype(ConstructionPrototype x, ConstructionPrototype y) { return String.Compare(x.Name, y.Name, StringComparison.Ordinal); From 5d2282231f879e540d77c4a96c2c81ed1af22cc5 Mon Sep 17 00:00:00 2001 From: Clyybber Date: Fri, 5 Jun 2020 23:49:41 +0200 Subject: [PATCH 2/8] Cleanup --- Content.Client/Construction/ConstructionMenu.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Content.Client/Construction/ConstructionMenu.cs b/Content.Client/Construction/ConstructionMenu.cs index 8ab81a99f2..b5772359b1 100644 --- a/Content.Client/Construction/ConstructionMenu.cs +++ b/Content.Client/Construction/ConstructionMenu.cs @@ -261,15 +261,8 @@ namespace Content.Client.Construction private void OnEraseToggled(BaseButton.ButtonToggledEventArgs args) { - if (args.Pressed) - { - Placement.Clear(); - Placement.ToggleEraserHijacked(new ConstructionPlacementHijack(null, Owner)); - } - else - { - Placement.ToggleEraserHijacked(new ConstructionPlacementHijack(null, Owner)); - } + if (args.Pressed) Placement.Clear(); + Placement.ToggleEraserHijacked(new ConstructionPlacementHijack(null, Owner)); EraseButton.Pressed = args.Pressed; } From 2995981b5e54de7c24268e250345df5d7e032d55 Mon Sep 17 00:00:00 2001 From: Clyybber Date: Sat, 6 Jun 2020 10:40:53 +0200 Subject: [PATCH 3/8] Better item construction --- .../Construction/ConstructionMenu.cs | 8 +-- .../Construction/ConstructorComponent.cs | 6 ++ .../Construction/ConstructorComponent.cs | 57 ++++++++++++++++++- .../SharedConstructorComponent.cs | 20 +++++++ 4 files changed, 84 insertions(+), 7 deletions(-) diff --git a/Content.Client/Construction/ConstructionMenu.cs b/Content.Client/Construction/ConstructionMenu.cs index b5772359b1..12e919752c 100644 --- a/Content.Client/Construction/ConstructionMenu.cs +++ b/Content.Client/Construction/ConstructionMenu.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Content.Client.GameObjects.Components.Construction; +using Content.Client.Interfaces.GameObjects; using Content.Shared.Construction; using Content.Shared.GameObjects.Components.Interactable; using Robust.Client.Graphics; @@ -236,11 +237,10 @@ namespace Content.Client.Construction return; } - if (prototype.Type != ConstructionType.Structure) + if (prototype.Type == ConstructionType.Item) { - // In-hand attackby doesn't exist so this is the best alternative. - var loc = Owner.Owner.GetComponent().GridPosition; - Owner.SpawnGhost(prototype, loc, Direction.North); + Owner.TryStartItemConstruction(prototype.ID); + BuildButton.Pressed = false; return; } diff --git a/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs b/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs index 5bc3a31be6..3c44298631 100644 --- a/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs +++ b/Content.Client/GameObjects/Components/Construction/ConstructorComponent.cs @@ -114,6 +114,12 @@ namespace Content.Client.GameObjects.Components.Construction SendNetworkMessage(msg); } + public void TryStartItemConstruction(string prototypeName) + { + var msg = new TryStartItemConstructionMessage(prototypeName); + SendNetworkMessage(msg); + } + public void ClearGhost(int ghostId) { if (Ghosts.TryGetValue(ghostId, out var ghost)) diff --git a/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs b/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs index 81ed05c74e..d23d711cfe 100644 --- a/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs +++ b/Content.Server/GameObjects/Components/Construction/ConstructorComponent.cs @@ -1,10 +1,8 @@ using System; using Content.Server.GameObjects.Components.Stack; -using Content.Server.GameObjects.EntitySystems; using Content.Server.Utility; using Content.Shared.Construction; using Content.Shared.GameObjects.Components.Construction; -using Content.Shared.Interfaces; using Robust.Server.GameObjects.EntitySystems; using Robust.Server.Interfaces.GameObjects; using Robust.Shared.GameObjects; @@ -13,7 +11,6 @@ using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Map; using Robust.Shared.Interfaces.Network; using Robust.Shared.IoC; -using Robust.Shared.Localization; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Players; @@ -40,6 +37,9 @@ namespace Content.Server.GameObjects.Components.Construction case TryStartStructureConstructionMessage tryStart: TryStartStructureConstruction(tryStart.Location, tryStart.PrototypeName, tryStart.Angle, tryStart.Ack); break; + case TryStartItemConstructionMessage tryStart: + TryStartItemConstruction(tryStart.PrototypeName); + break; } } @@ -102,5 +102,56 @@ namespace Content.Server.GameObjects.Components.Construction var msg = new AckStructureConstructionMessage(ack); SendNetworkMessage(msg); } + + void TryStartItemConstruction(string prototypeName) + { + var prototype = _prototypeManager.Index(prototypeName); + + if (prototype.Stages.Count < 2) + { + throw new InvalidOperationException($"Prototype '{prototypeName}' does not have enough stages."); + } + + var stage0 = prototype.Stages[0]; + if (!(stage0.Forward is ConstructionStepMaterial matStep)) + { + throw new NotImplementedException(); + } + + // Try to find the stack with the material in the user's hand. + var hands = Owner.GetComponent(); + var activeHand = hands.GetActiveHand?.Owner; + if (activeHand == null) + { + return; + } + + if (!activeHand.TryGetComponent(out StackComponent stack) || !ConstructionComponent.MaterialStackValidFor(matStep, stack)) + { + return; + } + + if (!stack.Use(matStep.Amount)) + { + return; + } + + // OK WE'RE GOOD CONSTRUCTION STARTED. + EntitySystem.Get().Play("/Audio/items/deconstruct.ogg", Owner); + if (prototype.Stages.Count == 2) + { + // Exactly 2 stages, so don't make an intermediate frame. + var ent = _serverEntityManager.SpawnEntity(prototype.Result, Owner.Transform.GridPosition); + hands.PutInHandOrDrop(ent.GetComponent()); + } + else + { + //TODO: Make these viable as an item and try putting them in the players hands + var frame = _serverEntityManager.SpawnEntity("structureconstructionframe", Owner.Transform.GridPosition); + var construction = frame.GetComponent(); + construction.Init(prototype); + } + + } } } diff --git a/Content.Shared/GameObjects/Components/Construction/SharedConstructorComponent.cs b/Content.Shared/GameObjects/Components/Construction/SharedConstructorComponent.cs index 4f609f2829..d7c9389fa2 100644 --- a/Content.Shared/GameObjects/Components/Construction/SharedConstructorComponent.cs +++ b/Content.Shared/GameObjects/Components/Construction/SharedConstructorComponent.cs @@ -48,6 +48,26 @@ namespace Content.Shared.GameObjects.Components.Construction } } + /// + /// Sent client -> server to to tell the server that we started building + /// an item-construction. + /// + [Serializable, NetSerializable] + protected class TryStartItemConstructionMessage : ComponentMessage + { + /// + /// The construction prototype to start building. + /// + public readonly string PrototypeName; + + public TryStartItemConstructionMessage(string prototypeName) + { + Directed = true; + PrototypeName = prototypeName; + } + } + + [Serializable, NetSerializable] protected class AckStructureConstructionMessage : ComponentMessage { From 027c338c5f47ad9e4abc19c9163a40e490af4257 Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Mon, 8 Jun 2020 06:31:54 -0400 Subject: [PATCH 4/8] virtualize all net ids to reduce net traffic --- .../Components/Cargo/SharedCargoOrderDatabaseComponent.cs | 4 +++- .../Components/Cargo/SharedGalacticMarketComponent.cs | 4 +++- .../Components/Chemistry/SharedInjectorComponent.cs | 3 ++- .../Components/Chemistry/SharedSolutionComponent.cs | 4 +++- .../GameObjects/Components/Damage/DamageableComponent.cs | 3 ++- .../Components/Instruments/SharedInstrumentComponent.cs | 3 ++- .../Components/Interactable/SharedToolComponent.cs | 6 ++++-- .../Components/Inventory/SharedInventoryComponent.cs | 3 ++- .../GameObjects/Components/Items/ClothingComponentState.cs | 3 ++- .../GameObjects/Components/Items/ItemComponentState.cs | 7 ++----- .../GameObjects/Components/Items/ItemCooldownComponent.cs | 3 ++- .../GameObjects/Components/Items/SharedHandsComponent.cs | 3 ++- .../Components/Mobs/SharedCombatModeComponent.cs | 2 +- .../Components/Mobs/SharedHumanoidAppearanceComponent.cs | 4 +++- .../Components/Mobs/SharedOverlayEffectsComponent.cs | 3 ++- .../Components/Mobs/SharedStatusEffectsComponent.cs | 3 ++- .../Components/Observer/SharedGhostComponent.cs | 3 ++- .../GameObjects/Components/PDA/SharedPDAComponent.cs | 3 ++- .../Components/Research/SharedLatheDatabaseComponent.cs | 4 +++- .../Components/Research/SharedMaterialStorageComponent.cs | 4 +++- .../Research/SharedProtolatheDatabaseComponent.cs | 4 +++- .../Research/SharedTechnologyDatabaseComponent.cs | 6 ++++-- .../GameObjects/Components/SharedHandheldLightComponent.cs | 4 +++- .../GameObjects/Components/SharedStackComponent.cs | 3 ++- .../Ranged/BallisticMagazineWeaponComponentState.cs | 4 +++- Content.Shared/Materials/Material.cs | 2 +- RobustToolbox | 2 +- 27 files changed, 64 insertions(+), 33 deletions(-) diff --git a/Content.Shared/GameObjects/Components/Cargo/SharedCargoOrderDatabaseComponent.cs b/Content.Shared/GameObjects/Components/Cargo/SharedCargoOrderDatabaseComponent.cs index cd7debb0ab..4a2b746eb5 100644 --- a/Content.Shared/GameObjects/Components/Cargo/SharedCargoOrderDatabaseComponent.cs +++ b/Content.Shared/GameObjects/Components/Cargo/SharedCargoOrderDatabaseComponent.cs @@ -16,7 +16,9 @@ namespace Content.Shared.GameObjects.Components.Cargo public class CargoOrderDatabaseState : ComponentState { public readonly List Orders; - public CargoOrderDatabaseState(List orders) : base(ContentNetIDs.CARGO_ORDER_DATABASE) + public override uint NetID => ContentNetIDs.CARGO_ORDER_DATABASE; + + public CargoOrderDatabaseState(List orders) { Orders = orders; } diff --git a/Content.Shared/GameObjects/Components/Cargo/SharedGalacticMarketComponent.cs b/Content.Shared/GameObjects/Components/Cargo/SharedGalacticMarketComponent.cs index 8f39c13724..4f6652183d 100644 --- a/Content.Shared/GameObjects/Components/Cargo/SharedGalacticMarketComponent.cs +++ b/Content.Shared/GameObjects/Components/Cargo/SharedGalacticMarketComponent.cs @@ -88,7 +88,9 @@ namespace Content.Shared.GameObjects.Components.Cargo public class GalacticMarketState : ComponentState { public List Products; - public GalacticMarketState(List technologies) : base(ContentNetIDs.GALACTIC_MARKET) + public override uint NetID => ContentNetIDs.GALACTIC_MARKET; + + public GalacticMarketState(List technologies) { Products = technologies; } diff --git a/Content.Shared/GameObjects/Components/Chemistry/SharedInjectorComponent.cs b/Content.Shared/GameObjects/Components/Chemistry/SharedInjectorComponent.cs index 4fbef4ff26..9b688229b3 100644 --- a/Content.Shared/GameObjects/Components/Chemistry/SharedInjectorComponent.cs +++ b/Content.Shared/GameObjects/Components/Chemistry/SharedInjectorComponent.cs @@ -22,8 +22,9 @@ namespace Content.Shared.GameObjects.Components.Chemistry public ReagentUnit CurrentVolume { get; } public ReagentUnit TotalVolume { get; } public InjectorToggleMode CurrentMode { get; } + public override uint NetID => ContentNetIDs.REAGENT_INJECTOR; - public InjectorComponentState(ReagentUnit currentVolume, ReagentUnit totalVolume, InjectorToggleMode currentMode) : base(ContentNetIDs.REAGENT_INJECTOR) + public InjectorComponentState(ReagentUnit currentVolume, ReagentUnit totalVolume, InjectorToggleMode currentMode) { CurrentVolume = currentVolume; TotalVolume = totalVolume; diff --git a/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionComponent.cs b/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionComponent.cs index 232bea635e..2af662130c 100644 --- a/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionComponent.cs +++ b/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionComponent.cs @@ -20,7 +20,9 @@ namespace Content.Shared.GameObjects.Components.Chemistry [Serializable, NetSerializable] public class SolutionComponentState : ComponentState { - public SolutionComponentState() : base(ContentNetIDs.SOLUTION) { } + public override uint NetID => ContentNetIDs.SOLUTION; + + public SolutionComponentState() { } } /// diff --git a/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs b/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs index 656efbaf82..2a3ab12946 100644 --- a/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs +++ b/Content.Shared/GameObjects/Components/Damage/DamageableComponent.cs @@ -16,8 +16,9 @@ namespace Content.Shared.GameObjects public class DamageComponentState : ComponentState { public Dictionary CurrentDamage = new Dictionary(); + public override uint NetID => ContentNetIDs.DAMAGEABLE; - public DamageComponentState(Dictionary damage) : base(ContentNetIDs.DAMAGEABLE) + public DamageComponentState(Dictionary damage) { CurrentDamage = damage; } diff --git a/Content.Shared/GameObjects/Components/Instruments/SharedInstrumentComponent.cs b/Content.Shared/GameObjects/Components/Instruments/SharedInstrumentComponent.cs index c431a25fc8..f62c02e638 100644 --- a/Content.Shared/GameObjects/Components/Instruments/SharedInstrumentComponent.cs +++ b/Content.Shared/GameObjects/Components/Instruments/SharedInstrumentComponent.cs @@ -59,8 +59,9 @@ namespace Content.Shared.GameObjects.Components.Instruments public class InstrumentState : ComponentState { public bool Playing { get; } + public override uint NetID => ContentNetIDs.INSTRUMENTS; - public InstrumentState(bool playing, uint sequencerTick = 0) : base(ContentNetIDs.INSTRUMENTS) + public InstrumentState(bool playing, uint sequencerTick = 0) { Playing = playing; } diff --git a/Content.Shared/GameObjects/Components/Interactable/SharedToolComponent.cs b/Content.Shared/GameObjects/Components/Interactable/SharedToolComponent.cs index a99f4e029f..3990088a31 100644 --- a/Content.Shared/GameObjects/Components/Interactable/SharedToolComponent.cs +++ b/Content.Shared/GameObjects/Components/Interactable/SharedToolComponent.cs @@ -27,8 +27,9 @@ namespace Content.Shared.GameObjects.Components.Interactable public class MultiToolComponentState : ComponentState { public ToolQuality Quality { get; } + public override uint NetID => ContentNetIDs.MULTITOOLS; - public MultiToolComponentState(ToolQuality quality) : base(ContentNetIDs.MULTITOOLS) + public MultiToolComponentState(ToolQuality quality) { Quality = quality; } @@ -41,8 +42,9 @@ namespace Content.Shared.GameObjects.Components.Interactable public float Fuel { get; } public bool Activated { get; } public ToolQuality Quality { get; } + public override uint NetID => ContentNetIDs.WELDER; - public WelderComponentState(float fuelCapacity, float fuel, bool activated) : base(ContentNetIDs.WELDER) + public WelderComponentState(float fuelCapacity, float fuel, bool activated) { FuelCapacity = fuelCapacity; Fuel = fuel; diff --git a/Content.Shared/GameObjects/Components/Inventory/SharedInventoryComponent.cs b/Content.Shared/GameObjects/Components/Inventory/SharedInventoryComponent.cs index cf49d55e09..51aac9a099 100644 --- a/Content.Shared/GameObjects/Components/Inventory/SharedInventoryComponent.cs +++ b/Content.Shared/GameObjects/Components/Inventory/SharedInventoryComponent.cs @@ -51,8 +51,9 @@ namespace Content.Shared.GameObjects protected class InventoryComponentState : ComponentState { public List> Entities { get; } + public override uint NetID => ContentNetIDs.STORAGE; - public InventoryComponentState(List> entities) : base(ContentNetIDs.STORAGE) + public InventoryComponentState(List> entities) { Entities = entities; } diff --git a/Content.Shared/GameObjects/Components/Items/ClothingComponentState.cs b/Content.Shared/GameObjects/Components/Items/ClothingComponentState.cs index 42994d9193..c86723d4f2 100644 --- a/Content.Shared/GameObjects/Components/Items/ClothingComponentState.cs +++ b/Content.Shared/GameObjects/Components/Items/ClothingComponentState.cs @@ -7,8 +7,9 @@ namespace Content.Shared.GameObjects.Components.Items public class ClothingComponentState : ItemComponentState { public string ClothingEquippedPrefix { get; set; } + public override uint NetID => ContentNetIDs.CLOTHING; - public ClothingComponentState(string clothingEquippedPrefix, string equippedPrefix) : base(equippedPrefix, ContentNetIDs.CLOTHING) + public ClothingComponentState(string clothingEquippedPrefix, string equippedPrefix) : base(equippedPrefix) { ClothingEquippedPrefix = clothingEquippedPrefix; } diff --git a/Content.Shared/GameObjects/Components/Items/ItemComponentState.cs b/Content.Shared/GameObjects/Components/Items/ItemComponentState.cs index bbcff17cf3..7d496d826c 100644 --- a/Content.Shared/GameObjects/Components/Items/ItemComponentState.cs +++ b/Content.Shared/GameObjects/Components/Items/ItemComponentState.cs @@ -8,15 +8,12 @@ namespace Content.Shared.GameObjects.Components.Items public class ItemComponentState : ComponentState { public string EquippedPrefix { get; set; } + public override uint NetID => ContentNetIDs.ITEM; - public ItemComponentState(string equippedPrefix) : base(ContentNetIDs.ITEM) + public ItemComponentState(string equippedPrefix) { EquippedPrefix = equippedPrefix; } - protected ItemComponentState(string equippedPrefix, uint netId) : base(netId) - { - EquippedPrefix = equippedPrefix; - } } } diff --git a/Content.Shared/GameObjects/Components/Items/ItemCooldownComponent.cs b/Content.Shared/GameObjects/Components/Items/ItemCooldownComponent.cs index c2425cc9bc..be498567f5 100644 --- a/Content.Shared/GameObjects/Components/Items/ItemCooldownComponent.cs +++ b/Content.Shared/GameObjects/Components/Items/ItemCooldownComponent.cs @@ -74,8 +74,9 @@ namespace Content.Shared.GameObjects.Components.Items { public TimeSpan? CooldownStart { get; set; } public TimeSpan? CooldownEnd { get; set; } + public override uint NetID => ContentNetIDs.ITEMCOOLDOWN; - public ItemCooldownComponentState() : base(ContentNetIDs.ITEMCOOLDOWN) + public ItemCooldownComponentState() { } } diff --git a/Content.Shared/GameObjects/Components/Items/SharedHandsComponent.cs b/Content.Shared/GameObjects/Components/Items/SharedHandsComponent.cs index dc3604eae6..acc5d1a266 100644 --- a/Content.Shared/GameObjects/Components/Items/SharedHandsComponent.cs +++ b/Content.Shared/GameObjects/Components/Items/SharedHandsComponent.cs @@ -17,8 +17,9 @@ namespace Content.Shared.GameObjects { public readonly Dictionary Hands; public readonly string ActiveIndex; + public override uint NetID => ContentNetIDs.HANDS; - public HandsComponentState(Dictionary hands, string activeIndex) : base(ContentNetIDs.HANDS) + public HandsComponentState(Dictionary hands, string activeIndex) { Hands = hands; ActiveIndex = activeIndex; diff --git a/Content.Shared/GameObjects/Components/Mobs/SharedCombatModeComponent.cs b/Content.Shared/GameObjects/Components/Mobs/SharedCombatModeComponent.cs index bde177ac64..9866beff09 100644 --- a/Content.Shared/GameObjects/Components/Mobs/SharedCombatModeComponent.cs +++ b/Content.Shared/GameObjects/Components/Mobs/SharedCombatModeComponent.cs @@ -57,9 +57,9 @@ namespace Content.Shared.GameObjects.Components.Mobs { public bool IsInCombatMode { get; } public TargetingZone TargetingZone { get; } + public override uint NetID => ContentNetIDs.COMBATMODE; public CombatModeComponentState(bool isInCombatMode, TargetingZone targetingZone) - : base(ContentNetIDs.COMBATMODE) { IsInCombatMode = isInCombatMode; TargetingZone = targetingZone; diff --git a/Content.Shared/GameObjects/Components/Mobs/SharedHumanoidAppearanceComponent.cs b/Content.Shared/GameObjects/Components/Mobs/SharedHumanoidAppearanceComponent.cs index 91abd4e721..1d7064ec7b 100644 --- a/Content.Shared/GameObjects/Components/Mobs/SharedHumanoidAppearanceComponent.cs +++ b/Content.Shared/GameObjects/Components/Mobs/SharedHumanoidAppearanceComponent.cs @@ -69,7 +69,9 @@ namespace Content.Shared.GameObjects.Components.Mobs [NetSerializable] private sealed class HumanoidAppearanceComponentState : ComponentState { - public HumanoidAppearanceComponentState(HumanoidCharacterAppearance appearance, Sex sex) : base(ContentNetIDs.HUMANOID_APPEARANCE) + public override uint NetID => ContentNetIDs.HUMANOID_APPEARANCE; + + public HumanoidAppearanceComponentState(HumanoidCharacterAppearance appearance, Sex sex) { Appearance = appearance; Sex = sex; diff --git a/Content.Shared/GameObjects/Components/Mobs/SharedOverlayEffectsComponent.cs b/Content.Shared/GameObjects/Components/Mobs/SharedOverlayEffectsComponent.cs index 07b2b839c2..59e47efac7 100644 --- a/Content.Shared/GameObjects/Components/Mobs/SharedOverlayEffectsComponent.cs +++ b/Content.Shared/GameObjects/Components/Mobs/SharedOverlayEffectsComponent.cs @@ -24,8 +24,9 @@ namespace Content.Shared.GameObjects.Components.Mobs public class OverlayEffectComponentState : ComponentState { public ScreenEffects ScreenEffect; + public override uint NetID => ContentNetIDs.OVERLAYEFFECTS; - public OverlayEffectComponentState(ScreenEffects screenEffect) : base(ContentNetIDs.OVERLAYEFFECTS) + public OverlayEffectComponentState(ScreenEffects screenEffect) { ScreenEffect = screenEffect; } diff --git a/Content.Shared/GameObjects/Components/Mobs/SharedStatusEffectsComponent.cs b/Content.Shared/GameObjects/Components/Mobs/SharedStatusEffectsComponent.cs index 482b24fc17..ae21409a82 100644 --- a/Content.Shared/GameObjects/Components/Mobs/SharedStatusEffectsComponent.cs +++ b/Content.Shared/GameObjects/Components/Mobs/SharedStatusEffectsComponent.cs @@ -19,8 +19,9 @@ namespace Content.Shared.GameObjects.Components.Mobs public class StatusEffectComponentState : ComponentState { public Dictionary StatusEffects; + public override uint NetID => ContentNetIDs.STATUSEFFECTS; - public StatusEffectComponentState(Dictionary statusEffects) : base(ContentNetIDs.STATUSEFFECTS) + public StatusEffectComponentState(Dictionary statusEffects) { StatusEffects = statusEffects; } diff --git a/Content.Shared/GameObjects/Components/Observer/SharedGhostComponent.cs b/Content.Shared/GameObjects/Components/Observer/SharedGhostComponent.cs index b838c3b63e..41881bd2f3 100644 --- a/Content.Shared/GameObjects/Components/Observer/SharedGhostComponent.cs +++ b/Content.Shared/GameObjects/Components/Observer/SharedGhostComponent.cs @@ -14,8 +14,9 @@ namespace Content.Shared.GameObjects.Components.Observer public class GhostComponentState : ComponentState { public bool CanReturnToBody { get; } + public override uint NetID => ContentNetIDs.GHOST; - public GhostComponentState(bool canReturnToBody) : base(ContentNetIDs.GHOST) + public GhostComponentState(bool canReturnToBody) { CanReturnToBody = canReturnToBody; } diff --git a/Content.Shared/GameObjects/Components/PDA/SharedPDAComponent.cs b/Content.Shared/GameObjects/Components/PDA/SharedPDAComponent.cs index 567f7f8b2c..e458912746 100644 --- a/Content.Shared/GameObjects/Components/PDA/SharedPDAComponent.cs +++ b/Content.Shared/GameObjects/Components/PDA/SharedPDAComponent.cs @@ -166,10 +166,11 @@ namespace Content.Shared.GameObjects.Components.PDA public UplinkCategory Category; public string Description; public string ListingName; + public override uint NetID => ContentNetIDs.PDA; public UplinkListingData(string listingName,string itemId, int price, UplinkCategory category, - string description) : base(ContentNetIDs.PDA) + string description) { ListingName = listingName; Price = price; diff --git a/Content.Shared/GameObjects/Components/Research/SharedLatheDatabaseComponent.cs b/Content.Shared/GameObjects/Components/Research/SharedLatheDatabaseComponent.cs index fea10d01f4..e3b3c4aa03 100644 --- a/Content.Shared/GameObjects/Components/Research/SharedLatheDatabaseComponent.cs +++ b/Content.Shared/GameObjects/Components/Research/SharedLatheDatabaseComponent.cs @@ -117,7 +117,9 @@ namespace Content.Shared.GameObjects.Components.Research public class LatheDatabaseState : ComponentState { public readonly List Recipes; - public LatheDatabaseState(List recipes) : base(ContentNetIDs.LATHE_DATABASE) + public override uint NetID => ContentNetIDs.LATHE_DATABASE; + + public LatheDatabaseState(List recipes) { Recipes = recipes; } diff --git a/Content.Shared/GameObjects/Components/Research/SharedMaterialStorageComponent.cs b/Content.Shared/GameObjects/Components/Research/SharedMaterialStorageComponent.cs index 5ded848a25..158bc69c6c 100644 --- a/Content.Shared/GameObjects/Components/Research/SharedMaterialStorageComponent.cs +++ b/Content.Shared/GameObjects/Components/Research/SharedMaterialStorageComponent.cs @@ -69,7 +69,9 @@ namespace Content.Shared.GameObjects.Components.Research public class MaterialStorageState : ComponentState { public readonly Dictionary Storage; - public MaterialStorageState(Dictionary storage) : base(ContentNetIDs.MATERIAL_STORAGE) + public override uint NetID => ContentNetIDs.MATERIAL_STORAGE; + + public MaterialStorageState(Dictionary storage) { Storage = storage; } diff --git a/Content.Shared/GameObjects/Components/Research/SharedProtolatheDatabaseComponent.cs b/Content.Shared/GameObjects/Components/Research/SharedProtolatheDatabaseComponent.cs index 9fb52757fe..db8ede759f 100644 --- a/Content.Shared/GameObjects/Components/Research/SharedProtolatheDatabaseComponent.cs +++ b/Content.Shared/GameObjects/Components/Research/SharedProtolatheDatabaseComponent.cs @@ -63,7 +63,9 @@ namespace Content.Shared.GameObjects.Components.Research public class ProtolatheDatabaseState : ComponentState { public readonly List Recipes; - public ProtolatheDatabaseState(List recipes) : base(ContentNetIDs.PROTOLATHE_DATABASE) + public override uint NetID => ContentNetIDs.PROTOLATHE_DATABASE; + + public ProtolatheDatabaseState(List recipes) { Recipes = recipes; } diff --git a/Content.Shared/GameObjects/Components/Research/SharedTechnologyDatabaseComponent.cs b/Content.Shared/GameObjects/Components/Research/SharedTechnologyDatabaseComponent.cs index d76b42260f..94b64e36d5 100644 --- a/Content.Shared/GameObjects/Components/Research/SharedTechnologyDatabaseComponent.cs +++ b/Content.Shared/GameObjects/Components/Research/SharedTechnologyDatabaseComponent.cs @@ -104,12 +104,14 @@ namespace Content.Shared.GameObjects.Components.Research public class TechnologyDatabaseState : ComponentState { public List Technologies; - public TechnologyDatabaseState(List technologies) : base(ContentNetIDs.TECHNOLOGY_DATABASE) + public override uint NetID => ContentNetIDs.TECHNOLOGY_DATABASE; + + public TechnologyDatabaseState(List technologies) { Technologies = technologies; } - public TechnologyDatabaseState(List technologies) : base(ContentNetIDs.TECHNOLOGY_DATABASE) + public TechnologyDatabaseState(List technologies) { Technologies = new List(); foreach (var technology in technologies) diff --git a/Content.Shared/GameObjects/Components/SharedHandheldLightComponent.cs b/Content.Shared/GameObjects/Components/SharedHandheldLightComponent.cs index ecc9229693..7d1d7402f7 100644 --- a/Content.Shared/GameObjects/Components/SharedHandheldLightComponent.cs +++ b/Content.Shared/GameObjects/Components/SharedHandheldLightComponent.cs @@ -12,7 +12,9 @@ namespace Content.Shared.GameObjects.Components [Serializable, NetSerializable] protected sealed class HandheldLightComponentState : ComponentState { - public HandheldLightComponentState(float? charge) : base(ContentNetIDs.HANDHELD_LIGHT) + public override uint NetID => ContentNetIDs.HANDHELD_LIGHT; + + public HandheldLightComponentState(float? charge) { Charge = charge; } diff --git a/Content.Shared/GameObjects/Components/SharedStackComponent.cs b/Content.Shared/GameObjects/Components/SharedStackComponent.cs index 3713108839..6143dfc221 100644 --- a/Content.Shared/GameObjects/Components/SharedStackComponent.cs +++ b/Content.Shared/GameObjects/Components/SharedStackComponent.cs @@ -107,8 +107,9 @@ namespace Content.Shared.GameObjects.Components { public int Count { get; } public int MaxCount { get; } + public override uint NetID => ContentNetIDs.STACK; - public StackComponentState(int count, int maxCount) : base(ContentNetIDs.STACK) + public StackComponentState(int count, int maxCount) { Count = count; MaxCount = maxCount; diff --git a/Content.Shared/GameObjects/Components/Weapons/Ranged/BallisticMagazineWeaponComponentState.cs b/Content.Shared/GameObjects/Components/Weapons/Ranged/BallisticMagazineWeaponComponentState.cs index 158dbaa5ad..fd8ca4e345 100644 --- a/Content.Shared/GameObjects/Components/Weapons/Ranged/BallisticMagazineWeaponComponentState.cs +++ b/Content.Shared/GameObjects/Components/Weapons/Ranged/BallisticMagazineWeaponComponentState.cs @@ -20,7 +20,9 @@ namespace Content.Shared.GameObjects.Components.Weapons.Ranged /// public (int count, int max)? MagazineCount { get; } - public BallisticMagazineWeaponComponentState(bool chambered, (int count, int max)? magazineCount) : base(ContentNetIDs.BALLISTIC_MAGAZINE_WEAPON) + public override uint NetID => ContentNetIDs.BALLISTIC_MAGAZINE_WEAPON; + + public BallisticMagazineWeaponComponentState(bool chambered, (int count, int max)? magazineCount) { Chambered = chambered; MagazineCount = magazineCount; diff --git a/Content.Shared/Materials/Material.cs b/Content.Shared/Materials/Material.cs index de8d8dcf68..fbee6a549f 100644 --- a/Content.Shared/Materials/Material.cs +++ b/Content.Shared/Materials/Material.cs @@ -12,7 +12,7 @@ namespace Content.Shared.Materials /// Materials are read-only storage for the properties of specific materials. /// Properties should be intrinsic (or at least as much is necessary for game purposes). /// -public class Material : IExposeData + public class Material : IExposeData { public string Name => _name; private string _name = "unobtanium"; diff --git a/RobustToolbox b/RobustToolbox index ec0f4b35f7..dc518ad1a7 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit ec0f4b35f7a9885d358a08729ee433e3e2e95957 +Subproject commit dc518ad1a7a823888cb313826664fb0079a30024 From 3754713f7ffd7cfd43ba8fae2ee4edde8a0f0c5b Mon Sep 17 00:00:00 2001 From: Tyler Young Date: Mon, 8 Jun 2020 07:12:49 -0400 Subject: [PATCH 5/8] fix indentation --- .../GameObjects/Components/Chemistry/SharedSolutionComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionComponent.cs b/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionComponent.cs index 2af662130c..acd9b18324 100644 --- a/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionComponent.cs +++ b/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionComponent.cs @@ -22,7 +22,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry { public override uint NetID => ContentNetIDs.SOLUTION; - public SolutionComponentState() { } + public SolutionComponentState() { } } /// From fb5179b3b60fc1a9e8daaa455f2c50385b62707c Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Mon, 8 Jun 2020 14:14:37 +0200 Subject: [PATCH 6/8] Revert "Fix integration tests." This reverts commit d2a38bdb00d95faecce1108b216b38e4d085efce. --- .../GameObjects/Components/Chemistry/SolutionComponent.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/Chemistry/SolutionComponent.cs b/Content.Server/GameObjects/Components/Chemistry/SolutionComponent.cs index cd75c9aaac..1b3f334f12 100644 --- a/Content.Server/GameObjects/Components/Chemistry/SolutionComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/SolutionComponent.cs @@ -42,7 +42,7 @@ namespace Content.Server.GameObjects.Components.Chemistry private Solution _containedSolution = new Solution(); private ReagentUnit _maxVolume; private SolutionCaps _capabilities; - private string _fillInitState = ""; + private string _fillInitState; private int _fillInitSteps; private string _fillPathString = "Objects/Chemistry/fillings.rsi"; private ResourcePath _fillPath; From 5ba610e868d66a1a21c9cc59522709ad1d930c8f Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Mon, 8 Jun 2020 14:16:55 +0200 Subject: [PATCH 7/8] Undo submodule update --- RobustToolbox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RobustToolbox b/RobustToolbox index dc518ad1a7..ec0f4b35f7 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit dc518ad1a7a823888cb313826664fb0079a30024 +Subproject commit ec0f4b35f7a9885d358a08729ee433e3e2e95957 From 741cb9a81a2149875e85703b4c15e36f7f40313c Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Mon, 8 Jun 2020 14:10:44 +0200 Subject: [PATCH 8/8] Update submodule --- RobustToolbox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RobustToolbox b/RobustToolbox index ec0f4b35f7..b3f8e12739 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit ec0f4b35f7a9885d358a08729ee433e3e2e95957 +Subproject commit b3f8e1273919039c5d0884985a08718af37e679d