move connection UI to commons

This commit is contained in:
Matthias Mailänder
2015-01-10 09:37:23 +01:00
parent 94a3fc0186
commit 5aeb6eda06
19 changed files with 42 additions and 43 deletions

View File

@@ -0,0 +1,36 @@
#region Copyright & License Information
/*
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets.Logic
{
class KickSpectatorsLogic
{
[ObjectCreator.UseCtor]
public KickSpectatorsLogic(Widget widget, string clientCount, Action okPressed, Action cancelPressed)
{
widget.Get<LabelWidget>("TEXT").GetText = () => "Are you sure you want to kick {0} spectators?".F(clientCount);
widget.Get<ButtonWidget>("OK_BUTTON").OnClick = () =>
{
widget.Parent.RemoveChild(widget);
okPressed();
};
widget.Get<ButtonWidget>("CANCEL_BUTTON").OnClick = () =>
{
widget.Parent.RemoveChild(widget);
cancelPressed();
};
}
}
}