Check if window info == null in OSX event handler, make classicube.net login auto go to the servers screen.

This commit is contained in:
UnknownShadow200 2015-11-04 10:07:58 +11:00
parent a8be2e4493
commit fda3d68753
3 changed files with 6 additions and 4 deletions

View file

@ -36,12 +36,14 @@ namespace Launcher2 {
if( !session.Working ) {
if( session.Exception != null ) {
DisplayWebException( session.Exception, session.Status );
} else if( HasServers ) {
game.SetScreen( new ClassiCubeServersScreen( game ) );
return;
}
signingIn = false;
game.MakeBackground();
Resize();
}
}
void LoadSavedInfo( IDrawer2D drawer ) {

View file

@ -79,7 +79,7 @@ namespace Launcher2 {
MakeButtonAt( "Connect", 100, 30, titleFont, Anchor.LeftOrTop,
180, 5, ConnectToServer );
MakeButtonAt( "Back", 70, 30, titleFont, Anchor.LeftOrTop,
195, 50, (x, y) => game.SetScreen( new MainScreen( game ) ) );
195, 50, (x, y) => game.SetScreen( new ClassiCubeScreen( game ) ) );
MakeTableWidget();
}

View file

@ -203,7 +203,7 @@ namespace OpenTK.Platform.MacOS {
protected OSStatus EventHandler( IntPtr inCaller, IntPtr inEvent, IntPtr userData ) {
// bail out if the window passed in is not actually our window.
if( userData != window.WindowRef)
if( window == null || userData != window.WindowRef )
return OSStatus.EventNotHandled;
EventInfo evt = new EventInfo(inEvent);