Initial settings menu copied from the old impl.

This commit is contained in:
Paul Chote
2011-05-12 18:50:23 +12:00
parent be79529d9e
commit f0f591c6fb
7 changed files with 396 additions and 4 deletions

View File

@@ -103,7 +103,7 @@ namespace OpenRA.Mods.Cnc.Widgets
var doNothing = (Action)(() => {});
menu.GetWidget<CncMenuButtonWidget>("QUIT_BUTTON").OnClick = () =>
PromptConfirmAction("Exit Game", "Are you sure you want to leave the game?", onQuit, doNothing);
PromptConfirmAction("Quit", "Are you sure you want to quit?", onQuit, doNothing);
var onSurrender = (Action)(() => world.IssueOrder(new Order("Surrender", world.LocalPlayer.PlayerActor, false)));
var surrenderButton = menu.GetWidget<CncMenuButtonWidget>("SURRENDER_BUTTON");
@@ -120,7 +120,14 @@ namespace OpenRA.Mods.Cnc.Widgets
});
};
menu.GetWidget<CncMenuButtonWidget>("PREFERENCES_BUTTON").IsDisabled = () => true;
menu.GetWidget<CncMenuButtonWidget>("PREFERENCES_BUTTON").OnClick = () =>
{
hideButtons = true;
Widget.OpenWindow("SETTINGS_PANEL", new Dictionary<string, object>()
{
{ "onExit", new Action(() => hideButtons = false) },
});
};
menu.GetWidget<CncMenuButtonWidget>("RESUME_BUTTON").OnClick = () =>
{