hack hack hack - no longer crash on failing to connect, etc

This commit is contained in:
Chris Forbes
2010-05-05 20:05:02 +12:00
parent 39920499e0
commit 1c50ec1879
2 changed files with 4 additions and 1 deletions

View File

@@ -26,10 +26,12 @@ namespace OpenRA.Widgets.Delegates
{ {
var r = Chrome.rootWidget; var r = Chrome.rootWidget;
r.GetWidget("CONNECTION_BUTTON_ABORT").OnMouseUp = mi => { r.GetWidget("CONNECTION_BUTTON_ABORT").OnMouseUp = mi => {
r.GetWidget("CONNECTION_BUTTON_ABORT").Parent.Visible = false;
Game.Disconnect(); Game.Disconnect();
return true; return true;
}; };
r.GetWidget("CONNECTION_BUTTON_CANCEL").OnMouseUp = mi => { r.GetWidget("CONNECTION_BUTTON_CANCEL").OnMouseUp = mi => {
r.GetWidget("CONNECTION_BUTTON_CANCEL").Parent.Visible = false;
Game.Disconnect(); Game.Disconnect();
return true; return true;
}; };

View File

@@ -215,7 +215,8 @@ namespace OpenRA.Widgets
public Widget OpenWindow(string id) public Widget OpenWindow(string id)
{ {
Chrome.rootWidget.GetWidget(WindowList.Peek()).Visible = false; if (WindowList.Count > 0)
Chrome.rootWidget.GetWidget(WindowList.Peek()).Visible = false;
WindowList.Push(id); WindowList.Push(id);
var window = Chrome.rootWidget.GetWidget(id); var window = Chrome.rootWidget.GetWidget(id);
window.Visible = true; window.Visible = true;