mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-23 05:08:34 +01:00
made the info box disallow background selection
This commit is contained in:
parent
f7810c8204
commit
969db1da1e
1 changed files with 3 additions and 2 deletions
|
@ -14,13 +14,14 @@ namespace MLEM.Ui.Elements {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Panel ShowInfoBox(UiSystem system, Anchor anchor, float width, string text, float buttonHeight = 10, string okText = "Okay") {
|
public static Panel ShowInfoBox(UiSystem system, Anchor anchor, float width, string text, float buttonHeight = 10, string okText = "Okay") {
|
||||||
var box = new Panel(anchor, new Vector2(width, 1), Vector2.Zero, true);
|
var group = new Group(Anchor.TopLeft, Vector2.One, false);
|
||||||
|
var box = group.AddChild(new Panel(anchor, new Vector2(width, 1), Vector2.Zero, true));
|
||||||
box.AddChild(new Paragraph(Anchor.AutoLeft, 1, text));
|
box.AddChild(new Paragraph(Anchor.AutoLeft, 1, text));
|
||||||
var button = box.AddChild(new Button(Anchor.AutoCenter, new Vector2(0.5F, buttonHeight), okText) {
|
var button = box.AddChild(new Button(Anchor.AutoCenter, new Vector2(0.5F, buttonHeight), okText) {
|
||||||
OnPressed = element => system.Remove("InfoBox"),
|
OnPressed = element => system.Remove("InfoBox"),
|
||||||
PositionOffset = new Vector2(0, 1)
|
PositionOffset = new Vector2(0, 1)
|
||||||
});
|
});
|
||||||
var root = system.Add("InfoBox", box);
|
var root = system.Add("InfoBox", group);
|
||||||
root.SelectElement(button);
|
root.SelectElement(button);
|
||||||
return box;
|
return box;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue