Further lighting optimization, fixed (railgun) controller movement, physicsbody collisioncategory changes, command room reactor controls in Vellamo

This commit is contained in:
Regalis11
2015-10-14 22:10:37 +03:00
parent 8df9133e84
commit 2bb5d41836
27 changed files with 135 additions and 126 deletions
@@ -63,6 +63,21 @@ namespace Subsurface.Items.Components
light.Position += amount;
}
public override bool IsActive
{
get
{
return base.IsActive;
}
set
{
if (base.IsActive == value) return;
base.IsActive = value;
light.Color = value ? lightColor : Color.Transparent;
}
}
public LightComponent(Item item, XElement element)
: base (item, element)
{
@@ -122,10 +137,11 @@ namespace Subsurface.Items.Components
public override void Draw(SpriteBatch spriteBatch, bool editing)
{
if (!IsActive)
{
light.Color = Color.Transparent;
}
if (!editing) return;
//Vector2 center = new Vector2(item.Rect.Center.X, -item.Rect.Y + item.Rect.Height/2.0f);
//GUI.DrawLine(spriteBatch, center - Vector2.One * range, center + Vector2.One * range, lightColor);
}
public override void Remove()