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

View File

@@ -327,10 +327,26 @@ namespace Barotrauma
if (PlayerInput.KeyHit(Keys.Escape)) GUI.TogglePauseMenu();
DebugConsole.Update(this, (float)Timing.Step);
GUIComponent.ClearUpdateList();
DebugConsole.AddToGUIUpdateList();
paused = (DebugConsole.IsOpen || GUI.PauseMenuOpen || GUI.SettingsMenuOpen) &&
(NetworkMember == null || !NetworkMember.GameStarted);
if (!paused)
{
Screen.Selected.AddToGUIUpdateList();
}
if (NetworkMember != null)
{
NetworkMember.AddToGUIUpdateList();
}
GUI.AddToGUIUpdateList();
GUIComponent.UpdateMouseOn();
DebugConsole.Update(this, (float)Timing.Step);
if (!paused)
{
@@ -371,6 +387,14 @@ namespace Barotrauma
{
Screen.Selected.Draw(deltaTime, GraphicsDevice, spriteBatch);
}
if (!DebugDraw) return;
if (GUIComponent.MouseOn!=null)
{
spriteBatch.Begin();
GUI.DrawRectangle(spriteBatch, GUIComponent.MouseOn.MouseRect, Color.Lime);
spriteBatch.End();
}
}
static bool waitForKeyHit = true;