Make the diplomacy panel consistent with cheats and menu.

This commit is contained in:
Paul Chote
2014-07-17 16:13:48 +12:00
parent 9e2b3ce0b8
commit fda3ae2fb0
4 changed files with 42 additions and 8 deletions

View File

@@ -23,13 +23,28 @@ namespace OpenRA.Mods.RA.Widgets.Logic
ScrollPanelWidget diplomacyPanel;
[ObjectCreator.UseCtor]
public DiplomacyLogic(Widget widget, Action onExit, World world)
public DiplomacyLogic(Widget widget, Action onExit, World world, bool transient)
{
this.world = world;
diplomacyPanel = widget.Get<ScrollPanelWidget>("DIPLOMACY_PANEL");
LayoutPlayers();
var close = widget.GetOrNull<ButtonWidget>("CLOSE");
if (close != null)
{
close.OnClick = () =>
{
if (transient)
{
Ui.CloseWindow();
Ui.Root.RemoveChild(widget);
}
onExit();
};
}
}
void LayoutPlayers()