Ingame settings menu

This commit is contained in:
Paul Chote
2010-04-11 18:01:20 +12:00
parent a89f576fb9
commit 98fce23100
10 changed files with 32 additions and 23 deletions

View File

@@ -26,11 +26,11 @@ namespace OpenRA.Widgets.Delegates
{
var r = Chrome.rootWidget;
r.GetWidget("CONNECTION_BUTTON_ABORT").OnMouseUp = mi => {
r.ShowMenu("MAINMENU_BG");
r.CloseWindow();
return true;
};
r.GetWidget("CONNECTION_BUTTON_CANCEL").OnMouseUp = mi => {
r.ShowMenu("MAINMENU_BG");
r.CloseWindow();
return true;
};
r.GetWidget("CONNECTION_BUTTON_RETRY").OnMouseUp = mi => {

View File

@@ -31,17 +31,17 @@ namespace OpenRA.Widgets.Delegates
{
var r = Chrome.rootWidget;
r.GetWidget("MAINMENU_BUTTON_CREATE").OnMouseUp = mi => {
r.ShowMenu("CREATESERVER_BG");
r.OpenWindow("CREATESERVER_BG");
return true;
};
r.GetWidget("CREATESERVER_BUTTON_CANCEL").OnMouseUp = mi => {
r.ShowMenu("MAINMENU_BG");
r.CloseWindow();
return true;
};
r.GetWidget("CREATESERVER_BUTTON_START").OnMouseUp = mi => {
r.ShowMenu(null);
r.OpenWindow("SERVER_LOBBY");
Log.Write("Creating server");
// TODO: Get this from a map chooser

View File

@@ -43,7 +43,7 @@ namespace OpenRA.Widgets.Delegates
};
optionsBG.GetWidget("BUTTON_SETTINGS").OnMouseUp = mi => {
// Todo: Unfail ShowMenu to work with multiple root menus
r.OpenWindow("SETTINGS_BG");
return true;
};

View File

@@ -35,7 +35,7 @@ namespace OpenRA.Widgets.Delegates
var r = Chrome.rootWidget;
r.GetWidget("MAINMENU_BUTTON_JOIN").OnMouseUp =
mi => {
var bg = r.ShowMenu("JOINSERVER_BG");
var bg = r.OpenWindow("JOINSERVER_BG");
int height = 50;
int width = 300;
int i = 0;
@@ -68,13 +68,13 @@ namespace OpenRA.Widgets.Delegates
};
r.GetWidget("JOINSERVER_BUTTON_DIRECTCONNECT").OnMouseUp = mi => {
r.GetWidget("JOINSERVER_BG").Visible = false;
r.CloseWindow();
Game.JoinServer(Game.Settings.NetworkHost, Game.Settings.NetworkPort);
return true;
};
r.GetWidget("JOINSERVER_BUTTON_CANCEL").OnMouseUp = mi => {
r.ShowMenu("MAINMENU_BG");
r.CloseWindow();
return true;
};
}

View File

@@ -38,12 +38,12 @@ namespace OpenRA.Widgets.Delegates
// Menu Buttons
r.GetWidget("MAINMENU_BUTTON_SETTINGS").OnMouseUp = mi => {
r.ShowMenu("SETTINGS_BG");
r.OpenWindow("SETTINGS_BG");
return true;
};
r.GetWidget("SETTINGS_BUTTON_OK").OnMouseUp = mi => {
r.ShowMenu("MAINMENU_BG");
r.CloseWindow();
return true;
};
}