void LoginAsync(int mouseX, int mouseY) { if (String.IsNullOrEmpty(Get(0))) { SetStatus("&ePlease enter a username"); return; } if (String.IsNullOrEmpty(Get(1))) { SetStatus("&ePlease enter a password"); return; } if (signingIn) { return; } UpdateSignInInfo(Get(0), Get(1)); LauncherBooleanWidget booleanWidget = widgets[skipSSLIndex] as LauncherBooleanWidget; if (booleanWidget != null && booleanWidget.Value) { ServicePointManager.ServerCertificateValidationCallback = delegate { return(true); }; } else { ServicePointManager.ServerCertificateValidationCallback = null; } game.Session.LoginAsync(Get(0), Get(1)); game.MakeBackground(); Resize(); SetStatus("&eSigning in.."); signingIn = true; }
void SetBool(bool value) { LauncherBooleanWidget widget = (LauncherBooleanWidget)widgets[skinsIndex]; widget.Value = value; widget.Redraw(game.Drawer); Dirty = true; }
void UseClassicubeSkinsClick(int mouseX, int mouseY) { using ( drawer ) { game.Drawer.SetBitmap(game.Framebuffer); LauncherBooleanWidget widget = (LauncherBooleanWidget)widgets[skinsIndex]; SetBool(!widget.Value); } }
void SSLSkipValidationClick(int mouseX, int mouseY) { using ( drawer ) { drawer.SetBitmap(game.Framebuffer); LauncherBooleanWidget widget = (LauncherBooleanWidget)widgets[skipSSLIndex]; SetBool(!widget.Value); } }
protected void MakeBooleanAt(Anchor horAnchor, Anchor verAnchor, Font font, bool initValue, int width, int height, int x, int y, Action <int, int> onClick) { LauncherBooleanWidget widget; if (widgets[widgetIndex] != null) { widget = (LauncherBooleanWidget)widgets[widgetIndex]; } else { widget = new LauncherBooleanWidget(game, font, width, height); widget.Value = initValue; widget.OnClick = onClick; widgets[widgetIndex] = widget; } widget.SetDrawData(drawer, horAnchor, verAnchor, x, y); widgetIndex++; }
protected void MakeBooleanAt( Anchor horAnchor, Anchor verAnchor, Font font, bool initValue, int width, int height, int x, int y, Action<int, int> onClick) { LauncherBooleanWidget widget; if( widgets[widgetIndex] != null ) { widget = (LauncherBooleanWidget)widgets[widgetIndex]; } else { widget = new LauncherBooleanWidget( game, font, width, height ); widget.Value = initValue; widget.OnClick = onClick; widgets[widgetIndex] = widget; } widget.SetDrawData( drawer, horAnchor, verAnchor, x, y ); widgetIndex++; }