Fix diplomacy/cheats menu stacking

This commit is contained in:
Paul Chote
2011-05-22 19:32:25 +12:00
parent cd756885a6
commit 7a2b78b1d8
3 changed files with 33 additions and 6 deletions

View File

@@ -18,6 +18,7 @@
*/
#endregion
using System;
using OpenRA.Traits;
using OpenRA.Widgets;
@@ -27,6 +28,7 @@ namespace OpenRA.Mods.Cnc.Widgets
{
[ObjectCreator.UseCtor]
public CncCheatsLogic([ObjectCreator.Param] Widget widget,
[ObjectCreator.Param] Action onExit,
[ObjectCreator.Param] World world)
{
var panel = widget.GetWidget("CHEATS_PANEL");
@@ -67,7 +69,7 @@ namespace OpenRA.Mods.Cnc.Widgets
panel.GetWidget<ButtonWidget>("GIVE_EXPLORATION_BUTTON").OnClick = () =>
world.IssueOrder(new Order("DevGiveExploration", world.LocalPlayer.PlayerActor, false));
panel.GetWidget<ButtonWidget>("CLOSE_BUTTON").OnClick = Widget.CloseWindow;
panel.GetWidget<ButtonWidget>("CLOSE_BUTTON").OnClick = () => { Widget.CloseWindow(); onExit(); };
}
public void Order(World world, string order)