Progress + prettier ice walls

This commit is contained in:
Regalis
2015-12-12 13:44:05 +02:00
parent 78bccca4af
commit 17e8a2171f
49 changed files with 479 additions and 273 deletions
@@ -98,6 +98,10 @@ namespace Barotrauma.Items.Components
public override void Update(float deltaTime, Camera cam)
{
base.Update(deltaTime, cam);
if (item.CurrentHull != null)
{
//light.Submarine = item.CurrentHull.Submarine;
}
if (item.container != null)
{
@@ -107,7 +111,7 @@ namespace Barotrauma.Items.Components
if (item.body != null)
{
light.Position = ConvertUnits.ToDisplayUnits(item.body.SimPosition);
light.Position = item.WorldPosition;
}
if (powerConsumption == 0.0f)
@@ -121,7 +125,7 @@ namespace Barotrauma.Items.Components
if (Rand.Range(0.0f, 1.0f) < 0.05f && voltage < Rand.Range(0.0f, minVoltage))
{
if (voltage > 0.1f) sparkSounds[Rand.Int(sparkSounds.Length)].Play(1.0f, 400.0f, item.Position);
if (voltage > 0.1f) sparkSounds[Rand.Int(sparkSounds.Length)].Play(1.0f, 400.0f, item.WorldPosition);
lightBrightness = 0.0f;
}
else
@@ -314,7 +314,11 @@ namespace Barotrauma.Items.Components
for (int i = 1; i < Nodes.Count; i++)
{
GUI.DrawRectangle(spriteBatch, new Rectangle((int)Nodes[i].X - 3, (int)-Nodes[i].Y - 3, 6, 6), Color.Red, true, 0.0f);
Vector2 worldPos = Nodes[i];
if (item.Submarine != null) worldPos += item.Submarine.Position;
worldPos.Y = -worldPos.Y;
GUI.DrawRectangle(spriteBatch, worldPos+new Vector2(-3,3), new Vector2(6, 6), Color.Red, true, 0.0f);
if (GUIComponent.MouseOn != null ||
Vector2.Distance(GameMain.EditMapScreen.Cam.ScreenToWorld(PlayerInput.MousePosition), Nodes[i]) > 10.0f)
@@ -322,7 +326,7 @@ namespace Barotrauma.Items.Components
continue;
}
GUI.DrawRectangle(spriteBatch, new Rectangle((int)Nodes[i].X - 10, (int)-Nodes[i].Y - 10, 20, 20), Color.Red, false, 0.0f);
GUI.DrawRectangle(spriteBatch, worldPos + new Vector2(-10, 10), new Vector2(20, 20), Color.Red, false, 0.0f);
if (selectedNodeIndex == null && !MapEntity.SelectedAny)
{