diff --git a/Subsurface/Barotrauma.csproj b/Subsurface/Barotrauma.csproj
index a7f2cdc70..a798b157a 100644
--- a/Subsurface/Barotrauma.csproj
+++ b/Subsurface/Barotrauma.csproj
@@ -442,28 +442,40 @@
PreserveNewest
-
+
PreserveNewest
-
+
PreserveNewest
-
+
PreserveNewest
-
+
PreserveNewest
-
+
PreserveNewest
-
+
PreserveNewest
-
+
PreserveNewest
-
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
+ PreserveNewest
+
+
PreserveNewest
@@ -562,10 +574,10 @@
PreserveNewest
Designer
-
+
PreserveNewest
-
+
PreserveNewest
diff --git a/Subsurface/Content/Items/Clothes/clothes.xml b/Subsurface/Content/Items/Clothes/clothes.xml
deleted file mode 100644
index 5bf5762d7..000000000
--- a/Subsurface/Content/Items/Clothes/clothes.xml
+++ /dev/null
@@ -1,282 +0,0 @@
-
- -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Subsurface/Content/Items/Electricity/poweritems.xml b/Subsurface/Content/Items/Electricity/poweritems.xml
index c509c77b7..3f2948508 100644
--- a/Subsurface/Content/Items/Electricity/poweritems.xml
+++ b/Subsurface/Content/Items/Electricity/poweritems.xml
@@ -16,6 +16,7 @@
+
diff --git a/Subsurface/Content/Items/Engine/engine.xml b/Subsurface/Content/Items/Engine/engine.xml
index a409935c7..51a20b46b 100644
--- a/Subsurface/Content/Items/Engine/engine.xml
+++ b/Subsurface/Content/Items/Engine/engine.xml
@@ -10,7 +10,14 @@
+
+
+
+
+
+
+
@@ -30,7 +37,14 @@
+
+
+
+
+
+
+
@@ -58,7 +72,14 @@
+
+
+
+
+
+
+
diff --git a/Subsurface/Content/Items/Clothes/captainLegs.png b/Subsurface/Content/Items/Jobgear/captainLegs.png
similarity index 100%
rename from Subsurface/Content/Items/Clothes/captainLegs.png
rename to Subsurface/Content/Items/Jobgear/captainLegs.png
diff --git a/Subsurface/Content/Items/Clothes/captainTorso.png b/Subsurface/Content/Items/Jobgear/captainTorso.png
similarity index 100%
rename from Subsurface/Content/Items/Clothes/captainTorso.png
rename to Subsurface/Content/Items/Jobgear/captainTorso.png
diff --git a/Subsurface/Content/Items/Jobgear/captaingear.xml b/Subsurface/Content/Items/Jobgear/captaingear.xml
new file mode 100644
index 000000000..b9303bf9c
--- /dev/null
+++ b/Subsurface/Content/Items/Jobgear/captaingear.xml
@@ -0,0 +1,59 @@
+
+ -
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Subsurface/Content/Items/Clothes/captainhat.png b/Subsurface/Content/Items/Jobgear/captainhat.png
similarity index 100%
rename from Subsurface/Content/Items/Clothes/captainhat.png
rename to Subsurface/Content/Items/Jobgear/captainhat.png
diff --git a/Subsurface/Content/Items/Clothes/clownmask.png b/Subsurface/Content/Items/Jobgear/clownmask.png
similarity index 100%
rename from Subsurface/Content/Items/Clothes/clownmask.png
rename to Subsurface/Content/Items/Jobgear/clownmask.png
diff --git a/Subsurface/Content/Items/Clothes/clownpants.png b/Subsurface/Content/Items/Jobgear/clownpants.png
similarity index 100%
rename from Subsurface/Content/Items/Clothes/clownpants.png
rename to Subsurface/Content/Items/Jobgear/clownpants.png
diff --git a/Subsurface/Content/Items/Clothes/clownshirt.png b/Subsurface/Content/Items/Jobgear/clownshirt.png
similarity index 100%
rename from Subsurface/Content/Items/Clothes/clownshirt.png
rename to Subsurface/Content/Items/Jobgear/clownshirt.png
diff --git a/Subsurface/Content/Items/Clothes/doctorgear.png b/Subsurface/Content/Items/Jobgear/doctorgear.png
similarity index 100%
rename from Subsurface/Content/Items/Clothes/doctorgear.png
rename to Subsurface/Content/Items/Jobgear/doctorgear.png
diff --git a/Subsurface/Content/Items/Jobgear/doctorgear.xml b/Subsurface/Content/Items/Jobgear/doctorgear.xml
new file mode 100644
index 000000000..d7c5a2cd4
--- /dev/null
+++ b/Subsurface/Content/Items/Jobgear/doctorgear.xml
@@ -0,0 +1,94 @@
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Subsurface/Content/Items/Clothes/engigear.png b/Subsurface/Content/Items/Jobgear/engigear.png
similarity index 100%
rename from Subsurface/Content/Items/Clothes/engigear.png
rename to Subsurface/Content/Items/Jobgear/engigear.png
diff --git a/Subsurface/Content/Items/Jobgear/engigear.xml b/Subsurface/Content/Items/Jobgear/engigear.xml
new file mode 100644
index 000000000..ce7f89054
--- /dev/null
+++ b/Subsurface/Content/Items/Jobgear/engigear.xml
@@ -0,0 +1,58 @@
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Subsurface/Content/Items/Jobgear/misc.xml b/Subsurface/Content/Items/Jobgear/misc.xml
new file mode 100644
index 000000000..8c4629268
--- /dev/null
+++ b/Subsurface/Content/Items/Jobgear/misc.xml
@@ -0,0 +1,35 @@
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Subsurface/Content/Items/Clothes/securitygear.png b/Subsurface/Content/Items/Jobgear/securitygear.png
similarity index 100%
rename from Subsurface/Content/Items/Clothes/securitygear.png
rename to Subsurface/Content/Items/Jobgear/securitygear.png
diff --git a/Subsurface/Content/Items/Jobgear/securitygear.xml b/Subsurface/Content/Items/Jobgear/securitygear.xml
new file mode 100644
index 000000000..1fb1e62e4
--- /dev/null
+++ b/Subsurface/Content/Items/Jobgear/securitygear.xml
@@ -0,0 +1,59 @@
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Subsurface/Content/Items/Reactor/reactor.xml b/Subsurface/Content/Items/Reactor/reactor.xml
index caa3ed36a..c1d0cab82 100644
--- a/Subsurface/Content/Items/Reactor/reactor.xml
+++ b/Subsurface/Content/Items/Reactor/reactor.xml
@@ -23,6 +23,7 @@
+
diff --git a/Subsurface/Content/Items/Tools/tools.png b/Subsurface/Content/Items/Tools/tools.png
index a1b58f649..2df75e002 100644
Binary files a/Subsurface/Content/Items/Tools/tools.png and b/Subsurface/Content/Items/Tools/tools.png differ
diff --git a/Subsurface/Content/Items/Tools/tools.xml b/Subsurface/Content/Items/Tools/tools.xml
index 0c2a1c926..07a3b0dbf 100644
--- a/Subsurface/Content/Items/Tools/tools.xml
+++ b/Subsurface/Content/Items/Tools/tools.xml
@@ -165,7 +165,6 @@
-
-
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Subsurface/Content/Items/Weapons/weapons.xml b/Subsurface/Content/Items/Weapons/weapons.xml
index b3b9450b4..02975be2a 100644
--- a/Subsurface/Content/Items/Weapons/weapons.xml
+++ b/Subsurface/Content/Items/Weapons/weapons.xml
@@ -175,7 +175,7 @@
tags="weapon"
description="HONK">
-
+
diff --git a/Subsurface/Data/ContentPackages/Vanilla 0.3.xml b/Subsurface/Data/ContentPackages/Vanilla 0.3.xml
index 7c02ddc28..a2fcd44e4 100644
--- a/Subsurface/Data/ContentPackages/Vanilla 0.3.xml
+++ b/Subsurface/Data/ContentPackages/Vanilla 0.3.xml
@@ -4,7 +4,11 @@
-
+
+
+
+
+
diff --git a/Subsurface/Source/Characters/CharacterHUD.cs b/Subsurface/Source/Characters/CharacterHUD.cs
index e13f11d7c..3c7b9c839 100644
--- a/Subsurface/Source/Characters/CharacterHUD.cs
+++ b/Subsurface/Source/Characters/CharacterHUD.cs
@@ -62,10 +62,12 @@ namespace Barotrauma
{
var item = character.Inventory.Items[i];
if (item == null || CharacterInventory.limbSlots[i]==LimbSlot.Any) continue;
- var statusHUD = item.GetComponent();
- if (statusHUD == null) continue;
-
- statusHUD.DrawHUD(spriteBatch, character);
+ //var statusHUD = item.GetComponent();
+ //if (statusHUD == null) continue;
+ foreach (ItemComponent ic in item.components)
+ {
+ if (ic.DrawHudWhenEquipped) ic.DrawHUD(spriteBatch, character);
+ }
}
}
diff --git a/Subsurface/Source/Items/Components/ItemComponent.cs b/Subsurface/Source/Items/Components/ItemComponent.cs
index 25b986577..fdf50d5bc 100644
--- a/Subsurface/Source/Items/Components/ItemComponent.cs
+++ b/Subsurface/Source/Items/Components/ItemComponent.cs
@@ -111,6 +111,13 @@ namespace Barotrauma.Items.Components
set { canBePicked = value; }
}
+ [HasDefaultValue(false, false)]
+ public bool DrawHudWhenEquipped
+ {
+ get;
+ private set;
+ }
+
[HasDefaultValue(false, false)]
public bool CanBeSelected
{
diff --git a/Subsurface/Source/Items/Components/Machines/Radar.cs b/Subsurface/Source/Items/Components/Machines/Radar.cs
index 31dd944ca..368963422 100644
--- a/Subsurface/Source/Items/Components/Machines/Radar.cs
+++ b/Subsurface/Source/Items/Components/Machines/Radar.cs
@@ -3,8 +3,6 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.Xml.Linq;
using Voronoi2;
@@ -16,7 +14,7 @@ namespace Barotrauma.Items.Components
private float pingState;
- private Sprite pingCircle, screenOverlay;
+ private readonly Sprite pingCircle, screenOverlay;
private GUITickBox isActiveTickBox;
@@ -30,6 +28,13 @@ namespace Barotrauma.Items.Components
set { range = MathHelper.Clamp(value, 0.0f, 100000.0f); }
}
+ [HasDefaultValue(false, false)]
+ public bool DetectSubmarineWalls
+ {
+ get;
+ set;
+ }
+
public Radar(Item item, XElement element)
: base(item, element)
{
@@ -71,7 +76,7 @@ namespace Barotrauma.Items.Components
if (radarBlips[i].FadeTimer <= 0.0f) radarBlips.RemoveAt(i);
}
- if (voltage >= minVoltage)
+ if (voltage >= minVoltage || powerConsumption <= 0.0f)
{
pingState = pingState + deltaTime * 0.5f;
if (pingState>1.0f)
@@ -87,7 +92,7 @@ namespace Barotrauma.Items.Components
pingState = 0.0f;
}
- voltage -= deltaTime;
+ Voltage -= deltaTime;
}
public override bool Use(float deltaTime, Character character = null)
@@ -101,7 +106,7 @@ namespace Barotrauma.Items.Components
GuiFrame.Update(1.0f / 60.0f);
GuiFrame.Draw(spriteBatch);
- if (voltage < minVoltage) return;
+ if (voltage < minVoltage && powerConsumption > 0.0f) return;
int radius = GuiFrame.Rect.Height / 2 - 30;
DrawRadar(spriteBatch, new Rectangle((int)GuiFrame.Center.X - radius, (int)GuiFrame.Center.Y - radius, radius * 2, radius * 2));
@@ -113,23 +118,59 @@ namespace Barotrauma.Items.Components
if (!IsActive) return;
- float pingRadius = (rect.Width / 2) * pingState;
- pingCircle.Draw(spriteBatch, center, Color.White * (1.0f-pingState), 0.0f, (rect.Width/pingCircle.size.X)*pingState);
-
+ float pingRadius = (rect.Width / 2.0f) * pingState;
+ pingCircle.Draw(spriteBatch, center, Color.White * (1.0f - pingState), 0.0f, (rect.Width / pingCircle.size.X) * pingState);
+
float radius = rect.Width / 2.0f;
- float displayScale = radius/range;
+ float displayScale = radius / range;
+ if (DetectSubmarineWalls)
+ {
+ for (int i = 0; i < Submarine.Loaded.HullVertices.Count; i++)
+ {
+ Vector2 start = ConvertUnits.ToDisplayUnits(Submarine.Loaded.HullVertices[i]);
+ Vector2 end = ConvertUnits.ToDisplayUnits(Submarine.Loaded.HullVertices[(i + 1) % Submarine.Loaded.HullVertices.Count]);
+
+ if (item.CurrentHull!=null)
+ {
+ start += Rand.Vector(500.0f);
+ end += Rand.Vector(500.0f);
+ }
+
+ CreateBlipsForLine(
+ start + Submarine.Loaded.WorldPosition,
+ end + Submarine.Loaded.WorldPosition,
+ radius, displayScale, 2.0f);
+ }
+
+ }
+ else
+ {
+ float simScale = ConvertUnits.ToSimUnits(displayScale);
+
+ Vector2 offset = ConvertUnits.ToSimUnits(Submarine.Loaded.WorldPosition - item.WorldPosition);
+
+ for (int i = 0; i < Submarine.Loaded.HullVertices.Count; i++)
+ {
+ Vector2 start = (Submarine.Loaded.HullVertices[i] + offset) * simScale;
+ start.Y = -start.Y;
+ Vector2 end = (Submarine.Loaded.HullVertices[(i + 1) % Submarine.Loaded.HullVertices.Count] + offset) * simScale;
+ end.Y = -end.Y;
+
+ GUI.DrawLine(spriteBatch, center + start, center + end, Color.Green);
+
+ }
+ }
- float simScale = 1.5f;
+
- if (Level.Loaded != null)
+ if (Level.Loaded != null && (item.CurrentHull==null || !DetectSubmarineWalls))
{
List cells = Level.Loaded.GetCells(item.WorldPosition, 7);
foreach (VoronoiCell cell in cells)
{
-
foreach (GraphEdge edge in cell.edges)
{
if (!edge.isSolid) continue;
@@ -140,59 +181,15 @@ namespace Barotrauma.Items.Components
Vector2.Normalize(edge.point1 - edge.point2),
Vector2.Normalize(cell.Center-item.WorldPosition));
- //if (Math.Abs(facingDot) > 0.5f) continue;
-
- //facingDot = 1.0f;// MathHelper.Clamp(facingDot, -1.0f, 1.0f);
-
- float length = (edge.point1 - edge.point2).Length();
- for (float x = 0; x < length; x += Rand.Range(300.0f, 400.0f))
- {
- Vector2 point = edge.point1 + Vector2.Normalize(edge.point2 - edge.point1) * x;
- point += cell.Translation;
-
- float pointDist = Vector2.Distance(item.WorldPosition, point) * displayScale;
-
- if (pointDist > radius) continue;
- if (pointDist < prevPingRadius || pointDist > pingRadius) continue;
-
-
- float step = 3.0f * (Math.Abs(facingDot) + 1.0f);
- float alpha = Rand.Range(1.5f, 2.0f);
- for (float z = 0; z < radius - pointDist; z += step)
- {
-
- var blip = new RadarBlip(
- point + Rand.Vector(150.0f) + Vector2.Normalize(point-item.WorldPosition) * z / displayScale,
- alpha);
-
- radarBlips.Add(blip);
- step += 0.5f;
- alpha -= (z == 0) ? 0.5f : 0.1f;
- }
-
- }
+ CreateBlipsForLine(edge.point1 + cell.Translation, edge.point2+cell.Translation, radius, displayScale, 3.0f * (Math.Abs(facingDot) + 1.0f));
}
}
-
- for (int i = 0; i < Submarine.Loaded.HullVertices.Count; i++)
- {
- Vector2 start = (Submarine.Loaded.HullVertices[i] - ConvertUnits.ToSimUnits(item.Position - Submarine.HiddenSubPosition)) * simScale;
- start.Y = -start.Y;
- Vector2 end = (Submarine.Loaded.HullVertices[(i + 1) % Submarine.Loaded.HullVertices.Count] - ConvertUnits.ToSimUnits(item.Position - Submarine.HiddenSubPosition)) * simScale;
- end.Y = -end.Y;
-
- Vector2 diff = end - start;
- for (float x = 0; x < diff.Length(); x += 4.0f)
- {
- GUI.DrawLine(spriteBatch, center + start, center + end, Color.Green);
- }
- }
-
}
foreach (Character c in Character.CharacterList)
{
if (c.AnimController.CurrentHull != null) continue;
+ if (DetectSubmarineWalls && c.AnimController.CurrentHull == null && item.CurrentHull != null) continue;
foreach (Limb limb in c.AnimController.Limbs)
{
@@ -272,7 +269,42 @@ namespace Barotrauma.Items.Components
prevPos = pos;
}
+ }
+ private void CreateBlipsForLine(Vector2 point1, Vector2 point2, float radius, float displayScale, float step)
+ {
+ float pingRadius = radius * pingState;
+
+ float length = (point1 - point2).Length();
+
+ Vector2 lineDir = (point2 - point1) / length;
+
+ for (float x = 0; x < length; x += Rand.Range(300.0f, 400.0f))
+ {
+ Vector2 point = point1 + lineDir * x;
+ //point += cell.Translation;
+
+ float pointDist = Vector2.Distance(item.WorldPosition, point) * displayScale;
+
+ if (pointDist > radius) continue;
+ if (pointDist < prevPingRadius || pointDist > pingRadius) continue;
+
+
+ //float step = 3.0f * (Math.Abs(facingDot) + 1.0f);
+ float alpha = Rand.Range(1.5f, 2.0f);
+ for (float z = 0; z < radius - pointDist; z += step)
+ {
+
+ var blip = new RadarBlip(
+ point + Rand.Vector(150.0f) + Vector2.Normalize(point - item.WorldPosition) * z / displayScale,
+ alpha);
+
+ radarBlips.Add(blip);
+ step += 0.5f;
+ alpha -= (z == 0) ? 0.5f : 0.1f;
+ }
+
+ }
}
private void DrawBlip(SpriteBatch spriteBatch, RadarBlip blip, Vector2 center, Color color, float radius)
diff --git a/Subsurface/Source/Items/Components/Machines/Reactor.cs b/Subsurface/Source/Items/Components/Machines/Reactor.cs
index 8f6e18cd5..fa835f642 100644
--- a/Subsurface/Source/Items/Components/Machines/Reactor.cs
+++ b/Subsurface/Source/Items/Components/Machines/Reactor.cs
@@ -225,7 +225,7 @@ namespace Barotrauma.Items.Components
fissionRate = Math.Min(fissionRate, AvailableFuel);
- float heat = 100 * fissionRate * (AvailableFuel/2000.0f);
+ float heat = 80 * fissionRate * (AvailableFuel/2000.0f);
float heatDissipation = 50 * coolingRate + Math.Max(ExtraCooling, 5.0f);
float deltaTemp = (((heat - heatDissipation) * 5) - temperature) / 10000.0f;
@@ -288,9 +288,12 @@ namespace Barotrauma.Items.Components
}
else if (autoTemp)
{
- fissionRate = Math.Min(load / 200.0f, shutDownTemp);
- //float target = Math.Min(targetTemp, load);
- CoolingRate = coolingRate + (temperature - Math.Min(load, shutDownTemp) + deltaTemp)*0.1f;
+ //take deltaTemp into account to slow down the change in temperature when getting closer to the desired value
+ float target = temperature + deltaTemp * 100.0f;
+
+ //-1.0f in order to gradually turn down both rates when the target temperature is reached
+ FissionRate += (MathHelper.Clamp(load - target, -10.0f, 10.0f) - 1.0f) * deltaTime;
+ CoolingRate += (MathHelper.Clamp(target - load, -5.0f, 5.0f) - 1.0f) * deltaTime;
}
//fission rate can't be lowered below a certain amount if the core is too hot
diff --git a/Subsurface/Source/Items/Item.cs b/Subsurface/Source/Items/Item.cs
index ef7b6d4ff..90f39e1f2 100644
--- a/Subsurface/Source/Items/Item.cs
+++ b/Subsurface/Source/Items/Item.cs
@@ -18,7 +18,7 @@ namespace Barotrauma
public enum ActionType
{
- Always, OnPicked, OnWearing, OnContaining, OnContained, OnActive, OnUse, OnFailure, OnBroken, OnFire
+ Always, OnPicked, OnWearing, OnContaining, OnContained, OnActive, OnUse, OnFailure, OnBroken, OnFire, InWater
}
class Item : MapEntity, IDamageable, IPropertyObject
@@ -646,7 +646,7 @@ namespace Barotrauma
ic.WasUsed = false;
if (Container != null) ic.ApplyStatusEffects(ActionType.OnContained, deltaTime);
-
+
if (!ic.IsActive) continue;
if (condition > 0.0f)
@@ -660,7 +660,11 @@ namespace Barotrauma
{
ic.UpdateBroken(deltaTime, cam);
}
- }
+ }
+
+
+ inWater = IsInWater();
+ if (inWater) ApplyStatusEffects(ActionType.InWater, deltaTime);
if (body == null || !body.Enabled) return;
@@ -681,8 +685,6 @@ namespace Barotrauma
body.MoveToTargetPosition();
- inWater = IsInWater();
-
if (!inWater || Container != null || body == null) return;
if (body.LinearVelocity != Vector2.Zero && body.LinearVelocity.Length() > 1000.0f)
@@ -692,7 +694,6 @@ namespace Barotrauma
ApplyWaterForces();
- //TODO: make sure items stay in sync between clients before letting flowing water move items
if(CurrentHull != null) CurrentHull.ApplyFlowForces(deltaTime, this);
}
diff --git a/Subsurface/Source/Map/Levels/LevelRenderer.cs b/Subsurface/Source/Map/Levels/LevelRenderer.cs
index 577ce74a3..fe526f726 100644
--- a/Subsurface/Source/Map/Levels/LevelRenderer.cs
+++ b/Subsurface/Source/Map/Levels/LevelRenderer.cs
@@ -156,35 +156,34 @@ namespace Barotrauma
public void Draw(SpriteBatch spriteBatch)
{
- Vector2 pos = new Vector2(0.0f, -level.Size.Y);// level.EndPosition;
-
- var cells = level.GetCells(GameMain.GameScreen.Cam.WorldViewCenter, 2);
- foreach (VoronoiCell cell in cells)
+ if (GameMain.DebugDraw)
{
- GUI.DrawRectangle(spriteBatch, new Vector2(cell.Center.X - 10.0f, -cell.Center.Y-10.0f), new Vector2(20.0f, 20.0f), Color.Cyan, true);
+ var cells = level.GetCells(GameMain.GameScreen.Cam.WorldViewCenter, 2);
+ foreach (VoronoiCell cell in cells)
+ {
+ GUI.DrawRectangle(spriteBatch, new Vector2(cell.Center.X - 10.0f, -cell.Center.Y-10.0f), new Vector2(20.0f, 20.0f), Color.Cyan, true);
- GUI.DrawLine(spriteBatch,
- new Vector2(cell.edges[0].point1.X, -cell.edges[0].point1.Y),
- new Vector2(cell.Center.X, -cell.Center.Y),
- Color.White);
+ GUI.DrawLine(spriteBatch,
+ new Vector2(cell.edges[0].point1.X, -cell.edges[0].point1.Y),
+ new Vector2(cell.Center.X, -cell.Center.Y),
+ Color.White);
- foreach (GraphEdge edge in cell.edges)
- {
- //GUI.DrawLine(spriteBatch,
- // new Vector2(edge.point1.X, -edge.point1.Y),
- // new Vector2(cell.Center.X, -cell.Center.Y),
- // Color.White);
+ foreach (GraphEdge edge in cell.edges)
+ {
+ GUI.DrawLine(spriteBatch, new Vector2(edge.point1.X, -edge.point1.Y),
+ new Vector2(edge.point2.X, -edge.point2.Y), Color.White);
+ }
- GUI.DrawLine(spriteBatch, new Vector2(edge.point1.X, -edge.point1.Y),
- new Vector2(edge.point2.X, -edge.point2.Y), Color.White);
- }
-
- foreach (Vector2 point in cell.bodyVertices)
- {
- GUI.DrawRectangle(spriteBatch, new Vector2(point.X, -point.Y), new Vector2(10.0f, 10.0f), Color.White, true);
- }
+ foreach (Vector2 point in cell.bodyVertices)
+ {
+ GUI.DrawRectangle(spriteBatch, new Vector2(point.X, -point.Y), new Vector2(10.0f, 10.0f), Color.White, true);
+ }
+ }
}
+
+ Vector2 pos = new Vector2(0.0f, -level.Size.Y);// level.EndPosition;
+
if (GameMain.GameScreen.Cam.WorldView.Y < -pos.Y - 512) return;
pos.X = GameMain.GameScreen.Cam.WorldView.X -512.0f;
@@ -197,8 +196,6 @@ namespace Barotrauma
Color.White, 0.0f,
Vector2.Zero,
SpriteEffects.None, 0.0f);
-
-
}