Fixed incorrect positioning of debug console question prompts. The ShowQuestionPrompt method used to take the last textblock in the console and consider that as the question prompt text, even though the text had only been queued and the actual GUITexblock hadn't been instantiated yet.

This commit is contained in:
Joonas Rikkonen
2017-12-20 18:57:42 +02:00
parent 0204bc2c49
commit 3e4d2c5a8a
3 changed files with 20 additions and 19 deletions
@@ -15,6 +15,8 @@ namespace Barotrauma
private static Queue<ColoredText> queuedMessages = new Queue<ColoredText>();
private static GUITextBlock activeQuestionText;
public static bool IsOpen
{
get
@@ -69,6 +71,13 @@ namespace Barotrauma
}
}
if (activeQuestionText != null &&
(listBox.children.Count == 0 || listBox.children[listBox.children.Count - 1] != activeQuestionText))
{
listBox.children.Remove(activeQuestionText);
listBox.children.Add(activeQuestionText);
}
if (PlayerInput.KeyHit(Keys.F3))
{
isOpen = !isOpen;
@@ -177,13 +186,6 @@ namespace Barotrauma
}
selectedIndex = Messages.Count;
if (activeQuestionText != null)
{
//make sure the active question stays at the bottom of the list
listBox.children.Remove(activeQuestionText);
listBox.children.Add(activeQuestionText);
}
}
private static void InitProjectSpecific()