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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user