From d007301fc4ba5994aefc2aa45f110fa1d38015d3 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Mon, 24 Jul 2017 17:03:13 +0300 Subject: [PATCH] Fixed GUIMessageBoxes being impossible to close in the launcher --- Barotrauma/Launcher/LauncherMain.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Barotrauma/Launcher/LauncherMain.cs b/Barotrauma/Launcher/LauncherMain.cs index 18a1f03fc..c2a116f39 100644 --- a/Barotrauma/Launcher/LauncherMain.cs +++ b/Barotrauma/Launcher/LauncherMain.cs @@ -197,7 +197,8 @@ namespace Launcher if (GUIMessageBox.VisibleBox != null) { - GUIComponent.ForceMouseOn(GUIMessageBox.VisibleBox); + GUIMessageBox.VisibleBox.AddToGUIUpdateList(); + GUIComponent.UpdateMouseOn(); GUIMessageBox.VisibleBox.Update(deltaTime); return; } @@ -580,7 +581,8 @@ namespace Launcher private void ShowError(string header, string message) { - GUIFrame dummyFrame = new GUIFrame(new Rectangle(0,0,graphicsWidth,graphicsHeight)); + GUIFrame dummyFrame = new GUIFrame(new Rectangle(0, 0, graphicsWidth, graphicsHeight)); + dummyFrame.Padding = Vector4.Zero; GUIMessageBox errorBox = new GUIMessageBox(header, message, new string[] { "OK" }, 400, 250, Alignment.TopLeft, dummyFrame); errorBox.Buttons[0].OnClicked = errorBox.Close; @@ -598,9 +600,9 @@ namespace Launcher Alignment.TopLeft, Alignment.TopLeft, updateInfoBox, true, GUI.SmallFont); textBlock.TextColor = Color.Red; - //textBlock.CanBeFocused = false; GUIFrame dummyFrame = new GUIFrame(new Rectangle(0, 0, graphicsWidth, graphicsHeight)); + dummyFrame.Padding = Vector4.Zero; GUIMessageBox errorBox = new GUIMessageBox("Error while updating", "Downloading the update failed.", new string[] { "Retry", "Cancel" }, 400, 250, Alignment.TopLeft, dummyFrame);