GUI elements now respect render order + some minor distance comparison optimization
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user