From 8e556f1c762182af3f2693b4dba9bc23f0402dd6 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Wed, 8 Nov 2017 21:15:03 +0200 Subject: [PATCH] - Renamed a bunch of ObjectProperty-related stuff (ObjectProperty -> SerializableProperty, IPropertyObject -> ISerializableEntity, the "SerializableProperty" attribute -> Serialize). - Rectangle serialization. - Option to restrict numeric properties to a range of values. - WIP generic ISerializableEntity editor. --- .../BarotraumaClient/BarotraumaClient.csproj | 2 + .../Source/Characters/Character.cs | 2 +- .../Source/GUI/GUIComponent.cs | 74 ++- .../Source/GUI/GUIDropDown.cs | 9 +- .../Source/Items/Components/ItemComponent.cs | 15 +- .../Source/Items/Components/ItemLabel.cs | 6 +- .../BarotraumaClient/Source/Items/Item.cs | 59 ++- .../BarotraumaClient/Source/Map/Hull.cs | 2 +- .../Source/Networking/GameServerSettings.cs | 2 +- .../Serialization/SerializableEntityEditor.cs | 196 ++++++++ .../Source/Characters/Character.cs | 2 +- .../Source/Items/Components/ItemComponent.cs | 2 +- .../Source/Items/Components/ItemLabel.cs | 6 +- .../BarotraumaServer/Source/Map/Hull.cs | 2 +- .../Source/Characters/Character.cs | 8 +- .../Source/Characters/DelayedEffect.cs | 4 +- .../Source/Characters/Jobs/SkillPrefab.cs | 2 +- .../Source/Characters/StatusEffect.cs | 18 +- .../Source/Items/Components/DockingPort.cs | 6 +- .../Source/Items/Components/Door.cs | 6 +- .../Items/Components/Holdable/Holdable.cs | 14 +- .../Items/Components/Holdable/MeleeWeapon.cs | 4 +- .../Items/Components/Holdable/Propulsion.cs | 4 +- .../Items/Components/Holdable/RangedWeapon.cs | 10 +- .../Items/Components/Holdable/RepairTool.cs | 14 +- .../Items/Components/Holdable/Throwable.cs | 2 +- .../Source/Items/Components/ItemComponent.cs | 28 +- .../Source/Items/Components/ItemContainer.cs | 16 +- .../Items/Components/Machines/Engine.cs | 2 +- .../Items/Components/Machines/MiniMap.cs | 6 +- .../Components/Machines/OxygenGenerator.cs | 2 +- .../Source/Items/Components/Machines/Pump.cs | 4 +- .../Source/Items/Components/Machines/Radar.cs | 4 +- .../Items/Components/Machines/Reactor.cs | 16 +- .../Items/Components/Machines/Steering.cs | 4 +- .../Items/Components/Power/PowerContainer.cs | 10 +- .../Source/Items/Components/Power/Powered.cs | 10 +- .../Source/Items/Components/Projectile.cs | 10 +- .../Items/Components/Signal/AndComponent.cs | 6 +- .../Items/Components/Signal/DelayComponent.cs | 2 +- .../Items/Components/Signal/LightComponent.cs | 12 +- .../Items/Components/Signal/MotionSensor.cs | 6 +- .../Components/Signal/OscillatorComponent.cs | 4 +- .../Components/Signal/RegExFindComponent.cs | 4 +- .../Items/Components/Signal/RelayComponent.cs | 4 +- .../Components/Signal/SignalCheckComponent.cs | 6 +- .../Items/Components/Signal/WifiComponent.cs | 6 +- .../Source/Items/Components/Turret.cs | 10 +- .../Source/Items/Components/Wearable.cs | 4 +- .../BarotraumaShared/Source/Items/Item.cs | 65 ++- .../Source/Items/ItemPrefab.cs | 2 +- .../BarotraumaShared/Source/Map/Hull.cs | 10 +- .../Map/Levels/LevelGenerationParams.cs | 30 +- .../Source/Map/StructurePrefab.cs | 2 +- .../Source/Networking/GameServerLogin.cs | 2 +- .../Source/Networking/GameServerSettings.cs | 36 +- ...opertyObject.cs => ISerializableEntity.cs} | 4 +- .../Source/Serialization/Properties.cs | 385 --------------- .../Serialization/SerializableProperty.cs | 449 ++++++++++++++++++ .../Source/Serialization/XMLExtensions.cs | 81 +++- 60 files changed, 1035 insertions(+), 678 deletions(-) create mode 100644 Barotrauma/BarotraumaClient/Source/Serialization/SerializableEntityEditor.cs rename Barotrauma/BarotraumaShared/Source/Serialization/{IPropertyObject.cs => ISerializableEntity.cs} (61%) delete mode 100644 Barotrauma/BarotraumaShared/Source/Serialization/Properties.cs create mode 100644 Barotrauma/BarotraumaShared/Source/Serialization/SerializableProperty.cs diff --git a/Barotrauma/BarotraumaClient/BarotraumaClient.csproj b/Barotrauma/BarotraumaClient/BarotraumaClient.csproj index 9f688d9a7..b24d7da67 100644 --- a/Barotrauma/BarotraumaClient/BarotraumaClient.csproj +++ b/Barotrauma/BarotraumaClient/BarotraumaClient.csproj @@ -206,6 +206,7 @@ + @@ -299,6 +300,7 @@ +