Progress:
- Input fields for vectors & colors in SerializableEntityEditor. - SerializableProperty tooltips. - GUINumberInput supports floats. - EditingHUD for structures (atm the only editable property is the color of the sprite)
This commit is contained in:
@@ -72,11 +72,17 @@ namespace Barotrauma
|
||||
child.Rect = new Rectangle(child.Rect.X + value.X - rect.X, child.Rect.Y + value.Y - rect.Y, child.Rect.Width, child.Rect.Height);
|
||||
}
|
||||
|
||||
Point moveAmount = value.Location - rect.Location;
|
||||
|
||||
rect = value;
|
||||
if (value.Width != rect.Width || value.Height != rect.Height)
|
||||
{
|
||||
SetTextPos();
|
||||
}
|
||||
else if (moveAmount != Point.Zero)
|
||||
{
|
||||
caretPos += moveAmount.ToVector2();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -240,7 +246,6 @@ namespace Barotrauma
|
||||
{
|
||||
caretPos = new Vector2(rect.X + size.X, rect.Y) + textPos - origin;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private Vector2 MeasureText(string text)
|
||||
@@ -257,6 +262,12 @@ namespace Barotrauma
|
||||
return size;
|
||||
}
|
||||
|
||||
protected override void SetAlpha(float a)
|
||||
{
|
||||
base.SetAlpha(a);
|
||||
textColor = new Color(textColor.R, textColor.G, textColor.B, a);
|
||||
}
|
||||
|
||||
public override void Draw(SpriteBatch spriteBatch)
|
||||
{
|
||||
Draw(spriteBatch, Vector2.Zero);
|
||||
|
||||
Reference in New Issue
Block a user