Replace one pile of hacks with another
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user