GUI elements now respect render order + some minor distance comparison optimization

This commit is contained in:
juanjp600
2016-11-15 22:26:36 -03:00
parent 3c57b9d945
commit d2c17274fe
39 changed files with 441 additions and 47 deletions
+16 -2
View File
@@ -88,7 +88,21 @@ namespace Barotrauma
Sounds.SoundManager.LowPassHFGain = 1.0f;
}
public override void AddToGUIUpdateList()
{
if (GameMain.GameSession != null) GameMain.GameSession.AddToGUIUpdateList();
if (Character.Controlled != null && Character.Controlled.SelectedConstruction != null)
{
if (Character.Controlled.SelectedConstruction == Character.Controlled.ClosestItem)
{
Character.Controlled.SelectedConstruction.AddToGUIUpdateList();
}
}
Character.AddAllToGUIUpdateList();
}
/// <summary>
/// Allows the game to run logic such as updating the world,
/// checking for collisions, gathering input, and playing audio.
@@ -132,7 +146,7 @@ namespace Barotrauma
}
}
Character.UpdateAll(cam, (float)deltaTime);
BackgroundCreatureManager.Update(cam, (float)deltaTime);
GameMain.ParticleManager.Update((float)deltaTime);