Changed GUIMessageBox.MessageBoxes from a queue to a list to make it easier to remove messageboxes that aren't currently visible, fixed clients creating multiple "permissions changed" messageboxes if there's another messagebox on the screen

This commit is contained in:
Regalis
2017-02-18 15:58:46 +02:00
parent 6c8f5b8999
commit 04f86865f7
7 changed files with 27 additions and 51 deletions
+7 -15
View File
@@ -191,16 +191,12 @@ namespace Launcher2
PlayerInput.Update(deltaTime);
if (GUIMessageBox.MessageBoxes.Count > 0)
if (GUIMessageBox.VisibleBox != null)
{
var messageBox = GUIMessageBox.MessageBoxes.Peek();
if (messageBox != null)
{
GUIComponent.ForceMouseOn(messageBox);
messageBox.Update(deltaTime);
return;
}
}
GUIComponent.ForceMouseOn(GUIMessageBox.VisibleBox);
GUIMessageBox.VisibleBox.Update(deltaTime);
return;
}
GUIComponent.ClearUpdateList();
guiRoot.AddToGUIUpdateList();
@@ -223,12 +219,8 @@ namespace Launcher2
spriteBatch.Draw(titleTexture, new Vector2(40.0f, 20.0f), null, Color.White, 0.0f, Vector2.Zero, new Vector2(0.2f, 0.2f), SpriteEffects.None, 0.0f);
guiRoot.Draw(spriteBatch);
if (GUIMessageBox.MessageBoxes.Count > 0)
{
var messageBox = GUIMessageBox.MessageBoxes.Peek();
if (messageBox != null) messageBox.Draw(spriteBatch);
}
if (GUIMessageBox.VisibleBox != null) GUIMessageBox.VisibleBox.Draw(spriteBatch);
spriteBatch.End();
}