Round summary screen, GUIMessageBoxes disable other UI elements, renamed quests as missions
This commit is contained in:
@@ -5,7 +5,7 @@ namespace Barotrauma
|
||||
{
|
||||
public class GUIMessageBox : GUIFrame
|
||||
{
|
||||
public static Queue<GUIMessageBox> MessageBoxes = new Queue<GUIMessageBox>();
|
||||
public static Queue<GUIComponent> MessageBoxes = new Queue<GUIComponent>();
|
||||
|
||||
const int DefaultWidth=400, DefaultHeight=200;
|
||||
|
||||
@@ -15,15 +15,15 @@ namespace Barotrauma
|
||||
//GUIFrame frame;
|
||||
public GUIButton[] Buttons;
|
||||
|
||||
public static GUIMessageBox VisibleBox
|
||||
public static GUIComponent VisibleBox
|
||||
{
|
||||
get { return MessageBoxes.Count==0 ? null : MessageBoxes.Peek(); }
|
||||
}
|
||||
|
||||
public string Text
|
||||
{
|
||||
get { return (children[1] as GUITextBlock).Text; }
|
||||
set { (children[1] as GUITextBlock).Text = value; }
|
||||
get { return (children[0].children[1] as GUITextBlock).Text; }
|
||||
set { (children[0].children[1] as GUITextBlock).Text = value; }
|
||||
}
|
||||
|
||||
public GUIMessageBox(string header, string text)
|
||||
@@ -39,17 +39,19 @@ namespace Barotrauma
|
||||
}
|
||||
|
||||
public GUIMessageBox(string header, string text, string[] buttons, int width=DefaultWidth, int height=DefaultHeight, Alignment textAlignment = Alignment.TopLeft, GUIComponent parent = null)
|
||||
: base(new Rectangle(0,0, width, height),
|
||||
null, Alignment.Center, GUI.Style, parent)
|
||||
: base(new Rectangle(0,0, GameMain.GraphicsWidth, GameMain.GraphicsHeight),
|
||||
Color.Black*0.5f, Alignment.TopLeft, null, parent)
|
||||
{
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 30), header, Color.Transparent, Color.White, textAlignment, GUI.Style, this, true);
|
||||
new GUITextBlock(new Rectangle(0, 30, 0, height - 70), text, Color.Transparent, Color.White, textAlignment, GUI.Style, this, true);
|
||||
var frame = new GUIFrame(new Rectangle(0,0,width,height), null, Alignment.Center, GUI.Style, this);
|
||||
|
||||
new GUITextBlock(new Rectangle(0, 0, 0, 30), header, Color.Transparent, Color.White, textAlignment, GUI.Style, frame, true);
|
||||
new GUITextBlock(new Rectangle(0, 30, 0, height - 70), text, Color.Transparent, Color.White, textAlignment, GUI.Style, frame, true);
|
||||
|
||||
int x = 0;
|
||||
this.Buttons = new GUIButton[buttons.Length];
|
||||
for (int i = 0; i < buttons.Length; i++)
|
||||
{
|
||||
this.Buttons[i] = new GUIButton(new Rectangle(x, 0, 150, 30), buttons[i], Alignment.Left | Alignment.Bottom, GUI.Style, this);
|
||||
this.Buttons[i] = new GUIButton(new Rectangle(x, 0, 150, 30), buttons[i], Alignment.Left | Alignment.Bottom, GUI.Style, frame);
|
||||
|
||||
x += this.Buttons[i].Rect.Width + 20;
|
||||
}
|
||||
@@ -57,6 +59,8 @@ namespace Barotrauma
|
||||
MessageBoxes.Enqueue(this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public bool Close(GUIButton button, object obj)
|
||||
{
|
||||
if (parent != null) parent.RemoveChild(this);
|
||||
|
||||
Reference in New Issue
Block a user