Replace one pile of hacks with another

This commit is contained in:
Paul Chote
2010-03-17 23:25:07 +13:00
parent 3aa9b17685
commit e1970ea8f0
7 changed files with 210 additions and 93 deletions

View File

@@ -155,4 +155,33 @@ namespace OpenRA.Widgets.Delegates
return false;
}
}
public class ConnectionDialogsDelegate : WidgetDelegate
{
public override bool OnMouseUp(Widget w, MouseInput mi)
{
// Main Menu root
if (w.Id == "CONNECTION_BUTTON_ABORT")
{
Game.chrome.rootWidget.GetWidget("MAINMENU_BG").Visible = true;
Game.chrome.rootWidget.GetWidget("CONNECTING_BG").Visible = false;
return true;
}
if (w.Id == "CONNECTION_BUTTON_CANCEL")
{
Game.chrome.rootWidget.GetWidget("MAINMENU_BG").Visible = true;
Game.chrome.rootWidget.GetWidget("CONNECTION_FAILED_BG").Visible = false;
return true;
}
if (w.Id == "CONNECTION_BUTTON_RETRY")
{
Game.JoinServer(Game.CurrentHost,Game.CurrentPort);
return true;
}
return false;
}
}
}