Working on improving the serialization system and ObjectProperty/IPropertyObject (TODO: come up with better names). The plan is to:
- Add support for some of the most common types (vectors, colors, rects) so there's no need to parse the values in the setters of the serializable properties (see Holdable.HoldPos for example). - Make a generic version of the item editing HUD that can be used on any IPropertyObject. Should make it easier to implement things like the character editor, editing structure properties, particle editor, etc. - Improve the interface of the editing HUD. Instead of having to type in a string value into a textbox, there should be number input fields for numeric properties, sliders for properties that only accept a range of values, a color picker, etc. And tooltips.
This commit is contained in:
@@ -21,48 +21,48 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
private float activeTimer;
|
||||
|
||||
[HasDefaultValue(0.0f, false)]
|
||||
[SerializableProperty(0.0f, false)]
|
||||
public float Range
|
||||
{
|
||||
get { return range; }
|
||||
set { range = value; }
|
||||
}
|
||||
|
||||
[HasDefaultValue(0.0f, false)]
|
||||
[SerializableProperty(0.0f, false)]
|
||||
public float StructureFixAmount
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[HasDefaultValue(0.0f, false)]
|
||||
[SerializableProperty(0.0f, false)]
|
||||
public float LimbFixAmount
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
[HasDefaultValue(0.0f, false)]
|
||||
[SerializableProperty(0.0f, false)]
|
||||
public float ExtinquishAmount
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[HasDefaultValue("", false)]
|
||||
[SerializableProperty("", false)]
|
||||
public string Particles
|
||||
{
|
||||
get { return particles; }
|
||||
set { particles = value; }
|
||||
}
|
||||
|
||||
[HasDefaultValue(0.0f, false)]
|
||||
[SerializableProperty(0.0f, false)]
|
||||
public float ParticleSpeed
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
[HasDefaultValue("0.0,0.0", false)]
|
||||
public string BarrelPos
|
||||
[SerializableProperty("0.0,0.0", false)]
|
||||
public Vector2 BarrelPos
|
||||
{
|
||||
get { return XMLExtensions.Vector2ToString(barrelPos); }
|
||||
set { barrelPos = XMLExtensions.ParseToVector2(value); }
|
||||
get { return barrelPos; }
|
||||
set { barrelPos = value; }
|
||||
}
|
||||
|
||||
public Vector2 TransformedBarrelPos
|
||||
|
||||
Reference in New Issue
Block a user