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

@@ -6,7 +6,7 @@ namespace OpenRA.Widgets
{
class ButtonWidget : Widget
{
public readonly string Text = "";
public string Text = "";
public bool Depressed = false;
public int VisualHeight = 1;
public override bool HandleInput(MouseInput mi)

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;
}
}
}

View File

@@ -6,8 +6,8 @@ namespace OpenRA.Widgets
{
class LabelWidget : Widget
{
public readonly string Text = null;
public readonly string Align = "Left";
public string Text = "";
public string Align = "Left";
public override void Draw()
{